Assert.assertNotNull("InputStream of mapping must not be null", strmMapping);
InputSource srcMapping = new InputSource(strmMapping);
Assert.assertNotNull("InputSource of mapping must not be null", srcMapping);
Mapping mapping = new Mapping();
mapping.loadMapping(srcMapping);
ClassDescriptorResolver classDescriptorResolver = ClassDescriptorResolverFactory
.createClassDescriptorResolver(BindingType.XML);
MappingUnmarshaller mappingUnmarshaller = new MappingUnmarshaller();
MappingLoader mappingLoader = mappingUnmarshaller.getMappingLoader(
mapping, BindingType.XML);
classDescriptorResolver.setMappingLoader(mappingLoader);
Unmarshaller unmarshaller = new Unmarshaller();
unmarshaller
.setResolver((XMLClassDescriptorResolver) classDescriptorResolver);
InputStream stream = this.getClass().getClassLoader().getResourceAsStream("withmapping-input.xml");