@Test public void testFindPrefixesForExportedVariables_withInstanceVariablesOnly() { Instance instance = new Instance( "inst" ).component( new Component( "comp" )); instance.overriddenExports.put( "comp.ip", "" ); instance.overriddenExports.put( "comp.split.property", "" ); instance.overriddenExports.put( "comp.port", "8000" ); instance.overriddenExports.put( "facet.desc", "some description" ); Set<String> prefixes = VariableHelpers.findPrefixesForExportedVariables( instance ); Assert.assertEquals( 2, prefixes.size()); Assert.assertTrue( prefixes.contains( "comp" )); Assert.assertTrue( prefixes.contains( "facet" )); }
public static Set<String> findPrefixesForExportedVariables( Instance instance ) { Set<String> result = new HashSet<> (); for( String exportedVariableName : InstanceHelpers.findAllExportedVariables( instance ).keySet()) result.add( VariableHelpers.parseVariableName( exportedVariableName ).getKey()); return result; }
VariableHelpers { public static Set<String> findPrefixesForExportedVariables( Instance instance ) { Set<String> result = new HashSet<> (); for( String exportedVariableName : InstanceHelpers.findAllExportedVariables( instance ).keySet()) result.add( VariableHelpers.parseVariableName( exportedVariableName ).getKey()); return result; } }
VariableHelpers { public static Set<String> findPrefixesForExportedVariables( Instance instance ) { Set<String> result = new HashSet<> (); for( String exportedVariableName : InstanceHelpers.findAllExportedVariables( instance ).keySet()) result.add( VariableHelpers.parseVariableName( exportedVariableName ).getKey()); return result; } private  VariableHelpers(); }
VariableHelpers { public static Set<String> findPrefixesForExportedVariables( Instance instance ) { Set<String> result = new HashSet<> (); for( String exportedVariableName : InstanceHelpers.findAllExportedVariables( instance ).keySet()) result.add( VariableHelpers.parseVariableName( exportedVariableName ).getKey()); return result; } private  VariableHelpers(); static Map.Entry<String,String> parseVariableName( String variableName ); static Map.Entry<String,String> parseExportedVariable( String exportedVariable ); static Map<String,ExportedVariable> parseExportedVariables( String line ); static Set<String> findPrefixesForExportedVariables( Instance instance ); static Set<String> findPrefixesForImportedVariables( Instance instance ); static Set<String> findPrefixesForMandatoryImportedVariables( Instance instance ); static Set<String> findPrefixesForExternalImports( AbstractApplication app ); }
VariableHelpers { public static Set<String> findPrefixesForExportedVariables( Instance instance ) { Set<String> result = new HashSet<> (); for( String exportedVariableName : InstanceHelpers.findAllExportedVariables( instance ).keySet()) result.add( VariableHelpers.parseVariableName( exportedVariableName ).getKey()); return result; } private  VariableHelpers(); static Map.Entry<String,String> parseVariableName( String variableName ); static Map.Entry<String,String> parseExportedVariable( String exportedVariable ); static Map<String,ExportedVariable> parseExportedVariables( String line ); static Set<String> findPrefixesForExportedVariables( Instance instance ); static Set<String> findPrefixesForImportedVariables( Instance instance ); static Set<String> findPrefixesForMandatoryImportedVariables( Instance instance ); static Set<String> findPrefixesForExternalImports( AbstractApplication app );  }