Search in sources :

Example 21 with EnabledOnOs

use of org.junit.jupiter.api.condition.EnabledOnOs in project cryptomator by cryptomator.

the class VaultModuleTest method testLinuxFuseDefaultMountFlags.

@Test
@DisplayName("provideDefaultMountFlags on Linux/FUSE")
@EnabledOnOs(OS.LINUX)
public void testLinuxFuseDefaultMountFlags() {
    Mockito.when(settings.preferredVolumeImpl()).thenReturn(new SimpleObjectProperty<>(VolumeImpl.FUSE));
    StringBinding result = module.provideDefaultMountFlags(settings, vaultSettings);
    MatcherAssert.assertThat(result.get(), CoreMatchers.containsString("-oro"));
}
Also used : StringBinding(javafx.beans.binding.StringBinding) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 22 with EnabledOnOs

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

the class DefaultFileSystemAbstractionTest method retrieveWindowsFileDescriptor.

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

Example 23 with EnabledOnOs

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

the class PageSwapperTest method doNotAllowDirectIOForPagesNotMultipleOfBlockSize.

@Test
@EnabledOnOs(OS.LINUX)
void doNotAllowDirectIOForPagesNotMultipleOfBlockSize() throws IOException {
    PageSwapperFactory factory = createSwapperFactory(getFs());
    Path file = file("file");
    checkUnsupportedPageSize(factory, file, 17);
    checkUnsupportedPageSize(factory, file, 115);
    checkUnsupportedPageSize(factory, file, 218);
    checkUnsupportedPageSize(factory, file, 419);
    checkUnsupportedPageSize(factory, file, 524);
    checkUnsupportedPageSize(factory, file, 1023);
    checkUnsupportedPageSize(factory, file, 4097);
}
Also used : Path(java.nio.file.Path) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) Test(org.junit.jupiter.api.Test)

Example 24 with EnabledOnOs

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

the class VersionAwareLogEntryReaderIT method readOnlyLogFilesWhileCommandsAreAvailable.

@Test
@EnabledOnOs(OS.LINUX)
void readOnlyLogFilesWhileCommandsAreAvailable() throws IOException {
    LogFiles logFiles = LogFilesBuilder.builder(databaseLayout, fs).withLogEntryReader(entryReader).withLogVersionRepository(new SimpleLogVersionRepository()).withTransactionIdStore(new SimpleTransactionIdStore()).withStoreId(StoreId.UNKNOWN).build();
    try (Lifespan lifespan = new Lifespan(logFiles)) {
        assertEquals(kibiBytes(128), Files.size(logFiles.getLogFile().getHighestLogFile()));
        LogPosition logPosition = entryReader.lastPosition();
        assertEquals(0L, logPosition.getLogVersion());
        // this position in a log file before 0's are actually starting
        assertEquals(END_OF_DATA_OFFSET, logPosition.getByteOffset());
    }
}
Also used : SimpleTransactionIdStore(org.neo4j.kernel.impl.transaction.SimpleTransactionIdStore) LogFiles(org.neo4j.kernel.impl.transaction.log.files.LogFiles) SimpleLogVersionRepository(org.neo4j.kernel.impl.transaction.SimpleLogVersionRepository) Lifespan(org.neo4j.kernel.lifecycle.Lifespan) LogPosition(org.neo4j.kernel.impl.transaction.log.LogPosition) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) Test(org.junit.jupiter.api.Test)

Example 25 with EnabledOnOs

use of org.junit.jupiter.api.condition.EnabledOnOs in project netty by netty.

the class NativeLibraryLoaderTest method testMultipleResourcesWithSameContentInTheClassLoader.

@Test
@EnabledOnOs(LINUX)
@EnabledIf("is_x86_64")
void testMultipleResourcesWithSameContentInTheClassLoader() throws MalformedURLException {
    URL url1 = new File("src/test/data/NativeLibraryLoader/1").toURI().toURL();
    URL url2 = new File("src/test/data/NativeLibraryLoader/2").toURI().toURL();
    final URLClassLoader loader = new URLClassLoader(new URL[] { url1, url2 });
    final String resourceName = "test3";
    NativeLibraryLoader.load(resourceName, loader);
    assertTrue(true);
}
Also used : URLClassLoader(java.net.URLClassLoader) File(java.io.File) URL(java.net.URL) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) Test(org.junit.jupiter.api.Test) EnabledIf(org.junit.jupiter.api.condition.EnabledIf)

Aggregations

Test (org.junit.jupiter.api.Test)36 EnabledOnOs (org.junit.jupiter.api.condition.EnabledOnOs)36 File (java.io.File)14 Path (java.nio.file.Path)7 URI (java.net.URI)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 EnabledForRepository (org.opengrok.indexer.condition.EnabledForRepository)5 TestRepository (org.opengrok.indexer.util.TestRepository)5 URL (java.net.URL)3 URLClassLoader (java.net.URLClassLoader)3 Date (java.util.Date)3 LinkedList (java.util.LinkedList)3 StringBinding (javafx.beans.binding.StringBinding)3 DisplayName (org.junit.jupiter.api.DisplayName)3 EnabledIf (org.junit.jupiter.api.condition.EnabledIf)3 CommandLine (com.thoughtworks.go.util.command.CommandLine)2 HttpServletRequest (jakarta.servlet.http.HttpServletRequest)2 HashSet (java.util.HashSet)2 DummyHttpServletRequest (org.opengrok.indexer.web.DummyHttpServletRequest)2 NantTask (com.thoughtworks.go.config.NantTask)1