Search in sources :

Example 36 with PropertyQuery

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

the class PropertyDeleteTest method testEntityTooLong.

@Test
public void testEntityTooLong() throws Exception {
    final Property property = new Property("delete-type-18", appendChar(new StringBuilder(), 'a', 5000).append("type-18").toString());
    property.addTag("t1", "v1");
    property.addKey("k1", "v1");
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setKey(property.getKey());
    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 37 with PropertyQuery

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

the class PropertyDeleteTest method testExtraKeyExactFalse.

@Test
public void testExtraKeyExactFalse() throws Exception {
    final Property property = new Property("delete-type13", "delete-entity13");
    property.addTag("t1", "v1");
    property.addKey("k1", "kv1");
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    deleteQuery.setKey(property.getKey());
    deleteQuery.addKey("k2", "kv2");
    deleteQuery.setExactMatch(false);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertTrue("Property should 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 38 with PropertyQuery

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

the class PropertyDeleteTest method testEntityTagsExactTrue.

@Test
public void testEntityTagsExactTrue() throws Exception {
    final String entityTagsType = "$entity_tags";
    final Entity entity = new Entity("delete-entity10");
    entity.addTag("t1", "v1");
    entity.addTag("t2", "v2");
    final Property property = new Property();
    property.setType(entityTagsType);
    property.setEntity(entity.getName());
    property.setTags(entity.getTags());
    EntityMethod.createOrReplaceEntityCheck(entity);
    assertTrue(propertyExist(property));
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType("$entity_tags");
    deleteQuery.setEntity(entity.getName());
    deleteQuery.setExactMatch(true);
    assertEquals("Fail to execute delete query", OK.getStatusCode(), deleteProperty(deleteQuery).getStatus());
    assertTrue(propertyExist(property));
}
Also used : Entity(com.axibase.tsd.api.model.entity.Entity) PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) Property(com.axibase.tsd.api.model.property.Property) Test(org.testng.annotations.Test)

Example 39 with PropertyQuery

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

the class PropertyDeleteTest method testTypeEntityExactFalse.

@Test
public void testTypeEntityExactFalse() throws Exception {
    final Property property = new Property("delete-type-5", "delete-entity5");
    property.addTag("t1", "v1");
    property.addKey("k1", "v1");
    insertPropertyCheck(property);
    Property secondProperty = new Property();
    secondProperty.setType(property.getType());
    secondProperty.setEntity(property.getEntity());
    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 40 with PropertyQuery

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

the class PropertyDeleteTest method testTimestampZeroNoDateFilter.

@Test
public void testTimestampZeroNoDateFilter() throws Exception {
    final Property property = new Property("delete-type20", "delete-entity20");
    property.addTag("t1", "v1");
    property.setDate(MIN_STORABLE_DATE);
    insertPropertyCheck(property);
    PropertyQuery deleteQuery = new PropertyQuery();
    deleteQuery.setType(property.getType());
    deleteQuery.setEntity(property.getEntity());
    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

PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)112 Test (org.testng.annotations.Test)109 Property (com.axibase.tsd.api.model.property.Property)94 Issue (io.qameta.allure.Issue)44 Entity (com.axibase.tsd.api.model.entity.Entity)12 Response (javax.ws.rs.core.Response)11 Period (com.axibase.tsd.api.model.Period)6 List (java.util.List)6 NotCheckedException (com.axibase.tsd.api.util.NotCheckedException)1