Search in sources :

Example 31 with Property

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

the class PropertyInsertTest method testTagValueContainSpace.

@Issue("2416")
@Test
public void testTagValueContainSpace() throws Exception {
    Property property = new Property("insert-property-t-7", "insert-property-e-7");
    property.addTag("t1", " tv1 ");
    property.setDate("2016-06-09T09:50:00.000Z");
    Response response = insertProperty(property);
    Property storedProperty = new Property(property);
    storedProperty.setTags(null);
    storedProperty.addTag("t1", "tv1");
    assertEquals("Incorrect response status code", OK.getStatusCode(), response.getStatus());
    assertTrue("Fail to get inserted properties", propertyExist(storedProperty));
}
Also used : Response(javax.ws.rs.core.Response) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 32 with Property

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

the class PropertyInsertTest method testLocalTimeUnsupported.

@Issue("2850")
@Test
public void testLocalTimeUnsupported() throws Exception {
    String entityName = "property-insert-test-localtime";
    String type = "test4";
    Property property = new Property(type, entityName);
    property.addTag("test", "test");
    property.setDate("2016-06-09 20:00:00");
    Response response = insertProperty(property);
    assertEquals("Incorrect response status code", BAD_REQUEST.getStatusCode(), response.getStatus());
    assertEquals("Error message mismatch", DATE_FILTER_INVALID_FORMAT, extractErrorMessage(response));
}
Also used : Response(javax.ws.rs.core.Response) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 33 with Property

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

the class PropertyInsertTest method testTimeRangeMaxTimeSaved.

@Issue("2957")
@Test
public void testTimeRangeMaxTimeSaved() throws Exception {
    Property property = new Property("t-time-range-p-3", "e-time-range-p-3");
    property.addTag("ttr-t", "ttr-v");
    property.setDate(MAX_STORABLE_DATE);
    Response response = insertProperty(property);
    assertEquals("Failed to insert property", response.getStatus(), OK.getStatusCode());
    assertTrue(propertyExist(property));
}
Also used : Response(javax.ws.rs.core.Response) Property(com.axibase.tsd.api.model.property.Property) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 34 with Property

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

the class PropertyInsertTest method testNoKeySamePropertyOverwrite.

/**
 * #NoTicket - base tests
 */
@Test
public void testNoKeySamePropertyOverwrite() throws Exception {
    final Property property = new Property("insert-type7", "insert-entity7");
    property.addTag("t1", "tv1");
    insertPropertyCheck(property);
    final Property property2 = new Property();
    property2.setType(property.getType());
    property2.setEntity(property.getEntity());
    property2.addTag("t2", "tv2");
    insertPropertyCheck(property2);
    assertFalse(propertyExist(property));
    assertTrue(propertyExist(property2));
}
Also used : Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 35 with Property

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

the class PropertyInsertTest method testKeyValueContainSpace.

@Issue("2416")
@Test
public void testKeyValueContainSpace() throws Exception {
    Property property = new Property("insert-property-t-5", "insert-property-e-5");
    property.addKey("k1", " spaced ");
    property.addTag("t1", "tv1");
    property.setDate("2016-06-09T09:50:00.000Z");
    Response response = insertProperty(property);
    Property storedProperty = new Property(property);
    storedProperty.setKey(null);
    storedProperty.addKey("k1", "spaced");
    assertEquals("Incorrect response status code", OK.getStatusCode(), response.getStatus());
    assertTrue("Fail to get inserted properties", propertyExist(storedProperty));
}
Also used : Response(javax.ws.rs.core.Response) Property(com.axibase.tsd.api.model.property.Property) 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