use of org.apache.cxf.bus.spring.SpringBusFactory in project testcases by coheigea.
the class EncryptedElementsTest method testEncryptedElements.
@org.junit.Test
public void testEncryptedElements() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = EncryptedElementsTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = EncryptedElementsTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItEncryptedElementsPort");
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 WSSecurityWebsocketTest method testAsymmetricOverWebsocket.
// TODO - See CXF-6932 - https://issues.apache.org/jira/browse/CXF-6932
@org.junit.Test
@org.junit.Ignore
public void testAsymmetricOverWebsocket() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityWebsocketTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = WSSecurityWebsocketTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricOAEPPort");
DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
// Update the port
String address = "ws://localhost:" + PORT + "/doubleit/services/doubleitasymmetricoaep";
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
doubleIt(port, 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 testAuthorizedRequest.
@org.junit.Test
public void testAuthorizedRequest() 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("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
Client client = ClientProxy.getClient(transportPort);
client.getRequestContext().put("ws-security.username", "alice");
TokenTestUtils.updateSTSPort((BindingProvider) transportPort, STS_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();
}
}
Aggregations