Author: krosenvold Date: Wed May 4 19:32:38 2011 New Revision: 1099567 URL: http://svn.apache.org/viewvc?rev=1099567&view=rev Log: [SUREFIRE-715] Added integration test
Patch by Stefan Birkner Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java (with props) maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/pom.xml (with props) maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/MyTest.java (with props) Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java?rev=1099567&view=auto ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java (added) +++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java Wed May 4 19:32:38 2011 @@ -0,0 +1,38 @@ +package org.apache.maven.surefire.its; + +import java.io.File; +import java.io.IOException; + +import org.apache.maven.it.VerificationException; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; + +/** + * Test when the configured working directory is an invalid property, SUREFIRE-715 + */ +public class WorkingDirectoryIsInvalidPropertyIT + extends AbstractSurefireIntegrationTestClass +{ + private File testDir; + + public void setUp() + throws IOException + { + testDir = ResourceExtractor.simpleExtractResources( getClass(), "/working-directory-is-invalid-property" ); + } + + public void testWorkingDirectory() + throws Exception + { + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + try + { + executeGoal( verifier, "test" ); + } + catch ( VerificationException e ) + { + } + verifier.verifyTextInLog( "workingDirectory cannot be null" ); + verifier.resetStreams(); + } +} \ No newline at end of file Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java ------------------------------------------------------------------------------ svn:eol-style = native Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/pom.xml URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/pom.xml?rev=1099567&view=auto ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/pom.xml (added) +++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/pom.xml Wed May 4 19:32:38 2011 @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>localhost</groupId> + <artifactId>working-directory-test</artifactId> + <version>1.0</version> + <name>Don't run tests if working directory is invalid property.</name> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${surefire.version}</version> + <configuration> + <workingDirectory>${notSet}</workingDirectory> + </configuration> + </plugin> + </plugins> + </build> + +</project> Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/MyTest.java URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/MyTest.java?rev=1099567&view=auto ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/MyTest.java (added) +++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/MyTest.java Wed May 4 19:32:38 2011 @@ -0,0 +1,7 @@ +import junit.framework.TestCase; + +public class MyTest extends TestCase { + public void testSomething() { + assertTrue(true); + } +} Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-is-invalid-property/src/test/java/MyTest.java ------------------------------------------------------------------------------ svn:eol-style = native