use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class FederationAdminServiceImplTest method testGetRegistryObjectsWithNoRegistryEntries.
@Test
public void testGetRegistryObjectsWithNoRegistryEntries() throws Exception {
QueryRequest request = getTestQueryRequest();
QueryResponse response = getPopulatedTestQueryResponse(request);
when(catalogFramework.query(any(QueryRequest.class))).thenReturn(response);
List<RegistryPackageType> packages = federationAdminServiceImpl.getRegistryObjects();
assertThat(packages, empty());
verify(catalogFramework).query(any(QueryRequest.class));
verify(parser, never()).unmarshal(any(ParserConfigurator.class), eq(JAXBElement.class), any(InputStream.class));
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class MetacardMarshaller method getRegistryPackageAsXml.
/**
* Converts the RegistryPackageType into an xml string
*
* @param registryPackage Registry package to convert
* @return Ebrim xml string
* @throws ParserException
*/
public String getRegistryPackageAsXml(RegistryPackageType registryPackage) throws ParserException {
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
JAXBElement<RegistryPackageType> registryObjectTypeJAXBElement = EbrimConstants.RIM_FACTORY.createRegistryPackage(registryPackage);
parser.marshal(marshalConfigurator, registryObjectTypeJAXBElement, outputStream);
return new String(outputStream.toByteArray(), StandardCharsets.UTF_8);
} catch (IOException e) {
throw new ParserException("Error parsing registry package to ebrim xml", e);
}
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType in project ddf by codice.
the class RegistryReportBuilderTest method testOrganizationReportWithSimplifiedRegistryPackage.
@Test
public void testOrganizationReportWithSimplifiedRegistryPackage() throws Exception {
RegistryPackageType registryPackage = getRegistryPackageFromResource("/csw-simplified-registry-package.xml");
String html = reportHelper.getHtmlFromRegistryPackage(registryPackage, reportHelper.ORGANIZATIONS);
assertOrganizationReportValues(Jsoup.parse(html));
}
Aggregations