Java Doc for BuildFileTest.java in  » Build » ANT » org » apache » tools » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.BuildFileTest

All known Subclasses:   org.apache.tools.ant.taskdefs.optional.vss.MSVSSTest,  org.apache.tools.ant.filters.DynamicFilterTest,  org.apache.tools.ant.taskdefs.optional.sos.SOSTest,  org.apache.tools.ant.filters.StripJavaCommentsTest,  org.apache.tools.ant.taskdefs.TarTest,  org.apache.tools.ant.taskdefs.UpToDateTest,  org.apache.tools.ant.taskdefs.NiceTest,  org.apache.tools.ant.taskdefs.optional.junit.JUnitReportTest,  org.apache.tools.ant.taskdefs.optional.depend.DependTest,  org.apache.tools.ant.filters.LineContainsTest,  org.apache.tools.ant.taskdefs.TypeAdapterTest,  org.apache.tools.ant.taskdefs.BasenameTest,  org.apache.tools.ant.taskdefs.InputTest,  org.apache.tools.ant.taskdefs.MacroDefTest,  org.apache.tools.ant.taskdefs.InitializeClassTest,  org.apache.tools.ant.taskdefs.ManifestClassPathTest,  org.apache.tools.ant.types.optional.ScriptConditionTest,  org.apache.tools.ant.taskdefs.condition.IsSignedTest,  org.apache.tools.ant.taskdefs.GetTest,  org.apache.tools.ant.types.optional.ScriptSelectorTest,  org.apache.tools.ant.taskdefs.AntLikeTasksAtTopLevelTest,  org.apache.tools.ant.types.FlexIntegerTest,  org.apache.tools.ant.taskdefs.TaskdefsTest,  org.apache.tools.ant.taskdefs.optional.XmlValidateCatalogTest,  org.apache.tools.ant.taskdefs.email.EmailTaskTest,  org.apache.tools.ant.filters.TokenFilterTest,  org.apache.tools.ant.taskdefs.AptTest,  org.apache.tools.ant.taskdefs.TypedefTest,  org.apache.tools.ant.taskdefs.condition.IsFailureTest,  org.apache.tools.ant.taskdefs.optional.junit.JUnitTestListenerTest,  org.apache.tools.ant.taskdefs.FilterTest,  org.apache.tools.ant.taskdefs.RenameTest,  org.apache.tools.ant.taskdefs.AntTest,  org.apache.tools.ant.taskdefs.optional.ReplaceRegExpTest,  org.apache.tools.ant.taskdefs.optional.PropertyFileTest,  org.apache.tools.ant.taskdefs.CopydirTest,  org.apache.tools.ant.taskdefs.BUnzip2Test,  org.apache.tools.ant.taskdefs.AbstractCvsTaskTest,  org.apache.tools.ant.taskdefs.RmicAdvancedTest,  org.apache.tools.ant.types.optional.ScriptMapperTest,  org.apache.tools.ant.types.DescriptionTest,  org.apache.tools.ant.types.XMLCatalogBuildFileTest,  org.apache.tools.ant.taskdefs.optional.i18n.TranslateTest,  org.apache.tools.ant.taskdefs.condition.XorTest,  org.apache.tools.ant.taskdefs.CopyTest,  org.apache.tools.ant.taskdefs.ZipTest,  org.apache.tools.ant.taskdefs.ExecTaskTest,  org.apache.tools.ant.taskdefs.SleepTest,  org.apache.tools.ant.taskdefs.SignJarTest,  org.apache.tools.ant.taskdefs.LoadFileTest,  org.apache.tools.ant.taskdefs.MultiMapTest,  org.apache.tools.ant.DirectoryScannerTest,  org.apache.tools.ant.taskdefs.XmlnsTest,  org.apache.tools.ant.taskdefs.EchoTest,  org.apache.tools.ant.taskdefs.ChecksumTest,  org.apache.tools.ant.ImmutableTest,  org.apache.tools.ant.taskdefs.DirnameTest,  org.apache.tools.ant.TaskContainerTest,  org.apache.tools.ant.taskdefs.optional.junit.XMLFormatterWithCDATAOnSystemOut,  org.apache.tools.ant.taskdefs.optional.net.FTPTest,  org.apache.tools.ant.taskdefs.condition.IsFileSelectedTest,  org.apache.tools.ant.taskdefs.condition.AntVersionTest,  org.apache.tools.ant.taskdefs.JavadocTest,  org.apache.tools.ant.taskdefs.optional.RhinoReferenceTest,  org.apache.tools.ant.taskdefs.TaskdefTest,  org.apache.tools.ant.taskdefs.GUnzipTest,  org.apache.tools.ant.LocationTest,  org.apache.tools.ant.types.PropertySetTest,  org.apache.tools.ant.taskdefs.LoadPropertiesTest,  org.apache.tools.ant.taskdefs.optional.jdepend.JDependTest,  org.apache.tools.ant.taskdefs.optional.BeanShellScriptTest,  org.apache.tools.ant.taskdefs.DefaultExcludesTest,  org.apache.tools.ant.taskdefs.condition.ParserSupportsTest,  org.apache.tools.ant.ExtendedTaskdefTest,  org.apache.tools.ant.taskdefs.ParallelTest,  org.apache.tools.ant.taskdefs.PathConvertTest,  org.apache.tools.ant.TopLevelTaskTest,  org.apache.tools.ant.taskdefs.CopyfileTest,  org.apache.tools.ant.taskdefs.optional.EchoPropertiesTest,  org.apache.tools.ant.taskdefs.optional.image.ImageTest,  org.apache.tools.ant.IncludeTest,  org.apache.tools.ant.taskdefs.MkdirTest,  org.apache.tools.ant.taskdefs.StyleTest,  org.apache.tools.ant.types.ResourceComparatorsTest,  org.apache.tools.ant.taskdefs.CVSPassTest,  org.apache.tools.ant.filters.NoNewLineTest,  org.apache.tools.ant.taskdefs.UntarTest,  org.apache.tools.ant.taskdefs.JarTest,  org.apache.tools.ant.taskdefs.optional.JavahTest,  org.apache.tools.ant.taskdefs.EchoXMLTest,  org.apache.tools.ant.taskdefs.JavaTest,  org.apache.tools.ant.types.AddTypeTest,  org.apache.tools.ant.taskdefs.SyncTest,  org.apache.tools.ant.types.ResourceOutputTest,  org.apache.tools.ant.taskdefs.DeltreeTest,  org.apache.tools.ant.taskdefs.DeleteTest,  org.apache.tools.ant.LoaderRefTest,  org.apache.tools.ant.types.selectors.SignedSelectorTest,  org.apache.tools.ant.taskdefs.ManifestTest,  org.apache.tools.ant.taskdefs.GzipTest,  org.apache.tools.ant.taskdefs.ConcatTest,  org.apache.tools.ant.types.AssertionsTest,  org.apache.tools.ant.taskdefs.AntStructureTest,  org.apache.tools.ant.taskdefs.CallTargetTest,  org.apache.tools.ant.DispatchTaskTest,  org.apache.tools.ant.taskdefs.condition.TypeFoundTest,  org.apache.tools.ant.types.FileListTest,  org.apache.tools.ant.taskdefs.optional.JspcTest,  org.apache.tools.ant.taskdefs.optional.XmlValidateTest,  org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskTest,  org.apache.tools.ant.taskdefs.ImportTest,  org.apache.tools.ant.types.optional.depend.ClassFileSetTest,  org.apache.tools.ant.taskdefs.RecorderTest,  org.apache.tools.ant.taskdefs.optional.Native2AsciiTest,  org.apache.tools.ant.taskdefs.optional.DotnetTest,  org.apache.tools.ant.taskdefs.optional.ANTLRTest,  org.apache.tools.ant.taskdefs.FixCrLfTest,  org.apache.tools.ant.taskdefs.condition.IsReachableTest,  org.apache.tools.ant.types.mappers.GlobMapperTest,  org.apache.tools.ant.types.PolyTest,  org.apache.tools.ant.taskdefs.PropertyTest,  org.apache.tools.ant.filters.ConcatFilterTest,  org.apache.tools.ant.types.mappers.RegexpPatternMapperTest,  org.apache.tools.ant.taskdefs.optional.script.ScriptDefTest,  org.apache.tools.ant.taskdefs.optional.RhinoScriptTest,  org.apache.tools.ant.types.resources.JavaResourceTest,  org.apache.tools.ant.taskdefs.optional.SchemaValidateTest,  org.apache.tools.ant.taskdefs.optional.XsltTest,  org.apache.tools.ant.taskdefs.MakeUrlTest,  org.apache.tools.ant.UnknownElementTest,  org.apache.tools.ant.filters.EscapeUnicodeTest,  org.apache.tools.ant.util.XMLFragmentTest,  org.apache.tools.ant.taskdefs.DynamicTest,  org.apache.tools.ant.taskdefs.WhichResourceTest,  org.apache.tools.ant.taskdefs.BZip2Test,  org.apache.tools.ant.taskdefs.LengthTest,  org.apache.tools.ant.taskdefs.AvailableTest,  org.apache.tools.ant.ExecutorTest,  org.apache.tools.ant.taskdefs.PreSetDefTest,  org.apache.tools.ant.taskdefs.AntlibTest,  org.apache.tools.ant.PropertyExpansionTest,  org.apache.tools.ant.AntClassLoaderTest,  org.apache.tools.ant.taskdefs.optional.unix.SymlinkTest,  org.apache.tools.ant.types.FilterSetTest,  org.apache.tools.ant.CaseTest,  org.apache.tools.ant.taskdefs.optional.WsdlToDotnetTest,  org.apache.tools.ant.taskdefs.XmlPropertyTest,  org.apache.tools.ant.taskdefs.condition.IsReferenceTest,  org.apache.tools.ant.filters.HeadTailTest,  org.apache.tools.ant.types.resources.TarResourceTest,  org.apache.tools.ant.taskdefs.MoveTest,  org.apache.tools.ant.taskdefs.SubAntTest,  org.apache.tools.ant.taskdefs.TouchTest,  org.apache.tools.ant.taskdefs.optional.PvcsTest,  org.apache.tools.ant.types.RedirectorElementTest,  org.apache.tools.ant.taskdefs.UnzipTest,  org.apache.tools.ant.taskdefs.ConditionTest,  org.apache.tools.ant.taskdefs.ProtectedJarMethodsTest,  org.apache.tools.ant.taskdefs.ReplaceTest,  org.apache.tools.ant.taskdefs.WarTest,  org.apache.tools.ant.filters.ReplaceTokensTest,  org.apache.tools.ant.taskdefs.FailTest,
BuildFileTest
abstract public class BuildFileTest extends TestCase (Code)
A BuildFileTest is a TestCase which executes targets from an Ant buildfile for testing. This class provides a number of utility methods for particular build file tests which extend this class.


