Mapping { TypeMapping getMapping(Class c) { return defaultMappers.get(c); } Mapping();  Mapping(Mapping m); static Mapping load(InputStream is); void add(TypeMapping typeMapping); void close(); T create(Class<T> type); boolean delete(Object object); Map<Class, TypeMapping> getTypes(); void initialize(); Set<T> list(Class<T> type); @SuppressWarnings("cast") Set<T> list(Class<T> type, Filter filter, String baseDN,
			SearchScope scope); Set<String> query(Class<T> type, Filter filter, String baseDN, SearchScope scope); T load(Class<T> type, String dn); T load(Class<T> type, String dn, boolean noCache); void refresh(Object o); void remove(TypeMapping tm); void save(Object o); void save(Object o, String baseDN); void setConnectionDescriptor(LDAPConnectionDescriptor lcd); void setDirectoryFacade(DirectoryFacade lcd); String getName(); void setName(String name); static boolean disableCache; static final String PROPERTY_FORCE_SINGLE_THREADED; }
@Test public void testClientCorrect() throws Exception { final TypeMapping clientMapping = MappingTest.mapping.getMapping(Client.class); assertNotNull(clientMapping); assertEquals("ou=clients", clientMapping.getBaseRDN()); assertEquals("(objectclass=ipHost)", clientMapping.getSearchFilter()); assertEquals("ipHost", clientMapping.getKeyClass()); assertAttributeMapping(String.class, "dn", "setDn", "getDn", clientMapping.getDNAttribute()); assertAttributeMapping(java.lang.String.class, "cn", "setName", "getName", clientMapping.getRDNAttribute()); assertArrayEquals(new String[]{"top", "device", "ipHost", "ieee802Device"}, clientMapping.getObjectClasses()); assertAttributeMapping(String.class, "description", "setDescription", "getDescription", clientMapping.getAttributeMappings().get(0)); assertAttributeMapping(String.class, "ipHostNumber", "setIpHostNumber", "getIpHostNumber", clientMapping.getAttributeMappings().get(1)); assertAttributeMapping(String.class, "macAddress", "setMacAddress", "getMacAddress", clientMapping.getAttributeMappings().get(2)); assertManyToOne(Location.class, "l", Cardinality.ZERO_OR_ONE, "setLocation", "getLocation", clientMapping.getAttributeMappings().get(3)); assertManyToMany(ApplicationGroup.class, "applicationGroups", "uniqueMember", "(uniqueMember={0})", clientMapping.getAttributeMappings().get(4)); }
@Test public void testClientGroupCorrect() throws Exception { assertNotNull(mapping.getMapping(ClientGroup.class)); }
@Test public void testLocationCorrect() throws Exception { assertNotNull(mapping.getMapping(Location.class)); }
@Test public void testApplicationGroupCorrect() throws Exception { assertNotNull(mapping.getMapping(ApplicationGroup.class)); }
@Test public void testApplicationCorrect() throws Exception { assertNotNull(mapping.getMapping(Application.class)); }
@Test public void testHardwareTypeCorrect() throws Exception { assertNotNull(mapping.getMapping(HardwareType.class)); }
@Test public void testDeviceCorrect() throws Exception { assertNotNull(mapping.getMapping(Device.class)); }
@Test public void testPrinterCorrect() throws Exception { assertNotNull(mapping.getMapping(Printer.class)); }
@Test public void testUserCorrect() throws Exception { assertNotNull(mapping.getMapping(User.class)); }
@Test public void testUserGroupCorrect() throws Exception { assertNotNull(mapping.getMapping(UserGroup.class)); }
@Test public void testPropertiesCorrect() throws Exception { assertNotNull(mapping.getMapping(Properties.class)); }
@Test public void testPropertyCorrect() throws Exception { assertNotNull(mapping.getMapping(Property.class)); }
@Test public void testOrganizationalUnitCorrect() throws Exception { assertNotNull(mapping.getMapping(OrganizationalUnit.class)); }
@Test public void testRealmCorrect() throws Exception { assertNotNull(mapping.getMapping(Realm.class)); }
@Test public void testUnrecognizedCorrect() throws Exception { assertNotNull(mapping.getMapping(UnrecognizedClient.class)); }