Search in sources :

Example 26 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class LengthTest method testMaxLengthOverflow.

@Issue("2412")
@Test
public void testMaxLengthOverflow() throws Exception {
    final Message message = new Message("e-message-max-len-overflow", "t-message-max-len-overflow");
    message.setDate(getCurrentDate());
    message.setSeverity(Severity.MAJOR.name());
    message.setMessage("");
    MessageCommand command = new MessageCommand(message);
    Integer currentLength = command.compose().length();
    String newMessage = new String(new char[MAX_LENGTH - currentLength + 1]).replace("\0", "m");
    message.setMessage(newMessage);
    command = new MessageCommand(message);
    assertTrue("Command must have overflow length", command.compose().length() > MAX_LENGTH);
    CommandSendingResult expectedResult = new CommandSendingResult(1, 0);
    String assertMessage = String.format("Result must contain one failed command with length %s", command.compose().length());
    assertEquals(assertMessage, expectedResult, CommandMethod.send(command));
}
Also used : Message(com.axibase.tsd.api.model.message.Message) CommandSendingResult(com.axibase.tsd.api.model.extended.CommandSendingResult) MessageCommand(com.axibase.tsd.api.model.command.MessageCommand) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 27 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class MetricCreateOrReplaceTest method testMetricNameContainsWhiteSpace.

@Issue("1278")
@Test
public void testMetricNameContainsWhiteSpace() throws Exception {
    final Metric metric = new Metric("createreplace metric-1");
    Response response = createOrReplaceMetric(metric);
    assertEquals("Method should fail if metricName contains whitespace", BAD_REQUEST.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 28 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class MetricCreateOrReplaceTest method testMetricNameContainsCyrillic.

@Issue("1278")
@Test
public void testMetricNameContainsCyrillic() throws Exception {
    final Metric metric = new Metric("createreplacйёmetric-3");
    metric.setDataType(DataType.DECIMAL);
    Response response = createOrReplaceMetric(metric);
    assertEquals("Fail to execute createOrReplaceEntityGroup method", OK.getStatusCode(), response.getStatus());
    assertTrue("Fail to check metric inserted", metricExist(metric));
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 29 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class MetricCreateOrReplaceTest method testMetricNameContainsSlash.

@Issue("1278")
@Test
public void testMetricNameContainsSlash() throws Exception {
    final Metric metric = new Metric("createreplace/metric-2");
    metric.setDataType(DataType.DECIMAL);
    Response response = createOrReplaceMetric(metric);
    assertEquals("Fail to execute createOrReplaceEntityGroup method", OK.getStatusCode(), response.getStatus());
    assertTrue("Fail to check metric inserted", metricExist(metric));
}
Also used : Response(javax.ws.rs.core.Response) Metric(com.axibase.tsd.api.model.metric.Metric) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 30 with Issue

use of io.qameta.allure.Issue in project atsd-api-test by axibase.

the class MetricGetTest method testURLEncodeNameWhiteSpace.

@Issue("1278")
@Test
public void testURLEncodeNameWhiteSpace() throws Exception {
    final String name = "get metric-1";
    Response response = queryMetric(name);
    assertEquals("Method should fail if metricName contains whitespace", BAD_REQUEST.getStatusCode(), response.getStatus());
    assertTrue(response.readEntity(String.class).contains("Invalid metric name"));
}
Also used : Response(javax.ws.rs.core.Response) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

Issue (io.qameta.allure.Issue)858 Test (org.testng.annotations.Test)857 SqlTest (com.axibase.tsd.api.method.sql.SqlTest)377 StringTable (com.axibase.tsd.api.model.sql.StringTable)270 Response (javax.ws.rs.core.Response)234 List (java.util.List)166 SeriesQuery (com.axibase.tsd.api.model.series.query.SeriesQuery)145 Series (com.axibase.tsd.api.model.series.Series)88 Property (com.axibase.tsd.api.model.property.Property)84 BigDecimal (java.math.BigDecimal)53 Metric (com.axibase.tsd.api.model.metric.Metric)50 Period (com.axibase.tsd.api.model.Period)47 PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)44 Entity (com.axibase.tsd.api.model.entity.Entity)43 ArrayList (java.util.ArrayList)37 Message (com.axibase.tsd.api.model.message.Message)32 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)31 HashMap (java.util.HashMap)30 EntityGroup (com.axibase.tsd.api.model.entitygroup.EntityGroup)29 Aggregate (com.axibase.tsd.api.model.series.query.transformation.aggregate.Aggregate)29