Search in sources :

Example 46 with RegistryPackageType

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));
}
Also used : ParserConfigurator(org.codice.ddf.parser.ParserConfigurator) QueryRequest(ddf.catalog.operation.QueryRequest) RegistryPackageType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType) InputStream(java.io.InputStream) QueryResponse(ddf.catalog.operation.QueryResponse) JAXBElement(javax.xml.bind.JAXBElement) Test(org.junit.Test)

Example 47 with RegistryPackageType

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);
    }
}
Also used : ParserException(org.codice.ddf.parser.ParserException) RegistryPackageType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException)

Example 48 with RegistryPackageType

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));
}
Also used : RegistryPackageType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType) Test(org.junit.Test)

Aggregations

RegistryPackageType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryPackageType)46 Test (org.junit.Test)26 Metacard (ddf.catalog.data.Metacard)16 InputStream (java.io.InputStream)12 RegistryObjectListType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType)11 ArrayList (java.util.ArrayList)9 JAXBElement (javax.xml.bind.JAXBElement)9 ExtrinsicObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType)9 AttributeImpl (ddf.catalog.data.impl.AttributeImpl)7 HashMap (java.util.HashMap)5 IOException (java.io.IOException)4 Map (java.util.Map)4 AssociationType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.AssociationType1)4 OrganizationType (oasis.names.tc.ebxml_regrep.xsd.rim._3.OrganizationType)4 PersonType (oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType)4 RegistryObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectType)4 ParserConfigurator (org.codice.ddf.parser.ParserConfigurator)4 FederationAdminException (org.codice.ddf.registry.federationadmin.service.internal.FederationAdminException)4 QueryRequest (ddf.catalog.operation.QueryRequest)3 QueryResponse (ddf.catalog.operation.QueryResponse)3