Field Summary
protected  Projectproject
    

Constructor Summary
public  BuildFileTest()
     Default constructor for the BuildFileTest object.
public  BuildFileTest(String name)
     Constructor for the BuildFileTest object.

Method Summary
public  voidassertDebuglogContaining(String substring)
     Assert that the given substring is in the log messages.
public  voidassertLogContaining(String substring)
     Assert that the given substring is in the log messages.
public  voidassertOutputContaining(String substring)
     Assert that the given substring is in the output messages.
public  voidassertPropertyEquals(String property, String value)
     assert that a property equals a value; comparison is case sensitive.
public  voidassertPropertySet(String property)
     assert that a property equals "true".
public  voidassertPropertyUnset(String property)
     assert that a property is null.
public  voidconfigureProject(String filename)
    
public  voidconfigureProject(String filename, int logLevel)
    
public  voidexecuteTarget(String targetName)
    
public  voidexpectBuildException(String target, String cause)
    
public  voidexpectBuildExceptionContaining(String target, String cause, String contains)
    
public  voidexpectDebuglog(String target, String log)
     Assert that the given message has been logged with a priority >= VERBOSE when running the given target.
public  voidexpectLog(String target, String log)
     Assert that only the given message has been logged with a priority <= INFO when running the given target.
public  voidexpectLogContaining(String target, String log)
     Assert that the given message has been logged with a priority <= INFO when running the given target.
public  voidexpectOutput(String target, String output)
    
public  voidexpectOutputAndError(String target, String output, String error)
    
public  voidexpectPropertySet(String target, String property, String value)
    
public  voidexpectPropertySet(String target, String property)
     call a target, verify named property is "true".
public  voidexpectPropertyUnset(String target, String property)
     Call a target, verify property is null.
public  voidexpectSpecificBuildException(String target, String cause, String msg)
     Runs a target, wait for a build exception.
public  BuildExceptiongetBuildException()
    
public  StringgetError()
    
public  StringgetFullLog()
     Gets the log the BuildFileTest object.
public  StringgetLog()
     Gets the log the BuildFileTest object.
public  StringgetOutput()
    
public  ProjectgetProject()
     Get the project which has been configured for a test.
public  FilegetProjectDir()
     Gets the directory of the project.
public  URLgetResource(String resource)
     Retrieve a resource from the caller classloader to avoid assuming a vm working directory.
protected  voidtearDown()
     Automatically calls the target called "tearDown" from the build file tested if it exits. This allows to use Ant tasks directly in the build file to clean up after each test.

Field Detail
project
protected Project project(Code)




Constructor Detail
BuildFileTest
public BuildFileTest()(Code)
Default constructor for the BuildFileTest object.



BuildFileTest
public BuildFileTest(String name)(Code)
Constructor for the BuildFileTest object.
Parameters:
  name - string to pass up to TestCase constructor




