Search in sources :

Example 1 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project cucumber-jvm by cucumber.

the class ResourceScannerTest method scanForResourcesDirectorySymlink.

@Test
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Only works if repository is explicitly cloned activated symlinks and " + "developer mode in windows is activated")
void scanForResourcesDirectorySymlink() {
    File file = new File("src/test/resource-symlink");
    List<URI> resources = resourceScanner.scanForResourcesPath(file.toPath());
    assertThat(resources, containsInAnyOrder(new File("src/test/resource-symlink/test/resource.txt").toURI(), new File("src/test/resource-symlink/test/other-resource.txt").toURI(), new File("src/test/resource-symlink/test/spaces in name resource.txt").toURI()));
}
Also used : File(java.io.File) URI(java.net.URI) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 2 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project cucumber-jvm by cucumber.

the class FeaturePathTest method can_parse_absolute_directory_form.

@Test
@DisabledOnOs(WINDOWS)
void can_parse_absolute_directory_form() {
    URI uri = FeaturePath.parse("file:/path/to");
    assertAll(() -> assertThat(uri.getScheme(), is("file")), () -> assertThat(uri.getSchemeSpecificPart(), is("/path/to")));
}
Also used : URI(java.net.URI) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 3 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project spring-security by spring-projects.

the class ApacheDSContainerTests method startWithLdapOverSsl.

/**
 * This test starts an LDAP server using LDAPs (LDAP over SSL). A self-signed
 * certificate is being used, which was previously generated with:
 *
 * <pre>
 * {@code
 * keytool -genkey -alias spring -keyalg RSA -keystore spring.keystore -validity 3650 -storetype JKS \
 * -dname "CN=localhost, OU=Spring, O=Pivotal, L=Kailua-Kona, ST=HI, C=US" -keypass spring -storepass spring
 * }
 * </pre>
 * @throws Exception
 */
@Test
@DisabledOnOs(OS.WINDOWS)
public void startWithLdapOverSsl() throws Exception {
    final ClassPathResource keyStoreResource = new ClassPathResource("/org/springframework/security/ldap/server/spring.keystore");
    final File temporaryKeyStoreFile = new File(this.temporaryFolder, "spring.keystore");
    FileCopyUtils.copy(keyStoreResource.getInputStream(), new FileOutputStream(temporaryKeyStoreFile));
    assertThat(temporaryKeyStoreFile).isFile();
    ApacheDSContainer server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif");
    List<Integer> ports = getDefaultPorts(1);
    server.setPort(ports.get(0));
    server.setLdapOverSslEnabled(true);
    server.setKeyStoreFile(temporaryKeyStoreFile);
    server.setCertificatePassord("spring");
    try {
        server.afterPropertiesSet();
    } finally {
        try {
            server.destroy();
        } catch (Throwable ex) {
        }
    }
}
Also used : FileOutputStream(java.io.FileOutputStream) File(java.io.File) ClassPathResource(org.springframework.core.io.ClassPathResource) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 4 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project spring-security by spring-projects.

the class ApacheDSContainerTests method startWithLdapOverSslWithWrongPassword.

@Test
@DisabledOnOs(OS.WINDOWS)
public void startWithLdapOverSslWithWrongPassword() throws Exception {
    final ClassPathResource keyStoreResource = new ClassPathResource("/org/springframework/security/ldap/server/spring.keystore");
    final File temporaryKeyStoreFile = new File(this.temporaryFolder, "spring.keystore");
    FileCopyUtils.copy(keyStoreResource.getInputStream(), new FileOutputStream(temporaryKeyStoreFile));
    assertThat(temporaryKeyStoreFile).isFile();
    ApacheDSContainer server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif");
    List<Integer> ports = getDefaultPorts(1);
    server.setPort(ports.get(0));
    server.setLdapOverSslEnabled(true);
    server.setKeyStoreFile(temporaryKeyStoreFile);
    server.setCertificatePassord("incorrect-password");
    assertThatExceptionOfType(RuntimeException.class).isThrownBy(server::afterPropertiesSet).withMessage("Server startup failed").withRootCauseInstanceOf(UnrecoverableKeyException.class);
}
Also used : FileOutputStream(java.io.FileOutputStream) File(java.io.File) ClassPathResource(org.springframework.core.io.ClassPathResource) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Example 5 with DisabledOnOs

use of org.junit.jupiter.api.condition.DisabledOnOs in project neo4j by neo4j.

the class DefaultFileSystemAbstractionTest method retrieveFileDescriptor.

@Test
@DisabledOnOs(OS.WINDOWS)
void retrieveFileDescriptor() throws IOException {
    Path testFile = testDirectory.file("testFile");
    try (StoreChannel storeChannel = fsa.write(testFile)) {
        int fileDescriptor = fsa.getFileDescriptor(storeChannel);
        assertThat(fileDescriptor).isGreaterThan(0);
    }
}
Also used : Path(java.nio.file.Path) DisabledOnOs(org.junit.jupiter.api.condition.DisabledOnOs) Test(org.junit.jupiter.api.Test)

Aggregations

DisabledOnOs (org.junit.jupiter.api.condition.DisabledOnOs)38 Test (org.junit.jupiter.api.Test)34 Path (java.nio.file.Path)25 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 PosixFilePermission (java.nio.file.attribute.PosixFilePermission)6 PageSwapperFactory (org.neo4j.io.pagecache.PageSwapperFactory)6 PageSwapperTest (org.neo4j.io.pagecache.PageSwapperTest)6 DelegatingStoreChannel (org.neo4j.io.fs.DelegatingStoreChannel)5 StoreChannel (org.neo4j.io.fs.StoreChannel)5 DisabledForRoot (org.neo4j.test.extension.DisabledForRoot)5 Closeable (java.io.Closeable)4 File (java.io.File)4 URI (java.net.URI)4 MethodSource (org.junit.jupiter.params.provider.MethodSource)4 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)4 IOException (java.io.IOException)3 FileLock (java.nio.channels.FileLock)3 AccessDeniedException (java.nio.file.AccessDeniedException)3 Client (javax.ws.rs.client.Client)3 Response (javax.ws.rs.core.Response)3