Search in sources :

Example 6 with DefaultTypeMapping

use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.

the class MapTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    tm = new DefaultTypeMapping();
    creator = new Java5TypeCreator();
    creator.setConfiguration(new TypeCreationOptions());
    tm.setTypeCreator(creator);
}
Also used : DefaultTypeMapping(org.apache.cxf.aegis.type.DefaultTypeMapping) TypeCreationOptions(org.apache.cxf.aegis.type.TypeCreationOptions) Before(org.junit.Before)

Example 7 with DefaultTypeMapping

use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.

the class AbstractEncodedTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    addNamespace("b", "urn:Bean");
    addNamespace("a", "urn:anotherns");
    addNamespace("xsi", Constants.URI_2001_SCHEMA_XSI);
    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(Constants.URI_2001_SCHEMA_XSD, baseMapping);
    mapping.setTypeCreator(context.createTypeCreator());
    context.setTypeMapping(mapping);
    context.initialize();
    // serialization root type
    trailingBlocks = new TrailingBlocks();
}
Also used : DefaultTypeMapping(org.apache.cxf.aegis.type.DefaultTypeMapping) AegisContext(org.apache.cxf.aegis.AegisContext) DefaultTypeMapping(org.apache.cxf.aegis.type.DefaultTypeMapping) TypeMapping(org.apache.cxf.aegis.type.TypeMapping) Before(org.junit.Before)

Example 8 with DefaultTypeMapping

use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.

the class CollectionTest method testCollectionDTO.

@Test
public void testCollectionDTO() {
    tm = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD);
    creator = new Java5TypeCreator();
    creator.setConfiguration(new TypeCreationOptions());
    tm.setTypeCreator(creator);
    AegisType dto = creator.createType(CollectionDTO.class);
    Set<AegisType> deps = dto.getDependencies();
    AegisType type = deps.iterator().next();
    assertTrue(type instanceof CollectionType);
    CollectionType colType = (CollectionType) type;
    deps = dto.getDependencies();
    assertEquals(1, deps.size());
    AegisType comType = colType.getComponentType();
    assertEquals(String.class, comType.getTypeClass());
}
Also used : DefaultTypeMapping(org.apache.cxf.aegis.type.DefaultTypeMapping) AegisType(org.apache.cxf.aegis.type.AegisType) CollectionType(org.apache.cxf.aegis.type.collection.CollectionType) TypeCreationOptions(org.apache.cxf.aegis.type.TypeCreationOptions) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Example 9 with DefaultTypeMapping

use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.

the class CollectionTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    tm = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD);
    creator = new Java5TypeCreator();
    creator.setConfiguration(new TypeCreationOptions());
    tm.setTypeCreator(creator);
}
Also used : DefaultTypeMapping(org.apache.cxf.aegis.type.DefaultTypeMapping) TypeCreationOptions(org.apache.cxf.aegis.type.TypeCreationOptions) Before(org.junit.Before)

Example 10 with DefaultTypeMapping

use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.

the class CollectionTest method testObjectDTO.

@Test
public void testObjectDTO() {
    tm = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD);
    creator = new Java5TypeCreator();
    creator.setConfiguration(new TypeCreationOptions());
    tm.setTypeCreator(creator);
    AegisType dto = creator.createType(ObjectDTO.class);
    Set<AegisType> deps = dto.getDependencies();
    assertFalse(deps.isEmpty());
    AegisType type = deps.iterator().next();
    assertTrue(type instanceof CollectionType);
    CollectionType colType = (CollectionType) type;
    deps = dto.getDependencies();
    assertEquals(1, deps.size());
    AegisType comType = colType.getComponentType();
    assertEquals(Object.class, comType.getTypeClass());
}
Also used : DefaultTypeMapping(org.apache.cxf.aegis.type.DefaultTypeMapping) AegisType(org.apache.cxf.aegis.type.AegisType) CollectionType(org.apache.cxf.aegis.type.collection.CollectionType) TypeCreationOptions(org.apache.cxf.aegis.type.TypeCreationOptions) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Aggregations

DefaultTypeMapping (org.apache.cxf.aegis.type.DefaultTypeMapping)13 TypeCreationOptions (org.apache.cxf.aegis.type.TypeCreationOptions)10 Before (org.junit.Before)8 TypeMapping (org.apache.cxf.aegis.type.TypeMapping)4 AbstractAegisTest (org.apache.cxf.aegis.AbstractAegisTest)3 AegisContext (org.apache.cxf.aegis.AegisContext)3 AegisType (org.apache.cxf.aegis.type.AegisType)3 DefaultTypeCreator (org.apache.cxf.aegis.type.DefaultTypeCreator)3 Test (org.junit.Test)3 CollectionType (org.apache.cxf.aegis.type.collection.CollectionType)2 Type (java.lang.reflect.Type)1 HashSet (java.util.HashSet)1 QName (javax.xml.namespace.QName)1 AbstractTypeCreator (org.apache.cxf.aegis.type.AbstractTypeCreator)1 TypeCreator (org.apache.cxf.aegis.type.TypeCreator)1 XMLTypeCreator (org.apache.cxf.aegis.type.XMLTypeCreator)1 MapType (org.apache.cxf.aegis.type.collection.MapType)1 Java5TypeCreator (org.apache.cxf.aegis.type.java5.Java5TypeCreator)1 XMLStreamReaderType (org.apache.cxf.aegis.type.xml.XMLStreamReaderType)1