Search in sources :

Example 81 with Property

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

the class PropertyDeleteTest method testEndDateEqDate.

@Test
public void testEndDateEqDate() throws Exception {
    final Property property = new Property("delete-type1", "delete-entity1");
    property.addTag("t1", "v1");
    property.addKey("k1", "v1");
    property.setDate("2016-06-01T12:00:00.000Z");
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setEndDate(property.getDate());
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertTrue("Property should be remain", propertyExist(property));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 82 with Property

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

the class PropertyDeleteTest method testFutureDateExactTrue.

@Test
public void testFutureDateExactTrue() throws Exception {
    final Property property = new Property("delete-type9", "delete-entity9");
    property.addTag("t1", "v1");
    property.addKey("k1", "v1");
    property.setDate(getNextDay());
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setExactMatch(true);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertTrue("Property should be remain", propertyExist(property));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 83 with Property

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

the class PropertyDeleteTest method testFutureDateExactFalse.

@Test
public void testFutureDateExactFalse() throws Exception {
    final Property property = new Property("delete-type8", "delete-entity8");
    property.addTag("t1", "v1");
    property.addKey("k1", "v1");
    property.setDate(getNextDay());
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setExactMatch(false);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertFalse("Property should be deleted", propertyExist(property));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 84 with Property

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

the class PropertyDeleteTest method testEmptyKeyExactFalse.

@Test
public void testEmptyKeyExactFalse() throws Exception {
    final Property property = new Property("delete-type-6.11", "delete-entity6.11");
    property.addTag("t1", "v1");
    insertPropertyCheck(property);
    Property secondProperty = new Property();
    secondProperty.setType(property.getType());
    secondProperty.setEntity(property.getEntity());
    secondProperty.setType(property.getType());
    secondProperty.setTags(property.getTags());
    secondProperty.addKey("k2", "v2");
    insertPropertyCheck(secondProperty);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setExactMatch(false);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertFalse("First property should be deleted", propertyExist(property));
    assertFalse("Second property should be deleted", propertyExist(secondProperty));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 85 with Property

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

the class PropertyDeleteTest method testTimestampZeroNoDateFilterExactMatch.

@Test
public void testTimestampZeroNoDateFilterExactMatch() throws Exception {
    final Property property = new Property("delete-type21", "delete-entity21");
    property.addTag("t1", "v1");
    property.setDate(MIN_STORABLE_DATE);
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setExactMatch(true);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertFalse("Property should be removed", propertyExist(property));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) 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