Search in sources :

Example 1 with Check

use of com.axibase.tsd.api.method.checks.Check in project atsd-api-test by axibase.

the class PropertyTest method assertPropertyTypeExist.

public static void assertPropertyTypeExist(String propertyType) {
    String assertMessage = String.format("Fail to find property type %s in ATSD", propertyType);
    try {
        Check propertyCheck = new Check(assertMessage, () -> PropertyTest.propertyTypeExist(propertyType));
        Checker.check(propertyCheck);
    } catch (NotCheckedException e) {
        fail(assertMessage);
    }
}
Also used : NotCheckedException(com.axibase.tsd.api.util.NotCheckedException) PropertyCheck(com.axibase.tsd.api.method.checks.PropertyCheck) Check(com.axibase.tsd.api.method.checks.Check)

Example 2 with Check

use of com.axibase.tsd.api.method.checks.Check in project atsd-api-test by axibase.

the class MessageTest method assertMessageExist.

/**
 * Try to find provided message in ATSD, and check that found message has the same values of the specified
 * fields as the provided message.
 */
public static void assertMessageExist(Message message, String... fields) {
    String assertMessage = String.format("Fail to find in ATSD message: %s", message);
    try {
        Check messageCheck = new Check(assertMessage, () -> MessageMethod.messageExistWithSameFields(message, "entity", "message"));
        Checker.check(messageCheck, 10, TimeUnit.SECONDS);
    } catch (NotCheckedException e) {
        fail(assertMessage);
    }
}
Also used : NotCheckedException(com.axibase.tsd.api.util.NotCheckedException) AbstractCheck(com.axibase.tsd.api.method.checks.AbstractCheck) Check(com.axibase.tsd.api.method.checks.Check) MessageCheck(com.axibase.tsd.api.method.checks.MessageCheck)

Example 3 with Check

use of com.axibase.tsd.api.method.checks.Check in project atsd-api-test by axibase.

the class EntityTest method assertEntityNameExist.

/**
 * Checks that ATSD knows some entity with given name.
 */
public static void assertEntityNameExist(String entityName) {
    String errorMessage = String.format("ATSD does not know entity %s.", entityName);
    Check entityNameCheck = new Check(errorMessage, () -> EntityMethod.entityExist(entityName));
    try {
        Checker.check(entityNameCheck);
    } catch (NotCheckedException e) {
        fail(errorMessage);
    }
}
Also used : NotCheckedException(com.axibase.tsd.api.util.NotCheckedException) EntityCheck(com.axibase.tsd.api.method.checks.EntityCheck) Check(com.axibase.tsd.api.method.checks.Check)

Aggregations

Check (com.axibase.tsd.api.method.checks.Check)3 NotCheckedException (com.axibase.tsd.api.util.NotCheckedException)3 AbstractCheck (com.axibase.tsd.api.method.checks.AbstractCheck)1 EntityCheck (com.axibase.tsd.api.method.checks.EntityCheck)1 MessageCheck (com.axibase.tsd.api.method.checks.MessageCheck)1 PropertyCheck (com.axibase.tsd.api.method.checks.PropertyCheck)1