public DefaultProfileStoreTest(String arg0) {
super(arg0);
}
public void testAddGetProfileSet() {
ProfileStore store = new DefaultProfileStore();
DefaultProfileSet set1 = new DefaultProfileSet("device1");
DefaultProfileSet set2 = new DefaultProfileSet("device2");
try {
DefaultProfileStore.UnitTest.addProfileSet(store, null);
fail("no IllegalArgumentException on null devicename");
} catch (IllegalArgumentException e) {
}
DefaultProfileStore.UnitTest.addProfileSet(store, set1);
DefaultProfileStore.UnitTest.addProfileSet(store, set2);
try {
store.getProfileSet("device3");
fail("no UnknownProfileMemberException");
} catch (UnknownProfileMemberException e) {
}
try {
assertEquals(set1, store.getProfileSet("device1"));
} catch (UnknownProfileMemberException e1) {
fail("failed to get set");
}
try {
assertEquals(set2, store.getProfileSet("device2"));
} catch (UnknownProfileMemberException e1) {
fail("failed to get set");
}
try {
DefaultProfileStore.UnitTest.addProfileSet(store, set1);
assertEquals(set1, store.getProfileSet("device2"));
} catch (UnknownProfileMemberException e1) {
fail("failed to get set");
}
}