Permalink
Browse files

Making includes configurable

  • Loading branch information...
1 parent 86e9f46 commit 109921b153955c72fb0b0d8e832e012e7834bd5d @velo velo committed May 3, 2011
@@ -204,7 +204,7 @@
private File testSourceDirectory;
public Result buildTest( String testFilename, List<? extends String> testClasses, Integer testControlPort,
- Integer testPort )
+ Integer testPort )
throws MojoExecutionException, MojoFailureException
{
getLog().info( "Compiling test class: " + testClasses );
@@ -260,29 +260,7 @@ public void execute()
return;
}
- if ( test != null )
- {
- includeTestFiles = new String[] { test };
- excludeTestFiles = null;
- }
-
- if ( includeTestFiles == null || includeTestFiles.length == 0 )
- {
- includeTestFiles = new String[] { "**/Test*.as", "**/*Test.as", "**/Test*.mxml", "**/*Test.mxml" };
- }
- else
- {
- for ( int i = 0; i < includeTestFiles.length; i++ )
- {
- String pattern = includeTestFiles[i];
-
- if ( !pattern.endsWith( ".as" ) && !pattern.endsWith( ".mxml" ) )
- {
- pattern = pattern + ".as";
- }
- includeTestFiles[i] = "**/" + pattern;
- }
- }
+ initializeIncludes();
if ( !testOutputDirectory.exists() )
{
@@ -650,7 +628,7 @@ else if ( !testRunnerTemplate.exists() )
}
}
- private List<String> getTestClasses()
+ protected List<String> getTestClasses()
{
getLog().debug( "Scanning for tests at " + testSourceDirectory + " for " + Arrays.toString( includeTestFiles )
+ " but " + Arrays.toString( excludeTestFiles ) );
@@ -676,6 +654,33 @@ else if ( !testRunnerTemplate.exists() )
return testClasses;
}
+ protected void initializeIncludes()
+ {
+ if ( test != null )
+ {
+ includeTestFiles = new String[] { test };
+ excludeTestFiles = null;
+ }
+
+ if ( includeTestFiles == null || includeTestFiles.length == 0 )
+ {
+ includeTestFiles = new String[] { "**/Test*.as", "**/*Test.as", "**/Test*.mxml", "**/*Test.mxml" };
+ }
+ else
+ {
+ for ( int i = 0; i < includeTestFiles.length; i++ )
+ {
+ String pattern = includeTestFiles[i];
+
+ if ( !pattern.endsWith( ".as" ) && !pattern.endsWith( ".mxml" ) )
+ {
+ pattern = pattern + ".as";
+ }
+ includeTestFiles[i] = "**/" + pattern;
+ }
+ }
+ }
+
@Override
public boolean isUpdateSecuritySandbox()
{

0 comments on commit 109921b

Please sign in to comment.