Package org.apache.wink.common.internal.providers.jaxb.jaxb1

Examples of org.apache.wink.common.internal.providers.jaxb.jaxb1.ObjectFactory


        assertEquals(2, ((AddNumbers)obj).getArg1());
       
        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(AddNumbers.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        AddNumbers testresponse =
            (AddNumbers)testunmarshaller.unmarshal(new ByteArrayInputStream(xmlWithDTD.getBytes()));
        assertEquals("we could not unmarshal the test xml", 99999999, testresponse.getArg0());
    }
View Full Code Here


        }});
       
        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(AddNumbers.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        AddNumbers testresponse =
            (AddNumbers)testunmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));
        assertEquals("we could not unmarshal the test xml", 1, testresponse.getArg0());
       
        assertTrue(jaxbProviderReader.isReadable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
        Object obj = jaxbProviderReader.readFrom(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, null, bais);
        assertTrue(obj instanceof AddNumbers);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void testJAXBMarshalling() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, null, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

    @Test
    public void testJAXBMarshallingWithMap() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MultivaluedMap map = new CaseInsensitiveMultivaluedMap<Object>();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, map, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

        assertTrue("expected an XMLStreamException", ex.getCause() instanceof XMLStreamException);
       
        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(AddNumbers.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        AddNumbers testresponse =
            (AddNumbers)testunmarshaller.unmarshal(new ByteArrayInputStream(xmlWithDTD.getBytes()));
        assertEquals("we could not unmarshal the test xml", 99999999, testresponse.getArg0());
    }
View Full Code Here

        assertEquals(2, ((AddNumbers)obj).getArg1());
       
        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(AddNumbers.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        AddNumbers testresponse =
            (AddNumbers)testunmarshaller.unmarshal(new ByteArrayInputStream(xmlWithDTD.getBytes()));
        assertEquals("we could not unmarshal the test xml", 99999999, testresponse.getArg0());
    }
View Full Code Here

        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(MyPojo.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        JAXBElement<MyPojo> testresponse =
            (JAXBElement<MyPojo>)testunmarshaller.unmarshal(new StreamSource(new ByteArrayInputStream(xmlMyPojoWithDTD.getBytes())), MyPojo.class);
        MyPojo myPojo = testresponse.getValue();
        assertEquals("we could not unmarshal the test xml", "99999999", myPojo.getStringdata().trim());
    }
View Full Code Here

        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(MyPojo.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        JAXBElement<MyPojo> testresponse =
            (JAXBElement<MyPojo>)testunmarshaller.unmarshal(new StreamSource(new ByteArrayInputStream(xmlMyPojoWithDTD.getBytes())), MyPojo.class);
        MyPojo myPojo = testresponse.getValue();
        assertEquals("we could not unmarshal the test xml", "99999999", myPojo.getStringdata().trim());
    }
View Full Code Here

 
    public BusinessLifeCycleManagerImpl(RegistryService registry) {
      super(registry);
       
        if(objectFactory == null)
          objectFactory = new ObjectFactory();       
    }
View Full Code Here

                        new org.apache.xml.security.binding.xmldsig.ObjectFactory().createX509Data((X509DataType) object);
                keyInfoType = new KeyInfoType();
                SecurityTokenReferenceType securityTokenReferenceType = new SecurityTokenReferenceType();
                securityTokenReferenceType.getAny().add(x509DataTypeJAXBElement);
                JAXBElement<SecurityTokenReferenceType> securityTokenReferenceTypeJAXBElement =
                        new ObjectFactory().createSecurityTokenReference(securityTokenReferenceType);
                keyInfoType.getContent().add(securityTokenReferenceTypeJAXBElement);
            } else if (object instanceof EncryptedKeyType) {
                EncryptedKeyType encryptedKeyType = (EncryptedKeyType) object;
               
                WSSEncryptedKeyInputHandler encryptedKeyInputHandler = new WSSEncryptedKeyInputHandler();
                encryptedKeyInputHandler.handle(inputProcessorChain, encryptedKeyType, xmlSecStartElement, securityProperties);
               
                SecurityTokenProvider<? extends InboundSecurityToken> securityTokenProvider =
                    inputProcessorChain.getSecurityContext().getSecurityTokenProvider(encryptedKeyType.getId());
                if (securityTokenProvider != null) {
                    return securityTokenProvider.getSecurityToken();
                }
             
            } else if (object instanceof SecurityTokenReferenceType) {
                JAXBElement<SecurityTokenReferenceType> securityTokenReferenceTypeJAXBElement =
                        new ObjectFactory().createSecurityTokenReference((SecurityTokenReferenceType) object);
                keyInfoType = new KeyInfoType();
                keyInfoType.getContent().add(securityTokenReferenceTypeJAXBElement);
            } else if (object instanceof KeyValueType) {
                JAXBElement<KeyValueType> keyValueTypeJAXBElement =
                        new org.apache.xml.security.binding.xmldsig.ObjectFactory().createKeyValue((KeyValueType) object);
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.providers.jaxb.jaxb1.ObjectFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.