Search in sources :

Example 16 with Property

use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.

the class PropertyQueryOffsetTest method buildProperty.

private static Property buildProperty(String entityName, String date, String... key) {
    if (key.length % 2 != 0) {
        throw new IllegalArgumentException("Key should be specified as name=value pairs");
    }
    Property property = new Property();
    property.setType(propertyType);
    property.setEntity(entityName);
    for (int i = 0; i < key.length; i += 2) {
        property.addKey(key[i], key[i + 1]);
    }
    property.addTag("defaultname", "defaultval");
    property.setDate(date);
    return property;
}
Also used : Property(com.axibase.tsd.api.model.property.Property)

Example 17 with Property

use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.

the class PropertyQueryTimezoneTest method testISOTimezonePlusHourMinute.

@Issue("2850")
@Test
public void testISOTimezonePlusHourMinute() throws Exception {
    PropertyQuery propertyQuery = buildPropertyQuery();
    propertyQuery.setStartDate("2016-05-21T01:23:00+01:23");
    List<Property> storedPropertyList = queryProperty(propertyQuery).readEntity(new GenericType<List<Property>>() {
    });
    Property storedProperty = storedPropertyList.get(0);
    assertEquals("Incorrect property entity", property.getEntity(), storedProperty.getEntity());
    assertEquals("Incorrect property tags", property.getTags(), storedProperty.getTags());
    assertEquals("Incorrect property date", property.getDate(), storedProperty.getDate());
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) List(java.util.List) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 18 with Property

use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.

the class PropertyQueryTimezoneTest method testISOTimezoneMinusHourMinute.

@Issue("2850")
@Test
public void testISOTimezoneMinusHourMinute() throws Exception {
    PropertyQuery propertyQuery = buildPropertyQuery();
    propertyQuery.setStartDate("2016-05-20T22:37:00-01:23");
    List<Property> storedPropertyList = queryProperty(propertyQuery).readEntity(new GenericType<List<Property>>() {
    });
    Property storedProperty = storedPropertyList.get(0);
    assertEquals("Incorrect property entity", property.getEntity(), storedProperty.getEntity());
    assertEquals("Incorrect property tags", property.getTags(), storedProperty.getTags());
    assertEquals("Incorrect property date", property.getDate(), storedProperty.getDate());
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) List(java.util.List) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 19 with Property

use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.

the class PropertyTypeQueryTest method testEntityNameContainsWhilespace.

@Issue("1278")
@Test
public void testEntityNameContainsWhilespace() {
    Property property = new Property("typequery-property-type-1", "typequery entityname-1");
    assertEquals(BAD_REQUEST.getStatusCode(), typeQueryProperty(property.getEntity()).getStatus());
}
Also used : Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 20 with Property

use of com.axibase.tsd.api.model.property.Property in project atsd-api-test by axibase.

the class BackslashCharEscapeTest method testType.

@Issue("2854")
@Test
public void testType() throws Exception {
    Property property = new Property("property-command-test\\-t5", "property-command-test-e5");
    property.setTags(DEFAULT_PROPERTY_TAGS);
    property.setDate(getCurrentDate());
    PlainCommand command = new PropertyCommand(property);
    CommandMethod.send(command);
    assertPropertyExisting("Inserted property can not be received", property);
}
Also used : PlainCommand(com.axibase.tsd.api.model.command.PlainCommand) Property(com.axibase.tsd.api.model.property.Property) PropertyCommand(com.axibase.tsd.api.model.command.PropertyCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

Property (com.axibase.tsd.api.model.property.Property)146 Test (org.testng.annotations.Test)143 PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)94 Issue (io.qameta.allure.Issue)84 Response (javax.ws.rs.core.Response)23 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)10 PropertyCommand (com.axibase.tsd.api.model.command.PropertyCommand)10 HashMap (java.util.HashMap)9 Entity (com.axibase.tsd.api.model.entity.Entity)8 List (java.util.List)6 Period (com.axibase.tsd.api.model.Period)5 EntityGroup (com.axibase.tsd.api.model.entitygroup.EntityGroup)1 CommandSendingResult (com.axibase.tsd.api.model.extended.CommandSendingResult)1 Series (com.axibase.tsd.api.model.series.Series)1 BeforeClass (org.testng.annotations.BeforeClass)1