use of org.apache.cxf.bus.spring.SpringBusFactory in project testcases by coheigea.
the class SymmetricActionTest method testSymmetricAES256.
@org.junit.Test
public void testSymmetricAES256() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = SymmetricActionTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = SymmetricActionTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSymmetric256Port");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
doubleIt(transportPort, 25);
}
use of org.apache.cxf.bus.spring.SpringBusFactory in project testcases by coheigea.
the class Server method run.
protected void run() {
URL busFile = Server.class.getResource("cxf-service.xml");
Bus busLocal = new SpringBusFactory().createBus(busFile);
BusFactory.setDefaultBus(busLocal);
setBus(busLocal);
try {
new Server();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.apache.cxf.bus.spring.SpringBusFactory in project testcases by coheigea.
the class AuthorizationTest method testUTSecureProxyUnauthorized.
@org.junit.Test
public void testUTSecureProxyUnauthorized() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = AuthorizationTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = AuthorizationTest.class.getResource("../proxyservice/DoubleItProxy.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PROXY_PORT);
((BindingProvider) transportPort).getRequestContext().put(SecurityConstants.USERNAME, "bob");
((BindingProvider) transportPort).getRequestContext().put(SecurityConstants.PASSWORD, "security");
try {
doubleIt(transportPort, 25);
fail("Failure expected on an unauthorized user");
} catch (Exception ex) {
// expected
}
}
use of org.apache.cxf.bus.spring.SpringBusFactory in project testcases by coheigea.
the class AsymmetricPolicyTest method testAsymmetricOAEP.
@org.junit.Test
public // @org.junit.Ignore
void testAsymmetricOAEP() throws Exception {
// Endpoint is at:
// http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricoaep
SpringBusFactory bf = new SpringBusFactory();
URL busFile = AsymmetricPolicyTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = AsymmetricPolicyTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricOAEPPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
doubleIt(transportPort, 25);
}
use of org.apache.cxf.bus.spring.SpringBusFactory in project testcases by coheigea.
the class AsymmetricPolicyTest method testAsymmetricPKCS12.
@org.junit.Test
public // @org.junit.Ignore
void testAsymmetricPKCS12() throws Exception {
// Endpoint is at:
// http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricpkcs12
SpringBusFactory bf = new SpringBusFactory();
URL busFile = AsymmetricPolicyTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = AsymmetricPolicyTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricPKCS12Port");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
doubleIt(transportPort, 25);
}
Aggregations