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());
}
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();
}
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());
}
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;
}
}
}
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);
}
Aggregations