use of org.junit.jupiter.api.condition.EnabledOnOs in project netty by netty.
the class NativeLibraryLoaderTest method testSingleResourceInTheClassLoader.
@Test
@EnabledOnOs(LINUX)
@EnabledIf("is_x86_64")
void testSingleResourceInTheClassLoader() throws MalformedURLException {
URL url1 = new File("src/test/data/NativeLibraryLoader/1").toURI().toURL();
URL url2 = new File("src/test/data/NativeLibraryLoader/2").toURI().toURL();
URLClassLoader loader = new URLClassLoader(new URL[] { url1, url2 });
String resourceName = "test2";
NativeLibraryLoader.load(resourceName, loader);
assertTrue(true);
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project netty by netty.
the class NativeLibraryLoaderTest method testMultipleResourcesInTheClassLoader.
@Test
@EnabledOnOs(LINUX)
@EnabledIf("is_x86_64")
void testMultipleResourcesInTheClassLoader() 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 = "test1";
Exception ise = assertThrows(IllegalStateException.class, new Executable() {
@Override
public void execute() {
NativeLibraryLoader.load(resourceName, loader);
}
});
assertTrue(ise.getMessage().contains("Multiple resources found for 'META-INF/native/lib" + resourceName + ".so'"));
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project Aeron by real-logic.
the class TimestampingSystemTest method shouldSupportMediaReceiveTimestampsInCDriver.
@Test
@InterruptAfter(10)
@EnabledOnOs(OS.LINUX)
void shouldSupportMediaReceiveTimestampsInCDriver() {
assumeTrue(TestMediaDriver.shouldRunCMediaDriver());
final DirectBuffer buffer = new UnsafeBuffer(new byte[64]);
try (TestMediaDriver driver = driver();
Aeron aeron = Aeron.connect(new Aeron.Context().aeronDirectoryName(driver.aeronDirectoryName()))) {
final Subscription sub = aeron.addSubscription(CHANNEL_WITH_MEDIA_TIMESTAMP, 1000);
while (null == sub.resolvedEndpoint()) {
Tests.yieldingIdle("Failed to resolve endpoint");
}
final String uri = "aeron:udp?endpoint=" + sub.resolvedEndpoint();
final Publication pub = aeron.addPublication(uri, 1000);
Tests.awaitConnected(pub);
while (0 > pub.offer(buffer, 0, buffer.capacity(), (termBuffer, termOffset, frameLength) -> SENTINEL_VALUE)) {
Tests.yieldingIdle("Failed to offer message");
}
final FragmentHandler fragmentHandler = (buffer1, offset, length, header) -> assertNotEquals(SENTINEL_VALUE, header.reservedValue());
while (1 > sub.poll(fragmentHandler, 1)) {
Tests.yieldingIdle("Failed to receive message");
}
}
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project gocd by gocd.
the class NantTaskBuilderTest method shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnWindows.
@Test
@EnabledOnOs(OS.WINDOWS)
void shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnWindows() {
NantTask nantTask = new NantTask();
nantTask.setNantPath("c:\\nantdir");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
assertThat(new File(builder.getCommand())).isEqualTo(new File("c:\\nantdir\\nant"));
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project gocd by gocd.
the class CommandBuilderTest method commandWithArgsList_shouldAddCmdBeforeAWindowsCommand.
@Test
@EnabledOnOs(OS.WINDOWS)
void commandWithArgsList_shouldAddCmdBeforeAWindowsCommand() {
String[] args = { "some thing" };
CommandBuilderWithArgList commandBuilderWithArgList = new CommandBuilderWithArgList("echo", args, tempWorkDir, null, null, "some desc");
CommandLine commandLine = commandBuilderWithArgList.buildCommandLine();
assertThat(commandLine.toStringForDisplay()).isEqualTo("cmd /c echo some thing");
}
Aggregations