From 403e946a1c9ddfcda6cf01ce2b0d25b7ca3f9567 Mon Sep 17 00:00:00 2001 From: cbonar Date: Mon, 8 Sep 2008 20:23:34 +0000 Subject: [PATCH] # jsunit-ant -> ant-jsunit --- .../jsunit/GeneratedConfigurationSource.java | 232 ------------------ .../net/jsunit/GeneratedStandaloneTest.java | 69 ------ 2 files changed, 301 deletions(-) delete mode 100644 ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedConfigurationSource.java delete mode 100644 ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedStandaloneTest.java diff --git a/ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedConfigurationSource.java b/ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedConfigurationSource.java deleted file mode 100644 index db56921..0000000 --- a/ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedConfigurationSource.java +++ /dev/null @@ -1,232 +0,0 @@ -package net.jsunit; - - - - - -/** - * This configuration redefines {@link #url()} to point to a custom file - * and gathers automatically some more properties. - * - * @author http://nicobo.net/contact?subject=jsunit+ant - */ -public class GeneratedConfigurationSource //extends DelegatingConfigurationSource -{ - // // - // // CONSTANTS - // // - // - // /** - // * Property name defining the Javascript files to include in the test suite - // * page. - // */ - // public static final String PROP_JAVASCRIPTS = "jsunit.in.javascripts"; - // - // /** - // * Associates a type of script to the corresponding property where their - // * name is stored. - // */ - // public static final String[][] TYPE_PROP = { { JsUnitTestTask.TYPE_JAVASCRIPT, PROP_JAVASCRIPTS } }; - // - // // - // // PRIVATE FIELDS - // // - // - // /** The generated test suite page */ - // private File testSuitePage = null; - // private String project; - // private String coreJs; - // private String testRunner; - // private Map includes; - // - // - // - // // - // // INITIALISATION - // // - // - // public GeneratedConfigurationSource( /*ConfigurationSource source,*/ - // String project, String coreJs, String testRunner ) - // throws URISyntaxException - // { - // //super( source ); - // - // // Checks for required parameters - // if ( System.getProperty( PROP_JAVASCRIPTS ) == null ) - // { - // throw new IllegalArgumentException( "Missing required property " - // + PROP_JAVASCRIPTS ); - // } - // - // setProject( project ); - // setCoreJs( coreJs ); - // setTestRunner( testRunner ); - // - // // Gathers all parameters - // // TODO Allow generic URI to be included in the generated file - // Map includes = new Hashtable(); - // for ( int s = 0; s < TYPE_PROP.length; s++ ) - // { - // String[] files = System.getProperty( TYPE_PROP[s][1] ).split( File.pathSeparator ); - // // indexed on the property's type - // includes.put( TYPE_PROP[s][0], files ); - // } - // } - // - // - // - // public GeneratedConfigurationSource( /*ConfigurationSource source */) - // throws URISyntaxException - // { - // this( /*Configuration.resolveSource(),*/"a JsUnit test suite", getRequiredURISystemProperty( PROP_COREJS ), getRequiredURISystemProperty( PROP_TESTRUNNER ) ); - // } - // - // - // - // // public GeneratedConfigurationSource() throws URISyntaxException - // // { - // // this( Configuration.resolveSource() ); - // // } - // - // // - // // ACCESSORS - // // - // - // public File getTestSuitePage() - // { - // return testSuitePage; - // } - // - // - // - // public void setTestSuitePage( File testSuitePage ) - // { - // this.testSuitePage = testSuitePage; - // } - // - // - // - // public String getProject() - // { - // return project; - // } - // - // - // - // public void setProject( String project ) - // { - // this.project = project; - // } - // - // - // - // public String getCoreJs() - // { - // return coreJs; - // } - // - // - // - // public void setCoreJs( String coreJs ) - // { - // this.coreJs = coreJs; - // } - // - // - // - // public String getTestRunner() - // { - // return testRunner; - // } - // - // - // - // public void setTestRunner( String testRunner ) - // { - // this.testRunner = testRunner; - // } - // - // - // - // public Map getIncludes() - // { - // return includes; - // } - // - // - // - // public void setIncludes( Map includes ) - // { - // this.includes = includes; - // } - // - // - // - // // - // // UTILITY METHODS - // // - // - // /** The best effort to get a well formed URI */ - // private static URI getURI( String text ) throws URISyntaxException - // { - // try - // { - // return new URL( text ).toURI(); - // } - // catch ( MalformedURLException murle ) - // { - // return new File( text ).toURI(); - // } - // } - // - // - // - // /** - // * @param key - // * the name of the property to retrieve - // * @return A well formed URI based on the value of the given property - // * @throws IllegalArgumentException - // * if the given property doesn't exist. - // */ - // private static String getRequiredURISystemProperty( String key ) - // throws URISyntaxException - // { - // String val = System.getProperty( key ); - // - // if ( val == null ) - // { - // System.err.println( "Missing property : " + key ); - // throw new IllegalArgumentException( "Missing property : " + key ); - // } - // - // return getURI( val ).toString(); - // } - // - // - // - // // - // // ConfigurationSource IMPLEMENTATION - // // - // - // /** - // * Before calling this method, make sure {@link #setTestSuitePage(File)} has been correctly set. - // * @throws IllegalStateException if a property is missing or is incorrect - // */ - // public String makeUrl() throws URISyntaxException, IOException - // { - // // try - // // { - // // returns the full URL to use with JsUnit - // return getRequiredURISystemProperty( PROP_TESTRUNNER ) + "?testPage=" - // + getTestSuitePage().getCanonicalPath(); - // - // // } - // // // URISyntaxException, IOException - // // catch ( Exception e ) - // // { - // // e.printStackTrace( System.err ); - // // throw new IllegalStateException( e ); - // // } - // } - -} diff --git a/ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedStandaloneTest.java b/ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedStandaloneTest.java deleted file mode 100644 index 035f9b5..0000000 --- a/ciform/trunk/tools/jsunit-ant/test/net/jsunit/GeneratedStandaloneTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package net.jsunit; - - -import junit.framework.Test; -import junit.framework.TestSuite; -import net.jsunit.configuration.Configuration; -import net.jsunit.configuration.ConfigurationSource; -import net.jsunit.configuration.DelegatingConfigurationSource; -import net.jsunit.model.Browser; - - - -/** - * Generates a JsUnit test suite page giving resources and executes it against - * JUnit. - * - * @author http://nicobo.net/contact?subject=jsunit+ant - */ -public class GeneratedStandaloneTest extends StandaloneTest -{ - - // - // INITIALISATION - // - - public GeneratedStandaloneTest( String name ) - { - super( name ); - } - - - - public GeneratedStandaloneTest( ConfigurationSource source ) - { - super( "" );//new GeneratedConfigurationSource( source ) ); - } - - - - // - // JUNIT SPECIFICATIONS - // - - public static Test suite() - { - try - { - TestSuite suite = new TestSuite(); - ConfigurationSource originalSource = Configuration.resolveSource(); - Configuration configuration = new Configuration( originalSource ); - for ( final Browser browser : configuration.getBrowsers() ) - { - suite.addTest( new GeneratedStandaloneTest( new DelegatingConfigurationSource( originalSource ) { - public String browserFileNames() - { - return browser.getFileName(); - } - } ) ); - } - return suite; - - } - catch ( Exception e ) - { - e.printStackTrace( System.err ); - return null; - } - } -}