use of org.apache.cxf.ws.rm.v200702.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));
}
use of org.apache.cxf.ws.rm.v200702.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();
}
}
Aggregations