Java Doc for BaseSelectorTest.java in  » Build » ANT » org » apache » tools » ant » types » selectors » 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.types.selectors 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.types.selectors.BaseSelectorTest

All known Subclasses:   org.apache.tools.ant.types.selectors.DateSelectorTest,  org.apache.tools.ant.types.selectors.ContainsSelectorTest,  org.apache.tools.ant.types.selectors.ModifiedSelectorTest,  org.apache.tools.ant.types.selectors.FilenameSelectorTest,  org.apache.tools.ant.types.selectors.DependSelectorTest,  org.apache.tools.ant.types.selectors.DepthSelectorTest,  org.apache.tools.ant.types.selectors.SizeSelectorTest,  org.apache.tools.ant.types.selectors.TypeSelectorTest,  org.apache.tools.ant.types.selectors.PresentSelectorTest,
BaseSelectorTest
abstract public class BaseSelectorTest extends TestCase (Code)
Base test case for Selectors. Provides a shared test as well as a test bed for selecting on, and a helper method for determining whether selections are correct.


Field Summary
protected  Filebasedir
    
protected  Stringbasedirname
    
protected  Filebeddir
    
protected  Stringbeddirname
    
protected  String[]filenames
    
protected  File[]files
    
protected  Filemirrordir
    
protected  Stringmirrordirname
    
protected  File[]mirrorfiles
    

Constructor Summary
public  BaseSelectorTest(String name)
    

Method Summary
protected  voidcleanupBed()
     Cleans up the testbed by calling a target in the src/etc/testcases/types/selectors.xml file.
protected  voidcleanupMirror()
     Cleans up the mirror testbed by calling a target in the src/etc/testcases/types/selectors.xml file.
public  Stringdiff(String expected, String result)
     Checks which files are selected and shouldn't be or which are not selected but should.
abstract public  BaseSelectorgetInstance()
    
public  ProjectgetProject()
    
public  BaseSelectorgetSelector()
     Return a preconfigured selector (with a set reference to project instance).
protected  voidmakeBed()
    

Creates a testbed.

protected  voidmakeMirror()
    

Creates a mirror of the testbed for use in dependency checks.

Note that the right way to call this is within a try block, with a finally clause that calls cleanupMirror().

public  StringmirrorSelectionString(FileSelector selector)
     This is a helper method that takes a selector and calls its isSelected() method on each file in the mirror testbed.
public  voidperformTests(FileSelector selector, String expected)
     Does the selection test for a given selector and prints the filenames of the differing files (selected but shouldn't, not selected but should).
public  Stringresolve(String filelist)
     Resolves a diff-String (@see diff()) against the (inherited) filenames- and files arrays.
public  StringselectionString(FileSelector selector)
     This is a helper method that takes a selector and calls its isSelected() method on each file in the testbed.
public  StringselectionString(File basedir, File[] files, FileSelector selector)
     Worker method for the two convenience methods above.
public  voidsetUp()
    
public  voidtestRespondsToError()
     This is a test that all Selectors derived from BaseSelector can use.

Field Detail
basedir
protected File basedir(Code)



basedirname
protected String basedirname(Code)



beddir
protected File beddir(Code)



beddirname
protected String beddirname(Code)



filenames
protected String[] filenames(Code)



files
protected File[] files(Code)



mirrordir
protected File mirrordir(Code)



mirrordirname
protected String mirrordirname(Code)



mirrorfiles
protected File[] mirrorfiles(Code)




Constructor Detail
BaseSelectorTest
public BaseSelectorTest(String name)(Code)




Method Detail
cleanupBed
protected void cleanupBed()(Code)
Cleans up the testbed by calling a target in the src/etc/testcases/types/selectors.xml file.



cleanupMirror
protected void cleanupMirror()(Code)
Cleans up the mirror testbed by calling a target in the src/etc/testcases/types/selectors.xml file.



diff
public String diff(String expected, String result)(Code)
Checks which files are selected and shouldn't be or which are not selected but should.
Parameters:
  expected - String containing 'F's and 'T's
Parameters:
  result - String containing 'F's and 'T's Difference as String containing '-' (equal) and'X' (difference).



getInstance
abstract public BaseSelector getInstance()(Code)
Override this in child classes to return a specific Selector



getProject
public Project getProject()(Code)



getSelector
public BaseSelector getSelector()(Code)
Return a preconfigured selector (with a set reference to project instance). the selector



makeBed
protected void makeBed()(Code)

Creates a testbed. We avoid the dreaded "test" word so that we don't falsely identify this as a test to be run. The actual setting up of the testbed is done in the src/etc/testcases/types/selectors.xml build file.

Note that the right way to call this is within a try block, with a finally clause that calls cleanupBed(). You place tests of the isSelected() method within the try block.




makeMirror
protected void makeMirror()(Code)

Creates a mirror of the testbed for use in dependency checks.

Note that the right way to call this is within a try block, with a finally clause that calls cleanupMirror(). You place tests of the isSelected() method within the try block.




mirrorSelectionString
public String mirrorSelectionString(FileSelector selector)(Code)
This is a helper method that takes a selector and calls its isSelected() method on each file in the mirror testbed. This variation is used for dependency checks and to get around the limitations in the touch task when running JDK 1.1. It returns a string of "T"s amd "F"s.



performTests
public void performTests(FileSelector selector, String expected)(Code)
Does the selection test for a given selector and prints the filenames of the differing files (selected but shouldn't, not selected but should).
Parameters:
  selector - The selector to test
Parameters:
  expected - The expected result



resolve
public String resolve(String filelist)(Code)
Resolves a diff-String (@see diff()) against the (inherited) filenames- and files arrays.
Parameters:
  filelist - Diff-String String containing the filenames for all differing files,separated with semicolons ';'



selectionString
public String selectionString(FileSelector selector)(Code)
This is a helper method that takes a selector and calls its isSelected() method on each file in the testbed. It returns a string of "T"s amd "F"s



selectionString
public String selectionString(File basedir, File[] files, FileSelector selector)(Code)
Worker method for the two convenience methods above. Applies a selector on a set of files passed in and returns a string of "T"s amd "F"s from applying the selector to each file.



setUp
public void setUp()(Code)



testRespondsToError
public void testRespondsToError()(Code)
This is a test that all Selectors derived from BaseSelector can use. It calls the setError() method and checks to ensure that a BuildException is thrown as a result.



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