From commits-return-70102-archive-asf-public=cust-asf.ponee.io@maven.apache.org Mon Feb 5 23:07:29 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 4DB851807A3 for ; Mon, 5 Feb 2018 23:07:27 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3D7BA160C4B; Mon, 5 Feb 2018 22:07:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E5215160C61 for ; Mon, 5 Feb 2018 23:07:24 +0100 (CET) Received: (qmail 60636 invoked by uid 500); 5 Feb 2018 22:07:19 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 58654 invoked by uid 99); 5 Feb 2018 22:07:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2018 22:07:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4180AF4DD5; Mon, 5 Feb 2018 22:07:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tibordigana@apache.org To: commits@maven.apache.org Date: Mon, 05 Feb 2018 22:07:56 -0000 Message-Id: <0a262506067a4680a89bfb95a209e923@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [43/51] [partial] maven-surefire git commit: [SUREFIRE-1471] Too long Windows path cause CI issues. Renamed surefire-intergation-tests to surefire-its. http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire697NiceSummaryIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire697NiceSummaryIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire697NiceSummaryIT.java deleted file mode 100644 index 3175196..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire697NiceSummaryIT.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * SUREFIRE-697 Asserts proper truncation of long exception messages Some say testing this is a bit over the top. - * - * @author Kristian Rosenvold - */ -public class Surefire697NiceSummaryIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testBuildFailingWhenErrors() - { - unpack( "/surefire-697-niceSummary" ).failNever().executeTest().verifyTextInLog( - "junit.surefire697.BasicTest#testShortMultiline RuntimeException A very short m" ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java deleted file mode 100644 index e1a258a..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * Test - * - * @author Kristian Rosenvold - */ -public class Surefire705ParallelForkTimeoutIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testTimeoutForked() - { - unpack( "/fork-timeout" ).setJUnitVersion( "4.8.1" ).addGoal( "-Djunit.version=4.8.1" ).addGoal( - "-Djunit.parallel=classes" ).addGoal( "-DtimeOut=1" ).maven().withFailure().executeTest() - .verifyTextInLog( "There was a timeout or other error in the fork" ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire733AllOverrridesCapturedIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire733AllOverrridesCapturedIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire733AllOverrridesCapturedIT.java deleted file mode 100644 index aabb05d..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire733AllOverrridesCapturedIT.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * @author Kristian Rosenvold - */ -public class Surefire733AllOverrridesCapturedIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testLogOutput() - { - unpack( "surefire-733-allOverridesCaptured" ).executeTest().verifyTextInLog( "abc" ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java deleted file mode 100644 index 34504c1..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.junit.Test; - -import java.io.File; -import java.io.FilenameFilter; - -import static org.fest.assertions.Assertions.assertThat; - -/** - * @author Kristian Rosenvold - */ -public class Surefire735ForkFailWithRedirectConsoleOutputIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - public void vmStartFail() - throws Exception - { - OutputValidator outputValidator = unpack().failNever().executeTest(); - assertJvmCrashed( outputValidator ); - } - - @Test - public void vmStartFailShouldFailBuildk() - throws Exception - { - OutputValidator outputValidator = unpack().maven().withFailure().executeTest(); - assertJvmCrashed( outputValidator ); - } - - private SurefireLauncher unpack() - { - return unpack( "fork-fail" ); - } - - private static void assertJvmCrashed( OutputValidator outputValidator ) - { - File reportDir = outputValidator.getSurefireReportsDirectory(); - String[] dumpFiles = reportDir.list( new FilenameFilter() - { - @Override - public boolean accept( File dir, String name ) - { - return name.endsWith( ".dumpstream" ); - } - } - ); - assertThat( dumpFiles ).isNotEmpty(); - for ( String dump : dumpFiles ) - { - outputValidator.getSurefireReportsFile( dump ) - .assertContainsText( "Invalid maximum heap size: -Xmxxxx712743m" ); - } - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java deleted file mode 100644 index e05cee7..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire740TruncatedCommaIT.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.TestFile; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; - -/** - * Test Surefire-740 Truncated comma with non us locale - * - * @author Kristian Rosenvold - */ -public class Surefire740TruncatedCommaIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testRussianLocaleReport() - { - OutputValidator validator = unpack( "/surefire-740-comma-truncated" ).setMavenOpts( - "-Duser.language=ru -Duser.country=RU" ).failNever().addSurefireReportGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting file", siteFile.exists() ); - siteFile.assertContainsText( "027" ); // Avoid asserting with the "," or "." ;) - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java deleted file mode 100644 index c5dbc84..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java +++ /dev/null @@ -1,168 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.it.VerificationException; -import org.apache.maven.surefire.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.junit.Before; -import org.junit.Test; - -import java.text.Format; -import java.text.NumberFormat; -import java.util.Iterator; -import java.util.Set; -import java.util.TreeSet; - -import static java.lang.String.format; -import static java.math.RoundingMode.DOWN; -import static java.util.Locale.ROOT; -import static org.hamcrest.CoreMatchers.anyOf; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.endsWith; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -/** - * @author Kristian Rosenvold - */ -public class Surefire747MethodParallelWithSuiteCountIT - extends SurefireJUnit4IntegrationTestCase -{ - // if you want to change his constant, change it in SuiteTest1.java and SuiteTest2.java as well - private static final int PERFORMANCE_TEST_MULTIPLICATION_FACTOR = 4; - - private Format lowerScaleFormatter, noFractionalDigitsFormatter; - - private static Set printTestLines( OutputValidator validator, String pattern ) - throws VerificationException - { - Set log = new TreeSet( validator.loadLogLines() ); - for ( Iterator it = log.iterator(); it.hasNext(); ) - { - String line = it.next(); - if ( !line.contains( pattern ) ) - { - it.remove(); - } - } - return log; - } - - private static long duration( String logLine ) - { - return Integer.decode( logLine.split( "=" )[1] ); - } - - @Before - public void init() - { - NumberFormat lowScaleFormatter = NumberFormat.getInstance( ROOT ); - lowScaleFormatter.setRoundingMode( DOWN ); - lowScaleFormatter.setMinimumFractionDigits( 1 ); - lowScaleFormatter.setMaximumFractionDigits( 1 ); - this.lowerScaleFormatter = lowScaleFormatter; - - NumberFormat noFractionalDigitsFormatter = NumberFormat.getInstance( ROOT ); - noFractionalDigitsFormatter.setRoundingMode( DOWN ); - noFractionalDigitsFormatter.setMinimumFractionDigits( 0 ); - noFractionalDigitsFormatter.setMaximumFractionDigits( 0 ); - this.noFractionalDigitsFormatter = noFractionalDigitsFormatter; - } - - @Test - public void testMethodsParallelWithSuite() - throws VerificationException - { - OutputValidator validator = unpack().executeTest().verifyErrorFree( 6 ); - Set testLines = printTestLines( validator, "test finished after duration=" ); - assertThat( testLines.size(), is( 2 ) ); - for ( String testLine : testLines ) - { - long duration = duration( testLine ); - long min = 250 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - long max = 750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), - duration > min && duration < max - ); - } - Set suiteLines = printTestLines( validator, "suite finished after duration=" ); - assertThat( suiteLines.size(), is( 1 ) ); - long duration = duration( suiteLines.iterator().next() ); - long min = 750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - long max = 1250 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), - duration > min && duration < max - ); - - String delayMin = lowerScaleFormatter.format( 0.98 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR * 0.5 ); - String delayMax = noFractionalDigitsFormatter.format( PERFORMANCE_TEST_MULTIPLICATION_FACTOR * 0.5 ) + "."; - - for ( String line : validator.loadLogLines() ) - { - if ( line.startsWith( "Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:" ) ) - { - assertThat( line, anyOf( // 1.9xx to 2.xxx can vary depending on CI jobs - containsString( "Time elapsed: " + delayMin ), - containsString( "Time elapsed: " + delayMax ) - ) - ); - assertThat( line, anyOf( - endsWith( " s - in surefire747.SuiteTest1" ), - endsWith( " s - in surefire747.SuiteTest2" ) - ) - ); - } - } - } - - @Test - public void testClassesParallelWithSuite() - throws VerificationException - { - OutputValidator validator = unpack().parallelClasses().executeTest().verifyErrorFree( 6 ); - Set testLines = printTestLines( validator, "test finished after duration=" ); - assertThat( testLines.size(), is( 2 ) ); - for ( String testLine : testLines ) - { - long duration = duration( testLine ); - long min = 1450 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - long max = 1750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), - duration > min && duration < max - ); - } - Set suiteLines = printTestLines( validator, "suite finished after duration=" ); - assertThat( suiteLines.size(), is( 1 ) ); - long duration = duration( suiteLines.iterator().next() ); - long min = 1450 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - long max = 1750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; - assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), - duration > min && duration < max - ); - } - - public SurefireLauncher unpack() - { - return unpack( "junit47-parallel-with-suite" ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java deleted file mode 100644 index 96d31c1..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.*; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -/** - * Test Surefire-740 Truncated comma with non us locale - * - * @author Kristian Rosenvold - */ -public class Surefire772BothReportsIT - extends SurefireJUnit4IntegrationTestCase -{ - - public SurefireLauncher unpack() - { - SurefireLauncher unpack = unpack( "/surefire-772-both-reports" ); - unpack.maven().deleteSiteDir().skipClean().failNever(); - return unpack; - } - - @Test - public void testReportGeneration() - throws Exception - { - OutputValidator outputValidator = - unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = outputValidator.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting surefire report file", siteFile.isFile() ); - - siteFile = outputValidator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - @Test - public void testSkippedFailsafeReportGeneration() - throws Exception - { - OutputValidator validator = unpack(). - activateProfile( - "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertFalse( "Expecting no failsafe report file", siteFile.isFile() ); - } - - @Test - public void testSkippedSurefireReportGeneration() - throws Exception - { - OutputValidator validator = unpack().failNever(). - activateProfile( - "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertFalse( "Expecting no surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java deleted file mode 100644 index af18336..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.IOException; -import org.apache.maven.it.VerificationException; -import org.apache.maven.surefire.its.fixture.*; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -/** - * Test Surefire-740 Truncated comma with non us locale - * - * @author Kristian Rosenvold - */ -public class Surefire772NoFailsafeReportsIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - public void testReportGeneration() - throws Exception - { - final OutputValidator site = - unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - assertSurefireReportPresent( site ); - assertNoFailsefeReport( site ); - } - - @Test - public void testSkippedFailsafeReportGeneration() - throws Exception - { - final OutputValidator validator = unpack().activateProfile( - "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - assertSurefireReportPresent( validator ); - assertNoFailsefeReport( validator ); - - } - - @Test - public void testForcedFailsafeReportGeneration() - throws Exception - { - final OutputValidator validator = unpack().activateProfile( - "forceFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - assertSurefireReportPresent( validator ); - assertFailsafeReport( validator ); - } - - @Test - public void testSkipForcedFailsafeReportGeneration() - throws Exception - { - final OutputValidator validator = unpack().activateProfile( "forceFailsafe" ).activateProfile( - "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - assertSurefireReportPresent( validator ); - assertNoFailsefeReport( validator ); - } - - private void assertNoFailsefeReport( OutputValidator site ) - { - TestFile siteFile = site.getSiteFile( "failsafe-report.html" ); - assertFalse( "Expecting no failsafe report file", siteFile.isFile() ); - } - - private void assertFailsafeReport( OutputValidator site ) - { - TestFile siteFile = site.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting no failsafe report file", siteFile.isFile() ); - } - - private void assertSurefireReportPresent( OutputValidator site ) - { - TestFile siteFile = site.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting surefire report file", siteFile.isFile() ); - } - - private SurefireLauncher unpack() - throws VerificationException, IOException - { - final SurefireLauncher unpack = unpack( "surefire-772-no-failsafe-reports" ); - unpack.maven().deleteSiteDir().skipClean().failNever().assertNotPresent( "site" ); - return unpack; - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoSurefireReportsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoSurefireReportsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoSurefireReportsIT.java deleted file mode 100644 index 6b59ba2..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoSurefireReportsIT.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.apache.maven.surefire.its.fixture.TestFile; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -/** - * Test Surefire-740 Truncated comma with non us locale - * - * @author Kristian Rosenvold - */ -public class Surefire772NoSurefireReportsIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testReportGeneration() - { - OutputValidator validator = - unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - @Test - public void testSkippedSurefireReportGeneration() - { - OutputValidator validator = unpack().activateProfile( - "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertFalse( "Expecting no surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - @Test - public void testOptionalSurefireReportGeneration() - { - OutputValidator validator = unpack().activateProfile( - "optionalSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertFalse( "Expecting no surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - @Test - public void testSkipOptionalSurefireReportGeneration() - { - OutputValidator validator = unpack().activateProfile( "optionalSurefire" ).activateProfile( - "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertFalse( "Expecting no surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - public SurefireLauncher unpack() - { - SurefireLauncher unpack = unpack( "/surefire-772-no-surefire-reports" ); - unpack.maven().failNever().deleteSiteDir().skipClean( ); - return unpack; - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java deleted file mode 100644 index a709f7d..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.*; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -/** - * Test Surefire-740 Truncated comma with non us locale - * - * @author Kristian Rosenvold - */ -public class Surefire772SpecifiedReportsIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testReportGeneration() - { - OutputValidator validator = - unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - @Test - public void testSkippedFailsafeReportGeneration() - { - OutputValidator validator = unpack().activateProfile( - "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertTrue( "Expecting surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertFalse( "Expecting no failsafe report file", siteFile.isFile() ); - } - - @Test - public void testSkippedSurefireReportGeneration() - { - OutputValidator validator = unpack().activateProfile( - "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); - - TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); - assertFalse( "Expecting no surefire report file", siteFile.isFile() ); - - siteFile = validator.getSiteFile( "failsafe-report.html" ); - assertTrue( "Expecting failsafe report file", siteFile.isFile() ); - } - - public SurefireLauncher unpack() - { - SurefireLauncher unpack = unpack( "/surefire-772-specified-reports" ); - unpack.maven().deleteSiteDir().skipClean().failNever(); - return unpack; - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire801ForkModeNoneClassLoaderIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire801ForkModeNoneClassLoaderIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire801ForkModeNoneClassLoaderIT.java deleted file mode 100644 index 910cfc5..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire801ForkModeNoneClassLoaderIT.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * Test - * - * @author Kristian Rosenvold - */ -public class Surefire801ForkModeNoneClassLoaderIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testSHouldBeOkWithForkNever() - { - unpack( "fork-mode-resource-loading" ).forkNever().executeTest(); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java deleted file mode 100644 index 658befd..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.junit.Test; - -public class Surefire803MultiFailsafeExecsIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - public void testSecondExecutionRunsAfterFirstExecutionFails() - { - unpack( - "/surefire-803-multiFailsafeExec-failureInFirst" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults( - 4, 0, 2, 0 ); - } - - @Test - public void testOneExecutionRunInTwoBuilds() - { - SurefireLauncher launcher = unpack( "/surefire-803-multiFailsafeExec-rebuildOverwrites" ); - launcher.sysProp( "success", "false" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults( - 1, 0, 1, 0 ); - launcher.reset(); - launcher.sysProp( "success", "true" ).executeVerify().assertIntegrationTestSuiteResults( 1, 0, 0, 0 ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java deleted file mode 100644 index aedb82b..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; - -import org.junit.Ignore; -import org.junit.Test; - -public class Surefire806SpecifiedTestControlsIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - @Ignore( "since SUREFIRE-1153 the includes/excludes are overridden by -Dtest or it.test for whatever execution" ) - public void singleTestInOneExecutionOfMultiExecutionProject() - { - unpack( "/surefire-806-specifiedTests-multi" ).setTestToRun( "FirstTest" ).failIfNoSpecifiedTests( - false ).executeTest().verifyErrorFree( 1 ); - } - - @Test - @Ignore( "since SUREFIRE-1153 the includes/excludes are overridden by -Dtest or it.test for whatever execution" ) - public void twoSpecifiedTestExecutionsInCorrectExecutionBlocks() - { - unpack( "/surefire-806-specifiedTests-multi" ).setTestToRun( - "FirstTest,SecondTest" ).executeTest().verifyErrorFree( 2 ); - } - - @Test - public void singleTestInSingleExecutionProject() - { - unpack( "/surefire-806-specifiedTests-single" ).setTestToRun( "ThirdTest" ).failIfNoSpecifiedTests( - false ).executeTest().verifyErrorFree( 1 ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java deleted file mode 100755 index 5ab103b..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; - -import org.junit.Test; - -public class Surefire809GroupExpressionsIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void categoryAB() - { - OutputValidator validator = unpackJUnit().groups( "junit4.CategoryA AND junit4.CategoryB" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 2, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 1" ); - validator.verifyTextInLog( "catB: 1" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 0" ); - validator.verifyTextInLog( "mA: 1" ); - validator.verifyTextInLog( "mB: 1" ); - validator.verifyTextInLog( "mC: 0" ); - } - - @Test - public void incorrectJUnitVersions() - { - unpackJUnit().setJUnitVersion( "4.5" ).groups( - "junit4.CategoryA AND junit4.CategoryB" ).maven().withFailure().executeTest(); - } - - @Test - public void testJUnitRunCategoryNotC() - { - OutputValidator validator = unpackJUnit().groups( "!junit4.CategoryC" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 5, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 2" ); - validator.verifyTextInLog( "catB: 2" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 1" ); - validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); - } - - @Test - public void testExcludedGroups() - { - OutputValidator validator = unpackJUnit().setExcludedGroups( "junit4.CategoryC" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 5, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 2" ); - validator.verifyTextInLog( "catB: 2" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 1" ); - validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); - } - - @Test - public void testNGRunCategoryAB() - { - OutputValidator validator = unpackTestNG().groups( "CategoryA AND CategoryB" ).debugLogging().executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 2, 0, 0, 0 ); - validator.verifyTextInLog( "BasicTest.testInCategoriesAB()" ); - validator.verifyTextInLog( "CategoryCTest.testInCategoriesAB()" ); - } - - @Test - public void testNGRunCategoryNotC() - { - OutputValidator validator = unpackTestNG().groups( "!CategoryC" ).debugLogging().executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 8, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 2" ); - validator.verifyTextInLog( "catB: 2" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 1" ); - validator.verifyTextInLog( "mA: 2" ); - validator.verifyTextInLog( "mB: 2" ); - validator.verifyTextInLog( "mC: 0" ); - validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); - } - - private SurefireLauncher unpackJUnit() - { - return unpack( "surefire-809-groupExpr-junit48" ); - } - - private SurefireLauncher unpackTestNG() - { - return unpack( "surefire-809-groupExpr-testng" ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire812Log4JClassLoaderIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire812Log4JClassLoaderIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire812Log4JClassLoaderIT.java deleted file mode 100644 index 065ec19..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire812Log4JClassLoaderIT.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * @author Kristian Rosenvold - */ -public class Surefire812Log4JClassLoaderIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testJunit3ParallelBuildResultCount() - { - executeErrorFreeTest( "surefire-812-log4j-classloader", 1 ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java deleted file mode 100644 index 215bd5d..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.it.VerificationException; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.junit.Test; - -/** - * @author Tibor Digana (tibor17) - * @see SUREFIRE-817 - * @since 2.18 - */ -public class Surefire817SystemExitIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - public void systemExit1() - throws VerificationException - { - unpack().maven().withFailure().executeTest().verifyTextInLog( "class jiras.surefire817.Test main" ); - } - - private SurefireLauncher unpack() - { - return unpack( "surefire-817-system-exit" ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java deleted file mode 100644 index 1bf4c8d..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * SUREFIRE-818 - * - * @author Kristian Rosenvold - */ -public class Surefire818NpeIgnoresTestsIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testBuildFailingWhenErrors() - { - unpack( "surefire-818-ignored-tests-on-npe" ).maven().withFailure().executeTest().assertTestSuiteResults( 2, 0, - 1, 0 ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java deleted file mode 100644 index b59bc6a..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.junit.Test; - -public class Surefire828EmptyGroupExprIT - extends SurefireJUnit4IntegrationTestCase -{ - // !CategoryC - @Test - public void testJUnitRunEmptyGroups() - { - OutputValidator validator = unpackJUnit().sysProp( "profile", "emptyGroups" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 5, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 2" ); - validator.verifyTextInLog( "catB: 2" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 1" ); - validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); - } - - // CategoryA && CategoryB - @Test - public void testJUnitRunEmptyExcludeGroups() - { - OutputValidator validator = unpackJUnit().sysProp( "profile", "emptyExcludedGroups" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 2, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 1" ); - validator.verifyTextInLog( "catB: 1" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 0" ); - validator.verifyTextInLog( "mA: 1" ); - validator.verifyTextInLog( "mB: 1" ); - validator.verifyTextInLog( "mC: 0" ); - } - - // CategoryA && CategoryB - @Test - public void testTestNGRunEmptyExcludeGroups() - { - OutputValidator validator = unpackTestNG().sysProp( "profile", "emptyExcludedGroups" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 2, 0, 0, 0 ); - validator.verifyTextInLog( "BasicTest.testInCategoriesAB()" ); - validator.verifyTextInLog( "CategoryCTest.testInCategoriesAB()" ); - } - - // !CategoryC - @Test - public void testTestNGRunEmptyGroups() - { - OutputValidator validator = unpackTestNG().sysProp( "profile", "emptyGroups" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 8, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 2" ); - validator.verifyTextInLog( "catB: 2" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 1" ); - validator.verifyTextInLog( "mA: 2" ); - validator.verifyTextInLog( "mB: 2" ); - validator.verifyTextInLog( "mC: 0" ); - validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); - } - - private SurefireLauncher unpackJUnit() - { - return unpack( "surefire-828-emptyGroupExpr-junit48" ); - } - - private SurefireLauncher unpackTestNG() - { - return unpack( "surefire-828-emptyGroupExpr-testng" ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java deleted file mode 100755 index c694a3d..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.apache.maven.surefire.its.fixture.SurefireLauncher; -import org.junit.Test; - -public class Surefire832ProviderSelectionIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testJUnitRunCategoryAB() - { - OutputValidator validator = unpackJUnit().groups( "junit4.CategoryA AND junit4.CategoryB" ).executeTest(); - validator.verifyErrorFreeLog(); - validator.assertTestSuiteResults( 2, 0, 0, 0 ); - validator.verifyTextInLog( "catA: 1" ); - validator.verifyTextInLog( "catB: 1" ); - validator.verifyTextInLog( "catC: 0" ); - validator.verifyTextInLog( "catNone: 0" ); - validator.verifyTextInLog( "mA: 1" ); - validator.verifyTextInLog( "mB: 1" ); - validator.verifyTextInLog( "mC: 0" ); - } - - private SurefireLauncher unpackJUnit() - { - return unpack( "surefire-832-provider-selection" ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java deleted file mode 100755 index 0babe66..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; - -import org.junit.Test; - -public class Surefire839TestWithoutCategoriesIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void classWithoutCategory() - { - unpack( "junit48-categories" ).setJUnitVersion( "4.11" ).executeTest().verifyErrorFree( 3 ); - } - - @Test - public void classWithoutCategoryForked() - { - unpack( "junit48-categories" ) - .setJUnitVersion( "4.11" ) - .forkPerThread() - .reuseForks( true ) - .threadCount( 2 ) - .executeTest() - .verifyErrorFree( 3 ); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java deleted file mode 100755 index eaecc90..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -public class Surefire847AdditionalFailureIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testJUnitRunCategoryAB() - { - unpack( "surefire-847-testngfail" ).setTestToRun( - "org/codehaus/SomePassedTest" ).executeTest().verifyErrorFreeLog(); - } -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire855AllowFailsafeUseArtifactFileIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire855AllowFailsafeUseArtifactFileIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire855AllowFailsafeUseArtifactFileIT.java deleted file mode 100644 index 1263ab3..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire855AllowFailsafeUseArtifactFileIT.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * @author Tibor Digana (tibor17) - * @see SUREFIRE-855 - * @since 2.19 - */ -public class Surefire855AllowFailsafeUseArtifactFileIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void warShouldUseClasses() - { - unpack( "surefire-855-failsafe-use-war" ).maven().executeVerify().verifyErrorFree( 2 ); - } - - @Test - public void jarShouldUseFile() - { - unpack( "surefire-855-failsafe-use-jar" ) - .maven().sysProp( "forkMode", "once" ).executeVerify().assertIntegrationTestSuiteResults( 3, 0, 0, 1 ); - } - - @Test - public void jarNotForkingShouldUseFile() - { - unpack( "surefire-855-failsafe-use-jar" ) - .maven().sysProp( "forkMode", "never" ).executeVerify().assertIntegrationTestSuiteResults( 3, 0, 0, 1 ); - } - - @Test - public void osgiBundleShouldUseFile() - { - unpack( "surefire-855-failsafe-use-bundle" ).maven().executeVerify().verifyErrorFree( 2 ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire901MIssingResultfileWhenNoTestsIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire901MIssingResultfileWhenNoTestsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire901MIssingResultfileWhenNoTestsIT.java deleted file mode 100644 index 14e278e..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire901MIssingResultfileWhenNoTestsIT.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; - -import org.junit.Test; - -/** - * Failsafe should work with early return when no tests - * s - */ -public class Surefire901MIssingResultfileWhenNoTestsIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void failsafeWithNoTests() - { - unpack( "failsafe-notests" ).executeVerify(); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java deleted file mode 100755 index 8317c52..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; - -import org.junit.Test; - -public class Surefire907PerThreadWithoutThreadCountIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void categoryAB() - { - OutputValidator validator = unpack( "fork-mode" ) - .forkPerThread() - .reuseForks( false ) - .maven() - .withFailure() - .executeTest(); - - validator.verifyTextInLog( "Fork mode perthread requires a thread count" ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java deleted file mode 100755 index 4f60895..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; - -import org.junit.Test; - -public class Surefire920TestFailureIgnoreWithTimeoutIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void timeoutInForkWithBuildFail() - { - OutputValidator validator = - unpack( "fork-timeout" ).sysProp( "junit.parallel", "none" ).maven().withFailure().executeTest(); - validator.verifyTextInLog( "There was a timeout or other error in the fork" ); - } - - @Test - public void timeoutInForkWithNoBuildFail() - { - OutputValidator validator = - unpack( "fork-timeout" ).sysProp( "junit.parallel", "none" ).mavenTestFailureIgnore( true ).executeTest(); - validator.verifyTextInLog( "[ERROR] There was a timeout or other error in the fork" ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire926FailureWith2ProvidersIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire926FailureWith2ProvidersIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire926FailureWith2ProvidersIT.java deleted file mode 100644 index e6f9dc6..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire926FailureWith2ProvidersIT.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Test; - -/** - * @author Kristian Rosenvold - */ -public class Surefire926FailureWith2ProvidersIT - extends SurefireJUnit4IntegrationTestCase -{ - @Test - public void testBuildFailingWhenErrors() - { - unpack( "surefire-926-2-provider-failure" ).maven().withFailure().executeTest(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java deleted file mode 100644 index 5963662..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.apache.maven.surefire.its.jiras; -/* - * 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.its.fixture.SurefireJUnit4IntegrationTestCase; - -import org.junit.Test; - -public class Surefire930TestNgSuiteXmlIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - public void suiteXmlRun() - { - unpack( - "surefire-930-failsafe-runtests" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults( - 1, 0, 1, 0 ); - } - -} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/09f0eef8/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java deleted file mode 100644 index 59d2170..0000000 --- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.apache.maven.surefire.its.jiras; - -/* - * 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.FileNotFoundException; - -import org.apache.maven.shared.utils.xml.Xpp3Dom; -import org.apache.maven.shared.utils.xml.Xpp3DomBuilder; -import org.apache.maven.surefire.its.fixture.OutputValidator; -import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; -import org.junit.Assert; -import org.junit.Test; - -public class Surefire943ReportContentIT - extends SurefireJUnit4IntegrationTestCase -{ - - @Test - public void test_noParallel() - throws Exception - { - doTest( "none" ); - } - - @Test - public void test_parallelBoth() - throws Exception - { - doTest( "both" ); - } - - private void doTest( String parallelMode ) - throws Exception - { - OutputValidator validator = - unpack( "surefire-943-report-content" ).maven() - .sysProp( "parallel", parallelMode ) - .sysProp( "threadCount", 4 ) - .withFailure().executeTest(); - - validator.assertTestSuiteResults( 10, 1, 3, 3 ); - - validate( validator, "org.sample.module.My1Test", 1 ); - validate( validator, "org.sample.module.My2Test", 1 ); - validate( validator, "org.sample.module.My3Test", 0 ); - validateSkipped( validator, "org.sample.module.My4Test" ); - validateFailInBeforeClass( validator, "org.sample.module.My5Test" ); - } - - private void validateFailInBeforeClass( OutputValidator validator, String className ) - throws FileNotFoundException - { - Xpp3Dom[] children = readTests( validator, className ); - - Assert.assertEquals( 1, children.length ); - - Xpp3Dom child = children[0]; - - Assert.assertEquals( className, child.getAttribute( "classname" ) ); - Assert.assertEquals( className, child.getAttribute( "name" ) ); - - Assert.assertEquals( "Expected error tag for failed BeforeClass method for " + className, 1, - child.getChildren( "error" ).length ); - - Assert.assertTrue( "time for test failure in BeforeClass is expected to be positive", - Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) >= 0 ); - - Assert.assertTrue( "time for test failure in BeforeClass is expected to be resonably low", - Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 2.0d ) <= 0 ); - - } - - private void validateSkipped( OutputValidator validator, String className ) - throws FileNotFoundException - { - Xpp3Dom[] children = readTests( validator, className ); - - Assert.assertEquals( 1, children.length ); - - Xpp3Dom child = children[0]; - - Assert.assertEquals( className, child.getAttribute( "classname" ) ); - Assert.assertEquals( className, child.getAttribute( "name" ) ); - - Assert.assertEquals( "Expected skipped tag for ignored method for " + className, 1, - child.getChildren( "skipped" ).length ); - - Assert.assertTrue( "time for ignored test is expected to be zero", - Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) == 0 ); - } - - private void validate( OutputValidator validator, String className, int ignored ) - throws FileNotFoundException - { - Xpp3Dom[] children = readTests( validator, className ); - - Assert.assertEquals( 2 + ignored, children.length ); - - for ( Xpp3Dom child : children ) - { - Assert.assertEquals( className, child.getAttribute( "classname" ) ); - - if ( "alwaysSuccessful".equals( child.getAttribute( "name" ) ) ) - { - Assert.assertEquals( "Expected no failures for method alwaysSuccessful for " + className, 0, - child.getChildCount() ); - - Assert.assertTrue( "time for successful test is expected to be positive", - Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) > 0 ); - } - else if ( child.getAttribute( "name" ).contains( "Ignored" ) ) - { - Assert.assertEquals( "Expected skipped-tag for ignored method for " + className, 1, - child.getChildren( "skipped" ).length ); - - Assert.assertTrue( "time for ignored test is expected to be zero", - Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) == 0 ); - - } - else - { - Assert.assertEquals( "Expected methods \"alwaysSuccessful\", \"*Ignored\" and \"fails\" in " - + className, "fails", child.getAttribute( "name" ) ); - Assert.assertEquals( "Expected failure description for method \"fails\" in " + className, 1, - child.getChildren( "failure" ).length ); - Assert.assertTrue( "time for failed test is expected to be positive", - Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) > 0 ); - } - } - } - - private Xpp3Dom[] readTests( OutputValidator validator, String className ) - throws FileNotFoundException - { - Xpp3Dom testResult = - Xpp3DomBuilder.build( validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" ).getFileInputStream(), - "UTF-8" ); - Xpp3Dom[] children = testResult.getChildren( "testcase" ); - return children; - } - -}