Search in sources :

Example 41 with ObjectFactory

use of ogc.schema.opengis.wfs.v_1_0_0.ObjectFactory in project cxf by apache.

the class AbstractSequenceTest method testIdentifierEquals.

@Test
public void testIdentifierEquals() {
    Identifier id1 = null;
    Identifier id2 = null;
    assertTrue(AbstractSequence.identifierEquals(id1, id2));
    ObjectFactory factory = new ObjectFactory();
    id1 = factory.createIdentifier();
    id1.setValue("seq1");
    assertTrue(!AbstractSequence.identifierEquals(id1, id2));
    id2 = factory.createIdentifier();
    id2.setValue("seq2");
    assertTrue(!AbstractSequence.identifierEquals(id1, id2));
    id2.setValue("seq1");
    assertTrue(AbstractSequence.identifierEquals(id1, id2));
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) ObjectFactory(org.apache.cxf.ws.rm.v200702.ObjectFactory) Test(org.junit.Test)

Example 42 with ObjectFactory

use of ogc.schema.opengis.wfs.v_1_0_0.ObjectFactory in project Payara by payara.

the class Jaxb1MarshallingTestServlet method service.

@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    resp.setContentType("text/html;charset=UTF-8");
    PrintWriter out = resp.getWriter();
    out.println("jaxb1 marshalling test: ");
    try {
        JAXBContext jc = JAXBContext.newInstance("jaxb1");
        Marshaller m = jc.createMarshaller();
        ObjectFactory of = new ObjectFactory();
        Catalog c = of.createCatalog();
        c.setSection("jaxb1 section");
        StringWriter sw = new StringWriter();
        m.marshal(c, sw);
        String s = sw.toString();
        if (s.contains("<catalog section=\"jaxb1 section\"/>"))
            out.println("marshalled OK");
        else {
            out.println("jaxb1 marshalling failed");
            System.err.println("Error in Jaxb1MarshallingTestServlet. Marshalling result: " + s);
        }
    } catch (JAXBException e) {
        out.println("jaxb1 marshalling failed: " + e.getMessage());
        e.printStackTrace();
    }
}
Also used : Marshaller(javax.xml.bind.Marshaller) ObjectFactory(jaxb1.ObjectFactory) StringWriter(java.io.StringWriter) JAXBException(javax.xml.bind.JAXBException) JAXBContext(javax.xml.bind.JAXBContext) Catalog(jaxb1.Catalog) PrintWriter(java.io.PrintWriter)

Aggregations

Test (org.junit.Test)14 ObjectFactory (net.opengis.cat.csw.v_2_0_2.ObjectFactory)13 QueryType (net.opengis.cat.csw.v_2_0_2.QueryType)11 JAXBElement (javax.xml.bind.JAXBElement)10 GetRecordsType (net.opengis.cat.csw.v_2_0_2.GetRecordsType)10 Marshaller (javax.xml.bind.Marshaller)8 ObjectFactory (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectFactory)7 StringWriter (java.io.StringWriter)7 JAXBContext (javax.xml.bind.JAXBContext)7 Holder (javax.xml.ws.Holder)7 ObjectFactory (org.apache.type_test.types3.ObjectFactory)7 BigInteger (java.math.BigInteger)6 CswRecordCollection (org.codice.ddf.spatial.ogc.csw.catalog.common.CswRecordCollection)6 XStream (com.thoughtworks.xstream.XStream)5 ByteArrayInputStream (java.io.ByteArrayInputStream)5 Writer (java.io.Writer)5 ArrayList (java.util.ArrayList)5 Ignore (jdk.nashorn.internal.ir.annotations.Ignore)5 ElementSetNameType (net.opengis.cat.csw.v_2_0_2.ElementSetNameType)5 GetRecordsResponseType (net.opengis.cat.csw.v_2_0_2.GetRecordsResponseType)5