ExtJarGraph { String getPropertiesFile() throws IOException { if (extNodes.isEmpty() || (!hasPreferences)) { return null; } if (hasDependencies) { checkDependencies(); } Properties p = new Properties(); StringBuilder servicesLine = new StringBuilder(); StringBuilder managersLine = new StringBuilder(); StringBuilder nodeTypesLine = new StringBuilder(); StringBuilder authenticatorsLine = new StringBuilder(); StringBuilder profileListenersLine = new StringBuilder(); for (JarNode node : dependencyRoots) { buildProperties(node, p, servicesLine, managersLine, nodeTypesLine, authenticatorsLine, profileListenersLine); } if (servicesLine.length() != 0) { p.setProperty("com.sun.sgs.ext.services", servicesLine.toString()); } if (managersLine.length() != 0) { p.setProperty("com.sun.sgs.ext.managers", managersLine.toString()); } if (nodeTypesLine.length() != 0) { p.setProperty("com.sun.sgs.ext.services.node.types", nodeTypesLine.toString()); } if (authenticatorsLine.length() != 0) { p.setProperty("com.sun.sgs.ext.authenticators", authenticatorsLine.toString()); } if (profileListenersLine.length() != 0) { p.setProperty("com.sun.sgs.ext.kernel.profile.listeners", profileListenersLine.toString()); } File propFile = File.createTempFile("extProperties", null); FileOutputStream out = new FileOutputStream(propFile); try { p.store(out, "Temporary extension properties file"); } finally { out.close(); } return propFile.getAbsolutePath(); } ExtJarGraph();   }
@Test public void testEmptyGraph() throws Exception { ExtJarGraph graph = new ExtJarGraph(); graph.getPropertiesFile(); }