Search in sources :

Example 36 with BeforeClass

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;
}
Also used : ApacheDSContainer(org.springframework.security.ldap.server.ApacheDSContainer) BeforeClass(org.junit.BeforeClass)

Example 37 with BeforeClass

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.");
    }
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) BeforeClass(org.junit.BeforeClass)

Example 38 with BeforeClass

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);
}
Also used : GreeterImpl(org.apache.hello_world_soap_http.GreeterImpl) BeforeClass(org.junit.BeforeClass)

Example 39 with BeforeClass

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);
    }
}
Also used : JavaFileObject(javax.tools.JavaFileObject) Compilation(com.google.testing.compile.Compilation) BeforeClass(org.junit.BeforeClass)

Example 40 with BeforeClass

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);
}
Also used : File(java.io.File) ClassPathResource(org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource) BeforeClass(org.junit.BeforeClass)

Aggregations

BeforeClass (org.junit.BeforeClass)2813 File (java.io.File)388 Configuration (org.apache.hadoop.conf.Configuration)287 IOException (java.io.IOException)128 Connection (java.sql.Connection)126 Properties (java.util.Properties)108 Reader (java.io.Reader)99 SqlSessionFactoryBuilder (org.apache.ibatis.session.SqlSessionFactoryBuilder)98 Provisioning (com.zimbra.cs.account.Provisioning)93 ScriptRunner (org.apache.ibatis.jdbc.ScriptRunner)91 HiveConf (org.apache.hadoop.hive.conf.HiveConf)86 MockProvisioning (com.zimbra.cs.account.MockProvisioning)77 Path (org.apache.hadoop.fs.Path)75 URI (java.net.URI)73 HashMap (java.util.HashMap)70 URL (java.net.URL)63 SqlSession (org.apache.ibatis.session.SqlSession)62 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)61 Injector (com.google.inject.Injector)57 CConfiguration (co.cask.cdap.common.conf.CConfiguration)56