[CIShell-SVN] SF.net SVN: cishell: [429]
trunk/testing/org.cishell.testing. convertertester.core.new
From: <mwl...@us...> - 2007-07-24 19:25:38
|
Revision: 429 http://svn.sourceforge.net/cishell/?rev=429&view=rev Author: mwlinnem Date: 2007-07-24 12:25:33 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Initial import. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/ trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/algorithm.properties trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/component.xml trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/l10n/ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/l10n/bundle_en.properties trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/metatype/ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/metatype/METADATA.XML trunk/testing/org.cishell.testing.convertertester.core.new/build.properties trunk/testing/org.cishell.testing.convertertester.core.new/src/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ 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/ConverterTesterImpl.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/ 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/ConfigurationFileParser.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLToPrefuseTographML trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLTonetTographML trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoNWBtographML.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoPrefuseGraphtoGraphML.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtographMLTest.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonet.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonwbTonet.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonetTonwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonwbTest.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtoprefuseTreetotreeML.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtotreeML.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmlToxgmml.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmltoPrefuseAlphatoxgmml.cfg trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Edge Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Edge Files/1.edge trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Edge Files/2.edge trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Edge Files/3.edge trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Full Converter.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/directedness1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/directedness2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgeattributes1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgeattributes2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgecount1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgecount2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgefrequency1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgefrequency2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgefrequency3.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/edgefrequency4.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/neighbor1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/neighbor2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/neighbor3.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/neighbor4.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/neighbor5.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/neighbor6.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/nodeattributes1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/nodeattributes2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/nodeattributes3.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/nodeattributes4.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/nodecount1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/nodecount2.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/GraphML Files/terror1.graphml.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile1.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile2.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile3.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile3nocomment.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile4.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile5.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile6.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile7.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile8.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NET Files/TestFile9.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile1.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile2.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile3.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile4.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile5.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile6.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile7.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile8.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/TestFile9.net trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/NWB Files/fittestperGeneration1179169554713.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TestFile8.net.1.nwb trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TestFile8.net.1.nwb.1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TestFile8.net.1.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TreeML Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TreeML Files/mwlinnem_dir_tree.treeml.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TreeML Files/nwb_dir_tree.treeml.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TreeML Files/treeml_sample.treeml.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/XGMML Files/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/XGMML Files/friendster.xgmml.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/XGMML Files/terror.xgmml.xml trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/fullconverterGraph.png trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/ConfigurationFileConstants.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/ConverterTester.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/ComparisonResult.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/DefaultGraphComparer.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/GraphComparer.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/GraphComparerTester.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/GraphUtil.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester/graphcomparison/RunningLog.java Added: trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Converter Tester Core +Bundle-SymbolicName: org.cishell.testing.convertertester.core.new +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.core.service.Activator +Require-Bundle: org.prefuse.lib +Export-Package: org.cishell.testing.convertertester.core.tester Added: trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/algorithm.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/algorithm.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/algorithm.properties 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,7 @@ +#menu_path=Visualization/SubMenu/additions +label=My Algorithm +description=This algorithm does this and this... +in_data=file:mime/type or java.lang.ClassName or null +out_data=file:mime/type or java.lang.ClassName or null +service.pid=org.my.algorithm.MyAlgorithm +remoteable=false Added: trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/component.xml =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/component.xml (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/component.xml 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component name="org.my.algorithm.MyAlgorithm.component" immediate="false"> + <implementation class="org.my.algorithm.MyAlgorithmFactory"/> + <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.core.new/OSGI-INF/l10n/bundle_en.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/l10n/bundle_en.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/l10n/bundle_en.properties 2007-07-24 19:25:33 UTC (rev 429) @@ -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.core.new/OSGI-INF/metatype/METADATA.XML =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/metatype/METADATA.XML (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/OSGI-INF/metatype/METADATA.XML 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> + <OCD name="My Algorithm" id="org.my.algorithm.MyAlgorithm.OCD" + description="This algorithm does this and this... "> + </OCD> + <Designate pid="org.my.algorithm.MyAlgorithm"> + <Object ocdref="org.my.algorithm.MyAlgorithm.OCD" /> + </Designate> +</metatype:MetaData> Added: trunk/testing/org.cishell.testing.convertertester.core.new/build.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/build.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/build.properties 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,5 @@ +source.. = src/ +output.. = build/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/ Added: 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 (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterLoaderImpl.java 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,228 @@ +package org.cishell.testing.convertertester.core.converter; + +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Map; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.algorithm.AlgorithmProperty; +import org.cishell.service.conversion.Converter; +import org.cishell.service.conversion.DataConversionService; +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.framework.ServiceReference; + + + +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); + + try { + this.bContext.addServiceListener(this, filter); + } catch (InvalidSyntaxException e) { + e.printStackTrace(); + } + assembleGraph(); + } + + 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); + + 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) { + throw new RuntimeException(e); + } + } + + + /* 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); + } + else if(event.getType() == ServiceEvent.REGISTERED) { + this.converterList.put(inServiceRef.getProperty("service.pid").toString(), inServiceRef); + } + else if(event.getType() == ServiceEvent.UNREGISTERING) { + System.out.println("Unregistering service: " + inServiceRef); + this.converterList.remove(inServiceRef.getProperty("service.pid").toString()); + + } + } + +/* 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 + return null; + } + + public Converter[] findConverters(String inFormat, String outFormat) { + // TODO Auto-generated method stub + return null; + } + + + + public Converter getConverter(String[] converterChain) throws Exception{ + ArrayList services = new ArrayList(); + for(int ii = 0; ii < converterChain.length; ii++){ + String s = converterChain[ii]; + ServiceReference ref = (ServiceReference) this.converterList.get(s); + if(ref == null){ + throw new Exception("Converter: " + s + " cannot be found"); + } + services.add(ref); + } + return new ConverterTesterImpl(this.bContext, this.ciContext, (ServiceReference[])services.toArray(new ServiceReference[0])); + } + + private static void printConverters(BundleContext bContext){ + String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+"))"; + try{ + + ServiceReference[] refs = bContext.getAllServiceReferences(AlgorithmFactory.class.getName(), filter); + for(int ii = 0; ii < refs.length; ii++){ + ServiceReference ref = refs[ii]; + System.out.println("\t"+ref.getProperty("service.pid")); + } + + } + catch(Exception ex){ + System.err.println(ex); + } + + } + + public org.cishell.framework.data.Data convert(org.cishell.framework.data.Data data, String outFormat) { + // TODO Auto-generated method stub + return null; + } + + public Converter[] findConverters(org.cishell.framework.data.Data data, String outFormat) { + // TODO Auto-generated method stub + return null; + } + +} Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterTesterImpl.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterTesterImpl.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/ConverterTesterImpl.java 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,169 @@ +package org.cishell.testing.convertertester.core.converter; + +import java.util.Dictionary; +import java.util.Enumeration; +import java.util.Hashtable; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.algorithm.AlgorithmProperty; +import org.cishell.framework.data.BasicData; +import org.cishell.framework.data.Data; +import org.cishell.service.conversion.Converter; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.ServiceReference; +import org.osgi.service.metatype.MetaTypeProvider; + + + +public class ConverterTesterImpl implements Converter, AlgorithmFactory, AlgorithmProperty{ + private ServiceReference[] refs; + private BundleContext bContext; + private Dictionary props; + private CIShellContext cContext; + + public ConverterTesterImpl(BundleContext bContext, CIShellContext cContext, ServiceReference[] refs) { + this.bContext = bContext; + this.cContext = cContext; + this.refs = refs; + + props = new Hashtable(); + + props.put(IN_DATA, refs[0].getProperty(IN_DATA)); + props.put(OUT_DATA, refs[refs.length-1].getProperty(OUT_DATA)); + props.put(LABEL, props.get(IN_DATA) + " -> " + props.get(OUT_DATA)); + + String lossiness = LOSSLESS; + for (int i=0; i < refs.length; i++) { + if (LOSSY.equals(refs[i].getProperty(CONVERSION))) { + lossiness = LOSSY; + } + } + //TODO: Do the same thing for complexity + props.put(CONVERSION, lossiness); + } + + public Data convert(Data inDM) { + Data[] dm = new Data[]{inDM}; + + AlgorithmFactory factory = getAlgorithmFactory(); + Algorithm alg = factory.createAlgorithm(dm, new Hashtable(), cContext); + + dm = alg.execute(); + + Object outData = null; + if (dm != null && dm.length > 0) { + outData = dm[0].getData(); + } + + if (outData != null) { + Dictionary props = inDM.getMetaData(); + Dictionary newProps = new Hashtable(); + + for (Enumeration e=props.keys(); e.hasMoreElements();) { + Object key = e.nextElement(); + newProps.put(key, props.get(key)); + } + + String outFormat = (String)getProperties().get(AlgorithmProperty.OUT_DATA); + return new BasicData(newProps, outData, outFormat); + } else { + return null; + } + } + + public AlgorithmFactory getAlgorithmFactory() { + // TODO Auto-generated method stub + return this; + } + + public ServiceReference[] getConverterChain() { + // TODO Auto-generated method stub + return this.refs; + } + + public Dictionary getProperties() { + // TODO Auto-generated method stub + return this.props; + } + + public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { + // TODO Auto-generated method stub + return new ConverterAlgorithm(data,parameters,context); + } + + public MetaTypeProvider createParameters(Data[] data) { + // TODO Auto-generated method stub + return null; + } + + private class ConverterAlgorithm implements Algorithm { + Data[] inDM; + CIShellContext context; + Dictionary parameters; + + public ConverterAlgorithm(Data[] dm, Dictionary parameters, CIShellContext context) { + this.inDM = dm; + this.parameters = parameters; + this.context = context; + } + + public Data[] execute() { + Data[] dm = inDM; + for (int i=0; i < refs.length; i++) { + AlgorithmFactory factory = (AlgorithmFactory)bContext.getService(refs[i]); + + if (factory != null) { + Algorithm alg = factory.createAlgorithm(dm, parameters, context); + System.out.println("Entering: " + refs[i].getProperty(Constants.SERVICE_PID)+ "-->"); + dm = alg.execute(); + if(dm == null){ + throw new RuntimeException("Error after " + refs[i].getProperty(Constants.SERVICE_PID)); + + } + } else { + throw new RuntimeException("Missing subconverter: " + + refs[i].getProperty(Constants.SERVICE_PID)); + } + } + + return dm; + } + } + + public int hashCode() { + return toString().hashCode(); + } + + public String toString() { + String str =""; + ServiceReference[] refs = this.refs; + for (int ii = 0; ii < refs.length; ii++) { + ServiceReference ref = refs[ii]; + str += ref.getProperty(Constants.SERVICE_ID) + " " + ref.getProperty(Constants.SERVICE_PID) + "-> "; + } + return str; + } + + public boolean equals(Object o) { + boolean equals = false; + if (o instanceof Converter) { + ServiceReference[] otherServiceReference = ((Converter)o).getConverterChain(); + if (refs.length == otherServiceReference.length) { + for (int i = 0; i < otherServiceReference.length; i++) { + if (refs[i].getProperty(Constants.SERVICE_ID).equals( + otherServiceReference[i].getProperty(Constants.SERVICE_ID))) { + equals = true; + } else { + equals = false; + break; + } + } + } + } + return equals; + } + +} Added: 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 (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/Activator.java 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,83 @@ +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"); + } + } + } + +} + Added: 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 (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/service/ConfigurationFileParser.java 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,249 @@ + +package org.cishell.testing.convertertester.core.service; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Queue; + +import org.cishell.testing.convertertester.core.tester.ConfigurationFileConstants; + + +public class ConfigurationFileParser { + //files + private Queue comparisonFiles; + //strings + private Queue comparisonConverters; + //strings + private Queue testConverters; + private boolean nodeIDChange = true; + private String extension; + private String configFile; + + + private boolean processFileList = false; + private boolean processComparisonConvertersList = false; + private boolean processTestConvertersList = false; + + + public ConfigurationFileParser(){ + //strings + comparisonConverters = new LinkedList(); + //strings + testConverters = new LinkedList(); + //files + comparisonFiles = new LinkedList(); + nodeIDChange = true; + } + + public ConfigurationFileParser(File f) throws Exception{ + //strings + comparisonConverters = new LinkedList(); + //strings + testConverters = new LinkedList(); + //files + comparisonFiles = new LinkedList(); + nodeIDChange = true; + + this.parseFile(f); + } + + public void parseFile(File f){ + configFile = f.getName(); + int lineNum = 0; + String line = null; + BufferedReader reader; + 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; + this.processTestConvertersList = false; + } + if(line.startsWith(ConfigurationFileConstants.EXTENSION)){ + line = line.replace(ConfigurationFileConstants.EXTENSION, ""); + //System.out.println(line ); + this.extension = line; + this.processFileList = false; + this.processComparisonConvertersList = false; + this.processTestConvertersList = false; + } + if(this.processFileList){ + this.processFiles(this.processLine(line)); + } + if(this.processComparisonConvertersList){ + this.processComparisonConverters(this.processLine(line)); + } + if(this.processTestConvertersList){ + this.processTestConverters(this.processLine(line)); + } + } + lineNum++; + //System.out.println("Next line"); + } + } + catch(FileNotFoundException fnfe){ + System.out.println(fnfe); + } + catch(IOException iex){ + System.out.println(iex); + } + //System.out.println("Finished parsing"); + } + + private String[] processLine(String s){ + String[] line = s.split(","); + for(int ii = 0; ii < line.length; ii++){ + String ss = (String) line[ii]; + line[ii] = ss.trim(); + } + return line; + } + + private void processFiles(String[] strings) throws FileNotFoundException{ + + for(int ii = 0; ii < strings.length; ii++) { + String s = strings[ii]; + if (! (s == null || s.length() == 0)) { + + if (s.charAt(0) != File.separatorChar) { + + /* + * relative paths are assumed to be relative to ther home + * directory + */ + s = System.getProperty("user.home") + File.separator + s; + } + File f = new File(s); + this.comparisonFiles.add(f); + } + } + } + + private void processTestConverters(String[] strings){ + for(int ii = 0; ii < strings.length; ii++) { + String s = strings[ii]; + this.testConverters.add(s); + } + } + + private void processComparisonConverters(String[] strings){ + for(int ii = 0; ii < strings.length; ii++) { + String s = strings[ii]; + this.comparisonConverters.add(s); + } + } + + public File[] getFiles(){ + File[] files = new File[this.comparisonFiles.size()]; + files = (File[]) this.comparisonFiles.toArray(files); + return files; + } + + public String[] getComparisonConverters(){ + return (String[]) this.comparisonConverters.toArray(new String[0]); + } + + public String[] getTestConverters(){ + return (String []) this.testConverters.toArray(new String[0]); + } + + public boolean getNodeIDChange(){ + return this.nodeIDChange; + } + + public static String asString(File f, String s){ + String output = s; + if(!f.isHidden()){ + if(f.isDirectory()){ + output += "Directory: "; + output += f.getName()+ "\n"; + File[] files = f.listFiles(); + for (int ii = 0; ii < files.length; ii++){ + File ff = files[ii]; + output += asString(ff, s); + } + } + else{ + output += "\t" + f.getName() + "\n"; + } + } + return output; + } + + public String toString(){ + String output = ""; + output += "Files to test:\n"; + Iterator iter0 = this.comparisonFiles.iterator(); + while (iter0.hasNext()){ + File f = (File) iter0.next(); + output += asString(f,""); + } + + output += "\nConverters to test:\n"; + Iterator iter1 = this.testConverters.iterator(); + while (iter1.hasNext()){ + String s = (String) iter1.next(); + output += s + "\n"; + } + + output += "\nConverters used to Compare files:\n"; + + Iterator ii2 = this.comparisonConverters.iterator(); + while (ii2.hasNext()){ + String s = (String) ii2.next(); + output += s +"\n"; + } + + output += "\nNode IDs are expected to change: " + this.nodeIDChange + "\n"; + + return output; + } + + public String getExtension(){ + return this.extension; + } + + public String getConfigFile(){ + return this.configFile; + } + +} + + Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLToPrefuseTographML =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLToPrefuseTographML (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLToPrefuseTographML 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,9 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/GraphML Files +test_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader, +edu.iu.nwb.converter.prefusegraphml.writer.PrefuseGraphMLWriter, +edu.iu.nwb.converter.prefusegraphml.writer.PrefuseGraphMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLTonetTographML =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLTonetTographML (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLTonetTographML 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,11 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/GraphML Files +test_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.nwbgraphml.GraphMLToNWBbyStax, +edu.iu.nwb.converter.nwbpajeknet.NWBToPajeknet, +edu.iu.nwb.converter.nwbpajeknet.PajeknetToNWB, +edu.iu.nwb.converter.nwbgraphml.NWBToGraphML, +edu.iu.nwb.converter.prefusegraphml.writer.PrefuseGraphMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoNWBtographML.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoNWBtographML.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoNWBtographML.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,9 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/GraphML Files +test_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.nwbgraphml.GraphMLToNWBbyStax, +edu.iu.nwb.converter.nwbgraphml.NWBToGraphML, +edu.iu.nwb.converter.prefusegraphml.writer.PrefuseGraphMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoPrefuseGraphtoGraphML.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoPrefuseGraphtoGraphML.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtoPrefuseGraphtoGraphML.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,9 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/GraphML Files +test_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.junggraphml.writer.JungGraphMLWriter +edu.iu.nwb.converter.junggraphml.reader.JungGraphMLReader +edu.iu.nwb.converter.prefusegraphml.writer.PrefuseGraphMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtographMLTest.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtographMLTest.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/graphMLtographMLTest.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,7 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/GraphML Files +test_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.writer.PrefuseGraphMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLValidationAlg, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.xml Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonet.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonet.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonet.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,11 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/NET Files +test_converters=edu.iu.nwb.converter.pajeknet.reader.NETValidation, +edu.iu.nwb.converter.pajeknet.writer.NETFileHandler +comparison_converters=edu.iu.nwb.converter.pajeknet.reader.NETValidation, +edu.iu.nwb.converter.nwbpajeknet.PajeknetToNWB, +edu.iu.nwb.converter.nwbgraphml.NWBToGraphML, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader + +nodeid_change=false + +extension=.net \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonwbTonet.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonwbTonet.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/netTonwbTonet.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,12 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/NET Files +test_converters=edu.iu.nwb.converter.pajeknet.reader.NETValidation, +edu.iu.nwb.converter.nwbpajeknet.PajeknetToNWB, +edu.iu.nwb.converter.nwbpajeknet.NWBToPajeknet, +edu.iu.nwb.converter.pajeknet.writer.NETFileHandler +comparison_converters=edu.iu.nwb.converter.pajeknet.reader.NETValidation, +edu.iu.nwb.converter.nwbpajeknet.PajeknetToNWB,edu.iu.nwb.converter.nwbgraphml.NWBToGraphML, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader + +nodeid_change=false + +extension=.net \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonetTonwb =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonetTonwb (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonetTonwb 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,10 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/NWB Files +test_converters=edu.iu.nwb.converter.nwb.reader.NWBValidation, +edu.iu.nwb.converter.nwbpajeknet.NWBToPajeknet, +edu.iu.nwb.converter.nwbpajeknet.PajeknetToNWB, +edu.iu.nwb.converter.nwb.writer.NWBFileHandler +comparison_converters=edu.iu.nwb.converter.nwb.reader.NWBValidation, +edu.iu.nwb.converter.nwbgraphml.NWBToGraphML, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.nwb \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonwbTest.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonwbTest.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/nwbTonwbTest.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,8 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/NWB Files +test_converters=edu.iu.nwb.converter.nwb.reader.NWBValidation, +edu.iu.nwb.converter.nwb.writer.NWBFileHandler +comparison_converters=edu.iu.nwb.converter.nwb.reader.NWBValidation, +edu.iu.nwb.converter.nwbgraphml.NWBToGraphML, +edu.iu.nwb.converter.prefusegraphml.reader.PrefuseGraphMLReader +nodeid_change=false +extension=.nwb \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtoprefuseTreetotreeML.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtoprefuseTreetotreeML.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtoprefuseTreetotreeML.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,10 @@ +test_graphs=workspace/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/TreeML Files +test_converters=edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLValidationAlg, +edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLReader, +edu.iu.nwb.converter.prefusetreeml.writer.PrefuseTreeMLWriter, +edu.iu.nwb.converter.prefusetreeml.writer.PrefuseTreeMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLValidationAlg, +edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLReader, +edu.iu.nwb.converter.treegraph.ConverterAlgorithm +nodeid_change=false +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtotreeML.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtotreeML.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/treeMLtotreeML.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,8 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/TreeML Files +test_converters=edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLValidationAlg, +edu.iu.nwb.converter.prefusetreeml.writer.PrefuseTreeMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLValidationAlg, +edu.iu.nwb.converter.prefusetreeml.reader.PrefuseTreeMLReader, +edu.iu.nwb.converter.treegraph.ConverterAlgorithm +nodeid_change=false +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmlToxgmml.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmlToxgmml.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmlToxgmml.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,9 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/XGMML Files +test_converters=edu.iu.nwb.converter.prefusexgmml.reader.PrefuseXGMMLValidationAlg, +edu.iu.nwb.converter.prefusexgmml.writer.PrefuseXGMMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusexgmml.reader.PrefuseXGMMLValidationAlg, +edu.iu.nwb.converter.prefusexgmml.reader.PrefuseXGMMLReader, +edu.iu.nwb.converter.jungprefuse.PrefuseJungConverterAlgorithm, +edu.iu.nwb.converter.jungprefuse.JungPrefuseBetaConverterAlgorithm +nodeid_change=true +extension=.xml \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmltoPrefuseAlphatoxgmml.cfg =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmltoPrefuseAlphatoxgmml.cfg (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/test_files/Configuration Files/xgmmltoPrefuseAlphatoxgmml.cfg 2007-07-24 19:25:33 UTC (rev 429) @@ -0,0 +1,9 @@ +test_graphs=workspace/edu.iu.nwb.converter.tester/test_files/XGMML Files +test_converters=edu.iu.nwb.converter.prefusexgmml.reader.PrefuseXGMMLValidationAlg, +edu.iu.nwb.converter.prefusexgmml.writer.PrefuseXGMMLFileHandlerAlg +comparison_converters=edu.iu.nwb.converter.prefusexgmml.reader.PrefuseXGMMLValidationAlg, +edu.iu.nwb.converter.prefusexgmml.reader.PrefuseXGMMLReader, +edu.iu.nwb.converter.jungprefuse.PrefuseJungConverterAlgorithm, +edu.iu.nwb.converter.jungprefuse.JungPrefuseBetaConverterAlgorithm +nodeid_change=false +e... [truncated message content] |
[CIShell-SVN] SF.net SVN: cishell: [433]
trunk/testing/org.cishell.testing. convertertester.core.new
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. |
[CIShell-SVN] SF.net SVN: cishell: [437]
trunk/testing/org.cishell.testing. convertertester.core.new
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. |
[CIShell-SVN] SF.net SVN: cishell: [626]
trunk/testing/org.cishell.testing. convertertester.core.new
From: <mwl...@us...> - 2008-02-16 01:20:01
|
Revision: 626 http://cishell.svn.sourceforge.net/cishell/?rev=626&view=rev Author: mwlinnem Date: 2008-02-15 17:19:53 -0800 (Fri, 15 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/FilePassResult.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassFailure.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassSuccess.java Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/ConvertedDataSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvertedDataReport.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 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF 2008-02-16 01:19:53 UTC (rev 626) @@ -4,7 +4,6 @@ Bundle-SymbolicName: org.cishell.testing.convertertester.core.new Bundle-Version: 0.0.1 Bundle-ClassPath: . -Bundle-Localization: plugin Import-Package: org.cishell.framework, org.cishell.framework.algorithm, org.cishell.framework.data, Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2008-02-16 01:19:53 UTC (rev 626) @@ -117,8 +117,6 @@ CIShellContext cContext, BundleContext bContext) { - - Map fileFormatToTestConvs = convGraph.getTestMap(); Map fileFormatToCompareConvs = convGraph.getCompareMap(); @@ -156,6 +154,7 @@ if (filteredTestConvs != null && compareConv != null) { for (int kk = 0; kk < filteredTestConvs.length; kk++) { + System.out.println("Running converter path " + kk); numTestsSoFar++; ConverterPath testConv = filteredTestConvs[kk]; Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java 2008-02-16 01:19:53 UTC (rev 626) @@ -6,11 +6,14 @@ import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Dictionary; import java.util.Hashtable; import java.util.List; import org.cishell.framework.data.BasicData; import org.cishell.framework.data.Data; +import org.cishell.framework.data.DataProperty; import org.cishell.testing.convertertester.core.converter.graph.Converter; import org.cishell.testing.convertertester.core.converter.graph.ConverterPath; import org.cishell.testing.convertertester.core.tester.graphcomparison.ComparisonResult; @@ -40,7 +43,7 @@ ConverterPath testConverters = testData.getTestConverters(); ConverterPath comparisonConverters = testData .getComparisonConverters(); - + List testResults = new ArrayList(); for (int ii = 0; ii < testFileData.length; ii++) { @@ -49,40 +52,45 @@ // test conversion phase ConvertResult testPhaseResult = convert(originalFileData, - testConverters, testData); + testConverters, testData, null); if (!testPhaseResult.succeeded()) { FilePassFailure failure = createFailResult(originalFileData, PassPhase.TEST_CONV_PHASE, - testPhaseResult.getFailInfo()); + testPhaseResult.getFailInfo(), + testPhaseResult.getAllData()); testResults.add(failure); continue; } Data[] resultFileData = testPhaseResult.getResult(); + Data[][] allDataFromTestPhase = testPhaseResult.getAllData(); // comparison conversion (for original file) phase ConvertResult comparePhaseOrigResult = convert(originalFileData, - comparisonConverters, testData); + comparisonConverters, testData, allDataFromTestPhase); if (!comparePhaseOrigResult.succeeded()) { FilePassFailure failure = createFailResult(originalFileData, PassPhase.COMPARE_CONV_ORIG_PHASE, - comparePhaseOrigResult.getFailInfo()); + comparePhaseOrigResult.getFailInfo(), + comparePhaseOrigResult.getAllData()); testResults.add(failure); continue; } Data[] originalInMemory = comparePhaseOrigResult.getResult(); - + Data[][] allDataFromTestAndComparisonPhases = comparePhaseOrigResult.getAllData(); + //comparison conversion (for result file) phase ConvertResult comparePhaseResultResult = convert(resultFileData, - comparisonConverters, testData); + comparisonConverters, testData, allDataFromTestAndComparisonPhases); if (!comparePhaseResultResult.succeeded()) { FilePassFailure failure = createFailResult(originalFileData, PassPhase.COMPARE_CONV_RESULT_PHASE, - comparePhaseResultResult.getFailInfo()); + comparePhaseResultResult.getFailInfo(), + comparePhaseResultResult.getAllData()); testResults.add(failure); continue; } @@ -102,13 +110,14 @@ graphComparisonPhaseResult.getLog(); FilePassFailure failure = createFailResult(originalFileData, explanation, PassPhase.GRAPH_COMPARE_PHASE, - null); + null, + comparePhaseResultResult.getAllData()); testResults.add(failure); continue; } FilePassSuccess success = new FilePassSuccess(originalFileData, - ""); + "", comparePhaseResultResult.getAllData()); testResults.add(success); } @@ -118,10 +127,18 @@ } private ConvertResult convert(Data[] startData, - ConverterPath converters, TestConfigData testData) { + ConverterPath converters, TestConfigData testData, Data[][] previousData) { Data[] currentData = getFilePathData(startData); + List dataSoFar = new ArrayList(); + if (previousData != null) { + dataSoFar.addAll(Arrays.asList(previousData)); + } + + if (startData != null) { + dataSoFar.add(startData); + } /* * rig up fake CISHellContext so we can get ahold of * errors sent to logger. @@ -129,16 +146,24 @@ FakeLogCIShellContext fakeCContext = new FakeLogCIShellContext(testData.getContext()); + + + dataSoFar.add(currentData); + Converter currentConverter = null; try { for (int ii = 0; ii < converters.size(); ii++) { currentConverter = converters.get(ii); - //no parameters used Hashtable parameters = new Hashtable(); currentData = currentConverter.execute(currentData, parameters, fakeCContext); + + if (currentData != null) { + setMetaData(currentData, currentConverter); + dataSoFar.add(currentData); + } /* * There are two ways that converters generally fail. @@ -164,34 +189,34 @@ ConvFailureInfo failInfo = new ConvFailureInfo( explanation, converter); - ConvertResult result = new ConvertResult(failInfo); + ConvertResult result = new ConvertResult(failInfo, (Data[][]) dataSoFar.toArray(new Data[dataSoFar.size()][])); return result; } } } catch (Throwable t) { ConvFailureInfo failInfo = new ConvFailureInfo(getStackTrace(t), currentConverter); - ConvertResult result = new ConvertResult(failInfo); + ConvertResult result = new ConvertResult(failInfo,(Data[][]) dataSoFar.toArray(new Data[dataSoFar.size()][])); return result; } Data[] resultData = currentData; - ConvertResult result = new ConvertResult(resultData); + ConvertResult result = new ConvertResult(resultData,(Data[][]) dataSoFar.toArray(new Data[dataSoFar.size()][])); return result; } private FilePassFailure createFailResult(Data[] origData, String explanation, PassPhase lastReachedPhase, - Converter failedConverter) { + Converter failedConverter, Data[][] allData) { FilePassFailure failure = new FilePassFailure(origData, explanation, - lastReachedPhase, failedConverter); + lastReachedPhase, failedConverter, allData); return failure; } private FilePassFailure createFailResult(Data[] origData, - PassPhase lastReachedPhase, ConvFailureInfo failInfo) { + PassPhase lastReachedPhase, ConvFailureInfo failInfo, Data[][] allData) { return createFailResult(origData, failInfo.getExplanation(), - lastReachedPhase, failInfo.getFailedConverter()); + lastReachedPhase, failInfo.getFailedConverter(), allData); } private class ConvertResult { @@ -199,18 +224,20 @@ private boolean succeeded; private Data[] result; + + private Data[][] allData; private ConvFailureInfo failInfo; - public ConvertResult(Data[] result) { + public ConvertResult(Data[] result, Data[][] allData) { this.result = result; - + this.allData = allData; this.succeeded = true; } - public ConvertResult(ConvFailureInfo failInfo) { + public ConvertResult(ConvFailureInfo failInfo, Data[][] allData) { this.failInfo = failInfo; - + this.allData = allData; this.succeeded = false; } @@ -221,6 +248,10 @@ public Data[] getResult() { return result; } + + public Data[][] getAllData() { + return this.allData; + } public ConvFailureInfo getFailInfo() { return this.failInfo; @@ -271,4 +302,16 @@ return logText; } + + private void setMetaData(Data[] data, Converter converter) { + if (data == null || data.length < 1) { + return; + } + + Data datum = data[0]; + Dictionary md = datum.getMetaData(); + if (md.get(DataProperty.LABEL) == null) { + md.put(DataProperty.LABEL, "result of " + converter.getShortName()); + } + } } Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/ConvertedDataSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/ConvertedDataSubGenerator.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/ConvertedDataSubGenerator.java 2008-02-16 01:19:53 UTC (rev 626) @@ -0,0 +1,59 @@ +package org.cishell.testing.convertertester.core.tester2.reportgen.alltests; + +import java.io.File; +import java.io.PrintStream; + +import org.cishell.framework.data.Data; +import org.cishell.framework.data.DataProperty; +import org.cishell.testing.convertertester.core.tester2.reportgen.reports.ConvertedDataReport; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.TestResult; +import org.osgi.service.log.LogService; + +public class ConvertedDataSubGenerator { +private ConvertedDataReport convertedDataReport; + + private LogService log; + + public ConvertedDataSubGenerator(LogService log) { + this.log = log; + } + + public void generateSubreport(TestResult tr, FilePassResult fpr, Data[] convertedData) { + if (convertedData.length == 0) { + return; + } + + Data firstData = convertedData[0]; + Object fileData = firstData.getData(); + if (fileData != null && fileData instanceof File) { + this.convertedDataReport = new ConvertedDataReport((File) fileData,(String) firstData.getMetaData().get(DataProperty.LABEL) + "for " + fpr.getName()); + } else { + this.convertedDataReport = new ConvertedDataReport((String) firstData.getMetaData().get(DataProperty.LABEL) + " for " + fpr.getName() + " of " + tr.getName()); + } + } + + public ConvertedDataReport getReport() { + return this.convertedDataReport; + } + + public void writeReport(PrintStream report, FilePassResult fpr) { + + report.println(""); + report.println("File used : " + fpr.getOriginalFileLabel()); + + report.println(""); + if (! fpr.getExplanation().trim().equals("")) { + + if (fpr.failedWhileConverting()) { + report.println("Failed at " + fpr.getFailedConverter()); + } + + report.println("Explanation... \r\n" + fpr.getExplanation()); + } + + report.println(""); + + report.flush(); + } +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java 2008-02-16 01:19:53 UTC (rev 626) @@ -5,23 +5,28 @@ import java.io.IOException; import java.io.PrintStream; +import org.cishell.framework.data.Data; import org.cishell.testing.convertertester.core.tester2.reportgen.ReportGenerator; +import org.cishell.testing.convertertester.core.tester2.reportgen.reports.ConvertedDataReport; import org.cishell.testing.convertertester.core.tester2.reportgen.reports.FilePassReport; import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; -import org.cishell.testing.convertertester.core.tester2.reportgen.results.filepass.PassPhase; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.TestResult; import org.osgi.service.log.LogService; public class FilePassSubGenerator { private FilePassReport filePassReport; + private ConvertedDataSubGenerator convDataSubGenerator; + private LogService log; public FilePassSubGenerator(LogService log) { this.log = log; + this.convDataSubGenerator = new ConvertedDataSubGenerator(log); } - public void generateSubreport(FilePassResult fpr) { + public void generateSubreport(TestResult tr, FilePassResult fpr) { FileOutputStream reportOutStream = null; try { File reportFile = new File(ReportGenerator.TEMP_DIR + fpr.getName()); @@ -42,8 +47,20 @@ writeReport(report, fpr); - this.filePassReport = new FilePassReport(reportFile, fpr.getName()); + Data[][] allData = fpr.getAllData(); + ConvertedDataReport[] convDataReports = null; + if (allData != null) { + convDataReports = new ConvertedDataReport[allData.length]; + + for (int ii = 0; ii < allData.length; ii++) { + Data[] data = allData[ii]; + convDataSubGenerator.generateSubreport(tr, fpr, data); + convDataReports[ii] =convDataSubGenerator.getReport(); + } + } + this.filePassReport = new FilePassReport(reportFile, fpr.getName() + " for " + tr.getName(), convDataReports); + } catch (IOException e) { this.log.log(LogService.LOG_ERROR, "Unable to generate file pass report.", e); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java 2008-02-16 01:19:53 UTC (rev 626) @@ -33,7 +33,7 @@ public void generateSubreport(TestResult tr) { FileOutputStream reportOutStream = null; try { - File reportFile = new File(ReportGenerator.TEMP_DIR + tr.getName()); + File reportFile = new File(ReportGenerator.TEMP_DIR + tr.getName() + " for " + tr.getName()); reportOutStream = new FileOutputStream(reportFile); PrintStream report = new PrintStream(reportOutStream); @@ -102,7 +102,7 @@ for (int ii = 0; ii < successfulFPs.length; ii++) { FilePassResult successfulFP = successfulFPs[ii]; - filePassSubGen.generateSubreport(successfulFP); + filePassSubGen.generateSubreport(tr, successfulFP); FilePassReport filePassReport = filePassSubGen.getFilePassReport(); successfulFPReports.add(filePassReport); @@ -112,15 +112,14 @@ for (int ii = 0; ii < failedFPs.length; ii++) { FilePassResult failedFP = failedFPs[ii]; - filePassSubGen.generateSubreport(failedFP); + filePassSubGen.generateSubreport(tr, failedFP); FilePassReport filePassReport = filePassSubGen.getFilePassReport(); failedFPReports.add(filePassReport); } - //TODO: remove file pass reports this.testReport = new TestReport(reportFile, tr.getNameWithSuccess(), - new FilePassReport[0], - new FilePassReport[0]); + (FilePassReport[]) successfulFPReports.toArray(new FilePassReport[successfulFPReports.size()]), + (FilePassReport[]) failedFPReports.toArray(new FilePassReport[failedFPReports.size()])); } catch (IOException e) { Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvertedDataReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvertedDataReport.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvertedDataReport.java 2008-02-16 01:19:53 UTC (rev 626) @@ -0,0 +1,27 @@ +package org.cishell.testing.convertertester.core.tester2.reportgen.reports; + +import java.io.File; + +public class ConvertedDataReport implements Report { + + private String name; + private File report; + + public ConvertedDataReport (File report, String name) { + this.report = report; + this.name = name; + } + + public ConvertedDataReport(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public File getReport() { + return report; + } + +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java 2008-02-16 01:19:53 UTC (rev 626) @@ -8,9 +8,12 @@ private String name; - public FilePassReport (File filePassReport, String name) { + private ConvertedDataReport[] convertedDataReports; + + public FilePassReport (File filePassReport, String name, ConvertedDataReport[] convertedDataReports) { this.filePassReport = filePassReport; this.name = name; + this.convertedDataReports = convertedDataReports; } public File getFilePassReport() { @@ -20,4 +23,8 @@ public String getName() { return this.name; } + + public ConvertedDataReport[] getConvertedDataReports() { + return this.convertedDataReports; + } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java 2008-02-16 01:19:53 UTC (rev 626) @@ -8,7 +8,6 @@ private File testReport; private FilePassReport[] successfulFilePassReports; private FilePassReport[] failedFilePassReports; - private String name; public TestReport(File testReport, String name, FilePassReport[] successfulFilePassReports, Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/FilePassResult.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/FilePassResult.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/FilePassResult.java 2008-02-16 01:19:53 UTC (rev 626) @@ -23,6 +23,7 @@ private String explanation; private PassPhase lastReachedPhase; private Converter failedConverter; + private Data[][] allData; //variables not set by constructor @@ -41,11 +42,12 @@ private List chanceAtFaults; public FilePassResult(Data[] originalData, String explanation, - PassPhase lastReachedPhase, Converter failedConverter) { + PassPhase lastReachedPhase, Converter failedConverter, Data[][] allData) { this.originalData = originalData; this.explanation = explanation; this.lastReachedPhase = lastReachedPhase; this.failedConverter = failedConverter; + this.allData = allData; chanceAtFaults = new ArrayList(); } @@ -95,6 +97,10 @@ return this.originalData; } + public Data[][] getAllData() { + return this.allData; + } + public String getOriginalFileLabel() { return (String) getOriginalData()[0].getMetaData().get(DataProperty.LABEL); } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassFailure.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassFailure.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassFailure.java 2008-02-16 01:19:53 UTC (rev 626) @@ -7,8 +7,8 @@ public class FilePassFailure extends FilePassResult { public FilePassFailure(Data[] originalData, String explanation, - PassPhase phaseReached, Converter failedConverter) { + PassPhase phaseReached, Converter failedConverter, Data[][] allData) { super(originalData, explanation, phaseReached, - failedConverter); + failedConverter, allData); } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassSuccess.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassSuccess.java 2008-02-16 01:04:29 UTC (rev 625) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/filepass/FilePassSuccess.java 2008-02-16 01:19:53 UTC (rev 626) @@ -5,7 +5,7 @@ public class FilePassSuccess extends FilePassResult { - public FilePassSuccess(Data[] originalData, String explanation) { - super(originalData, explanation, PassPhase.SUCCEEDED_PHASE, null); + public FilePassSuccess(Data[] originalData, String explanation, Data[][] allData) { + super(originalData, explanation, PassPhase.SUCCEEDED_PHASE, null, allData); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |