private Family getFamily(URL registryBase, String familyName) throws RegistryException { return getRegistry(registryBase).getComponentFamily(familyName); }
private void updateToolTipText() { String key = (String) registryBox.getSelectedItem(); Registry registry = registryMap.get(key); registryBox.setToolTipText(registry.getRegistryBase().toString()); }
@Test public void testGetComponentFamilies() throws Exception { assertEquals(0, componentRegistry.getComponentFamilies().size()); assertEquals(0, componentRegistry.getComponentFamilies().size()); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertEquals(1, componentRegistry.getComponentFamilies().size()); assertTrue(componentRegistry.getComponentFamilies().contains( componentFamily)); componentRegistry.removeComponentFamily(componentFamily); assertEquals(0, componentRegistry.getComponentFamilies().size()); }
if (chosenRegistry.getComponentFamily(newName) != null) { showMessageDialog(null, newName + " is already used", "Duplicate component family name", ERROR_MESSAGE); return; chosenRegistry.createComponentFamily(newName, chosenProfile, familyDescription, license, permission); } catch (RegistryException e) {
@After public void tearDown() throws Exception { for (Family componentFamily : componentRegistry.getComponentFamilies()) { componentRegistry.removeComponentFamily(componentFamily); } }
for (Profile p : chosenRegistry.getComponentProfiles()) if (p.getName().equals(newName)) { showMessageDialog(null, newName + " is already used", return; chosenRegistry.addComponentProfile(newProfile, license, permission); } catch (MalformedURLException e) {
@Test public void testRemoveComponentFamily() throws Exception { assertEquals(0, componentRegistry.getComponentFamilies().size()); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertEquals(1, componentRegistry.getComponentFamilies().size()); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertEquals(componentFamily, componentRegistry.getComponentFamily("TestComponentFamily")); componentRegistry.removeComponentFamily(componentFamily); assertEquals(0, componentRegistry.getComponentFamilies().size()); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); }
@Test public void testGetComponentFamily() throws Exception { assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertEquals(componentFamily, componentRegistry.getComponentFamily("TestComponentFamily")); componentRegistry.removeComponentFamily(componentFamily); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); }
@Test public void testCreateComponentFamily() throws Exception { assertEquals(0, componentRegistry.getComponentFamilies().size()); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertEquals("TestComponentFamily", componentFamily.getName()); assertEquals(componentRegistry, componentFamily.getComponentRegistry()); assertEquals(0, componentFamily.getComponents().size()); // assertEquals(componentProfile, // componentFamily.getComponentProfile()); assertEquals(1, componentRegistry.getComponentFamilies().size()); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertEquals(componentFamily, componentRegistry.getComponentFamily("TestComponentFamily")); }
@Override public void delete() throws RegistryException { getComponentRegistry().removeComponentFamily(this); } }
@Test(expected = RegistryException.class) public void testCreateComponentFamilyDuplicate() throws Exception { componentRegistry.createComponentFamily("TestComponentFamily", componentProfile, "Some description", null, null); componentRegistry.createComponentFamily("TestComponentFamily", componentProfile, "Some description", null, null); }
@Before public void setup() throws Exception { URL componentProfileUrl = getClass().getClassLoader().getResource( "ValidationComponent.xml"); assertNotNull(componentProfileUrl); componentProfile = ComponentUtil.makeProfile(componentProfileUrl); componentRegistry.addComponentProfile(componentProfile, null, null); URL dataflowUrl = getClass().getClassLoader().getResource( "beanshell_test.t2flow"); assertNotNull(dataflowUrl); dataflow = new FileManagerImpl().openDataflowSilently( new T2FlowFileType(), dataflowUrl).getDataflow(); componentFamily = componentRegistry.createComponentFamily( "Test Component Family", componentProfile, "Some description", null, null); }
@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; }
@Test(expected = RegistryException.class) public void testAddComponentProfileNullProfile() throws Exception { componentRegistry.addComponentProfile(null, null, null); }
private void updateFamiliesFromRegistry() throws RegistryException { for (Family f : chosenRegistry.getComponentFamilies()) { if (profileFilter == null) { familyMap.put(f.getName(), f); continue; } Profile componentProfile = null; try { componentProfile = f.getComponentProfile(); } catch (Exception e) { logger.error("failed to get profile of component", e); } if (componentProfile != null) { String id = componentProfile.getId(); if ((profileFilter == null) || id.equals(profileFilter.getId())) familyMap.put(f.getName(), f); } else logger.info("Ignoring " + f.getName()); } }
private synchronized net.sf.taverna.t2.component.api.Profile parent() throws RegistryException { if (parent == null) { if (!isBase() && getProfileDocument().getExtends() != null && parentRegistry != null) { parent = parentRegistry .getComponentProfile(getProfileDocument().getExtends() .getProfileId()); if (parent != null) return parent; } parent = new EmptyProfile(); } return parent; }
@Test public void testRemoveComponentFamily() throws Exception { assertEquals(0, componentRegistry.getComponentFamilies().size()); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertEquals(1, componentRegistry.getComponentFamilies().size()); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertEquals(componentFamily, componentRegistry.getComponentFamily("TestComponentFamily")); componentRegistry.removeComponentFamily(componentFamily); assertEquals(0, componentRegistry.getComponentFamilies().size()); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); }
@Test public void testGetComponentFamily() throws Exception { assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertEquals(componentFamily, componentRegistry.getComponentFamily("TestComponentFamily")); componentRegistry.removeComponentFamily(componentFamily); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); }
@Test public void testCreateComponentFamily() throws Exception { assertEquals(0, componentRegistry.getComponentFamilies().size()); assertNull(componentRegistry.getComponentFamily("TestComponentFamily")); Family componentFamily = componentRegistry.createComponentFamily( "TestComponentFamily", componentProfile, "Some description", null, null); assertEquals("TestComponentFamily", componentFamily.getName()); assertEquals(componentRegistry, componentFamily.getComponentRegistry()); assertEquals(0, componentFamily.getComponents().size()); // assertEquals(componentProfile, // componentFamily.getComponentProfile()); assertEquals(1, componentRegistry.getComponentFamilies().size()); assertNotNull(componentRegistry .getComponentFamily("TestComponentFamily")); assertEquals(componentFamily, componentRegistry.getComponentFamily("TestComponentFamily")); }
return; for (Profile p : targetRegistry.getComponentProfiles()) { if (p.getName().equals(sourceProfile.getName())) { showMessageDialog(null, targetRegistry.addComponentProfile(sourceProfile, license, permission);