ServiceElement { public static org.holodeckb2b.common.messagemodel.Service readElement(final OMElement svcElement) { if (svcElement == null) return null; final String svcName = svcElement.getText(); final String svcType = svcElement.getAttributeValue(new QName(LN_ATTR_TYPE)); return new org.holodeckb2b.common.messagemodel.Service(svcName, svcType); }  static OMElement createElement(final OMElement ciElement, final IService data); static OMElement getElement(final OMElement ciElement); static org.holodeckb2b.common.messagemodel.Service readElement(final OMElement svcElement); static final QName Q_ELEMENT_NAME; static final String LN_ATTR_TYPE; }
@Test public void testReadElementWithTypeAttr() throws Exception { String svcType = "org:holodeckb2b:services:test"; String svcName = "Packaging"; Service svc = ServiceElement.readElement(createXML( " <eb3:Service type=\"" + svcType + "\"" + " xmlns:eb3=\"http: svcName + "</eb3:Service>")); assertNotNull(svc); assertEquals(svcType, svc.getType()); assertEquals(svcName, svc.getName()); }
@Test public void testReadElementNoTypeAttr() throws Exception { String svcName = "Packaging"; Service svc = ServiceElement.readElement(createXML( " <eb3:Service xmlns:eb3=\"http: svcName + "</eb3:Service>")); assertNotNull(svc); assertNull(svc.getType()); assertEquals(svcName, svc.getName()); }