org.junit.jupiter.api.condition.DisabledIfSystemProperty Java Examples

The following examples show how to use org.junit.jupiter.api.condition.DisabledIfSystemProperty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CamelSinkAWSSQSITCase.java    From camel-kafka-connector with Apache License 2.0 6 votes vote down vote up
@DisabledIfSystemProperty(named = "aws-service.instance.type", matches = "remote")
@Test
@Timeout(value = 120)
@RepeatedTest(3)
public void testBasicSendReceiveUsingKafkaStyle() {
    try {
        Properties amazonProperties = awsService.getConnectionProperties();

        ConnectorPropertyFactory testProperties = CamelAWSSQSPropertyFactory
                .basic()
                .withName("CamelAwssqsSinkConnectorKafkaStyle")
                .withTopics(TestUtils.getDefaultTestTopic(this.getClass()))
                .withAmazonConfig(amazonProperties, CamelAWSSQSPropertyFactory.KAFKA_STYLE)
                .withQueueNameOrArn(queueName);

        runTest(testProperties);

    } catch (Exception e) {
        LOG.error("Amazon SQS test failed: {}", e.getMessage(), e);
        fail(e.getMessage());
    }
}
 
Example #2
Source File: CamelSourceAWSSQSITCase.java    From camel-kafka-connector with Apache License 2.0 6 votes vote down vote up
@DisabledIfSystemProperty(named = "aws-service.instance.type", matches = "remote")
@Test
@Timeout(90)
public void testBasicSendReceiveUsingUrl() throws ExecutionException, InterruptedException {
    Properties amazonProperties = service.getConnectionProperties();

    ConnectorPropertyFactory connectorPropertyFactory = CamelAWSSQSPropertyFactory
            .basic()
            .withKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()))
            .withUrl(queueName)
            .append("accessKey", amazonProperties.getProperty(AWSConfigs.ACCESS_KEY))
            .append("secretKey", amazonProperties.getProperty(AWSConfigs.SECRET_KEY))
            .append("protocol", amazonProperties.getProperty(AWSConfigs.PROTOCOL))
            .appendIfAvailable("amazonAWSHost", amazonProperties.getProperty(AWSConfigs.AMAZON_AWS_HOST))
            .append("region", amazonProperties.getProperty(AWSConfigs.REGION, Regions.US_EAST_1.name()))
            .buildUrl();

    runTest(connectorPropertyFactory);
}
 
Example #3
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 6 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void timeDuration6() {
    long seconds = TimeUnit.HOURS.toSeconds(8) + TimeUnit.MINUTES.toSeconds(5) + 45;
    Duration one = Duration.ofSeconds(0, -1000);
    Duration aDuration = Duration.ofSeconds(seconds, 45_610_000);
    Duration oneDay = Duration.ofSeconds(-TimeUnit.DAYS.toSeconds(1), -1000);
    Duration oneDayOne = Duration.ofSeconds(TimeUnit.DAYS.toSeconds(1), 1000);
    LocalTime aTime = LocalTime.of(8, 5, 45, 45_610_000);
    LocalTime lastMicro = LocalTime.of(23, 59, 59, 999_999_000);
    LocalTime firstMicro = LocalTime.of(0, 0, 0, 1000);

    List<Tuple2<Duration, LocalTime>> dataCases = Arrays.asList(
        Tuples.of(one, lastMicro),
        Tuples.of(oneDay, lastMicro),
        Tuples.of(oneDayOne, firstMicro),
        Tuples.of(aDuration, aTime)
    );
    String tdl = "CREATE TEMPORARY TABLE test(id INT PRIMARY KEY AUTO_INCREMENT,value TIME(6))";
    complete(connection -> Mono.from(connection.createStatement(tdl).execute())
        .flatMap(IntegrationTestSupport::extractRowsUpdated)
        .thenMany(Flux.fromIterable(dataCases)
            .concatMap(pair -> testTimeDuration(connection, pair.getT1(), pair.getT2()))));
}
 
