use of org.junit.jupiter.api.condition.DisabledOnOs in project dropwizard by dropwizard.
the class DropwizardSSLConnectionSocketFactoryTest method shouldReturn200IfAbleToClientAuth.
@Test
// https://github.com/dropwizard/dropwizard/issues/4330
@DisabledOnOs(OS.WINDOWS)
void shouldReturn200IfAbleToClientAuth() throws Exception {
tlsConfiguration.setKeyStorePath(toFile("stores/client/keycert.p12"));
tlsConfiguration.setKeyStorePassword("password");
tlsConfiguration.setKeyStoreType("PKCS12");
final Client client = new JerseyClientBuilder(TLS_APP_RULE.getEnvironment()).using(jerseyClientConfiguration).build("client_auth_working");
final Response response = client.target(String.format("https://localhost:%d", TLS_APP_RULE.getPort(2))).request().get();
assertThat(response.getStatus()).isEqualTo(200);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project dropwizard by dropwizard.
the class DropwizardSSLConnectionSocketFactoryTest method shouldSucceedWithBcProvider.
@Test
// https://github.com/dropwizard/dropwizard/issues/4330
@DisabledOnOs(OS.WINDOWS)
void shouldSucceedWithBcProvider() throws Exception {
// switching host verifier off for simplicity
tlsConfiguration.setVerifyHostname(false);
tlsConfiguration.setKeyStorePath(toFile("stores/client/acme-weak.keystore.p12"));
tlsConfiguration.setKeyStorePassword("acme2");
tlsConfiguration.setKeyStoreType("PKCS12");
tlsConfiguration.setKeyStoreProvider(PROVIDER_NAME);
tlsConfiguration.setCertAlias("acme-weak");
tlsConfiguration.setTrustStorePath(toFile("stores/server/acme-weak.truststore.p12"));
tlsConfiguration.setTrustStorePassword("acme2");
tlsConfiguration.setTrustStoreType("PKCS12");
tlsConfiguration.setTrustStoreProvider(PROVIDER_NAME);
final Client client = new JerseyClientBuilder(TLS_APP_RULE.getEnvironment()).using(jerseyClientConfiguration).build("custom_jce_supported");
final Response response = client.target(String.format("https://localhost:%d", TLS_APP_RULE.getPort(5))).request().get();
assertThat(response.getStatus()).isEqualTo(200);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project dropwizard by dropwizard.
the class HealthCheckManagerTest method shouldContinueScheduledCheckingWhileDelayingShutdown.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldContinueScheduledCheckingWhileDelayingShutdown() throws Exception {
// given
final int checkIntervalMillis = 10;
final int shutdownWaitTimeMillis = 50;
final int expectedCount = shutdownWaitTimeMillis / checkIntervalMillis - 1;
final AtomicBoolean shutdownFailure = new AtomicBoolean(false);
final CountingHealthCheck check = new CountingHealthCheck();
final Schedule schedule = new Schedule();
schedule.setCheckInterval(Duration.milliseconds(checkIntervalMillis));
final HealthCheckConfiguration checkConfig = new HealthCheckConfiguration();
checkConfig.setName("check1");
checkConfig.setCritical(true);
checkConfig.setSchedule(schedule);
final List<HealthCheckConfiguration> configs = singletonList(checkConfig);
final ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1);
final HealthCheckScheduler scheduler = new HealthCheckScheduler(executorService);
final MetricRegistry metrics = new MetricRegistry();
final Duration shutdownWaitPeriod = Duration.milliseconds(shutdownWaitTimeMillis);
// when
final HealthCheckManager manager = new HealthCheckManager(configs, scheduler, metrics, shutdownWaitPeriod, true, Collections.emptyList());
manager.onHealthCheckAdded("check1", check);
// simulate JVM shutdown hook
final Thread shutdownThread = new Thread(() -> {
try {
manager.notifyShutdownStarted();
} catch (Exception e) {
shutdownFailure.set(true);
e.printStackTrace();
}
});
Thread.sleep(20);
long beforeCount = check.getCount();
shutdownThread.start();
shutdownThread.join();
Thread.sleep(20);
long afterCount = check.getCount();
// then
assertThat(shutdownFailure).isFalse();
assertThat(afterCount - beforeCount).isGreaterThanOrEqualTo(expectedCount);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project jgnash by ccavanaugh.
the class AutoCompleteModelTest method testPayeeMemoModels.
@Test
@DisabledOnOs(OS.MAC)
void testPayeeMemoModels() {
Options.useFuzzyMatchForAutoCompleteProperty().set(true);
final Engine engine = createEngine("payee-test");
final Account account = new Account(AccountType.CASH, engine.getDefaultCurrency());
engine.addAccount(engine.getRootAccount(), account);
assertEquals(1, engine.getAccountList().size());
final LocalDate localDate = LocalDate.of(2000, Month.JANUARY, 1);
// create a bunch of transactions
for (int i = 1; i <= TRANSACTION_COUNT; i++) {
final Transaction t = TransactionFactory.generateSingleEntryTransaction(account, BigDecimal.TEN, localDate.plusDays(i), "Memo " + i, "Payee " + i, Integer.toString(i));
engine.addTransaction(t);
assertEquals(i, engine.getTransactions().size());
}
assertEquals(TRANSACTION_COUNT, engine.getTransactions().size());
final AutoCompleteTextField<Transaction> autoCompletePayeeTextField = new AutoCompleteTextField<>();
AutoCompleteFactory.setPayeeModel(autoCompletePayeeTextField, account);
final AutoCompleteTextField<Transaction> autoCompleteMemoTextField = new AutoCompleteTextField<>();
AutoCompleteFactory.setMemoModel(autoCompleteMemoTextField);
final AutoCompleteModel<Transaction> payeeModel = autoCompletePayeeTextField.autoCompleteModelObjectProperty().get();
final AutoCompleteModel<Transaction> memoModel = autoCompleteMemoTextField.autoCompleteModelObjectProperty().get();
final AtomicBoolean payeeModelLoaded = payeeModel.isLoadComplete();
final AtomicBoolean memoModelLoaded = memoModel.isLoadComplete();
// Block until the atomics have been set, or the test will fail
Awaitility.await().untilTrue(payeeModelLoaded);
Awaitility.await().untilTrue(memoModelLoaded);
// noinspection SpellCheckingInspection
final String payeeResult = payeeModel.doLookAhead("Paye");
final String memoResult = memoModel.doLookAhead("Me");
assertEquals("Payee " + TRANSACTION_COUNT, payeeResult);
assertEquals("Memo " + TRANSACTION_COUNT, memoResult);
EngineFactory.closeEngine(EngineFactory.DEFAULT);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithBuildpackFromTarGzip.
@TestTemplate
@DisabledOnOs(OS.WINDOWS)
void buildsImageWithBuildpackFromTarGzip() throws IOException {
writeMainClass();
writeLongNameResource();
writeBuildpackContent();
tarGzipBuildpackContent();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("---> Hello World buildpack");
removeImages(projectName);
}
Aggregations