use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class ServiceLocatorImplTest method failureWhenGettingServices.
@Test
public void failureWhenGettingServices() throws Exception {
expect(backend.connect()).andReturn(rootNode);
expect(rootNode.getServiceNames()).andThrow(new ServiceLocatorException());
replayAll();
ServiceLocatorImpl slc = new ServiceLocatorImpl();
slc.setBackend(backend);
try {
slc.getServices();
fail("A ServiceLocatorException should have been thrown.");
} catch (ServiceLocatorException e) {
ignore("Expected exception");
}
verifyAll();
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class ServiceLocatorImplTest method failureWhenRegisteringService.
@Test
public void failureWhenRegisteringService() throws Exception {
expect(backend.connect()).andReturn(rootNode);
expect(rootNode.getServiceNode(SERVICE_QNAME_1)).andReturn(serviceNode);
serviceNode.ensureExists();
expectLastCall().andThrow(new ServiceLocatorException());
replayAll();
ServiceLocatorImpl slc = new ServiceLocatorImpl();
slc.setBackend(backend);
try {
slc.register(SERVICE_QNAME_1, ENDPOINT_1);
fail("A ServiceLocatorException should have been thrown.");
} catch (ServiceLocatorException e) {
ignore("Expected exception");
}
verifyAll();
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class LocatorSoapServiceTest method lookUpEndpointsExpectedLocatorException.
@Test(expected = ServiceLocatorFault.class)
public void lookUpEndpointsExpectedLocatorException() throws ServiceLocatorException, InterruptedException, ServiceLocatorFault, InterruptedExceptionFault {
sl.lookup(SERVICE_NAME);
EasyMock.expectLastCall().andStubThrow(new ServiceLocatorException("test"));
replayAll();
lps.lookupEndpoints(SERVICE_NAME, null);
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class LocatorSoapServiceTest method lookUpEndpointExpectedLocatorException.
@Test(expected = ServiceLocatorFault.class)
public void lookUpEndpointExpectedLocatorException() throws ServiceLocatorException, InterruptedException, ServiceLocatorFault, InterruptedExceptionFault {
sl.lookup(SERVICE_NAME);
EasyMock.expectLastCall().andStubThrow(new ServiceLocatorException("test"));
replayAll();
lps.lookupEndpoint(SERVICE_NAME, null);
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class LocatorSoapServiceTest method registerEndpointExpectedLocatorException.
@Test(expected = ServiceLocatorFault.class)
public void registerEndpointExpectedLocatorException() throws ServiceLocatorException, InterruptedException, ServiceLocatorFault, InterruptedExceptionFault {
sl.register(endpoint(), EasyMock.eq(true));
EasyMock.expectLastCall().andStubThrow(new ServiceLocatorException("test"));
replayAll();
lps.registerEndpoint(SERVICE_NAME, ENDPOINTURL, null, null, null);
}
Aggregations