Example #4
Source File: JacksonIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 6 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.[56](\\.\\d+)?")
@Test
void json() {
    create().flatMap(connection -> Mono.from(connection.createStatement(TDL).execute())
        .flatMap(IntegrationTestSupport::extractRowsUpdated)
        .thenMany(insert(connection))
        .flatMap(IntegrationTestSupport::extractRowsUpdated)
        .thenMany(connection.createStatement("SELECT value FROM test WHERE id > ?")
            .bind(0, 0)
            .execute())
        .concatMap(r -> r.map((row, meta) -> row.get(0, Bar.class)))
        .collectList())
        .as(StepVerifier::create)
        .expectNext(Arrays.asList(BARS))
        .verifyComplete();
}
 
Example #5
Source File: JacksonIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 6 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.[56](\\.\\d+)?")
@Test
void json() {
    create().flatMap(connection -> Mono.from(connection.createStatement(TDL).execute())
        .flatMap(IntegrationTestSupport::extractRowsUpdated)
        .thenMany(insert(connection))
        .flatMap(IntegrationTestSupport::extractRowsUpdated)
        .thenMany(connection.createStatement("SELECT value FROM test WHERE id > ?")
            .bind(0, 0)
            .execute())
        .concatMap(r -> r.map((row, meta) -> row.get(0, Bar.class)))
        .collectList())
        .as(StepVerifier::create)
        .expectNext(Arrays.asList(BARS))
        .verifyComplete();
}
 
Example #6
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 6 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void timeDuration6() {
    long seconds = TimeUnit.HOURS.toSeconds(8) + TimeUnit.MINUTES.toSeconds(5) + 45;
    Duration one = Duration.ofSeconds(0, -1000);
    Duration aDuration = Duration.ofSeconds(seconds, 45_610_000);
    Duration oneDay = Duration.ofSeconds(-TimeUnit.DAYS.toSeconds(1), -1000);
    Duration oneDayOne = Duration.ofSeconds(TimeUnit.DAYS.toSeconds(1), 1000);
    LocalTime aTime = LocalTime.of(8, 5, 45, 45_610_000);
    LocalTime lastMicro = LocalTime.of(23, 59, 59, 999_999_000);
    LocalTime firstMicro = LocalTime.of(0, 0, 0, 1000);

    List<Tuple2<Duration, LocalTime>> dataCases = Arrays.asList(
        Tuples.of(one, lastMicro),
        Tuples.of(oneDay, lastMicro),
        Tuples.of(oneDayOne, firstMicro),
        Tuples.of(aDuration, aTime)
    );
    String tdl = "CREATE TEMPORARY TABLE test(id INT PRIMARY KEY AUTO_INCREMENT,value TIME(6))";
    complete(connection -> Mono.from(connection.createStatement(tdl).execute())
        .flatMap(IntegrationTestSupport::extractRowsUpdated)
        .thenMany(Flux.fromIterable(dataCases)
            .concatMap(pair -> testTimeDuration(connection, pair.getT1(), pair.getT2()))));
}
 
Example #7
Source File: CamelSinkAWSSQSITCase.java    From camel-kafka-connector with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "aws-service.instance.type", matches = "remote")
@Test
@Timeout(value = 120)
@RepeatedTest(3)
public void testBasicSendReceiveUsingUrl() {
    try {
        Properties amazonProperties = awsService.getConnectionProperties();

        ConnectorPropertyFactory testProperties = CamelAWSSQSPropertyFactory
                .basic()
                .withName("CamelAwssqsSinkConnectorUsingUrl")
                .withTopics(TestUtils.getDefaultTestTopic(this.getClass()))
                .withUrl(queueName)
                    .append("autoCreateQueue", "true")
                    .append("accessKey", amazonProperties.getProperty(AWSConfigs.ACCESS_KEY))
                    .append("secretKey", amazonProperties.getProperty(AWSConfigs.SECRET_KEY))
                    .append("protocol", amazonProperties.getProperty(AWSConfigs.PROTOCOL))
                    .append("region", amazonProperties.getProperty(AWSConfigs.REGION, Regions.US_EAST_1.name()))
                    .append("amazonAWSHost", amazonProperties.getProperty(AWSConfigs.AMAZON_AWS_HOST))
                    .buildUrl();

        runTest(testProperties);

    } catch (Exception e) {
        LOG.error("Amazon SQS test failed: {}", e.getMessage(), e);
        fail(e.getMessage());
    }
}
 
