Search in sources :

Example 56 with BeforeClass

use of org.junit.BeforeClass in project camel by apache.

the class SoapToSoapSingleDataFormatterTest method setup.

@BeforeClass
public static void setup() {
    namespacePrefixMap = new HashMap<String, String>();
    namespacePrefixMap.put("http://schemas.xmlsoap.org/soap/envelope/", "soap");
    namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema", "xsd");
    namespacePrefixMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
    namespacePrefixMap.put("http://www.example.com/contact", "cont");
    namespacePrefixMap.put("http://www.example.com/soapheaders", "custom");
    soapjaxbModel = new SoapJaxbDataFormat("com.example.contact:com.example.soapheaders");
    soapjaxbModel.setNamespacePrefix(namespacePrefixMap);
    soapjaxbModel.setPrettyPrint(true);
    soapjaxbModel.setIgnoreUnmarshalledHeaders(false);
    soapjaxbModel.setIgnoreJAXBElement(false);
    soapjaxbModel.setElementNameStrategy(new TypeNameStrategy());
}
Also used : TypeNameStrategy(org.apache.camel.dataformat.soap.name.TypeNameStrategy) BeforeClass(org.junit.BeforeClass)

Example 57 with BeforeClass

use of org.junit.BeforeClass in project camel by apache.

the class SpringJmsClientServerTest method setupFreePort.

@BeforeClass
public static void setupFreePort() throws Exception {
    // find a free port number, and write that in the custom.properties file
    // which we will use for the unit tests, to avoid port number in use problems
    int port = AvailablePortFinder.getNextAvailable();
    String bank1 = "tcp.port=" + port;
    File custom = new File("target/custom.properties");
    FileOutputStream fos = new FileOutputStream(custom);
    fos.write(bank1.getBytes());
    fos.close();
}
Also used : FileOutputStream(java.io.FileOutputStream) File(java.io.File) Endpoint(org.apache.camel.Endpoint) BeforeClass(org.junit.BeforeClass)

Example 58 with BeforeClass

use of org.junit.BeforeClass in project camel by apache.

the class KarafRuntimeProviderTest method createCamelCatalog.

@BeforeClass
public static void createCamelCatalog() {
    catalog = new DefaultCamelCatalog();
    catalog.setRuntimeProvider(new KarafRuntimeProvider());
}
Also used : DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) BeforeClass(org.junit.BeforeClass)

Example 59 with BeforeClass

use of org.junit.BeforeClass in project cassandra by apache.

the class DatabaseDescriptorTest method selectSuitableInterface.

/*
     * Server only accepts interfaces by name if they have a single address
     * OS X seems to always have an ipv4 and ipv6 address on all interfaces which means some tests fail
     * if not checked for and skipped
     */
@BeforeClass
public static void selectSuitableInterface() throws Exception {
    Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
    while (interfaces.hasMoreElements()) {
        NetworkInterface intf = interfaces.nextElement();
        System.out.println("Evaluating " + intf.getName());
        if (intf.isLoopback()) {
            suitableInterface = intf;
            boolean hasIPv4 = false;
            boolean hasIPv6 = false;
            Enumeration<InetAddress> addresses = suitableInterface.getInetAddresses();
            while (addresses.hasMoreElements()) {
                if (addresses.nextElement() instanceof Inet6Address)
                    hasIPv6 = true;
                else
                    hasIPv4 = true;
            }
            hasIPv4andIPv6 = hasIPv4 && hasIPv6;
            return;
        }
    }
}
Also used : NetworkInterface(java.net.NetworkInterface) Inet6Address(java.net.Inet6Address) InetAddress(java.net.InetAddress) BeforeClass(org.junit.BeforeClass)

Example 60 with BeforeClass

use of org.junit.BeforeClass in project cassandra by apache.

the class NativeCellTest method setUp.

@BeforeClass
public static void setUp() {
    long seed = System.currentTimeMillis();
    logger.info("Seed : {}", seed);
    rand = new Random(seed);
}
Also used : Random(java.util.Random) 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