You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
(46) |
Oct
(102) |
Nov
(10) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(3) |
Mar
(14) |
Apr
(9) |
May
(12) |
Jun
(4) |
Jul
(40) |
Aug
(60) |
Sep
(38) |
Oct
(2) |
Nov
(1) |
Dec
(42) |
2008 |
Jan
(23) |
Feb
(29) |
Mar
(107) |
Apr
(27) |
May
(3) |
Jun
(1) |
Jul
(15) |
Aug
(7) |
Sep
(19) |
Oct
|
Nov
(2) |
Dec
|
2009 |
Jan
(36) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(30) |
Aug
(32) |
Sep
(11) |
Oct
(21) |
Nov
(12) |
Dec
(15) |
2010 |
Jan
(29) |
Feb
(9) |
Mar
(25) |
Apr
|
May
(7) |
Jun
(5) |
Jul
(21) |
Aug
(32) |
Sep
(10) |
Oct
(8) |
Nov
(29) |
Dec
(8) |
2011 |
Jan
(9) |
Feb
(35) |
Mar
(11) |
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(30) |
2012 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Revision: 454 http://cishell.svn.sourceforge.net/cishell/?rev=454&view=rev Author: teakettle22 Date: 2007-08-01 12:12:45 -0700 (Wed, 01 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-08-01 19:12:16 UTC (rev 453) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-08-01 19:12:45 UTC (rev 454) @@ -32,13 +32,13 @@ public boolean addAlgoritm(ServiceReference sr){ boolean val = true; - //System.out.println(this.in_data + " " + this.out_data); + if(path.contains(sr)){ System.out.println("Path already contains " + sr.getProperty("service.pid")); - //this.setOutData(sr.getProperty("out_data").toString()); + return false; } - //System.out.println("Adding: " + sr.getProperty("service.pid")); + path.add(sr); this.setOutData(sr.getProperty("out_data").toString()); return val; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 453 http://cishell.svn.sourceforge.net/cishell/?rev=453&view=rev Author: teakettle22 Date: 2007-08-01 12:12:16 -0700 (Wed, 01 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/ConfigurationFileParser.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/ConfigurationFileParser.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/ConfigurationFileParser.java 2007-08-01 19:08:07 UTC (rev 452) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/ConfigurationFileParser.java 2007-08-01 19:12:16 UTC (rev 453) @@ -60,37 +60,37 @@ try{ reader = new BufferedReader(new FileReader(f)); - //System.out.println("Beginning to parse."); + while((line = reader.readLine()) != null){ if(!line.trim().equals("")){ - //System.out.println("Parsing line: " + lineNum + " " + line); + if(line.startsWith(ConfigurationFileConstants.TEST_GRAPHS)){ line = line.replace(ConfigurationFileConstants.TEST_GRAPHS, ""); - //System.out.println(line); + this.processFileList = true; this.processComparisonConvertersList = false; this.processTestConvertersList = false; } if(line.startsWith(ConfigurationFileConstants.COMPARISON_CONVERTERS)){ line = line.replace(ConfigurationFileConstants.COMPARISON_CONVERTERS, ""); - //System.out.println(line); + this.processFileList = false; this.processComparisonConvertersList = true; this.processTestConvertersList = false; } if(line.startsWith(ConfigurationFileConstants.TEST_CONVERTERS)){ line = line.replace(ConfigurationFileConstants.TEST_CONVERTERS, ""); - //System.out.println(line); + this.processFileList = false; this.processComparisonConvertersList = false; this.processTestConvertersList = true; } if(line.startsWith(ConfigurationFileConstants.NODE_ID_CHANGE)){ line = line.replace(ConfigurationFileConstants.NODE_ID_CHANGE, ""); - //System.out.println(line ); + this.nodeIDChange = new Boolean(line.toLowerCase()).booleanValue(); this.processFileList = false; this.processComparisonConvertersList = false; @@ -98,7 +98,7 @@ } if(line.startsWith(ConfigurationFileConstants.EXTENSION)){ line = line.replace(ConfigurationFileConstants.EXTENSION, ""); - //System.out.println(line ); + this.extension = line; this.processFileList = false; this.processComparisonConvertersList = false; @@ -115,7 +115,7 @@ } } lineNum++; - //System.out.println("Next line"); + } } catch(FileNotFoundException fnfe){ @@ -124,7 +124,7 @@ catch(IOException iex){ System.out.println(iex); } - //System.out.println("Finished parsing"); + } private String[] processLine(String s){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 452 http://cishell.svn.sourceforge.net/cishell/?rev=452&view=rev Author: teakettle22 Date: 2007-08-01 12:08:07 -0700 (Wed, 01 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-08-01 16:57:10 UTC (rev 451) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-08-01 19:08:07 UTC (rev 452) @@ -19,23 +19,19 @@ public class ConverterLoaderImpl implements AlgorithmProperty, DataConversionService, ServiceListener{ - //private Converter[] testConverters; //to store the chain of converters we want to test. - //private Converter[] toGraphObjectConverters; //to store the chain of converters to convert the files to prefuse or jung Graph objects. - //private BundleContext bContext; + public final static String SERVICE_LIST = "SERVICE_LIST"; private Map converterList; private BundleContext bContext; private CIShellContext ciContext; - // private Map dataTypeToVertex; - // private Graph graph; + public ConverterLoaderImpl(BundleContext bContext, CIShellContext cContext){ this.ciContext = cContext; this.bContext = bContext; converterList = new Hashtable(); - //this.graph = new DirectedSparseGraph(); - // this.dataTypeToVertex = new Hashtable(); + String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+"))"; //printConverters(bContext); @@ -51,28 +47,18 @@ private void assembleGraph() { try { String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+"))";// + - /* "("+IN_DATA+"=*) " + - "("+OUT_DATA+"=*)" + - "(!("+REMOTE+"=*))" + - "(!("+IN_DATA+"=file-ext:*))" + - "(!("+OUT_DATA+"=file-ext:*)))";*/ + ServiceReference[] refs = bContext.getServiceReferences( AlgorithmFactory.class.getName(), filter); ConverterGraph g = new ConverterGraph(refs); g.asNWB(); - // System.out.println("Blah!"); - // System.out.println(g); + if (refs != null) { for (int i = 0; i < refs.length; ++i) { - //System.out.println(refs[i]); + this.converterList.put(refs[i].getProperty("service.pid").toString(), refs[i]); - /*String inData = (String) refs[i] - .getProperty(AlgorithmProperty.IN_DATA); - String outData = (String) refs[i] - .getProperty(AlgorithmProperty.OUT_DATA); - - addServiceReference(inData, outData, refs[i]);*/ + } } } catch (InvalidSyntaxException e) { @@ -81,79 +67,13 @@ } - /* private void addServiceReference(String srcDataType, String tgtDataType, ServiceReference serviceReference) { - if (srcDataType != null && srcDataType.length() > 0 - && tgtDataType != null && tgtDataType.length() > 0) { - Vertex srcVertex = getVertex(srcDataType); - Vertex tgtVertex = getVertex(tgtDataType); - removeServiceReference(srcDataType, tgtDataType, serviceReference); - this.converterList.put(serviceReference.getProperty("service.pid").toString(), serviceReference); - Edge directedEdge = srcVertex.findEdge(tgtVertex); - if (directedEdge == null) { - directedEdge = new DirectedSparseEdge(srcVertex, tgtVertex); - graph.addEdge(directedEdge); - } - - AbstractList serviceList = (AbstractList) directedEdge.getUserDatum(SERVICE_LIST); - if (serviceList == null) { - serviceList = new ArrayList(); - serviceList.add(serviceReference); - } - directedEdge.setUserDatum(SERVICE_LIST, serviceList, - new UserDataContainer.CopyAction.Shared()); - } - }*/ + - /* private Vertex getVertex(String dataType) { - Vertex vertex = (SparseVertex)dataTypeToVertex.get(dataType); - if (vertex== null) { - vertex = new SparseVertex(); - vertex.addUserDatum("label", dataType, - new UserDataContainer.CopyAction.Shared()); - graph.addVertex(vertex); - dataTypeToVertex.put(dataType, vertex); - } - return vertex; - } - - private void removeServiceReference(String srcDataType, String tgtDataType, ServiceReference serviceReference) { - if (srcDataType != null && tgtDataType != null) { - Vertex srcVertex = (Vertex) dataTypeToVertex.get(srcDataType); - Vertex tgtVertex = (Vertex) dataTypeToVertex.get(tgtDataType); - String pid = (String) serviceReference - .getProperty(Constants.SERVICE_PID); - - if (srcVertex != null && tgtVertex != null) { - Edge edge = srcVertex.findEdge(tgtVertex); - if (edge != null) { - AbstractList serviceList = (AbstractList) edge - .getUserDatum(SERVICE_LIST); - for (Iterator iterator = serviceList.iterator(); iterator - .hasNext();) { - ServiceReference currentServiceReference = (ServiceReference) iterator - .next(); - String currentPid = (String) currentServiceReference - .getProperty(Constants.SERVICE_PID); - - if (pid.equals(currentPid)) { - iterator.remove(); - } - } - if (serviceList.isEmpty()) { - graph.removeEdge(edge); - } - } - } - } - }*/ - public void serviceChanged(ServiceEvent event) { ServiceReference inServiceRef = event.getServiceReference(); - /*String inDataType = (String)inServiceRef.getProperty(AlgorithmProperty.IN_DATA); - String outDataType = (String)inServiceRef.getProperty(AlgorithmProperty.OUT_DATA);*/ - + if (event.getType() == ServiceEvent.MODIFIED) { this.converterList.put(inServiceRef.getProperty("service.pid").toString(), inServiceRef); } @@ -167,15 +87,7 @@ } } -/* public Data convert(Data data, String outFormat) { - // TODO Auto-generated method stub - return null; - } - public Converter[] findConverters(Data data, String outFormat) { - // TODO Auto-generated method stub - return null; - }*/ public Converter[] findConverters(String inFormat, String outFormat, int maxHops, String maxComplexity) { // TODO Auto-generated method stub This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-08-01 17:06:31
|
Revision: 451 http://cishell.svn.sourceforge.net/cishell/?rev=451&view=rev Author: mwlinnem Date: 2007-08-01 09:57:10 -0700 (Wed, 01 Aug 2007) Log Message: ----------- Fixed .toArray calls to work correctly. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-08-01 16:47:06 UTC (rev 450) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-08-01 16:57:10 UTC (rev 451) @@ -211,16 +211,17 @@ } public ConverterPath[] getTestPath(String s){ - return (ConverterPath[])((ArrayList)this.fileExtensionTestConverters.get(s)).toArray(); + return (ConverterPath[])((ArrayList)this.fileExtensionTestConverters.get(s)).toArray(new ConverterPath[0]); } public ConverterPath[][] getTestPaths(){ - String[] fileExtensions = (String[])this.fileExtensionTestConverters.keySet().toArray(); + String[] fileExtensions = (String[])this.fileExtensionTestConverters.keySet().toArray(new String[0]); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ graphs.add(getTestPath(fileExtensions[i])); } - return (ConverterPath[][])graphs.toArray(); + //this line may be busted + return (ConverterPath[][])graphs.toArray(new ConverterPath[0][]); } public ConverterPath getComparePath(String s){ @@ -228,12 +229,12 @@ } public ConverterPath[] getComparePaths(){ - String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(); + String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(new String[0]); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ graphs.add(getComparePath(fileExtensions[i])); } - return (ConverterPath[])graphs.toArray(); + return (ConverterPath[])graphs.toArray(new ConverterPath[0]); } public File asNWB(){ Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-08-01 16:47:06 UTC (rev 450) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-08-01 16:57:10 UTC (rev 451) @@ -56,8 +56,8 @@ return this.path; } - public ServiceReference[] pathAsArray(){ - return (ServiceReference[])this.path.toArray(); + public ServiceReference[] getPathAsArray(){ + return (ServiceReference[])this.path.toArray(new ServiceReference[0]); } public String toString(){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-08-01 17:06:29
|
Revision: 449 http://cishell.svn.sourceforge.net/cishell/?rev=449&view=rev Author: mwlinnem Date: 2007-08-01 09:44:53 -0700 (Wed, 01 Aug 2007) Log Message: ----------- Project Stuff. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.algorithm/.classpath trunk/testing/org.cishell.testing.convertertester.algorithm/.project trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/ trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.core.prefs trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.ui.prefs trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.pde.core.prefs Added: trunk/testing/org.cishell.testing.convertertester.algorithm/.classpath =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/.classpath (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/.classpath 2007-08-01 16:44:53 UTC (rev 449) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="build"/> +</classpath> Added: trunk/testing/org.cishell.testing.convertertester.algorithm/.project =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/.project (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/.project 2007-08-01 16:44:53 UTC (rev 449) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.testing.convertertester.algorithm</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.core.prefs 2007-08-01 16:44:53 UTC (rev 449) @@ -0,0 +1,12 @@ +#Mon Jul 23 10:56:42 EDT 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.3 Added: trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.jdt.ui.prefs 2007-08-01 16:44:53 UTC (rev 449) @@ -0,0 +1,3 @@ +#Mon Jul 23 10:52:15 EDT 2007 +eclipse.preferences.version=1 +internal.default.compliance=default Added: trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/.settings/org.eclipse.pde.core.prefs 2007-08-01 16:44:53 UTC (rev 449) @@ -0,0 +1,4 @@ +#Fri Jul 20 13:44:43 EDT 2007 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-08-01 17:00:36
|
Revision: 450 http://cishell.svn.sourceforge.net/cishell/?rev=450&view=rev Author: teakettle22 Date: 2007-08-01 09:47:06 -0700 (Wed, 01 Aug 2007) Log Message: ----------- added an asNWB function Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-08-01 16:44:53 UTC (rev 449) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-08-01 16:47:06 UTC (rev 450) @@ -59,7 +59,8 @@ ServiceReference[] refs = bContext.getServiceReferences( AlgorithmFactory.class.getName(), filter); - // ConverterGraph g = new ConverterGraph(refs); + ConverterGraph g = new ConverterGraph(refs); + g.asNWB(); // System.out.println("Blah!"); // System.out.println(g); if (refs != null) { Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-08-01 16:44:53 UTC (rev 449) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-08-01 16:47:06 UTC (rev 450) @@ -245,7 +245,7 @@ BufferedWriter bw = new BufferedWriter(out); writeNodes(bw,nodes); - + writeEdges(bw,output); } catch(IOException ex){ System.out.println("Blurt!"); @@ -255,26 +255,25 @@ private void writeNodeHeader(BufferedWriter bw, int numNodes) throws IOException{ bw.flush(); - bw.write("*Nodes " + numNodes); + bw.write("*Nodes " + numNodes + "\nid*int label*string\n"); } private void writeNodes(BufferedWriter bw, Map nodes) throws IOException{ - System.out.println("*Nodes " + nodes.size()); + System.out.println("*Nodes " + nodes.size() + "\n"); writeNodeHeader(bw, nodes.size()); String[] keySet = new String[nodes.keySet().size()]; keySet = (String[])nodes.keySet().toArray(keySet); - for(int i = 0; i < keySet.length; i++){ bw.flush(); - bw.write(nodes.get(keySet[i]) + " " + keySet[i]); + bw.write(nodes.get(keySet[i]) + " \"" + keySet[i]+"\"\n"); } } private void writeEdgeHeader(BufferedWriter bw, int numEdges) throws IOException{ bw.flush(); - bw.write("*DirectedEdges " + numEdges); + bw.write("*DirectedEdges " + numEdges + "\nsource*int target*int\n"); } @@ -288,7 +287,7 @@ for(int i = 0; i < edgeArray.length; i++){ System.out.println(edgeArray[i]); bw.flush(); - bw.write(edgeArray[i]); + bw.write(edgeArray[i]+"\n"); } } @@ -307,8 +306,9 @@ ServiceReference[] references = new ServiceReference[paths.size()]; references = (ServiceReference[])paths.toArray(references); - for(int j = 0; j < references.length; j++){ - nodeNames.add(s); + for(int j = 0; j < references.length; j++){ + ServiceReference r = references[j]; + nodeNames.add(r.getProperty("service.pid").toString()); } } @@ -316,6 +316,7 @@ names = (String[])nodeNames.toArray(names); for(int i = 0; i < names.length; i++){ + System.out.println(names[i] + " " + (i+1)); nodesToInt.put(names[i], new Integer(i+1)); } @@ -328,16 +329,23 @@ keySet = (String[])m.keySet().toArray(keySet); for(int i = 0; i < keySet.length; i++){ String s = keySet[i]; - + System.out.println(keySet[i]); ArrayList paths = (ArrayList)this.inDataToAlgorithm.get(s); + if(paths != null){ ServiceReference[] references = new ServiceReference[paths.size()]; references = (ServiceReference[])paths.toArray(references); for(int j = 0; j < references.length; j++){ - String output = m.get(s).toString() + " "; - output += m.get(references[j].getProperty("service.pid")).toString(); - edges.add(output); + String output1 = m.get(s).toString() + " "; + String output2 = references[j].getProperty("service.pid").toString(); + output1 += m.get(output2).toString(); + output2 = m.get(output2).toString() + " " + m.get(references[j].getProperty("out_data")).toString(); + System.out.println(output1); + System.out.println(output2); + edges.add(output1); + edges.add(output2); } + } } return edges; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-07-31 15:55:23
|
Revision: 448 http://cishell.svn.sourceforge.net/cishell/?rev=448&view=rev Author: teakettle22 Date: 2007-07-31 08:55:16 -0700 (Tue, 31 Jul 2007) Log Message: ----------- an initial to nwb file format of the converter graph. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-30 18:00:47 UTC (rev 447) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-31 15:55:16 UTC (rev 448) @@ -59,9 +59,9 @@ ServiceReference[] refs = bContext.getServiceReferences( AlgorithmFactory.class.getName(), filter); - ConverterGraph g = new ConverterGraph(refs); - System.out.println("Blah!"); - System.out.println(g); + // ConverterGraph g = new ConverterGraph(refs); + // System.out.println("Blah!"); + // System.out.println(g); if (refs != null) { for (int i = 0; i < refs.length; ++i) { //System.out.println(refs[i]); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 18:00:47 UTC (rev 447) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-31 15:55:16 UTC (rev 448) @@ -1,8 +1,13 @@ package org.cishell.testing.convertertester.core.converter.graph; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import org.osgi.framework.ServiceReference; @@ -94,16 +99,16 @@ String key = cp.getInData() + " " + ((ServiceReference)cp.getPath().get(0)).getProperty("out_data").toString(); if(this.fileExtensionCompareConverters.get(key) == null){ - System.out.println("Adding a new Comparison Path:\n" + cp); + // System.out.println("Adding a new Comparison Path:\n" + cp); this.fileExtensionCompareConverters.put(key, new ConverterPath(cp)); } else { ConverterPath tempPath = (ConverterPath)this.fileExtensionCompareConverters.get(key); int pathSize = tempPath.getPath().size(); if(pathSize > cp.getPath().size()){ - ConverterPath oldPath = (ConverterPath)this.fileExtensionCompareConverters.get(key); - System.out.println("Replacing Comparision Path:\n" + oldPath + "with\n" - + cp); + //ConverterPath oldPath = (ConverterPath)this.fileExtensionCompareConverters.get(key); + //System.out.println("Replacing Comparision Path:\n" + oldPath + "with\n" + // + cp); this.fileExtensionCompareConverters.put(key, new ConverterPath(cp)); } } @@ -119,7 +124,7 @@ ServiceReference sr = (ServiceReference)srs.get(i); String ss = sr.getProperty("out_data").toString(); if(ss.startsWith("file-ext") && (!ss.equals(cp.getInData()))){ - System.out.println(sr.getProperty("service.pid") + " yes"); + //System.out.println(sr.getProperty("service.pid") + " yes"); forbidden.add(sr); } } @@ -129,16 +134,16 @@ private void addPath(ConverterPath p){ if(this.fileExtensionTestConverters.get(p.getInData()) == null){ - System.out.println("Adding a new path"); + //System.out.println("Adding a new path"); ArrayList paths = new ArrayList(); paths.add(p); this.fileExtensionTestConverters.put(p.getInData(), paths); - System.out.println("Successfully Added"); + //System.out.println("Successfully Added"); } else{ - System.out.println("Adding a path"); + //System.out.println("Adding a path"); ((ArrayList)this.fileExtensionTestConverters.get(p.getInData())).add(p); - System.out.println("Successfully Added"); + //System.out.println("Successfully Added"); } } @@ -173,7 +178,8 @@ public String printComparisonConverterPaths(){ StringBuffer sb = new StringBuffer(); - String[] keySet = (String[])this.fileExtensionTestConverters.keySet().toArray(); + String[] keySet = new String[this.fileExtensionTestConverters.keySet().size()]; + keySet = (String[])this.fileExtensionTestConverters.keySet().toArray(keySet); for(int i = 0; i < keySet.length; i++){ String s = keySet[i]; sb.append(printTestConverterPath(s)); @@ -229,4 +235,129 @@ } return (ConverterPath[])graphs.toArray(); } + + public File asNWB(){ + File f = getTempFile(); + Map nodes = assembleNodesSet(); + TreeSet output = assembleEdges(nodes); + try{ + FileWriter out = new FileWriter(f); + BufferedWriter bw = new BufferedWriter(out); + + writeNodes(bw,nodes); + + } + catch(IOException ex){ + System.out.println("Blurt!"); + } + return f; + } + + private void writeNodeHeader(BufferedWriter bw, int numNodes) throws IOException{ + bw.flush(); + bw.write("*Nodes " + numNodes); + + } + + private void writeNodes(BufferedWriter bw, Map nodes) throws IOException{ + System.out.println("*Nodes " + nodes.size()); + writeNodeHeader(bw, nodes.size()); + String[] keySet = new String[nodes.keySet().size()]; + keySet = (String[])nodes.keySet().toArray(keySet); + + for(int i = 0; i < keySet.length; i++){ + bw.flush(); + bw.write(nodes.get(keySet[i]) + " " + keySet[i]); + } + + } + + private void writeEdgeHeader(BufferedWriter bw, int numEdges) throws IOException{ + bw.flush(); + bw.write("*DirectedEdges " + numEdges); + } + + + private void writeEdges(BufferedWriter bw, TreeSet edges) throws IOException{ + System.out.println("*DirectedEdges " + edges.size()); + writeEdgeHeader(bw,edges.size()); + + String[] edgeArray = new String[edges.size()]; + edgeArray = (String[])edges.toArray(edgeArray); + + for(int i = 0; i < edgeArray.length; i++){ + System.out.println(edgeArray[i]); + bw.flush(); + bw.write(edgeArray[i]); + } + } + + private Map assembleNodesSet(){ + + Map nodesToInt = new ConcurrentHashMap(); + + //create a set of all the in_data, out_data, and algorithm names + String[] keySet = new String[this.inDataToAlgorithm.keySet().size()]; + keySet = (String[])this.inDataToAlgorithm.keySet().toArray(keySet); + TreeSet nodeNames = new TreeSet(); + for(int i = 0; i < keySet.length; i++){ + String s = keySet[i]; + nodeNames.add(s); + ArrayList paths = (ArrayList)this.inDataToAlgorithm.get(s); + ServiceReference[] references = new ServiceReference[paths.size()]; + references = (ServiceReference[])paths.toArray(references); + + for(int j = 0; j < references.length; j++){ + nodeNames.add(s); + } + } + + String[] names = new String[nodeNames.size()]; + names = (String[])nodeNames.toArray(names); + + for(int i = 0; i < names.length; i++){ + nodesToInt.put(names[i], new Integer(i+1)); + } + + return nodesToInt; + } + + private TreeSet assembleEdges(Map m){ + TreeSet edges = new TreeSet(); + String[] keySet = new String[m.size()]; + keySet = (String[])m.keySet().toArray(keySet); + for(int i = 0; i < keySet.length; i++){ + String s = keySet[i]; + + ArrayList paths = (ArrayList)this.inDataToAlgorithm.get(s); + ServiceReference[] references = new ServiceReference[paths.size()]; + references = (ServiceReference[])paths.toArray(references); + + for(int j = 0; j < references.length; j++){ + String output = m.get(s).toString() + " "; + output += m.get(references[j].getProperty("service.pid")).toString(); + edges.add(output); + } + + } + return edges; + } + + private File getTempFile(){ + File tempFile; + + String tempPath = System.getProperty("java.io.tmpdir"); + File tempDir = new File(tempPath+File.separator+"temp"); + if(!tempDir.exists()) + tempDir.mkdir(); + try{ + tempFile = File.createTempFile("NWB-Session-", ".nwb", tempDir); + + }catch (IOException e){ + + tempFile = new File (tempPath+File.separator+"nwbTemp"+File.separator+"temp.nwb"); + + } + return tempFile; + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 447 http://cishell.svn.sourceforge.net/cishell/?rev=447&view=rev Author: teakettle22 Date: 2007-07-30 11:00:47 -0700 (Mon, 30 Jul 2007) Log Message: ----------- corrected return types again. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:58:27 UTC (rev 446) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 18:00:47 UTC (rev 447) @@ -221,12 +221,12 @@ return (ConverterPath)this.fileExtensionCompareConverters.get(s); } - public ServiceReference[] getComparePaths(){ + public ConverterPath[] getComparePaths(){ String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ graphs.add(getComparePath(fileExtensions[i])); } - return (ServiceReference[])graphs.toArray(); + return (ConverterPath[])graphs.toArray(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 446 http://cishell.svn.sourceforge.net/cishell/?rev=446&view=rev Author: teakettle22 Date: 2007-07-30 10:58:27 -0700 (Mon, 30 Jul 2007) Log Message: ----------- fixed the fixes Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:54:45 UTC (rev 445) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:58:27 UTC (rev 446) @@ -204,17 +204,17 @@ return str.toString(); } - public ServiceReference[] getTestPath(String s){ - return (ServiceReference[])((ArrayList)this.fileExtensionTestConverters.get(s)).toArray(); + public ConverterPath[] getTestPath(String s){ + return (ConverterPath[])((ArrayList)this.fileExtensionTestConverters.get(s)).toArray(); } - public ServiceReference[][] getTestPaths(){ + public ConverterPath[][] getTestPaths(){ String[] fileExtensions = (String[])this.fileExtensionTestConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ graphs.add(getTestPath(fileExtensions[i])); } - return (ServiceReference[][])graphs.toArray(); + return (ConverterPath[][])graphs.toArray(); } public ConverterPath getComparePath(String s){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-07-30 17:54:49
|
Revision: 445 http://cishell.svn.sourceforge.net/cishell/?rev=445&view=rev Author: teakettle22 Date: 2007-07-30 10:54:45 -0700 (Mon, 30 Jul 2007) Log Message: ----------- fixed some errors, return cast arrays rather than ArrayLists. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-30 17:28:26 UTC (rev 444) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-30 17:54:45 UTC (rev 445) @@ -60,6 +60,7 @@ ServiceReference[] refs = bContext.getServiceReferences( AlgorithmFactory.class.getName(), filter); ConverterGraph g = new ConverterGraph(refs); + System.out.println("Blah!"); System.out.println(g); if (refs != null) { for (int i = 0; i < refs.length; ++i) { Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:28:26 UTC (rev 444) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:54:45 UTC (rev 445) @@ -43,7 +43,8 @@ private void createConverterPaths(Map algorithms, Map testPaths, Map comparePaths){ - String[] keySet = (String[])algorithms.keySet().toArray(); + String[] keySet = new String[algorithms.keySet().size()]; + keySet = (String[])algorithms.keySet().toArray(keySet); for(int i = 0; i < keySet.length; i++){ String s = keySet[i]; if(s.startsWith("file-ext")){ @@ -155,7 +156,8 @@ public String printTestConverterPaths(){ StringBuffer sb = new StringBuffer(); - String[] keySet = (String[])this.fileExtensionTestConverters.keySet().toArray(); + String[] keySet = new String[this.fileExtensionTestConverters.keySet().size()]; + keySet = (String[])this.fileExtensionTestConverters.keySet().toArray(keySet); for(int i = 0; i < keySet.length; i++){ String s = keySet[i]; sb.append(printTestConverterPath(s)); @@ -183,7 +185,8 @@ public String toString(){ StringBuffer str = new StringBuffer(); - String[] keySet = (String[])this.inDataToAlgorithm.keySet().toArray(); + String[] keySet = new String[this.inDataToAlgorithm.keySet().size()]; + keySet = (String[])this.inDataToAlgorithm.keySet().toArray(keySet); for(int i = 0; i < keySet.length; i++){ String s = keySet[i]; str.append(s + "\n"); @@ -201,29 +204,29 @@ return str.toString(); } - public ArrayList getTestPath(String s){ - return (ArrayList)this.fileExtensionTestConverters.get(s); + public ServiceReference[] getTestPath(String s){ + return (ServiceReference[])((ArrayList)this.fileExtensionTestConverters.get(s)).toArray(); } - public ArrayList getTestPaths(){ + public ServiceReference[][] getTestPaths(){ String[] fileExtensions = (String[])this.fileExtensionTestConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ graphs.add(getTestPath(fileExtensions[i])); } - return graphs; + return (ServiceReference[][])graphs.toArray(); } public ConverterPath getComparePath(String s){ return (ConverterPath)this.fileExtensionCompareConverters.get(s); } - public ArrayList getComparePaths(){ + public ServiceReference[] getComparePaths(){ String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ graphs.add(getComparePath(fileExtensions[i])); } - return graphs; + return (ServiceReference[])graphs.toArray(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 444 http://cishell.svn.sourceforge.net/cishell/?rev=444&view=rev Author: teakettle22 Date: 2007-07-30 10:28:26 -0700 (Mon, 30 Jul 2007) Log Message: ----------- More accurate naming Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:25:19 UTC (rev 443) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:28:26 UTC (rev 444) @@ -201,28 +201,28 @@ return str.toString(); } - public ArrayList getTestGraph(String s){ + public ArrayList getTestPath(String s){ return (ArrayList)this.fileExtensionTestConverters.get(s); } - public ArrayList getTestGraphs(){ + public ArrayList getTestPaths(){ String[] fileExtensions = (String[])this.fileExtensionTestConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ - graphs.add(getTestGraph(fileExtensions[i])); + graphs.add(getTestPath(fileExtensions[i])); } return graphs; } - public ConverterPath getCompareGraph(String s){ + public ConverterPath getComparePath(String s){ return (ConverterPath)this.fileExtensionCompareConverters.get(s); } - public ArrayList getCompareGraphs(){ + public ArrayList getComparePaths(){ String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); for(int i = 0; i < fileExtensions.length; i++){ - graphs.add(getCompareGraph(fileExtensions[i])); + graphs.add(getComparePath(fileExtensions[i])); } return graphs; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 442 http://cishell.svn.sourceforge.net/cishell/?rev=442&view=rev Author: teakettle22 Date: 2007-07-30 10:12:48 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Retrieve the list of Compare Graphs as a two dimensional array of ConverterPaths. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 16:11:36 UTC (rev 441) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:12:48 UTC (rev 442) @@ -200,4 +200,18 @@ str.trimToSize(); return str.toString(); } + + public ArrayList getCompareGraph(String s){ + return (ArrayList)this.fileExtensionCompareConverters.get(s); + } + + public ArrayList getCompareGraphs(){ + String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(); + ArrayList graphs = new ArrayList(); + for(int i = 0; i < fileExtensions.length; i++){ + graphs.add(getCompareGraph(fileExtensions[i])); + } + return graphs; + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-07-30 17:25:22
|
Revision: 443 http://cishell.svn.sourceforge.net/cishell/?rev=443&view=rev Author: teakettle22 Date: 2007-07-30 10:25:19 -0700 (Mon, 30 Jul 2007) Log Message: ----------- getTestGraph(String), getTestGraphs() Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:12:48 UTC (rev 442) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 17:25:19 UTC (rev 443) @@ -201,10 +201,23 @@ return str.toString(); } - public ArrayList getCompareGraph(String s){ - return (ArrayList)this.fileExtensionCompareConverters.get(s); + public ArrayList getTestGraph(String s){ + return (ArrayList)this.fileExtensionTestConverters.get(s); } + public ArrayList getTestGraphs(){ + String[] fileExtensions = (String[])this.fileExtensionTestConverters.keySet().toArray(); + ArrayList graphs = new ArrayList(); + for(int i = 0; i < fileExtensions.length; i++){ + graphs.add(getTestGraph(fileExtensions[i])); + } + return graphs; + } + + public ConverterPath getCompareGraph(String s){ + return (ConverterPath)this.fileExtensionCompareConverters.get(s); + } + public ArrayList getCompareGraphs(){ String[] fileExtensions = (String[])this.fileExtensionCompareConverters.keySet().toArray(); ArrayList graphs = new ArrayList(); @@ -213,5 +226,4 @@ } return graphs; } - } \ No newline at end of file Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-07-30 17:12:48 UTC (rev 442) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-07-30 17:25:19 UTC (rev 443) @@ -56,6 +56,10 @@ return this.path; } + public ServiceReference[] pathAsArray(){ + return (ServiceReference[])this.path.toArray(); + } + public String toString(){ String val = this.in_data +" -->\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-07-30 16:11:40
|
Revision: 441 http://cishell.svn.sourceforge.net/cishell/?rev=441&view=rev Author: teakettle22 Date: 2007-07-30 09:11:36 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Refactored code to 1.4 Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-26 20:57:48 UTC (rev 440) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-30 16:11:36 UTC (rev 441) @@ -9,6 +9,7 @@ import org.cishell.framework.algorithm.AlgorithmProperty; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; +import org.cishell.testing.convertertester.core.converter.graph.ConverterGraph; import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceEvent; @@ -58,7 +59,8 @@ ServiceReference[] refs = bContext.getServiceReferences( AlgorithmFactory.class.getName(), filter); - + ConverterGraph g = new ConverterGraph(refs); + System.out.println(g); if (refs != null) { for (int i = 0; i < refs.length; ++i) { //System.out.println(refs[i]); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-26 20:57:48 UTC (rev 440) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-30 16:11:36 UTC (rev 441) @@ -9,41 +9,43 @@ public class ConverterGraph { prefuse.data.Graph converterGraph; - Map<String, ArrayList<ServiceReference>> inDataToAlgorithm; - Map<String, ArrayList<ConverterPath>> fileExtensionTestConverters; - Map<String, ConverterPath> fileExtensionCompareConverters; + Map inDataToAlgorithm; + Map fileExtensionTestConverters; + Map fileExtensionCompareConverters; ServiceReference[] converters; private static final String testOutData = "prefuse.data.Graph"; public ConverterGraph(ServiceReference[] converters){ this.converters = converters; - inDataToAlgorithm = new HashMap<String, ArrayList<ServiceReference>>(); - fileExtensionTestConverters = new ConcurrentHashMap<String, ArrayList<ConverterPath>>(); - fileExtensionCompareConverters = new ConcurrentHashMap<String, ConverterPath>(); + inDataToAlgorithm = new HashMap();//<String, ArrayList<ServiceReference>>(); + fileExtensionTestConverters = new ConcurrentHashMap();//<String, ArrayList<ConverterPath>>(); + fileExtensionCompareConverters = new ConcurrentHashMap();//<String, ConverterPath>(); associateAlgorithms(this.converters, this.inDataToAlgorithm); createConverterPaths(this.inDataToAlgorithm, this.fileExtensionTestConverters, this.fileExtensionCompareConverters); //System.out.println("And here"); } - private void associateAlgorithms(ServiceReference[] sr, Map<String, ArrayList<ServiceReference>> hm){ - for(ServiceReference srv : sr){ + private void associateAlgorithms(ServiceReference[] sr, Map hm){ + for(int i = 0; i < sr.length; i++){ + ServiceReference srv = sr[i]; String s = srv.getProperty("in_data").toString(); if(hm.get(s) == null){ - ArrayList<ServiceReference> al = new ArrayList<ServiceReference>(); + ArrayList al = new ArrayList(); al.add(srv); hm.put(s, al); } else{ - hm.get(s).add(srv); + ((ArrayList)hm.get(s)).add(srv); } } } - private void createConverterPaths(Map<String, ArrayList<ServiceReference>> algorithms, Map<String, ArrayList<ConverterPath>> testPaths, - Map<String, ConverterPath> comparePaths){ - - for(String s : algorithms.keySet()){ + private void createConverterPaths(Map algorithms, Map testPaths, + Map comparePaths){ + String[] keySet = (String[])algorithms.keySet().toArray(); + for(int i = 0; i < keySet.length; i++){ + String s = keySet[i]; if(s.startsWith("file-ext")){ @@ -51,14 +53,14 @@ //ConverterPath test.setInData(s); //createPaths(algorithms, testPaths, comparePaths, test, s); - createPaths(algorithms.get(s), test, s); + createPaths((ArrayList)algorithms.get(s), test, s); //System.out.println("I've got here"); } } } - private ConverterPath createPaths(ArrayList<ServiceReference> algorithms, ConverterPath path, String dataType){ - ArrayList<ServiceReference> refs = removeReferences(algorithms, path); + private ConverterPath createPaths(ArrayList algorithms, ConverterPath path, String dataType){ + ArrayList refs = removeReferences(algorithms, path); addCompareCycle(path); @@ -68,9 +70,9 @@ } while(!refs.isEmpty()){ ConverterPath p = new ConverterPath(path); - p.addAlgoritm(refs.get(0)); + p.addAlgoritm((ServiceReference)refs.get(0)); refs.remove(0); - createPaths(this.inDataToAlgorithm.get(p.getOutData()), p, p.getOutData()); + createPaths((ArrayList)this.inDataToAlgorithm.get(p.getOutData()), p, p.getOutData()); } return null; @@ -78,8 +80,8 @@ private void addTestCycle(ConverterPath cp){ String firstOutData, lastInData; - firstOutData = cp.getPath().get(0).getProperty("out_data").toString(); - lastInData = cp.getPath().get(cp.getPath().size()-1).getProperty("in_data").toString(); + firstOutData = ((ServiceReference)cp.getPath().get(0)).getProperty("out_data").toString(); + lastInData = ((ServiceReference)cp.getPath().get(cp.getPath().size()-1)).getProperty("in_data").toString(); if(firstOutData.equals(lastInData)){ addPath(cp); } @@ -88,16 +90,17 @@ private void addCompareCycle(ConverterPath cp){ if(cp.getOutData() != null){ if(cp.getOutData().equals(ConverterGraph.testOutData)){ - String key = cp.getInData() + " " + cp.getPath().get(0).getProperty("out_data").toString(); + String key = cp.getInData() + " " + ((ServiceReference)cp.getPath().get(0)).getProperty("out_data").toString(); if(this.fileExtensionCompareConverters.get(key) == null){ System.out.println("Adding a new Comparison Path:\n" + cp); this.fileExtensionCompareConverters.put(key, new ConverterPath(cp)); } else { - int pathSize = this.fileExtensionCompareConverters.get(key).getPath().size(); + ConverterPath tempPath = (ConverterPath)this.fileExtensionCompareConverters.get(key); + int pathSize = tempPath.getPath().size(); if(pathSize > cp.getPath().size()){ - ConverterPath oldPath = this.fileExtensionCompareConverters.get(key); + ConverterPath oldPath = (ConverterPath)this.fileExtensionCompareConverters.get(key); System.out.println("Replacing Comparision Path:\n" + oldPath + "with\n" + cp); this.fileExtensionCompareConverters.put(key, new ConverterPath(cp)); @@ -107,11 +110,12 @@ } } - private static ArrayList<ServiceReference> removeReferences(ArrayList<ServiceReference> al, ConverterPath cp){ - ArrayList<ServiceReference> srs = new ArrayList<ServiceReference>(al); + private static ArrayList removeReferences(ArrayList al, ConverterPath cp){ + ArrayList srs = new ArrayList(al); srs.removeAll(cp.getPath()); - ArrayList<ServiceReference> forbidden = new ArrayList<ServiceReference>(); - for(ServiceReference sr: srs){ + ArrayList forbidden = new ArrayList(); + for(int i = 0; i < srs.size(); i++){ + ServiceReference sr = (ServiceReference)srs.get(i); String ss = sr.getProperty("out_data").toString(); if(ss.startsWith("file-ext") && (!ss.equals(cp.getInData()))){ System.out.println(sr.getProperty("service.pid") + " yes"); @@ -125,14 +129,14 @@ private void addPath(ConverterPath p){ if(this.fileExtensionTestConverters.get(p.getInData()) == null){ System.out.println("Adding a new path"); - ArrayList<ConverterPath> paths = new ArrayList<ConverterPath>(); + ArrayList paths = new ArrayList(); paths.add(p); this.fileExtensionTestConverters.put(p.getInData(), paths); System.out.println("Successfully Added"); } else{ System.out.println("Adding a path"); - this.fileExtensionTestConverters.get(p.getInData()).add(p); + ((ArrayList)this.fileExtensionTestConverters.get(p.getInData())).add(p); System.out.println("Successfully Added"); } } @@ -140,7 +144,9 @@ public String printTestConverterPath(String s){ StringBuffer sb = new StringBuffer(); - for(ConverterPath cp : this.fileExtensionTestConverters.get(s)){ + ArrayList al = (ArrayList)this.fileExtensionTestConverters.get(s); + for(int i = 0; i < al.size(); i++){ + ConverterPath cp = (ConverterPath)al.get(i); sb.append(cp.toString()); } sb.trimToSize(); @@ -149,7 +155,9 @@ public String printTestConverterPaths(){ StringBuffer sb = new StringBuffer(); - for(String s : this.fileExtensionTestConverters.keySet()){ + String[] keySet = (String[])this.fileExtensionTestConverters.keySet().toArray(); + for(int i = 0; i < keySet.length; i++){ + String s = keySet[i]; sb.append(printTestConverterPath(s)); } sb.trimToSize(); @@ -163,8 +171,10 @@ public String printComparisonConverterPaths(){ StringBuffer sb = new StringBuffer(); - for(String s: this.fileExtensionCompareConverters.keySet()){ - sb.append(printComparisonConverterPath(s)); + String[] keySet = (String[])this.fileExtensionTestConverters.keySet().toArray(); + for(int i = 0; i < keySet.length; i++){ + String s = keySet[i]; + sb.append(printTestConverterPath(s)); } sb.trimToSize(); return sb.toString(); @@ -173,9 +183,13 @@ public String toString(){ StringBuffer str = new StringBuffer(); - for(String s : this.inDataToAlgorithm.keySet()){ + String[] keySet = (String[])this.inDataToAlgorithm.keySet().toArray(); + for(int i = 0; i < keySet.length; i++){ + String s = keySet[i]; str.append(s + "\n"); - for(ServiceReference sr : this.inDataToAlgorithm.get(s)){ + ArrayList al = (ArrayList)this.inDataToAlgorithm.get(s); + for(int j = 0; j < al.size(); j++){ + ServiceReference sr = (ServiceReference)al.get(j); str.append("\t" + sr.getProperty("service.pid") + "\n"); } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-07-26 20:57:48 UTC (rev 440) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-07-30 16:11:36 UTC (rev 441) @@ -8,17 +8,17 @@ public class ConverterPath { String in_data; String out_data = null; - ArrayList<ServiceReference> path; + ArrayList path; public ConverterPath(){ - path = new ArrayList<ServiceReference>(); + path = new ArrayList(); } public ConverterPath(ConverterPath p){ in_data = p.getInData(); out_data = p.getOutData(); - this.path = new ArrayList<ServiceReference>(p.getPath()); + this.path = new ArrayList(p.getPath()); } @@ -52,14 +52,15 @@ return this.out_data; } - public List<ServiceReference> getPath(){ + public List getPath(){ return this.path; } public String toString(){ String val = this.in_data +" -->\n"; - for(ServiceReference sr : this.path){ + for(int i = 0; i < this.path.size(); i++){ + ServiceReference sr = (ServiceReference)this.path.get(i); val += "\t" + sr.getProperty("service.pid") + "\n"; } val += "--> " + this.out_data + "\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 440 http://cishell.svn.sourceforge.net/cishell/?rev=440&view=rev Author: teakettle22 Date: 2007-07-26 13:57:48 -0700 (Thu, 26 Jul 2007) Log Message: ----------- A functioning Converter Graph Assembler. For each file extension, it generates all valid paths that do not write out to another file extension. It also creates the shortest path from the given file extension to prefuse.data.Graph for use in the ConverterTester. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-25 20:50:58 UTC (rev 439) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-26 20:57:48 UTC (rev 440) @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.osgi.framework.ServiceReference; @@ -17,11 +18,12 @@ public ConverterGraph(ServiceReference[] converters){ this.converters = converters; inDataToAlgorithm = new HashMap<String, ArrayList<ServiceReference>>(); - fileExtensionTestConverters = new HashMap<String, ArrayList<ConverterPath>>(); - fileExtensionCompareConverters = new HashMap<String, ConverterPath>(); + fileExtensionTestConverters = new ConcurrentHashMap<String, ArrayList<ConverterPath>>(); + fileExtensionCompareConverters = new ConcurrentHashMap<String, ConverterPath>(); associateAlgorithms(this.converters, this.inDataToAlgorithm); createConverterPaths(this.inDataToAlgorithm, this.fileExtensionTestConverters, this.fileExtensionCompareConverters); + //System.out.println("And here"); } private void associateAlgorithms(ServiceReference[] sr, Map<String, ArrayList<ServiceReference>> hm){ @@ -48,77 +50,140 @@ ConverterPath test = new ConverterPath(); //ConverterPath test.setInData(s); - createPaths(algorithms, testPaths, comparePaths, test, s); + //createPaths(algorithms, testPaths, comparePaths, test, s); + createPaths(algorithms.get(s), test, s); + //System.out.println("I've got here"); } } } - private void createPaths(Map<String,ArrayList<ServiceReference>> algorithms, Map<String, ArrayList<ConverterPath>> testPaths, - Map<String, ConverterPath> comparePaths, ConverterPath path, String dataType){ - /* + private ConverterPath createPaths(ArrayList<ServiceReference> algorithms, ConverterPath path, String dataType){ + ArrayList<ServiceReference> refs = removeReferences(algorithms, path); + + addCompareCycle(path); + if(path.getInData().equals(path.getOutData())){ - if(testPaths.get(path.getInData()) == null){ - ArrayList<ConverterPath> paths = new ArrayList<ConverterPath>(); - paths.add(new ConverterPath(path)); - testPaths.put(path.getInData(), paths); - System.out.println(path); - } - else{ - testPaths.get(path.getInData()).add(new ConverterPath(path)); - System.out.println(path); - } - }*/ - try{ - ArrayList<ServiceReference> algs = new ArrayList<ServiceReference>(algorithms.get(dataType)); + addTestCycle(path); + return path; + } + while(!refs.isEmpty()){ + ConverterPath p = new ConverterPath(path); + p.addAlgoritm(refs.get(0)); + refs.remove(0); + createPaths(this.inDataToAlgorithm.get(p.getOutData()), p, p.getOutData()); - algs.removeAll(path.getPath()); - for(ServiceReference sr : algs){ - //for(ServiceReference sr: algs){ - System.out.println(sr.getProperty("service.pid")); - //} - ConverterPath p = new ConverterPath(path); - System.out.println(); - if(p.addAlgoritm(sr)){ - algs.remove(sr); - createPaths(algorithms, testPaths,comparePaths,p,p.getOutData()); + } + return null; + } + + private void addTestCycle(ConverterPath cp){ + String firstOutData, lastInData; + firstOutData = cp.getPath().get(0).getProperty("out_data").toString(); + lastInData = cp.getPath().get(cp.getPath().size()-1).getProperty("in_data").toString(); + if(firstOutData.equals(lastInData)){ + addPath(cp); + } + } + + private void addCompareCycle(ConverterPath cp){ + if(cp.getOutData() != null){ + if(cp.getOutData().equals(ConverterGraph.testOutData)){ + String key = cp.getInData() + " " + cp.getPath().get(0).getProperty("out_data").toString(); + if(this.fileExtensionCompareConverters.get(key) == null){ + + System.out.println("Adding a new Comparison Path:\n" + cp); + this.fileExtensionCompareConverters.put(key, new ConverterPath(cp)); + } + else { + int pathSize = this.fileExtensionCompareConverters.get(key).getPath().size(); + if(pathSize > cp.getPath().size()){ + ConverterPath oldPath = this.fileExtensionCompareConverters.get(key); + System.out.println("Replacing Comparision Path:\n" + oldPath + "with\n" + + cp); + this.fileExtensionCompareConverters.put(key, new ConverterPath(cp)); } - - else{ - if(testPaths.get(path.getInData()) == null){ - ArrayList<ConverterPath> paths = new ArrayList<ConverterPath>(); - paths.add(p); - testPaths.put(path.getInData(), paths); - System.out.println(p); - } - else{ - testPaths.get(path.getInData()).add(p); - System.out.println(p); - } - algs.remove(sr); + } + } + } + } + + private static ArrayList<ServiceReference> removeReferences(ArrayList<ServiceReference> al, ConverterPath cp){ + ArrayList<ServiceReference> srs = new ArrayList<ServiceReference>(al); + srs.removeAll(cp.getPath()); + ArrayList<ServiceReference> forbidden = new ArrayList<ServiceReference>(); + for(ServiceReference sr: srs){ + String ss = sr.getProperty("out_data").toString(); + if(ss.startsWith("file-ext") && (!ss.equals(cp.getInData()))){ + System.out.println(sr.getProperty("service.pid") + " yes"); + forbidden.add(sr); } } - }catch(NullPointerException npe){ - npe.printStackTrace(); + srs.removeAll(forbidden); + return srs; + } + + private void addPath(ConverterPath p){ + if(this.fileExtensionTestConverters.get(p.getInData()) == null){ + System.out.println("Adding a new path"); + ArrayList<ConverterPath> paths = new ArrayList<ConverterPath>(); + paths.add(p); + this.fileExtensionTestConverters.put(p.getInData(), paths); + System.out.println("Successfully Added"); } + else{ + System.out.println("Adding a path"); + this.fileExtensionTestConverters.get(p.getInData()).add(p); + System.out.println("Successfully Added"); } + } + public String printTestConverterPath(String s){ + StringBuffer sb = new StringBuffer(); + for(ConverterPath cp : this.fileExtensionTestConverters.get(s)){ + sb.append(cp.toString()); + } + sb.trimToSize(); + return sb.toString(); + } + public String printTestConverterPaths(){ + StringBuffer sb = new StringBuffer(); + for(String s : this.fileExtensionTestConverters.keySet()){ + sb.append(printTestConverterPath(s)); + } + sb.trimToSize(); + return sb.toString(); + } + + + public String printComparisonConverterPath(String s){ + return this.fileExtensionCompareConverters.get(s).toString(); + } + + public String printComparisonConverterPaths(){ + StringBuffer sb = new StringBuffer(); + for(String s: this.fileExtensionCompareConverters.keySet()){ + sb.append(printComparisonConverterPath(s)); + } + sb.trimToSize(); + return sb.toString(); + } + + public String toString(){ - String str = ""; + StringBuffer str = new StringBuffer(); for(String s : this.inDataToAlgorithm.keySet()){ - str += s + "\n"; + str.append(s + "\n"); for(ServiceReference sr : this.inDataToAlgorithm.get(s)){ - str += "\t" + sr.getProperty("service.pid") + "\n"; + str.append("\t" + sr.getProperty("service.pid") + "\n"); } } - - for(String s : this.fileExtensionTestConverters.keySet()){ - for(ConverterPath cp : this.fileExtensionTestConverters.get(s)){ - str += cp.toString(); - } - } - - return str; + str.append("Test Paths:\n"); + str.append(printTestConverterPaths()); + str.append("Comparison Paths:\n"); + str.append(printComparisonConverterPaths()); + str.trimToSize(); + return str.toString(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-07-25 20:51:02
|
Revision: 439 http://cishell.svn.sourceforge.net/cishell/?rev=439&view=rev Author: teakettle22 Date: 2007-07-25 13:50:58 -0700 (Wed, 25 Jul 2007) Log Message: ----------- first implementation of the converter graph. Warning!!! Many errors; unusable, committing to store it so that I don't rely on local storage. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterNode.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-07-25 20:50:58 UTC (rev 439) @@ -0,0 +1,124 @@ +package org.cishell.testing.convertertester.core.converter.graph; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import org.osgi.framework.ServiceReference; + +public class ConverterGraph { + prefuse.data.Graph converterGraph; + Map<String, ArrayList<ServiceReference>> inDataToAlgorithm; + Map<String, ArrayList<ConverterPath>> fileExtensionTestConverters; + Map<String, ConverterPath> fileExtensionCompareConverters; + ServiceReference[] converters; + private static final String testOutData = "prefuse.data.Graph"; + + public ConverterGraph(ServiceReference[] converters){ + this.converters = converters; + inDataToAlgorithm = new HashMap<String, ArrayList<ServiceReference>>(); + fileExtensionTestConverters = new HashMap<String, ArrayList<ConverterPath>>(); + fileExtensionCompareConverters = new HashMap<String, ConverterPath>(); + + associateAlgorithms(this.converters, this.inDataToAlgorithm); + createConverterPaths(this.inDataToAlgorithm, this.fileExtensionTestConverters, this.fileExtensionCompareConverters); + } + + private void associateAlgorithms(ServiceReference[] sr, Map<String, ArrayList<ServiceReference>> hm){ + for(ServiceReference srv : sr){ + String s = srv.getProperty("in_data").toString(); + if(hm.get(s) == null){ + ArrayList<ServiceReference> al = new ArrayList<ServiceReference>(); + al.add(srv); + hm.put(s, al); + } + else{ + hm.get(s).add(srv); + } + } + } + + private void createConverterPaths(Map<String, ArrayList<ServiceReference>> algorithms, Map<String, ArrayList<ConverterPath>> testPaths, + Map<String, ConverterPath> comparePaths){ + + for(String s : algorithms.keySet()){ + if(s.startsWith("file-ext")){ + + + ConverterPath test = new ConverterPath(); + //ConverterPath + test.setInData(s); + createPaths(algorithms, testPaths, comparePaths, test, s); + } + } + } + + private void createPaths(Map<String,ArrayList<ServiceReference>> algorithms, Map<String, ArrayList<ConverterPath>> testPaths, + Map<String, ConverterPath> comparePaths, ConverterPath path, String dataType){ + /* + if(path.getInData().equals(path.getOutData())){ + if(testPaths.get(path.getInData()) == null){ + ArrayList<ConverterPath> paths = new ArrayList<ConverterPath>(); + paths.add(new ConverterPath(path)); + testPaths.put(path.getInData(), paths); + System.out.println(path); + } + else{ + testPaths.get(path.getInData()).add(new ConverterPath(path)); + System.out.println(path); + } + }*/ + try{ + ArrayList<ServiceReference> algs = new ArrayList<ServiceReference>(algorithms.get(dataType)); + + algs.removeAll(path.getPath()); + for(ServiceReference sr : algs){ + //for(ServiceReference sr: algs){ + System.out.println(sr.getProperty("service.pid")); + //} + ConverterPath p = new ConverterPath(path); + System.out.println(); + if(p.addAlgoritm(sr)){ + algs.remove(sr); + createPaths(algorithms, testPaths,comparePaths,p,p.getOutData()); + } + + else{ + if(testPaths.get(path.getInData()) == null){ + ArrayList<ConverterPath> paths = new ArrayList<ConverterPath>(); + paths.add(p); + testPaths.put(path.getInData(), paths); + System.out.println(p); + } + else{ + testPaths.get(path.getInData()).add(p); + System.out.println(p); + } + algs.remove(sr); + } + } + }catch(NullPointerException npe){ + npe.printStackTrace(); + } + } + + + + public String toString(){ + String str = ""; + for(String s : this.inDataToAlgorithm.keySet()){ + str += s + "\n"; + for(ServiceReference sr : this.inDataToAlgorithm.get(s)){ + str += "\t" + sr.getProperty("service.pid") + "\n"; + } + } + + for(String s : this.fileExtensionTestConverters.keySet()){ + for(ConverterPath cp : this.fileExtensionTestConverters.get(s)){ + str += cp.toString(); + } + } + + return str; + } +} \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterNode.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterNode.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterNode.java 2007-07-25 20:50:58 UTC (rev 439) @@ -0,0 +1,32 @@ +package org.cishell.testing.convertertester.core.converter.graph; + +public class ConverterNode { + String name; + int id; + + public ConverterNode(String s, int i){ + name = s; + id = i; + } + + public String getName(){ + return name; + } + + public int getID(){ + return id; + } + + public void setName(String s){ + name = s; + } + + public void setID(int i){ + id = i; + } + + public String toString(){ + return name + " " + id; + } + +} Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-07-25 20:50:58 UTC (rev 439) @@ -0,0 +1,69 @@ +package org.cishell.testing.convertertester.core.converter.graph; + +import java.util.ArrayList; +import java.util.List; + +import org.osgi.framework.ServiceReference; + +public class ConverterPath { + String in_data; + String out_data = null; + ArrayList<ServiceReference> path; + + public ConverterPath(){ + path = new ArrayList<ServiceReference>(); + } + + public ConverterPath(ConverterPath p){ + in_data = p.getInData(); + out_data = p.getOutData(); + + this.path = new ArrayList<ServiceReference>(p.getPath()); + + } + + public void setInData(String s){ + this.in_data = s; + } + + public void setOutData(String s){ + this.out_data = s; + } + + public boolean addAlgoritm(ServiceReference sr){ + boolean val = true; + //System.out.println(this.in_data + " " + this.out_data); + if(path.contains(sr)){ + System.out.println("Path already contains " + sr.getProperty("service.pid")); + //this.setOutData(sr.getProperty("out_data").toString()); + return false; + } + //System.out.println("Adding: " + sr.getProperty("service.pid")); + path.add(sr); + this.setOutData(sr.getProperty("out_data").toString()); + return val; + } + + public String getInData(){ + return this.in_data; + } + + public String getOutData(){ + return this.out_data; + } + + public List<ServiceReference> getPath(){ + return this.path; + } + + public String toString(){ + String val = this.in_data +" -->\n"; + + for(ServiceReference sr : this.path){ + val += "\t" + sr.getProperty("service.pid") + "\n"; + } + val += "--> " + this.out_data + "\n"; + return val; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 20:33:36
|
Revision: 437 http://cishell.svn.sourceforge.net/cishell/?rev=437&view=rev Author: mwlinnem Date: 2007-07-25 13:32:40 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Including extra hidden files so hopefully project will be correctly treated as a plugin project in other people's workspaces. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.core.new/.classpath trunk/testing/org.cishell.testing.convertertester.core.new/.project trunk/testing/org.cishell.testing.convertertester.core.new/.settings/ trunk/testing/org.cishell.testing.convertertester.core.new/.settings/org.eclipse.pde.core.prefs Added: trunk/testing/org.cishell.testing.convertertester.core.new/.classpath =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/.classpath (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/.classpath 2007-07-25 20:32:40 UTC (rev 437) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="build"/> +</classpath> Added: trunk/testing/org.cishell.testing.convertertester.core.new/.project =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/.project (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/.project 2007-07-25 20:32:40 UTC (rev 437) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.testing.convertertester.core.new</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/testing/org.cishell.testing.convertertester.core.new/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/.settings/org.eclipse.pde.core.prefs 2007-07-25 20:32:40 UTC (rev 437) @@ -0,0 +1,4 @@ +#Tue Jul 24 14:03:40 EDT 2007 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 20:33:29
|
Revision: 438 http://cishell.svn.sourceforge.net/cishell/?rev=438&view=rev Author: mwlinnem Date: 2007-07-25 13:33:27 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Including extra hidden files so hopefully project will be correctly treated as a plugin project in other people's workspaces. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.commandline/.classpath trunk/testing/org.cishell.testing.convertertester.commandline/.project trunk/testing/org.cishell.testing.convertertester.commandline/.settings/ trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs Added: trunk/testing/org.cishell.testing.convertertester.commandline/.classpath =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/.classpath (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/.classpath 2007-07-25 20:33:27 UTC (rev 438) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="build"/> +</classpath> Added: trunk/testing/org.cishell.testing.convertertester.commandline/.project =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/.project (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/.project 2007-07-25 20:33:27 UTC (rev 438) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.testing.convertertester.commandline</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs 2007-07-25 20:33:27 UTC (rev 438) @@ -0,0 +1,4 @@ +#Wed Jul 25 13:20:26 EDT 2007 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 18:18:09
|
Revision: 436 http://cishell.svn.sourceforge.net/cishell/?rev=436&view=rev Author: mwlinnem Date: 2007-07-25 11:18:02 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Initial import. Separates out the commandline code from the core ConverterTester. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/ trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.commandline/build.properties trunk/testing/org.cishell.testing.convertertester.commandline/src/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java Added: trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF 2007-07-25 18:18:02 UTC (rev 436) @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Converter Tester Command-Line +Bundle-SymbolicName: org.cishell.testing.convertertester.commandline +Bundle-Version: 0.0.1 +Bundle-ClassPath: . +Bundle-Localization: plugin +Import-Package: org.cishell.framework, + org.cishell.framework.algorithm, + org.cishell.framework.data, + org.cishell.service.conversion, + org.osgi.framework;version="1.3.0", + org.osgi.service.component;version="1.0.0", + org.osgi.service.log;version="1.3.0", + org.osgi.service.metatype;version="1.1.0", + org.osgi.service.prefs;version="1.1.0" +Bundle-Activator: org.cishell.testing.convertertester.commandline.Activator +Require-Bundle: org.cishell.testing.convertertester.core.new Added: trunk/testing/org.cishell.testing.convertertester.commandline/build.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/build.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/build.properties 2007-07-25 18:18:02 UTC (rev 436) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = build/ +bin.includes = META-INF/,\ + . Added: trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java 2007-07-25 18:18:02 UTC (rev 436) @@ -0,0 +1,91 @@ +package org.cishell.testing.convertertester.commandline; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Scanner; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.LocalCIShellContext; +import org.cishell.testing.convertertester.core.tester.ConverterTester; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + + +public class Activator implements BundleActivator{ + private ConverterTester ct; + private BundleContext b; + private CIShellContext c; + private File configFile; + + public static final String QUIT = "q"; + + public void start(BundleContext b){ + this.b = b; + this.c = new LocalCIShellContext(b); + + startCommandLine(); + } + + + + public void stop(BundleContext b){ + System.out.println("Goodbye!"); + + b = null; + c = null; + configFile = null; + ct = null; + } + + public void startCommandLine(){ + Scanner in = new Scanner(System.in); + while(true) { + System.out.println("Welcome to NWB's Converter Tester"); + System.out.println( "Please enter the name of a configuration " + + "file or\n a directory of configuration files (" + QUIT + + ") to quit): "); + + String s = in.nextLine(); + if(s.trim().equalsIgnoreCase(QUIT)) + break; + try{ + configFile = new File(s); + processConfigurationFile(configFile); + } + catch (NullPointerException ex){ + System.out.println("Invalid file name");; + } + catch(FileNotFoundException fnfe){ + System.out.println("Could not find the specified " + + "configuration file"); + } + } + } + + private void processConfigurationFile(File f) + throws FileNotFoundException { + System.out.println("Processing " + f.getName()); + if(!f.isHidden() && (f.getName().charAt(0) != '.')){ + if(f.isDirectory()){ + File[] files = f.listFiles(); + for (int ii = 0; ii < files.length; ii++) { + File ff = files[ii]; + processConfigurationFile(ff); + } + } + else{ + try{ + ct = new ConverterTester(b, c, f); + System.out.println(ct); + ct.testFiles(); + ct.printResults(); + }catch(Exception ex){ + System.out.println("Failed to create " + + "ConverterTester\n\n"); + ex.printStackTrace(); + } + } + } + } +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 18:17:31
|
Revision: 435 http://cishell.svn.sourceforge.net/cishell/?rev=435&view=rev Author: mwlinnem Date: 2007-07-25 11:17:29 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Initial import. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.commandline/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 18:16:52
|
Revision: 434 http://cishell.svn.sourceforge.net/cishell/?rev=434&view=rev Author: mwlinnem Date: 2007-07-25 11:16:50 -0700 (Wed, 25 Jul 2007) Log Message: ----------- removed build warning. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/build.properties Modified: trunk/testing/org.cishell.testing.convertertester.core.new/build.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/build.properties 2007-07-25 18:12:17 UTC (rev 433) +++ trunk/testing/org.cishell.testing.convertertester.core.new/build.properties 2007-07-25 18:16:50 UTC (rev 434) @@ -1,5 +1,4 @@ source.. = src/ output.. = build/ bin.includes = META-INF/,\ - .,\ - OSGI-INF/ + . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 18:12:27
|
Revision: 433 http://cishell.svn.sourceforge.net/cishell/?rev=433&view=rev Author: mwlinnem Date: 2007-07-25 11:12:17 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Removed unnecessary OSGI-INF stuff. Extracted the commandline stuff out into commandline bundle. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF Removed Paths: ------------- trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/Activator.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF 2007-07-24 19:40:33 UTC (rev 432) +++ trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF 2007-07-25 18:12:17 UTC (rev 433) @@ -14,6 +14,5 @@ org.osgi.service.log;version="1.3.0", org.osgi.service.metatype;version="1.1.0", org.osgi.service.prefs;version="1.1.0" -Bundle-Activator: org.cishell.testing.convertertester.core.service.Activator Require-Bundle: org.prefuse.lib Export-Package: org.cishell.testing.convertertester.core.tester Deleted: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/Activator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/Activator.java 2007-07-24 19:40:33 UTC (rev 432) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/Activator.java 2007-07-25 18:12:17 UTC (rev 433) @@ -1,83 +0,0 @@ -package org.cishell.testing.convertertester.core.service; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.Scanner; - -import org.cishell.framework.CIShellContext; -import org.cishell.framework.LocalCIShellContext; -import org.cishell.testing.convertertester.core.tester.ConverterTester; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - - -public class Activator implements BundleActivator{ - private ConverterTester ct; - private BundleContext b; - private CIShellContext c; - private File configFile; - - public void start(BundleContext b){ - this.b = b; - this.c = new LocalCIShellContext(b); - startUp(); - } - - - - public void stop(BundleContext b){ - System.out.println("Goodbye!"); - b = null; - c = null; - configFile = null; - ct = null; - } - - private void processConfigurationFile(File f) throws FileNotFoundException { - System.out.println("Processing " + f.getName()); - if(!f.isHidden() && (f.getName().charAt(0) != '.')){ - if(f.isDirectory()){ - File[] files = f.listFiles(); - for (int ii = 0; ii < files.length; ii++) { - File ff = files[ii]; - processConfigurationFile(ff); - } - } - else{ - try{ - ct = new ConverterTester(b, c, f); - System.out.println(ct); - ct.testFiles(); - ct.printResults(); - }catch(Exception ex){ - System.out.println("Failed to create ConverterTester\n\n"); - ex.printStackTrace(); - } - } - } - } - - public void startUp(){ - Scanner in = new Scanner(System.in); - for(;;){ - System.out.println("Welcome to NWB's Converter Tester\n"+ - "Please enter the name of a configuration file \n"+ - "or a directory of configuration files (Q/q to quit): "); - String s = in.nextLine(); - if(s.trim().equalsIgnoreCase("Q")) - break; - try{ - configFile = new File(s); - processConfigurationFile(configFile); - } - catch (NullPointerException ex){ - System.out.println("Invalid file name");; - } - catch(FileNotFoundException fnfe){ - System.out.println("Could not find the specified configuration file"); - } - } - } - -} - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-24 19:40:36
|
Revision: 432 http://svn.sourceforge.net/cishell/?rev=432&view=rev Author: mwlinnem Date: 2007-07-24 12:40:33 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Initial import. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/ trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/component.xml trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/l10n/ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/l10n/bundle_en.properties trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/metatype/ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/metatype/METADATA.XML trunk/testing/org.cishell.testing.convertertester.algorithm/build.properties trunk/testing/org.cishell.testing.convertertester.algorithm/src/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java Added: trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,27 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ConverterTester Algorithm +Bundle-SymbolicName: org.cishell.testing.convertertester.algorithm +Bundle-Version: 0.0.1 +Bundle-ClassPath: . +Bundle-Localization: plugin +Import-Package: org.cishell.app.service.datamanager, + org.cishell.framework, + org.cishell.framework.algorithm, + org.cishell.framework.data, + org.cishell.reference.gui.common, + org.cishell.reference.service.metatype, + org.cishell.service.conversion, + org.cishell.service.guibuilder, + org.osgi.framework;version="1.3.0", + org.osgi.service.component;version="1.0.0", + org.osgi.service.log;version="1.3.0", + org.osgi.service.metatype;version="1.1.0", + org.osgi.service.prefs;version="1.1.0" +X-AutoStart: true +Service-Component: OSGI-INF/component.xml +Require-Bundle: org.eclipse.swt, + org.eclipse.ui, + edu.uci.ics.jung, + org.prefuse.lib, + org.cishell.testing.convertertester.core.new Added: trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,7 @@ +menu_path=File/Test/additions +label=Converter Tester Algorithm +description=Tests Converters +in_data=null +out_data=null +service.pid=org.cishell.testing.convertertester.algorithm.ConverterTesterAlgorithm +remoteable=false Added: trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/component.xml =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/component.xml (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/component.xml 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component name="org.cishell.testing.convertertester.algorithm.ConverterTesterAlgorithm.component" immediate="false"> + <implementation class="org.cishell.testing.convertertester.algorithm.ConverterTesterAlgorithmFactory"/> + <properties entry="OSGI-INF/algorithm.properties"/> + <reference name="LOG" interface="org.osgi.service.log.LogService"/> + <reference name="MTS" interface="org.osgi.service.metatype.MetaTypeService"/> + + <service> + <provide interface= + "org.cishell.framework.algorithm.AlgorithmFactory"/> + </service> +</component> \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/l10n/bundle_en.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/l10n/bundle_en.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/l10n/bundle_en.properties 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,7 @@ +#Localization variables for OSGI-INF/metatatype/METADATA.XML +# +#Samples: +#input=Input +#desc=Enter an integer (that will be converted to a string) +#name=Input->String +#name_desc=Converts inputted integer to string Added: trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/metatype/METADATA.XML =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/metatype/METADATA.XML (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/metatype/METADATA.XML 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> + <OCD name="Converter Tester Algorithm" id="org.cishell.testing.convertertester.algorithm.ConverterTesterAlgorithm.OCD"> + <AD name="Number of nodes" description="Enter number of nodes in the network, must be > 0" id="networkSize" type="Integer" default="2" min="1"/> + </OCD> + <Designate pid="org.cishell.testing.convertertester.algorithm.ConverterTesterAlgorithm"> + <Object ocdref="org.cishell.testing.convertertester.algorithm.ConverterTesterAlgorithm.OCD" /> + </Designate> +</metatype:MetaData> + Added: trunk/testing/org.cishell.testing.convertertester.algorithm/build.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/build.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/build.properties 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,5 @@ +source.. = src/ +output.. = build/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/ Added: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,123 @@ +package org.cishell.testing.convertertester.algorithm; + +import java.io.File; +import java.util.ArrayList; +import java.util.Dictionary; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.data.Data; +import org.cishell.testing.convertertester.core.tester.ConverterTester; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.BundleContext; + +//TODO: OMG Fix this whole thing as soon as possible. + +public class ConverterTesterAlgorithm implements Algorithm { + private static File currentDir; + + Data[] data; + Dictionary parameters; + CIShellContext context; + ConverterTester tester; + + public ConverterTesterAlgorithm(Data[] data, Dictionary parameters, + CIShellContext csContext, BundleContext bContext ) { + this.data = data; + this.parameters = parameters; + this.context = csContext; + + this.tester = new ConverterTester(bContext, csContext); +// ServiceReference ctReference = bContext.getServiceReference(ConverterTester.class.getName()); +// this.tester = (ConverterTester) bContext.getService(ctReference); + } + + public Data[] execute() { + +// int counter = PlatformUI.getWorkbench().getWorkbenchWindowCount(); +// System.out.println("counter is "+counter); +// ?? why getActiveWorkbenchWindow() didn't work?? + Data[] returnDM; + + final IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + if (windows.length ==0){ + return null; + } + + Display display = PlatformUI.getWorkbench().getDisplay(); + DataUpdater dataUpdater = new DataUpdater (windows[0]); + + if (Thread.currentThread() != display.getThread()) { + display.syncExec(dataUpdater); + } else { + dataUpdater.run(); + } + + if (!dataUpdater.returnList.isEmpty()){ + int size = dataUpdater.returnList.size(); + returnDM = new Data[size]; + for(int index=0; index<size; index++){ + returnDM[index]=(Data)dataUpdater.returnList.get(index); + } + return returnDM; + } + else { + return null; + } + + } + + public static String getFileExtension(File theFile) { + String fileName = theFile.getName() ; + String extension ; + if (fileName.lastIndexOf(".") != -1) + extension = fileName.substring(fileName.lastIndexOf(".")+1) ; + else + extension = "" ; + return extension ; + } + + final class DataUpdater implements Runnable{ + boolean loadFileSuccess = false; + IWorkbenchWindow window; + ArrayList returnList = new ArrayList(); + + DataUpdater (IWorkbenchWindow window){ + this.window = window; + } + + public void run (){ + + FileDialog dialog = new FileDialog(window.getShell(), SWT.OPEN); + if (currentDir == null) { + currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata"); + + if (!currentDir.exists()) { + currentDir = new File(System.getProperty("user.home") + File.separator + "anything"); + } else { + currentDir = new File(System.getProperty("user.dir") + File.separator + "sampledata" + File.separator + "anything"); + } + } + dialog.setFilterPath(currentDir.getPath()); + dialog.setText("Select a File"); + String fileName = dialog.open(); + if (fileName == null) { + return; + } + + File file = new File(fileName); + + try { + tester.runTests(file); + } catch (Exception e) { + System.out.println("Why oh why am I catching type Exception?"); + System.out.println(e); + } + } + } + +} \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-07-24 19:40:33 UTC (rev 432) @@ -0,0 +1,37 @@ +package org.cishell.testing.convertertester.algorithm; + +import java.util.Dictionary; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.data.Data; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.metatype.MetaTypeProvider; +import org.osgi.service.metatype.MetaTypeService; + + +public class ConverterTesterAlgorithmFactory implements AlgorithmFactory { + private MetaTypeProvider provider; + private BundleContext bContext; + + protected void activate(ComponentContext ctxt) { + //You may delete all references to metatype service if + //your algorithm does not require parameters and return + //null in the createParameters() method + MetaTypeService mts = (MetaTypeService)ctxt.locateService("MTS"); + this.bContext = ctxt.getBundleContext(); + provider = mts.getMetaTypeInformation(this.bContext.getBundle()); + } + protected void deactivate(ComponentContext ctxt) { + provider = null; + } + + public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { + return new ConverterTesterAlgorithm(data, parameters, context, bContext); + } + public MetaTypeProvider createParameters(Data[] data) { + return provider; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-24 19:40:19
|
Revision: 431 http://svn.sourceforge.net/cishell/?rev=431&view=rev Author: mwlinnem Date: 2007-07-24 12:40:14 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Initial import. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.algorithm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-24 19:39:12
|
Revision: 430 http://svn.sourceforge.net/cishell/?rev=430&view=rev Author: mwlinnem Date: 2007-07-24 12:39:05 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Was in wrong directory. Removed Paths: ------------- trunk/testing/META-INF/ trunk/testing/OSGI-INF/ trunk/testing/build.properties trunk/testing/src/ Deleted: trunk/testing/build.properties =================================================================== --- trunk/testing/build.properties 2007-07-24 19:25:33 UTC (rev 429) +++ trunk/testing/build.properties 2007-07-24 19:39:05 UTC (rev 430) @@ -1,5 +0,0 @@ -source.. = src/ -output.. = build/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |