Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java?view=auto&rev=537691 ============================================================================== --- maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java (added) +++ maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGTestSet.java Sun May 13 18:33:45 2007 @@ -0,0 +1,56 @@ +package org.apache.maven.surefire.testng; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.surefire.report.ReporterManager; +import org.apache.maven.surefire.testset.AbstractTestSet; +import org.apache.maven.surefire.testset.TestSetFailedException; + +/** + * Main plugin point for running testng tests within the Surefire runtime + * infrastructure. + * + * @author jkuhnert + */ +public class TestNGTestSet + extends AbstractTestSet +{ + /** + * Creates a new test testset that will process the class being + * passed in to determine the testing configuration. + */ + public TestNGTestSet( Class testClass ) + { + super( testClass ); + } + + public int getTestCount() + throws TestSetFailedException + { + // TODO: need to get this from TestNG somehow + return 1; + } + + public void execute( ReporterManager reportManager, ClassLoader loader ) + { + throw new UnsupportedOperationException( + "This should have been called directly from TestNGDirectoryTestSuite" ); + } +}
Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java?view=auto&rev=537691 ============================================================================== --- maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java (added) +++ maven/sandbox/branches/surefire/surefire-collab2/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java Sun May 13 18:33:45 2007 @@ -0,0 +1,120 @@ +package org.apache.maven.surefire.testng; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.surefire.report.ReporterManager; +import org.apache.maven.surefire.suite.SurefireTestSuite; +import org.apache.maven.surefire.testset.TestSetFailedException; + +/** + * Handles suite xml file definitions for TestNG. + * + * @author jkuhnert + * @author <a href='mailto:the[dot]mindstorm[at]gmail[dot]com'>Alex Popescu</a> + */ +public class TestNGXmlTestSuite + implements SurefireTestSuite +{ + private File[] suiteFiles; + + private List suiteFilePaths; + + private ArtifactVersion version; + + private Map options = new HashMap(); + + // Not really used + private Map testSets; + + /** + * Creates a testng testset to be configured by the specified + * xml file. + */ + public TestNGXmlTestSuite( File[] suiteFiles, String testSourceDirectory , ArtifactVersion artifactVersion) + { + this.suiteFiles = suiteFiles; + + this.version = artifactVersion; + + this.options.put(TestNGExecutor.SOURCE_DIRS_OPTION, testSourceDirectory); + } + + public void execute( ReporterManager reporterManager, ClassLoader classLoader ) + { + if ( testSets == null ) + { + throw new IllegalStateException( "You must call locateTestSets before calling execute" ); + } + + TestNGExecutor.run( this.suiteFilePaths, this.options, new ExecEnv(this, this.version, reporterManager) ); + } + + public void execute( String testSetName, ReporterManager reporterManager, ClassLoader classLoader ) + throws TestSetFailedException + { + + throw new TestSetFailedException( "Cannot run individual test when suite files are specified" ); + } + + public int getNumTests() + { + return this.suiteFiles != null ? this.suiteFiles.length : 0; + } + + public int getNumTestSets() + { + return this.suiteFiles != null ? this.suiteFiles.length : 0; + } + + public Map locateTestSets( ClassLoader classLoader ) + throws TestSetFailedException + { + if ( testSets != null ) + { + throw new IllegalStateException( "You can't call locateTestSets twice" ); + } + + if ( this.suiteFiles == null ) + { + throw new IllegalStateException( "No suite files were specified" ); + } + + this.testSets = new HashMap(); + this.suiteFilePaths = new ArrayList(); + + for(int i = 0; i < this.suiteFiles.length; i++) { + if(!this.suiteFiles[i].exists() || !this.suiteFiles[i].isFile()) { + throw new TestSetFailedException( "Suite file " + this.suiteFiles[i] + " is not a valid file" ); + } + this.testSets.put(this.suiteFiles[i], this.suiteFiles[i].getAbsolutePath()); + this.suiteFilePaths.add(this.suiteFiles[i].getAbsolutePath()); + } + + return this.testSets; + } +} Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/pom.xml?view=auto&rev=537691 ============================================================================== --- maven/sandbox/branches/surefire/surefire-collab2/surefire-site/pom.xml (added) +++ maven/sandbox/branches/surefire/surefire-collab2/surefire-site/pom.xml Sun May 13 18:33:45 2007 @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire</artifactId> + <version>2.4-SNAPSHOT</version> + </parent> + <artifactId>surefire-site</artifactId> + <name>Surefire</name> + <distributionManagement> + <site> + <id>website</id> + <url>scpexe://minotaur.apache.org/www/maven.apache.org/surefire/</url> + </site> + </distributionManagement> +</project> Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/css/maven-theme.css URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/css/maven-theme.css?view=auto&rev=537691 ============================================================================== --- maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/css/maven-theme.css (added) +++ maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/css/maven-theme.css Sun May 13 18:33:45 2007 @@ -0,0 +1,226 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +body { + background-color: #fff; + font-family: Verdana, Helvetica, Arial, sans-serif; + margin-left: auto; + margin-right: auto; + background-repeat: repeat-y; + font-size: 13px; + padding: 0px; +} + +td, select, input, li { + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 12px; + color: #333333; +} + +code { + font-size: 12px; +} + +a { + text-decoration: none; +} + +a:link { + color: #47a; +} + +a:visited { + color: #666666; +} + +a:active, a:hover { + color: #990000; +} + +#legend li.externalLink { + background: url( ../images/external.png ) left top no-repeat; + padding-left: 18px; +} + +a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { + background: url( ../images/external.png ) right center no-repeat; + padding-right: 18px; +} + +#legend li.newWindow { + background: url( ../images/newwindow.png ) left top no-repeat; + padding-left: 18px; +} + +a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { + background: url( ../images/newwindow.png ) right center no-repeat; + padding-right: 18px; +} + +h2 { + font-size: 17px; + color: #333333; +} + +h3 { + padding: 4px 4px 4px 24px; + color: #666; + background-color: #ccc; + font-weight: bold; + font-size: 14px; + background-image: url( ../images/h3.jpg ); + background-repeat: no-repeat; + background-position: left bottom; +} + +p { + line-height: 1.3em; + font-size: 12px; + color: #000; +} + +#breadcrumbs { + height: 13px; + background-image: url( ../images/breadcrumbs.jpg ); + padding: 5px 10px 14px 20px; +} + +* html #breadcrumbs { + padding-bottom: 8px; +} + +#leftColumn { + margin: 10px 0 10px 0; + border-top-color: #ccc; + border-top-style: solid; + border-top-width: 1px; + border-right-color: #ccc; + border-right-style: solid; + border-right-width: 1px; + border-bottom-color: #ccc; + border-bottom-style: solid; + border-bottom-width: 1px; + padding-right: 5px; + padding-left: 5px; +} + +#navcolumn h5 { + font-size: smaller; + border-bottom: 1px solid #aaaaaa; + padding-top: 2px; + padding-left: 9px; + color: #49635a; + background-image: url( ../images/h5.jpg ); + background-repeat: no-repeat; + background-position: left bottom; +} + +table.bodyTable th { + color: white; + background-color: #bbb; + text-align: left; + font-weight: bold; +} + +table.bodyTable th, table.bodyTable td { + font-size: 11px; +} + +table.bodyTable tr.a { + background-color: #ddd; +} + +table.bodyTable tr.b { + background-color: #eee; +} + +.source { + border: 1px solid #999; + overflow: auto +} + +dt { + padding: 4px 4px 4px 24px; + color: #333333; + background-color: #ccc; + font-weight: bold; + font-size: 14px; + background-image: url( ../images/h3.jpg ); + background-repeat: no-repeat; + background-position: left bottom; +} + +.subsectionTitle { + font-size: 13px; + font-weight: bold; + color: #666; + +} + +table { + font-size: 10px; +} + +.xright a:link, .xright a:visited, .xright a:active { + color: #666; +} + +.xright a:hover { + color: #003300; +} + +#banner { + height: 93px; + background: url( ../images/banner.jpg ); +} + +#navcolumn ul { + margin: 5px 0 15px -0em; +} + +#navcolumn ul a { + color: #333333; +} + +#navcolumn ul a:hover { + color: red; +} + +#intro { + border: solid #ccc 1px; + margin: 6px 0px 0px 0px; + padding: 10px 40px 10px 40px; +} + +.subsection { + margin-left: 3px; + color: #333333; +} + +.subsection p { + font-size: 12px; +} + +#footer { + padding: 10px; + margin: 20px 0px 20px 0px; + border-top: solid #ccc 1px; + color: #333333; +} + Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/apache-maven-project-2.png URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/apache-maven-project-2.png?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/apache-maven-project-2.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/banner.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/banner.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/banner.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/bg.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/bg.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/bg.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/breadcrumbs.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/breadcrumbs.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/breadcrumbs.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/collapsed.gif URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/collapsed.gif?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/collapsed.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/expanded.gif URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/expanded.gif?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/expanded.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/h3.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/h3.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/h3.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/h5.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/h5.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/h5.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/logo_apache.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/logo_apache.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/logo_apache.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/logo_maven.jpg URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/logo_maven.jpg?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/logo_maven.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/maven-logo-2.gif URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/maven-logo-2.gif?view=auto&rev=537691 ============================================================================== Binary file - no diff available. Propchange: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/resources/images/maven-logo-2.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/site.xml URL: http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/site.xml?view=auto&rev=537691 ============================================================================== --- maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/site.xml (added) +++ maven/sandbox/branches/surefire/surefire-collab2/surefire-site/src/site/site.xml Sun May 13 18:33:45 2007 @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<project name="Doxia"> + <bannerLeft> + <name>Surefire</name> + <src>http://maven.apache.org/images/apache-maven-project-2.png</src> + <href>http://maven.apache.org/surefire/</href> + </bannerLeft> + <bannerRight> + <src>http://maven.apache.org/images/maven-logo-2.gif</src> + </bannerRight> + <body> + <links> + <item name="Apache" href="http://www.apache.org/"/> + <item name="Maven 1.x" href="http://maven.apache.org/maven-1.x"/> + <item name="Maven 2.x" href="http://maven.apache.org/"/> + <item name="Continuum" href="http://maven.apache.org/continuum"/> + <item name="SCM" href="http://maven.apache.org/scm"/> + <item name="Wagon" href="http://maven.apache.org/wagon"/> + <item name="JXR" href="http://maven.apache.org/jxr"/> + <item name="Doxia" href="http://maven.apache.org/doxia"/> + </links> + ${reports} + </body> +</project>