Example #8
Source File: DataFlowIT.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
@Test
@EnabledIfSystemProperty(named = "PLATFORM_TYPE", matches = "cloudfoundry")
@DisabledIfSystemProperty(named = "SKIP_CLOUD_CONFIG", matches = "true")
public void streamWithConfigServer() {

	logger.info("stream-server-config-test");

	try (Stream stream = Stream.builder(dataFlowOperations)
			.name("TICKTOCK-config-server")
			.definition("time | log")
			.create()
			.deploy(new DeploymentPropertiesBuilder()
					.putAll(testDeploymentProperties())
					.put("app.log.spring.profiles.active", "test")
					.put("deployer.log.cloudfoundry.services", "cloud-config-server")
					.put("app.log.spring.cloud.config.name", "MY_CONFIG_TICKTOCK_LOG_NAME")
					.build())) {

		Awaitility.await(stream.getName() + " failed to deploy!")
				.until(() -> stream.getStatus().equals(DEPLOYED));

		Awaitility.await().await("Source not started")
				.until(() -> runtimeApps.getFirstInstanceLog(stream, "time")
						.contains("Started TimeSource"));
		Awaitility.await().await("Sink not started")
				.until(() -> runtimeApps.getFirstInstanceLog(stream, "log")
						.contains("Started LogSink"));
		Awaitility.await().await("No output found")
				.until(() -> runtimeApps.getFirstInstanceLog(stream, "log")
						.contains("TICKTOCK CLOUD CONFIG - TIMESTAMP:"));
	}
}
 
Example #9
Source File: AsyncExclusiveJobsTest.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
/**
 * Test for https://activiti.atlassian.net/browse/ACT-4035.
 */
@Test
@Deployment
@DisabledIfSystemProperty(named = "database", matches = "cockroachdb")
public void testExclusiveJobs() {

    if (HistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.AUDIT, processEngineConfiguration)) {

        // The process has two script tasks in parallel, both exclusive.
        // They should be executed with at least 6 seconds in between (as they both sleep for 6 seconds)
        runtimeService.startProcessInstanceByKey("testExclusiveJobs");
        waitForJobExecutorToProcessAllJobs(20000L, 500L);
        
        waitForHistoryJobExecutorToProcessAllJobs(7000, 100);

        HistoricActivityInstance scriptTaskAInstance = historyService.createHistoricActivityInstanceQuery().activityId("scriptTaskA").singleResult();
        HistoricActivityInstance scriptTaskBInstance = historyService.createHistoricActivityInstanceQuery().activityId("scriptTaskB").singleResult();

        long endTimeA = scriptTaskAInstance.getEndTime().getTime();
        long endTimeB = scriptTaskBInstance.getEndTime().getTime();
        long endTimeDifference = 0;
        if (endTimeB > endTimeA) {
            endTimeDifference = endTimeB - endTimeA;
        } else {
            endTimeDifference = endTimeA - endTimeB;
        }
        assertThat(endTimeDifference).isGreaterThan(6000); // > 6000 -> jobs were executed in parallel
    }

}
 
Example #10
Source File: CallActivityTest.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Test
@Deployment(resources = {
        "org/flowable/engine/test/api/event/CallActivityTest.testCallActivityAsyncComplete.bpmn20.xml",
        "org/flowable/engine/test/api/event/CallActivityTest.testCallActivityAsyncComplete_subprocess.bpmn20.xml"
})
@DisabledIfSystemProperty(named = "database", matches = "cockroachdb")
public void testCallActivityAsyncCompleteRealExecutor() {
    runtimeService.startProcessInstanceByKey("testAsyncComplete");
    waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(20000L, 200L);
    assertThat(runtimeService.createProcessInstanceQuery().count()).isZero();
}
 
Example #11
Source File: StandardExceptionMappingIT.java    From microprofile-sandbox with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "jee-testcontainer", matches = "tomee")
@Test void shouldMapServerWebApplicationExceptionWithoutEntityOrMessage() {
    testPost("/standard/plain-service-unavailable")
        .hasStatus(SERVICE_UNAVAILABLE)
        .hasContentType(PROBLEM_DETAIL_JSON)
        .hasType("urn:problem-type:service-unavailable")
        .hasTitle("Service Unavailable")
        .hasDetail(null)
        .hasUuidInstance();
}
 
Example #12
Source File: StandardExceptionMappingIT.java    From microprofile-sandbox with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "jee-testcontainer", matches = "tomee")
@Test void shouldMapClientWebApplicationExceptionWithoutEntityButMessage() {
    testPost("/standard/bad-request-with-message")
        .hasStatus(BAD_REQUEST)
        .hasContentType(PROBLEM_DETAIL_JSON)
        .hasType("urn:problem-type:bad-request")
        .hasTitle("Bad Request")
        .hasDetail("some message")
        .hasUuidInstance();
}
 
Example #13
Source File: StandardExceptionMappingIT.java    From microprofile-sandbox with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "jee-testcontainer", matches = "tomee")
@Test void shouldMapClientWebApplicationExceptionWithoutEntityOrMessage() {
    testPost("standard/plain-bad-request")
        .hasStatus(BAD_REQUEST)
        .hasContentType(PROBLEM_DETAIL_JSON)
        .hasType("urn:problem-type:bad-request")
        .hasTitle("Bad Request")
        .hasDetail(null)
        .hasUuidInstance();
}
 
Example #14
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void timestamp6() {
    LocalDateTime minTimestamp = LocalDateTime.of(1970, 1, 3, 0, 0, 0, 1000);
    LocalDateTime aTimestamp = LocalDateTime.of(2020, 5, 12, 8, 4, 10, 5_4210_000);
    LocalDateTime maxTimestamp = LocalDateTime.of(2038, 1, 15, 23, 59, 59, 999_999_000);

    // TIMESTAMP must not be null when database version less than 8.0
    testType(LocalDateTime.class, true, "TIMESTAMP(6)", minTimestamp, aTimestamp, maxTimestamp);
}
 
Example #15
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void dateTime6() {
    LocalDateTime smallDateTime = LocalDateTime.of(1000, 1, 1, 0, 0, 0, 1000);
    LocalDateTime aDateTime = LocalDateTime.of(2020, 5, 12, 8, 4, 10, 5_4210_000);
    LocalDateTime maxDateTime = LocalDateTime.of(9999, 12, 31, 23, 59, 59, 999_999_000);

    testType(LocalDateTime.class, true, "DATETIME(6)", null, smallDateTime, aDateTime, maxDateTime);
}
 
Example #16
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void time6() {
    LocalTime smallTime = LocalTime.of(0, 0, 0, 1000);
    LocalTime aTime = LocalTime.of(10, 5, 28, 5_410_000);
    LocalTime maxTime = LocalTime.of(23, 59, 59, 999_999_000);
    Duration smallDuration = Duration.ofSeconds(-TimeUnit.HOURS.toSeconds(838) - TimeUnit.MINUTES.toSeconds(59) - 58, -999_999_000);
    Duration aDuration = Duration.ofSeconds(1854672, 5_410_000);
    Duration bigDuration = Duration.ofSeconds(TimeUnit.HOURS.toSeconds(838) + TimeUnit.MINUTES.toSeconds(59) + 58, 999_999_000);

    testType(LocalTime.class, true, "TIME(6)", null, smallTime, aTime, maxTime);
    testType(Duration.class, true, "TIME(6)", null, smallDuration, aDuration, bigDuration);
}
 
Example #17
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void timestamp6() {
    LocalDateTime minTimestamp = LocalDateTime.of(1970, 1, 3, 0, 0, 0, 1000);
    LocalDateTime aTimestamp = LocalDateTime.of(2020, 5, 12, 8, 4, 10, 5_4210_000);
    LocalDateTime maxTimestamp = LocalDateTime.of(2038, 1, 15, 23, 59, 59, 999_999_000);

    // TIMESTAMP must not be null when database version less than 8.0
    testType(LocalDateTime.class, true, "TIMESTAMP(6)", minTimestamp, aTimestamp, maxTimestamp);
}
 
Example #18
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void dateTime6() {
    LocalDateTime smallDateTime = LocalDateTime.of(1000, 1, 1, 0, 0, 0, 1000);
    LocalDateTime aDateTime = LocalDateTime.of(2020, 5, 12, 8, 4, 10, 5_4210_000);
    LocalDateTime maxDateTime = LocalDateTime.of(9999, 12, 31, 23, 59, 59, 999_999_000);

    testType(LocalDateTime.class, true, "DATETIME(6)", null, smallDateTime, aDateTime, maxDateTime);
}
 
Example #19
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.5(\\.\\d+)?")
@Test
void time6() {
    LocalTime smallTime = LocalTime.of(0, 0, 0, 1000);
    LocalTime aTime = LocalTime.of(10, 5, 28, 5_410_000);
    LocalTime maxTime = LocalTime.of(23, 59, 59, 999_999_000);
    Duration smallDuration = Duration.ofSeconds(-TimeUnit.HOURS.toSeconds(838) - TimeUnit.MINUTES.toSeconds(59) - 58, -999_999_000);
    Duration aDuration = Duration.ofSeconds(1854672, 5_410_000);
    Duration bigDuration = Duration.ofSeconds(TimeUnit.HOURS.toSeconds(838) + TimeUnit.MINUTES.toSeconds(59) + 58, 999_999_000);

    testType(LocalTime.class, true, "TIME(6)", null, smallTime, aTime, maxTime);
    testType(Duration.class, true, "TIME(6)", null, smallDuration, aDuration, bigDuration);
}
 
Example #20
Source File: CamelSourceAWSSQSITCase.java    From camel-kafka-connector with Apache License 2.0 5 votes vote down vote up
@DisabledIfSystemProperty(named = "aws-service.instance.type", matches = "remote")
@Test
@Timeout(90)
public void testBasicSendReceiveWithKafkaStyle() throws ExecutionException, InterruptedException {
    ConnectorPropertyFactory connectorPropertyFactory = CamelAWSSQSPropertyFactory
            .basic()
            .withKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()))
            .withQueueOrArn(queueName)
            .withAmazonConfig(service.getConnectionProperties(), CamelAWSSQSPropertyFactory.KAFKA_STYLE);

    runTest(connectorPropertyFactory);
}
 
Example #21
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 4 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.[56](\\.\\d+)?")
@Test
void json() {
    testType(String.class, false, "JSON", null, "{\"data\": 1}", "[\"data\", 1]", "1", "null", "\"R2DBC\"", "2.56");
}
 
Example #22
Source File: SystemPropertyTestsDemo.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 4 votes vote down vote up
@Test
@DisabledIfSystemProperty(named = "ci-server", matches = "true")
void notOnCiServer() {
    // ...
}
 
Example #23
Source File: DisabledTests.java    From journaldev with MIT License 4 votes vote down vote up
@Test
// My System Properties "os.name" value is "Mac OS X"
@DisabledIfSystemProperty(named = "os.name", matches = "Mac.*")
void test8() {
	assertFalse(3 < 0);
}
 
Example #24
Source File: QueryIntegrationTestSupport.java    From r2dbc-mysql with Apache License 2.0 4 votes vote down vote up
@DisabledIfSystemProperty(named = "test.mysql.version", matches = "5\\.[56](\\.\\d+)?")
@Test
void json() {
    testType(String.class, false, "JSON", null, "{\"data\": 1}", "[\"data\", 1]", "1", "null", "\"R2DBC\"", "2.56");
}
 
Example #25
Source File: ClientFactoryBuilderTest.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Test
@DisabledIfSystemProperty(named = "com.linecorp.armeria.useJdkDnsResolver",  matches = "true")
void useRefreshingAddressResolverGroup() {
    final DefaultClientFactory clientFactory = (DefaultClientFactory) ClientFactory.ofDefault();
    assertThat(clientFactory.addressResolverGroup()).isInstanceOf(RefreshingAddressResolverGroup.class);
}