use of com.ibm.lsid.ExpiringResponse in project cdmlib by cybertaxonomy.
the class AuthorityControllerTest method setUp.
@Before
public void setUp() {
try {
lsid = new LSID("urn:lsid:example.org:taxonconcept:1");
} catch (MalformedLSIDException e) {
}
try {
lsidAuthority = new LSIDAuthority("fred.org");
} catch (MalformedLSIDException e) {
}
authorityService = org.easymock.classextension.EasyMock.createMock(LSIDAuthorityService.class);
authorityController = new AuthorityController();
source = new Object();
expiringResponse = new ExpiringResponse(source, null);
}
use of com.ibm.lsid.ExpiringResponse in project cdmlib by cybertaxonomy.
the class LsidAuthorityServiceImpl method getAuthorityWSDL.
@Override
public ExpiringResponse getAuthorityWSDL() throws LSIDServerException {
LSID lsid = null;
LSIDWSDLWrapper wsdl = lsidWSDLWrapperFactory.getLSIDWSDLWrapper(lsid);
try {
wsdl.setAuthorityLocation(new HTTPLocation("AuthorityServiceHTTP", "HTTPPort", lsidDomain, lsidPort, null));
// lsidWSDLWrapperFactory.setAuthorityLocation(new SOAPLocation("AuthorityServiceSOAP", "SOAPPort", "http://" + lsidDomain + ":" + lsidPort + "/authority/soap/"), wsdl);
return new ExpiringResponse(wsdl.getWSDLSource(), getExpiration());
} catch (LSIDException e) {
throw new LSIDServerException(e, e.getErrorCode(), "LSIDAuthorityServiceImpl Error in getAuthorityWSDL");
} catch (WSDLException e) {
throw new LSIDServerException(e, LSIDServerException.INTERNAL_PROCESSING_ERROR, "LSIDAuthorityServiceImpl Error in getAuthorityWSDL");
}
}
use of com.ibm.lsid.ExpiringResponse in project cdmlib by cybertaxonomy.
the class LSIDAuthorityServiceTest method testGetAuthorityWSDL.
@Test
public void testGetAuthorityWSDL() throws Exception {
ExpiringResponse expiringResponse = lsidAuthorityService.getAuthorityWSDL();
String resource = "/eu/etaxonomy/cdm/api/service/lsid/LSIDAuthorityServiceTest.testGetAuthorityWSDL-result.wsdl";
String result = transformSourceToString((Source) expiringResponse.getValue());
assertXMLEqual("getAuthorityWSDL should return an xml source equal to the test resource", new InputStreamReader(this.getClass().getResourceAsStream(resource)), new StringReader(result));
}
use of com.ibm.lsid.ExpiringResponse in project cdmlib by cybertaxonomy.
the class LSIDAuthorityServiceTest method testGetAvailableServicesWithKnownLSID.
/**
* Unfortunately, the ordering of the services switches round between linux and windows.
* This is why we ignore this test failure.
*
* @throws Exception
*/
@Test
@Ignore
public void testGetAvailableServicesWithKnownLSID() throws Exception {
ExpiringResponse expiringResponse = lsidAuthorityService.getAvailableServices(knownLsid);
String resource = "/eu/etaxonomy/cdm/api/service/lsid/LSIDAuthorityServiceTest.testGetAvailableServicesWithKnownLSID-result.wsdl";
String result = transformSourceToString((Source) expiringResponse.getValue());
assertXMLEqual("getAvailableServices should return an xml source equal to the test resource", new InputStreamReader(this.getClass().getResourceAsStream(resource)), new StringReader(result));
}
Aggregations