From: <mwl...@us...> - 2007-07-25 18:18:09
|
Revision: 436 http://cishell.svn.sourceforge.net/cishell/?rev=436&view=rev Author: mwlinnem Date: 2007-07-25 11:18:02 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Initial import. Separates out the commandline code from the core ConverterTester. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/ trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.commandline/build.properties trunk/testing/org.cishell.testing.convertertester.commandline/src/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java Added: trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/META-INF/MANIFEST.MF 2007-07-25 18:18:02 UTC (rev 436) @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Converter Tester Command-Line +Bundle-SymbolicName: org.cishell.testing.convertertester.commandline +Bundle-Version: 0.0.1 +Bundle-ClassPath: . +Bundle-Localization: plugin +Import-Package: org.cishell.framework, + org.cishell.framework.algorithm, + org.cishell.framework.data, + org.cishell.service.conversion, + org.osgi.framework;version="1.3.0", + org.osgi.service.component;version="1.0.0", + org.osgi.service.log;version="1.3.0", + org.osgi.service.metatype;version="1.1.0", + org.osgi.service.prefs;version="1.1.0" +Bundle-Activator: org.cishell.testing.convertertester.commandline.Activator +Require-Bundle: org.cishell.testing.convertertester.core.new Added: trunk/testing/org.cishell.testing.convertertester.commandline/build.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/build.properties (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/build.properties 2007-07-25 18:18:02 UTC (rev 436) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = build/ +bin.includes = META-INF/,\ + . Added: trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/src/org/cishell/testing/convertertester/commandline/Activator.java 2007-07-25 18:18:02 UTC (rev 436) @@ -0,0 +1,91 @@ +package org.cishell.testing.convertertester.commandline; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Scanner; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.LocalCIShellContext; +import org.cishell.testing.convertertester.core.tester.ConverterTester; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + + +public class Activator implements BundleActivator{ + private ConverterTester ct; + private BundleContext b; + private CIShellContext c; + private File configFile; + + public static final String QUIT = "q"; + + public void start(BundleContext b){ + this.b = b; + this.c = new LocalCIShellContext(b); + + startCommandLine(); + } + + + + public void stop(BundleContext b){ + System.out.println("Goodbye!"); + + b = null; + c = null; + configFile = null; + ct = null; + } + + public void startCommandLine(){ + Scanner in = new Scanner(System.in); + while(true) { + System.out.println("Welcome to NWB's Converter Tester"); + System.out.println( "Please enter the name of a configuration " + + "file or\n a directory of configuration files (" + QUIT + + ") to quit): "); + + String s = in.nextLine(); + if(s.trim().equalsIgnoreCase(QUIT)) + break; + try{ + configFile = new File(s); + processConfigurationFile(configFile); + } + catch (NullPointerException ex){ + System.out.println("Invalid file name");; + } + catch(FileNotFoundException fnfe){ + System.out.println("Could not find the specified " + + "configuration file"); + } + } + } + + private void processConfigurationFile(File f) + throws FileNotFoundException { + System.out.println("Processing " + f.getName()); + if(!f.isHidden() && (f.getName().charAt(0) != '.')){ + if(f.isDirectory()){ + File[] files = f.listFiles(); + for (int ii = 0; ii < files.length; ii++) { + File ff = files[ii]; + processConfigurationFile(ff); + } + } + else{ + try{ + ct = new ConverterTester(b, c, f); + System.out.println(ct); + ct.testFiles(); + ct.printResults(); + }catch(Exception ex){ + System.out.println("Failed to create " + + "ConverterTester\n\n"); + ex.printStackTrace(); + } + } + } + } +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-07-25 20:33:29
|
Revision: 438 http://cishell.svn.sourceforge.net/cishell/?rev=438&view=rev Author: mwlinnem Date: 2007-07-25 13:33:27 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Including extra hidden files so hopefully project will be correctly treated as a plugin project in other people's workspaces. Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.commandline/.classpath trunk/testing/org.cishell.testing.convertertester.commandline/.project trunk/testing/org.cishell.testing.convertertester.commandline/.settings/ trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs Added: trunk/testing/org.cishell.testing.convertertester.commandline/.classpath =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/.classpath (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/.classpath 2007-07-25 20:33:27 UTC (rev 438) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="build"/> +</classpath> Added: trunk/testing/org.cishell.testing.convertertester.commandline/.project =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/.project (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/.project 2007-07-25 20:33:27 UTC (rev 438) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.testing.convertertester.commandline</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs =================================================================== --- trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.commandline/.settings/org.eclipse.pde.core.prefs 2007-07-25 20:33:27 UTC (rev 438) @@ -0,0 +1,4 @@ +#Wed Jul 25 13:20:26 EDT 2007 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |