AnnotationMapper { public String getUsedFramework() { return this.usedFramework; } AnnotationMapper();  AnnotationMapper(final String usedFramework); String getUsedFramework(); ArrayList<String> getUsedImports(); String[] getRootAnnotations(final String rootName); String[] getElementAnnotations(final String elementName); String[] getAttributeAnnotations(final String attributeName); String[] getEnumAnnotations(final String enumName); String[] getArrayAnnotations(final String arrayName, final String arrayClassName, final String itemName, final String itemClassName); String[] getListAnnotations(final String listName, final String itemName, final String itemClassName);  }
@Test(timeout = 1000) public void testMapperCreation() throws Exception { AnnotationMapper mapper = new AnnotationMapper(); assertNotNull("Mapper object must not be null.", mapper); assertEquals("Mapper must use 'Simple' XML library as default.", "Simple", mapper.getUsedFramework()); mapper = new AnnotationMapper("Simple"); assertEquals("Mapper must use 'Simple' XML library.", "Simple", mapper.getUsedFramework()); mapper = new AnnotationMapper("XStream"); assertEquals("Mapper must use 'XStream' XML library.", "XStream", mapper.getUsedFramework()); mapper = new AnnotationMapper("JAXB"); assertEquals("Mapper must use 'JAXB' XML library.", "JAXB", mapper.getUsedFramework()); Exception exception = null; try { mapper = new AnnotationMapper("SomeUnknownMapper"); } catch (Exception e) { exception = e; } assertTrue("Mapper must throw 'UnsupportedXMLFrameworkException'.", exception instanceof UnsupportedXMLFrameworkException); }