use of org.apache.cxf.Bus in project cxf by apache.
the class DistributedCachingTest method testSecurityContextToken.
@org.junit.Test
public void testSecurityContextToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = DistributedCachingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = DistributedCachingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSCTPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
doubleIt(transportPort, 25);
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
use of org.apache.cxf.Bus in project cxf by apache.
the class STSServer method run.
protected void run() {
URL busFile = STSServer.class.getResource("cxf-sts-1.xml");
Bus busLocal = new SpringBusFactory().createBus(busFile);
BusFactory.setDefaultBus(busLocal);
setBus(busLocal);
try {
new STSServer();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.apache.cxf.Bus in project cxf by apache.
the class STSServer2 method run.
protected void run() {
URL busFile = STSServer2.class.getResource("cxf-sts-2.xml");
Bus busLocal = new SpringBusFactory().createBus(busFile);
BusFactory.setDefaultBus(busLocal);
setBus(busLocal);
try {
new STSServer2();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.apache.cxf.Bus in project cxf by apache.
the class JWTUnitTest method testIssueJWTToken.
@org.junit.Test
public void testIssueJWTToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = JWTUnitTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
// Issue the token
SecurityToken token = requestSecurityToken(JWT_TOKEN_TYPE, bus, DEFAULT_ADDRESS, null, null);
assertNotNull(token);
assertNotNull(token.getToken());
// Validate the token
token = validateSecurityToken(token, bus, null, null);
assertNotNull(token);
assertNotNull(token.getToken());
}
use of org.apache.cxf.Bus in project cxf by apache.
the class Intermediary method run.
protected void run() {
URL busFile = Intermediary.class.getResource("cxf-intermediary.xml");
Bus busLocal = new SpringBusFactory().createBus(busFile);
BusFactory.setDefaultBus(busLocal);
setBus(busLocal);
try {
new Intermediary();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations