@Test public void testGetComponent() throws Exception { assertNull(componentFamily.getComponent("Test Component")); Version componentVersion = componentFamily.createComponentBasedOn( "Test Component", "Some description", dataflow); assertNotNull(componentFamily.getComponent("Test Component")); assertEquals(componentVersion.getComponent(), componentFamily.getComponent("Test Component")); }
@Override public void notify(Observable<ComponentChoiceMessage> sender, ComponentChoiceMessage message) throws Exception { ProfileChoiceMessage profileMessage = new ProfileChoiceMessage( message.getComponentFamily().getComponentProfile()); target.notify(null, profileMessage); } });
private Version.ID findComponentVersionWithWorkflow(Element wfElement) throws RegistryException { String resourceUri = wfElement.getAttributeValue("resource"); for (Family f : this.getComponentFamilies()) for (Component c : f.getComponents()) for (Version cv : c.getComponentVersionMap().values()) if (cv instanceof MyExperimentComponentVersion) if (((MyExperimentComponentVersion) cv) .hasWorkflowUri(resourceUri)) return new ComponentVersionIdentification( this.getRegistryBase(), f.getName(), c.getName(), cv.getVersionNumber()); return null; }
public ComponentServiceProviderConfig(Family family) { registryBase = family.getComponentRegistry().getRegistryBase(); familyName = family.getName(); }
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()); } }
@Override protected void internalRemoveComponentFamily(Family componentFamily) throws RegistryException { File componentFamilyDir = new File(getComponentFamiliesDir(), componentFamily.getName()); try { deleteDirectory(componentFamilyDir); } catch (IOException e) { throw new RegistryException("Unable to delete component family", e); } }
@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")); }
try { List<SemanticAnnotationProfile> problemProfiles = new ArrayList<SemanticAnnotationProfile>( checkComponent(dataflow, family.getComponentProfile())); OK_CANCEL_OPTION); if (answer == OK_OPTION) { newVersion = family.createComponentBasedOn( ident.getComponentName(), descriptionArea.getText(), dataflow); Component component = family.getComponent(ident .getComponentName()); JTextArea descriptionArea = new JTextArea(10, 60);
@Test public void testGetComponents() throws Exception { assertEquals(0, componentFamily.getComponents().size()); assertEquals(0, componentFamily.getComponents().size()); Version componentVersion = componentFamily.createComponentBasedOn( "Test Component", "Some description", dataflow); assertEquals(1, componentFamily.getComponents().size()); assertTrue(componentFamily.getComponents().contains( componentVersion.getComponent())); // componentFamily.removeComponent(componentVersion.getComponent()); // assertEquals(0, componentFamily.getComponents().size()); }
private Component getComponent(URL registryBase, String familyName, String componentName) throws RegistryException { return getRegistry(registryBase).getComponentFamily(familyName) .getComponent(componentName); }
@Override protected String doInBackground() throws Exception { Family chosenFamily = registryAndFamilyChooserPanel .getChosenFamily(); if (chosenFamily != null) for (Component component : chosenFamily.getComponents()) componentMap.put(component.getName(), component); return null; }
@Before public void setUp() throws Exception { URL dataflowUrl = getClass().getClassLoader().getResource( "beanshell_test.t2flow"); assertNotNull(dataflowUrl); dataflow = FileManager.getInstance() .openDataflowSilently(new T2FlowFileType(), dataflowUrl) .getDataflow(); URL componentProfileUrl = getClass().getClassLoader().getResource( "ValidationComponent.xml"); assertNotNull(componentProfileUrl); Profile componentProfile = ComponentUtil .makeProfile(componentProfileUrl); componentFamily = componentRegistry.createComponentFamily( "Test Component Family", componentProfile, "Some description", null, null); componentVersion = componentFamily.createComponentBasedOn( "Test Component", "Some description", dataflow); }
@Test public void testGetComponentRegistry() throws Exception { assertEquals(componentRegistry, componentFamily.getComponentRegistry()); }
@Override public void delete() throws RegistryException { getFamily().removeComponent(this); } }
@Override protected void internalRemoveComponentFamily(Family componentFamily) throws RegistryException { File componentFamilyDir = new File(getComponentFamiliesDir(), componentFamily.getName()); try { deleteDirectory(componentFamilyDir); } catch (IOException e) { throw new RegistryException("Unable to delete component family", e); } }
@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")); }
@Test public void testGetComponents() throws Exception { assertEquals(0, componentFamily.getComponents().size()); assertEquals(0, componentFamily.getComponents().size()); Version componentVersion = componentFamily.createComponentBasedOn( "Test Component", "Some description", dataflow); assertEquals(1, componentFamily.getComponents().size()); assertTrue(componentFamily.getComponents().contains( componentVersion.getComponent())); // componentFamily.removeComponent(componentVersion.getComponent()); // assertEquals(0, componentFamily.getComponents().size()); }
private Component getComponent(URL registryBase, String familyName, String componentName) throws RegistryException { return getRegistry(registryBase).getComponentFamily(familyName) .getComponent(componentName); }
public static void post() throws Exception { NewComponentRegistry registry = (NewComponentRegistry) getComponentRegistry(componentRegistryUrl); for (Profile p : registry.getComponentProfiles()) registry.client.delete("/file.xml", "id=" + p.getId()); for (Family f : registry.getComponentFamilies()) { for (Component c : f.getComponents()) registry.deleteComponent((NewComponent) c); registry.client.delete("/pack.xml", "id=" + ((NewComponentFamily) f).getId()); } } }
@Before public void setUp() throws Exception { URL dataflowUrl = getClass().getClassLoader().getResource( "beanshell_test.t2flow"); assertNotNull(dataflowUrl); dataflow = FileManager.getInstance() .openDataflowSilently(new T2FlowFileType(), dataflowUrl) .getDataflow(); URL componentProfileUrl = getClass().getClassLoader().getResource( "ValidationComponent.xml"); assertNotNull(componentProfileUrl); Profile componentProfile = ComponentUtil .makeProfile(componentProfileUrl); componentFamily = componentRegistry.createComponentFamily( "Test Component Family", componentProfile, "Some description", null, null); componentVersion = componentFamily.createComponentBasedOn( "Test Component", "Some description", dataflow); }