Method Detail
assertDebuglogContaining
public void assertDebuglogContaining(String substring)(Code)
Assert that the given substring is in the log messages.



assertLogContaining
public void assertLogContaining(String substring)(Code)
Assert that the given substring is in the log messages.



assertOutputContaining
public void assertOutputContaining(String substring)(Code)
Assert that the given substring is in the output messages.
since:
   Ant1.7



assertPropertyEquals
public void assertPropertyEquals(String property, String value)(Code)
assert that a property equals a value; comparison is case sensitive.
Parameters:
  property - property name
Parameters:
  value - expected value



assertPropertySet
public void assertPropertySet(String property)(Code)
assert that a property equals "true".
Parameters:
  property - property name



assertPropertyUnset
public void assertPropertyUnset(String property)(Code)
assert that a property is null.
Parameters:
  property - property name



configureProject
public void configureProject(String filename) throws BuildException(Code)
Sets up to run the named project
Parameters:
  filename - name of project file to run



configureProject
public void configureProject(String filename, int logLevel) throws BuildException(Code)
Sets up to run the named project
Parameters:
  filename - name of project file to run



executeTarget
public void executeTarget(String targetName)(Code)
Executes a target we have set up
Parameters:
  targetName - target to run



expectBuildException
public void expectBuildException(String target, String cause)(Code)
run a target, expect for any build exception
Parameters:
  target - target to run
Parameters:
  cause - information string to reader of report



expectBuildExceptionContaining
public void expectBuildExceptionContaining(String target, String cause, String contains)(Code)
run a target, expect an exception string containing the substring we look for (case sensitive match)
Parameters:
  target - target to run
Parameters:
  cause - information string to reader of report
Parameters:
  contains - substring of the build exception to look for



expectDebuglog
public void expectDebuglog(String target, String log)(Code)
Assert that the given message has been logged with a priority >= VERBOSE when running the given target.



expectLog
public void expectLog(String target, String log)(Code)
Assert that only the given message has been logged with a priority <= INFO when running the given target.



expectLogContaining
public void expectLogContaining(String target, String log)(Code)
Assert that the given message has been logged with a priority <= INFO when running the given target.



expectOutput
public void expectOutput(String target, String output)(Code)
execute the target, verify output matches expectations
Parameters:
  target - target to execute
Parameters:
  output - output to look for



expectOutputAndError
public void expectOutputAndError(String target, String output, String error)(Code)
Executes the target, verify output matches expectations and that we got the named error at the end
Parameters:
  target - target to execute
Parameters:
  output - output to look for
Parameters:
  error - Description of Parameter



expectPropertySet
public void expectPropertySet(String target, String property, String value)(Code)
call a target, verify property is as expected
Parameters:
  target - build file target
Parameters:
  property - property name
Parameters:
  value - expected value



expectPropertySet
public void expectPropertySet(String target, String property)(Code)
call a target, verify named property is "true".
Parameters:
  target - build file target
Parameters:
  property - property name



expectPropertyUnset
public void expectPropertyUnset(String target, String property)(Code)
Call a target, verify property is null.
Parameters:
  target - build file target
Parameters:
  property - property name



expectSpecificBuildException
public void expectSpecificBuildException(String target, String cause, String msg)(Code)
Runs a target, wait for a build exception.
Parameters:
  target - target to run
Parameters:
  cause - information string to reader of report
Parameters:
  msg - the message value of the build exception we are waitingfor set to null for any build exception to be valid



getBuildException
public BuildException getBuildException()(Code)



getError
public String getError()(Code)



getFullLog
public String getFullLog()(Code)
Gets the log the BuildFileTest object. Only valid if configureProject() has been called. The log value



getLog
public String getLog()(Code)
Gets the log the BuildFileTest object. Only valid if configureProject() has been called. The log value



getOutput
public String getOutput()(Code)



getProject
public Project getProject()(Code)
Get the project which has been configured for a test. the Project instance for this test.



getProjectDir
public File getProjectDir()(Code)
Gets the directory of the project. the base dir of the project



getResource
public URL getResource(String resource)(Code)
Retrieve a resource from the caller classloader to avoid assuming a vm working directory. The resource path must be relative to the package name or absolute from the root path.
Parameters:
  resource - the resource to retrieve its url.
throws:
  junit.framework.AssertionFailedError - if the resource is not found.



tearDown
protected void tearDown() throws Exception(Code)
Automatically calls the target called "tearDown" from the build file tested if it exits. This allows to use Ant tasks directly in the build file to clean up after each test. Note that no "setUp" target is automatically called, since it's trivial to have a test target depend on it.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.