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-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: <mwl...@us...> - 2008-02-16 01:04:35
|
Revision: 625 http://cishell.svn.sourceforge.net/cishell/?rev=625&view=rev Author: mwlinnem Date: 2008-02-15 17:04:29 -0800 (Fri, 15 Feb 2008) Log Message: ----------- Changes for converted data. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF 2008-02-13 15:14:14 UTC (rev 624) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/META-INF/MANIFEST.MF 2008-02-16 01:04:29 UTC (rev 625) @@ -9,7 +9,14 @@ org.cishell.framework, org.cishell.framework.algorithm, org.cishell.framework.data, + org.cishell.reference.app.service.datamanager, + org.cishell.reference.app.service.scheduler, org.cishell.reference.gui.common, + org.cishell.reference.gui.datamanager, + org.cishell.reference.gui.guibuilder.swt, + org.cishell.reference.gui.scheduler, + org.cishell.reference.gui.workspace, + org.cishell.reference.service.conversion, org.cishell.reference.service.metatype, org.cishell.service.conversion, org.cishell.service.guibuilder, Modified: 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 2008-02-13 15:14:14 UTC (rev 624) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2008-02-16 01:04:29 UTC (rev 625) @@ -24,6 +24,7 @@ import org.cishell.testing.convertertester.core.tester2.reportgen.reports.AllErrorReport; import org.cishell.testing.convertertester.core.tester2.reportgen.reports.AllTestsReport; import org.cishell.testing.convertertester.core.tester2.reportgen.reports.ConvReport; +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.reports.ReadMeReport; import org.cishell.testing.convertertester.core.tester2.reportgen.reports.TestReport; @@ -266,7 +267,9 @@ * @param report the report to be returned from this algorithm */ private void addReturn(Data report) { - this.returnList.add(report); + if (report != null) { + this.returnList.add(report); + } } @@ -292,6 +295,14 @@ Data fpData = createReportData(fpFile, fp.getName(), testReportData); addReturn(fpData); + ConvertedDataReport[] cdrs = fp.getConvertedDataReports(); + if (cdrs != null) { + for (int mm = 0; mm < cdrs.length; mm++) { + File cdrFile = cdrs[mm].getReport(); + Data cdrData = createReportData(cdrFile, cdrs[mm].getName(), fpData); + addReturn(cdrData); + } + } } FilePassReport[] fFilePassReports = @@ -302,6 +313,14 @@ Data fpData = createReportData(fpFile, fp.getName(), testReportData); addReturn(fpData); + ConvertedDataReport[] cdrs = fp.getConvertedDataReports(); + if (cdrs != null) { + for (int mm = 0; mm < cdrs.length; mm++) { + File cdrFile = cdrs[mm].getReport(); + Data cdrData = createReportData(cdrFile, cdrs[mm].getName(), fpData); + addReturn(cdrData); + } + } } } } @@ -323,6 +342,13 @@ Data parent, String format, String type) { Data reportData = new BasicData(report, format); Dictionary metadata = reportData.getMetaData(); + if (label == null) { + label = "no label"; + } + + if (type == null) { + type = "No type"; + } metadata.put(DataProperty.LABEL, label); metadata.put(DataProperty.TYPE, type); if (parent != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |