@Test public void testFindComponentFrom() { TestApplicationTemplate app = new TestApplicationTemplate(); Component comp = app.getTomcatVm().getComponent(); Assert.assertNull( ComponentHelpers.findComponentFrom( comp, "inexisting" )); Assert.assertNull( ComponentHelpers.findComponentFrom( null, "inexisting" )); Assert.assertEquals( comp, ComponentHelpers.findComponentFrom( comp, comp.getName())); Component targetComp = app.getTomcat().getComponent(); Assert.assertEquals( targetComp, ComponentHelpers.findComponentFrom( comp, targetComp.getName())); targetComp = app.getWar().getComponent(); Assert.assertEquals( targetComp, ComponentHelpers.findComponentFrom( comp, targetComp.getName())); }
public static Component findComponentFrom( Component component, String componentName ) { Graphs partialGraph = new Graphs(); if( component != null ) partialGraph.getRootComponents().add( component ); return findComponent( partialGraph, componentName ); }
ComponentHelpers { public static Component findComponentFrom( Component component, String componentName ) { Graphs partialGraph = new Graphs(); if( component != null ) partialGraph.getRootComponents().add( component ); return findComponent( partialGraph, componentName ); } }
ComponentHelpers { public static Component findComponentFrom( Component component, String componentName ) { Graphs partialGraph = new Graphs(); if( component != null ) partialGraph.getRootComponents().add( component ); return findComponent( partialGraph, componentName ); } private  ComponentHelpers(); }
ComponentHelpers { public static Component findComponentFrom( Component component, String componentName ) { Graphs partialGraph = new Graphs(); if( component != null ) partialGraph.getRootComponents().add( component ); return findComponent( partialGraph, componentName ); } private  ComponentHelpers(); static Component findComponent( Graphs graphs, String name ); static Component findComponent( AbstractApplication app, String name ); static Component findComponentFrom( Component component, String componentName ); static List<String> extractNames( Collection<? extends AbstractType> types ); static boolean isTarget( Component component ); static Collection<Component> findAllChildren( Component component ); static Collection<Component> findAllAncestors( Component component ); static String findComponentInstaller( Component component ); static Map<String,String> findAllExportedVariables( Component component ); static Map<String,String> findAllExportedVariables( AbstractType type ); static Map<String,String> findAllExportedVariables( Graphs graphs ); static Map<String,String> findAllExportedVariables( Facet facet ); static Map<String,ImportedVariable> findAllImportedVariables( Component component ); static Collection<Facet> findAllFacets( Component component ); static List<Component> findAllExtendedComponents( Component component ); static Collection<Facet> findAllExtendedFacets( Facet facet ); static Collection<Facet> findAllExtendingFacets( Facet facet ); static Collection<Component> findAllExtendingComponents( Component component ); static List<Component> findAllComponents( Graphs graphs ); static List<Component> findAllComponents( AbstractApplication app ); static String searchForLoop( Component component ); static String searchForInheritanceCycle( Facet facet ); static String searchForInheritanceCycle( Component component ); static Map<String,Boolean> findComponentDependenciesFor( Component component ); static Map<Component,Boolean> findComponentDependenciesFor( Component component, ApplicationTemplate app ); static Map<Component,Boolean> findComponentsThatDependOn( Component component, ApplicationTemplate app ); }
ComponentHelpers { public static Component findComponentFrom( Component component, String componentName ) { Graphs partialGraph = new Graphs(); if( component != null ) partialGraph.getRootComponents().add( component ); return findComponent( partialGraph, componentName ); } private  ComponentHelpers(); static Component findComponent( Graphs graphs, String name ); static Component findComponent( AbstractApplication app, String name ); static Component findComponentFrom( Component component, String componentName ); static List<String> extractNames( Collection<? extends AbstractType> types ); static boolean isTarget( Component component ); static Collection<Component> findAllChildren( Component component ); static Collection<Component> findAllAncestors( Component component ); static String findComponentInstaller( Component component ); static Map<String,String> findAllExportedVariables( Component component ); static Map<String,String> findAllExportedVariables( AbstractType type ); static Map<String,String> findAllExportedVariables( Graphs graphs ); static Map<String,String> findAllExportedVariables( Facet facet ); static Map<String,ImportedVariable> findAllImportedVariables( Component component ); static Collection<Facet> findAllFacets( Component component ); static List<Component> findAllExtendedComponents( Component component ); static Collection<Facet> findAllExtendedFacets( Facet facet ); static Collection<Facet> findAllExtendingFacets( Facet facet ); static Collection<Component> findAllExtendingComponents( Component component ); static List<Component> findAllComponents( Graphs graphs ); static List<Component> findAllComponents( AbstractApplication app ); static String searchForLoop( Component component ); static String searchForInheritanceCycle( Facet facet ); static String searchForInheritanceCycle( Component component ); static Map<String,Boolean> findComponentDependenciesFor( Component component ); static Map<Component,Boolean> findComponentDependenciesFor( Component component, ApplicationTemplate app ); static Map<Component,Boolean> findComponentsThatDependOn( Component component, ApplicationTemplate app );  }