org.apache.maven.surefire.its
Class SurefireVerifierTestClass

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.maven.surefire.its.SurefireVerifierTestClass
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractTestSingleMethod, AsbtractTestMethodPattern, CheckTestNgReportTestIT, CheckTestNgSuiteXmlSingleIT, ForkConsoleOutputIT, JUnit44HamcrestIT, Junit47concurrencyIT, JUnit4ForkAlwaysStaticInitPollutionIT, Junit4IgnoreIT, JUnit4RunListenerIT, Junit4VersionsIT, JUnitDepIT, NoRunnableTestsInClassIT, PlainOldJavaClasspathIT, ReportersIT, Surefire146ForkPerTestNoSetupIT, Surefire162CharsetProviderIT, Surefire224WellFormedXmlFailuresIT, Surefire257NotRerunningTestsIT, Surefire260TestWithIdenticalNamesIT, Surefire376TestNgAfterSuiteFailure, Surefire377TestNgAndJUnitTogetherIT, Surefire408ManualProviderSelectionIT, Surefire42NotExtendingTestCaseIT, Surefire44InnerClassTestIT, Surefire500PuzzlingErrorIT, Surefire510TestClassPathForkModesIT, Surefire570MultipleReportDirectoriesIT, Surefire613TestCountInParallelIT, Surefire621TestCountingJunit3InParallelIT, Surefire628ConsoleOutputBeforeAndAfterClassIT, Surefire634UnsettableSystemPropertiesWarningIT, Surefire673MockitoIT, Surefire674BuildFailingWhenErrorsIT, Surefire685CommaSeparatedIncludesIT, Surefire697NiceSummaryIT, Surefire705ParallelForkTimeoutIT, SystemPropertiesTestIT, TestNgParallelWithAnnotations, TimeoutForkedTestIT, UseIsolatedClassLoaderIT

public abstract class SurefireVerifierTestClass
extends junit.framework.TestCase

Contains commonly used featurtes for most tests, encapsulating common use cases. Also includes thread-safe access to the extracted resource files, which AbstractSurefireIntegrationTestClass does not. Thread safe only for running in "classes" mode.

Author:
Kristian Rosenvold

Constructor Summary
protected SurefireVerifierTestClass(String testProject)
           
 
Method Summary
protected  void activateProfile(String profile)
           
protected  SurefireVerifierTestClass addGoal(String goal)
           
protected  boolean assertContainsText(File file, String text)
           
protected  void assertNotPresent(File file)
           
protected  void assertPresent(File file)
           
 void assertTestSuiteResults(int total, int errors, int failures, int skipped)
           
protected  void debugLogging()
           
protected  org.apache.maven.it.Verifier execute(String goal)
           
protected  org.apache.maven.it.Verifier executeTest()
           
protected  void failNever()
           
protected  void forkAlways()
           
protected  void forkMode(String forkMode)
           
protected  void forkNever()
           
protected  void forkOnce()
           
protected  List<String> getInitialGoals(String testNgVersion)
           
protected  File getSiteFile(String fileName)
           
protected  File getSiteFile(String moduleName, String fileName)
           
protected  File getSubFile(String path)
          Returns a file, referenced from the extracted root (where pom.xml is located)
protected  File getSurefireReportsFile(String fileName)
           
protected  String getSurefireVersion()
           
 File getTestDir()
           
protected  org.apache.maven.it.Verifier getVerifier()
           
protected  boolean isMaven3X()
           
protected  void printSummary(boolean printsummary)
           
protected  void redirectToFile(boolean redirect)
           
protected  void reset()
           
protected  void showErrorStackTraces()
           
protected  void verifyErrorFreeLog()
           
 void verifyTextInLog(String text)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SurefireVerifierTestClass

protected SurefireVerifierTestClass(String testProject)
Method Detail

reset

protected void reset()

getInitialGoals

protected List<String> getInitialGoals(String testNgVersion)

getSubFile

protected File getSubFile(String path)
Returns a file, referenced from the extracted root (where pom.xml is located)

Parameters:
path - The subdirectory under basedir
Returns:
A file

assertPresent

protected void assertPresent(File file)

assertNotPresent

protected void assertNotPresent(File file)

showErrorStackTraces

protected void showErrorStackTraces()

debugLogging

protected void debugLogging()

failNever

protected void failNever()

addGoal

protected SurefireVerifierTestClass addGoal(String goal)

executeTest

protected org.apache.maven.it.Verifier executeTest()
                                            throws org.apache.maven.it.VerificationException
Throws:
org.apache.maven.it.VerificationException

execute

protected org.apache.maven.it.Verifier execute(String goal)
                                        throws org.apache.maven.it.VerificationException
Throws:
org.apache.maven.it.VerificationException

getSurefireReportsFile

protected File getSurefireReportsFile(String fileName)

getSiteFile

protected File getSiteFile(String fileName)

getSiteFile

protected File getSiteFile(String moduleName,
                           String fileName)

printSummary

protected void printSummary(boolean printsummary)

redirectToFile

protected void redirectToFile(boolean redirect)

forkOnce

protected void forkOnce()

forkNever

protected void forkNever()

forkAlways

protected void forkAlways()

forkMode

protected void forkMode(String forkMode)

activateProfile

protected void activateProfile(String profile)

assertTestSuiteResults

public void assertTestSuiteResults(int total,
                                   int errors,
                                   int failures,
                                   int skipped)

verifyTextInLog

public void verifyTextInLog(String text)
                     throws org.apache.maven.it.VerificationException
Throws:
org.apache.maven.it.VerificationException

verifyErrorFreeLog

protected void verifyErrorFreeLog()
                           throws org.apache.maven.it.VerificationException
Throws:
org.apache.maven.it.VerificationException

getVerifier

protected org.apache.maven.it.Verifier getVerifier()

getTestDir

public File getTestDir()

assertContainsText

protected boolean assertContainsText(File file,
                                     String text)
                              throws org.apache.maven.it.VerificationException
Throws:
org.apache.maven.it.VerificationException

isMaven3X

protected boolean isMaven3X()

getSurefireVersion

protected String getSurefireVersion()


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.