Examples of AegisContext


Examples of org.apache.cxf.aegis.AegisContext

        testUtilities.addDefaultNamespaces();
    }

    @Test
    public void testAegisTypeSchema() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        XmlSchemaCollection collection = new XmlSchemaCollection();
        context.addTypesSchemaDocument(collection);
        XmlSchema[] schemas = collection.getXmlSchemas();
        XmlSchema typeSchema = null;
        for (XmlSchema schema : schemas) {
            if (AegisContext.UTILITY_TYPES_SCHEMA_NS.equals(schema.getTargetNamespace())) {
                typeSchema = schema;
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        addNamespace("b", "urn:Bean");
        addNamespace("a", "urn:anotherns");
        addNamespace("xsi", SOAPConstants.XSI_NS);
        addNamespace("soapenc", Soap11.getInstance().getSoapEncodingStyle());

        AegisContext context = new AegisContext();
        // create a different mapping than the context creates.
        TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false, false);
        mapping = new DefaultTypeMapping(SOAPConstants.XSD, baseMapping);
        mapping.setTypeCreator(context.createTypeCreator());
        context.setTypeMapping(mapping);
        context.initialize();
        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        xmlInputFactory = XMLInputFactory.newInstance();
    }
   
    @Test
    public void testTypeLookup() throws Exception {
        context = new AegisContext();
        context.initialize();
        AegisType st = context.getTypeMapping().getType(new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,
                                                             "string"));
        assertNotNull(st);
        assertEquals(st.getClass(), StringType.class);
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        assertEquals(st.getClass(), StringType.class);
    }
   
    @Test
    public void testBasicTypeWrite() throws Exception {
        context = new AegisContext();
        context.initialize();
        AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
        StringWriter stringWriter = new StringWriter();
        XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter(stringWriter);
        writer.write("ball-of-yarn",
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        assertEquals("ball-of-yarn", text);
    }
   
    @Test
    public void testWriteCollection() throws Exception {
        context = new AegisContext();
        context.setWriteXsiTypes(true);
        context.initialize();
        List<String> strings = new ArrayList<String>();
        strings.add("cat");
        strings.add("dog");
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        assertEquals("hailstorm", text);
    }
   
    @Test
    public void testBean() throws Exception {
        context = new AegisContext();
        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
        rootClasses.add(SimpleBean.class);
        context.setRootClasses(rootClasses);
        context.initialize();
        SimpleBean sb = new SimpleBean();
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        xmlOutputFactory = XMLOutputFactory.newInstance();
    }
   
    @Test
    public void testWriteSqlDateAsDate() throws Exception {
        context = new AegisContext();
        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
        rootClasses.add(BeanWithDate.class);
        context.setRootClasses(rootClasses);
        context.initialize();
        BeanWithDate bean = new BeanWithDate();
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        // an absence of exception is success here.
    }
   
    @Test
    public void testWriteCustomTypeSchemaType() throws Exception {
        context = new AegisContext();
        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
        rootClasses.add(BeanWithDate.class);
        context.setRootClasses(rootClasses);
        context.initialize();
        BeanWithDate bean = new BeanWithDate();
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext

        testUtilities = new TestUtilities(getClass());
    }
   
    @Test
    public void testBasicTypeRead() throws Exception {
        context = new AegisContext();
        context.initialize();
        XMLStreamReader streamReader = testUtilities.getResourceAsXMLStreamReader("stringElement.xml");
        AegisReader<XMLStreamReader> reader = context.createXMLStreamReader();
        Object something = reader.read(streamReader);
        assertTrue("ball-of-yarn".equals(something));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.