use of org.junit.BeforeClass in project spring-security by spring-projects.
the class ApacheDSServerIntegrationTests method startServer.
@BeforeClass
public static void startServer() throws Exception {
// OpenLDAP configuration
// contextSource = new
// DefaultSpringSecurityContextSource("ldap://127.0.0.1:22389/dc=springsource,dc=com");
// contextSource.setUserDn("cn=admin,dc=springsource,dc=com");
// contextSource.setPassword("password");
server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif");
int port = getAvailablePort();
server.setPort(port);
server.afterPropertiesSet();
serverPort = port;
}
use of org.junit.BeforeClass in project camel by apache.
the class CamelTransportClientServerTest method startUpServer.
@BeforeClass
public static void startUpServer() throws Exception {
if (!"true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"))) {
port = AvailablePortFinder.getNextAvailable();
System.setProperty("port", String.valueOf(port));
context = new ClassPathXmlApplicationContext(new String[] { "/META-INF/spring/CamelTransportSpringConfig.xml" });
} else {
System.out.println("Skipping starting CamelContext as system property skipStartingCamelContext is set to be true.");
}
}
use of org.junit.BeforeClass in project camel by apache.
the class CxfPayloadProviderRouterTest method startService.
@BeforeClass
public static void startService() {
implementor = new GreeterImpl();
String address = "http://localhost:" + CXFTestSupport.getPort1() + "/CxfPayLoadProviderRouterTest/SoapContext/SoapPort";
endpoint = Endpoint.publish(address, implementor);
}
use of org.junit.BeforeClass in project auto by google.
the class AutoValueJava8Test method setUpClass.
// This is appalling. Some versions of javac do not correctly report annotations on type uses in
// certain cases, for example on type variables or arrays. Since some of the tests here are for
// exactly that, we compile a test program with a test annotation processor to see whether we
// might be in the presence of such a javac, and if so we skip the tests that would fail because
// of the bug. This isn't completely sound because we can't be entirely sure that the javac that
// Compiler.javac() finds is the same as the javac that was used to build this test (and therefore
// run AutoValueProcessor), but it's better than just ignoring the tests outright.
@BeforeClass
public static void setUpClass() {
JavaFileObject javaFileObject = JavaFileObjects.forSourceLines("Test", "import java.lang.annotation.ElementType;", "import java.lang.annotation.Retention;", "import java.lang.annotation.RetentionPolicy;", "import java.lang.annotation.Target;", "public abstract class Test<T> {", " @Retention(RetentionPolicy.RUNTIME)", " @Target(ElementType.TYPE_USE)", " public @interface Nullable {}", "", " public abstract @Nullable T t();", "}");
Compilation compilation = Compiler.javac().withProcessors(new BugTestProcessor()).compile(javaFileObject);
if (compilation.errors().isEmpty()) {
javacHandlesTypeAnnotationsCorrectly = true;
} else {
assertThat(compilation).hadErrorCount(1);
assertThat(compilation).hadErrorContaining(JAVAC_HAS_BUG_ERROR);
}
}
use of org.junit.BeforeClass in project flyway by flyway.
the class ClassUtilsSmallTest method setUp.
@BeforeClass
public static void setUp() throws IOException {
oldClassLoader = getClassLoader();
String jar = new ClassPathResource("no-directory-entries.jar", getClassLoader()).getLocationOnDisk();
assertTrue(new File(jar).isFile());
ClassUtils.addJarOrDirectoryToClasspath(jar);
}
Aggregations