Package org.apache.cxf.aegis

Examples of org.apache.cxf.aegis.Context


        assertArrayEquals(new int[]{3, 4}, numbers);
    }

    @Test
    public void testUrTypeArray() throws Exception {
        Context context = getContext();

        // ur-type[4] nested elements have xsi:type
        ElementReader reader = new ElementReader(getClass().getResourceAsStream("arrayUrType1.xml"));
        Object[] objects = (Object[]) createArrayType(Object[].class).readObject(reader, context);
        reader.getXMLStreamReader().close();
View Full Code Here


       
    }

    @Test
    public void testAnyTypeArray() throws Exception {
        Context context = getContext();

        // ur-type[4] nested elements have xsi:type
        ElementReader reader = new ElementReader(getClass().getResourceAsStream("arrayAnyType1.xml"));
        Object[] objects = (Object[]) createArrayType(Object[].class).readObject(reader, context);
        reader.getXMLStreamReader().close();
View Full Code Here

        assertArrayEquals(new Object[]{42, new BigDecimal("42.42"), "Forty Two"}, objects);
    }

    @Test
    public void testStructArray() throws Exception {
        Context context = getContext();

        // b:address[2]
        ElementReader reader = new ElementReader(getClass().getResourceAsStream("arrayStructs.xml"));
        Address[] addresses = (Address[]) createArrayType(Address[].class).readObject(reader, context);
        reader.getXMLStreamReader().close();
View Full Code Here

        StructTypeTest.validateBillingAddress(addresses[1]);
    }

    @Test
    public void testSquareArray() throws Exception {
        Context context = getContext();

        // xsd:string[2,3,4]
        ElementReader reader = new ElementReader(getClass().getResourceAsStream("arraySquare.xml"));
        String[][][] strings = (String[][][]) createArrayType(String[][][].class).readObject(reader, context);
        reader.getXMLStreamReader().close();
View Full Code Here

        assertArrayEquals(ARRAY_2_3_4, strings);
    }

    @Test
    public void testArrayOfArrays() throws Exception {
        Context context = getContext();

        // xsd:string[,][2]
        ElementReader reader = new ElementReader(getClass().getResourceAsStream("arrayArrayOfArrays1.xml"));
        String[][][] strings = (String[][][]) createArrayType(String[][][].class).readObject(reader, context);
        reader.getXMLStreamReader().close();
View Full Code Here

        assertArrayEquals(ARRAY_2_3_4, strings);
    }

    @Test
    public void testPartiallyTransmitted() throws Exception {
        Context context = getContext();

        // xsd:int[5] offset="[2]"
        ElementReader reader = new ElementReader(
                getClass().getResourceAsStream("arrayPartiallyTransmitted.xml"));
        int[] numbers = (int[]) createArrayType(int[].class).readObject(reader, context);
View Full Code Here

        assertArrayEquals(new int[]{0, 0, 3, 4, 0}, numbers);
    }

    @Test
    public void testSparseArray() throws Exception {
        Context context = getContext();

        // xsd:string[2,3,4]
        ElementReader reader = new ElementReader(getClass().getResourceAsStream("arraySparse1.xml"));
        String[][][] strings = (String[][][]) createArrayType(String[][][].class).readObject(reader, context);
        reader.getXMLStreamReader().close();
View Full Code Here

    private StructType addressType;
    private StructType purchaseOrderType;
   
    private Context getLocalContext() {
        AegisContext aegisContext = new AegisContext();
        return new Context(aegisContext);
    }
View Full Code Here

   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }
View Full Code Here

        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }

    public <T> T readWriteReadRef(String file, Class<T> typeClass) throws XMLStreamException {
        Context context = getContext();
       
        Type type = mapping.getType(typeClass);
        assertNotNull("no type found for " + typeClass.getName());

        // read file
View Full Code Here

TOP

Related Classes of org.apache.cxf.aegis.Context

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.