@Override protected String doInBackground() throws Exception { if (registry == null) return null; List<Profile> componentProfiles; try { componentProfiles = registry.getComponentProfiles(); } catch (RegistryException e) { logger.error("failed to get profiles", e); throw e; } catch (NullPointerException e) { logger.error("failed to get profiles", e); throw e; } for (Profile profile : componentProfiles) try { profileMap.put(profile.getName(), profile); } catch (NullPointerException e) { logger.error("failure getting profile name", e); } return null; }
for (Profile p : chosenRegistry.getComponentProfiles()) if (p.getName().equals(newName)) { showMessageDialog(null, newName + " is already used",
return; for (Profile p : targetRegistry.getComponentProfiles()) { if (p.getName().equals(sourceProfile.getName())) { showMessageDialog(null,
@Test public void testGetComponentProfiles() throws Exception { assertNotNull(componentRegistry.getComponentProfiles()); }
@Test public void testGetComponentProfiles() throws Exception { assertNotNull(componentRegistry.getComponentProfiles()); }
@Test public void testAddComponentProfile() throws Exception { List<Profile> componentProfiles = componentRegistry .getComponentProfiles(); boolean contained = false; for (Profile p : componentProfiles) { if (p.getId().equals(componentProfile.getId())) { contained = true; } } assertFalse(contained); int componentProfileCount = componentProfiles.size(); componentRegistry.addComponentProfile(componentProfile, null, null); int newSize = componentRegistry.getComponentProfiles().size(); assertEquals(componentProfileCount + 1, newSize); }
@Test public void testAddComponentProfile() throws Exception { List<Profile> componentProfiles = componentRegistry .getComponentProfiles(); boolean contained = false; for (Profile p : componentProfiles) { if (p.getId().equals(componentProfile.getId())) { contained = true; } } assertFalse(contained); int componentProfileCount = componentProfiles.size(); componentRegistry.addComponentProfile(componentProfile, null, null); int newSize = componentRegistry.getComponentProfiles().size(); assertEquals(componentProfileCount + 1, newSize); }