Esempio n. 1
0
 @Validated
 @Test
 public final void testAddDetailEntryUsingQName() throws Exception {
   Detail detail = createEmptySOAPFault().addDetail();
   DetailEntry detailEntry = detail.addDetailEntry(new QName("urn:ns", "mydetail", "p"));
   assertEquals("urn:ns", detailEntry.getNamespaceURI());
   assertEquals("mydetail", detailEntry.getLocalName());
   assertEquals("p", detailEntry.getPrefix());
   assertSame(detailEntry, detail.getFirstChild());
 }
Esempio n. 2
0
 @Validated
 @Test
 public final void testAddDetailEntryUsingName() throws Exception {
   SOAPEnvelope envelope = createSOAPEnvelope();
   Detail detail = envelope.addBody().addFault().addDetail();
   DetailEntry detailEntry = detail.addDetailEntry(envelope.createName("mydetail", "p", "urn:ns"));
   assertEquals("urn:ns", detailEntry.getNamespaceURI());
   assertEquals("mydetail", detailEntry.getLocalName());
   assertEquals("p", detailEntry.getPrefix());
   assertSame(detailEntry, detail.getFirstChild());
 }
Esempio n. 3
0
 @Validated
 @Test
 public final void testAddDetailEntryUsingQNameWithoutNamespace() throws Exception {
   Detail detail = createEmptySOAPFault().addDetail();
   DetailEntry detailEntry = detail.addDetailEntry(new QName("mydetail"));
   // TODO: Sun's implementation returns an empty string here (which I believe is incorrect)
   //        assertNull(detailEntry.getNamespaceURI());
   assertEquals("mydetail", detailEntry.getLocalName());
   assertNull(detailEntry.getPrefix());
   assertSame(detailEntry, detail.getFirstChild());
 }