Java Doc for AntBasedTestUtil.java in  » IDE-Netbeans » project.ant » org » netbeans » spi » project » support » 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 » IDE Netbeans » project.ant » org.netbeans.spi.project.support.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.spi.project.support.ant.AntBasedTestUtil

AntBasedTestUtil
public class AntBasedTestUtil (Code)
Test-related utilities for use in ant/project.
author:
   Jesse Glick

Inner Class :public interface AntArtifactProviderMutable extends AntArtifactProvider
Inner Class :final public static class TestListener implements AntProjectListener
Inner Class :public static class TestAntArtifact extends AntArtifact
Inner Class :final public static class TestMutablePropertyProvider implements PropertyProvider



Method Summary
public static  int[]countTextDiffs(Reader r1, Reader r2)
     Count the number of (line-based) differences between two text files. The returned count has, in this order:
  1. Lines modified between the first and second files.
  2. Lines added in the second file that were not in the first.
  3. Lines removed in the second file that were in the first.
It thus serves as a summary of the number of diff lines you would expect to get from e.g.
public static  intreplaceInFile(File f, String from, String to)
     Replace all occurrences of a given string in a file with a new string.
public static  PropertiesslurpProperties(AntProjectHelper h, String path)
     Load a properties file from disk.
public static  StringslurpText(AntProjectHelper h, String path)
     Load a text file from disk.
public static  DocumentslurpXml(AntProjectHelper h, String path)
     Load an XML file from disk.
public static  AntBasedProjectTypetestAntBasedProjectType()
     Create an AntBasedProjectType instance suitable for testing.
public static  AntBasedProjectTypetestAntBasedProjectType(AntBuildExtenderImplementation extender)
    
public static  URLtestBuildXmlStylesheet()
     Get a sample build.xsl.
public static  CollocationQueryImplementationtestCollocationQueryImplementation(File root)
     Get a sample file collocation query provider.



Method Detail
countTextDiffs
public static int[] countTextDiffs(Reader r1, Reader r2) throws IOException(Code)
Count the number of (line-based) differences between two text files. The returned count has, in this order:
  1. Lines modified between the first and second files.
  2. Lines added in the second file that were not in the first.
  3. Lines removed in the second file that were in the first.
It thus serves as a summary of the number of diff lines you would expect to get from e.g. a version control system doing a normal text checkin.
Parameters:
  r1 - the first file (the reader will not be closed for you)
Parameters:
  r2 - the second file (the reader will not be closed for you) a count of lines modified, added, and removed (resp.)
throws:
  IOException - in case reading from the files failed



replaceInFile
public static int replaceInFile(File f, String from, String to) throws IOException(Code)
Replace all occurrences of a given string in a file with a new string. UTF-8 encoding is assumed.
Parameters:
  f - the file to modify
Parameters:
  from - the search string
Parameters:
  to - the replacement string a count of how many occurrences were replaced
throws:
  IOException - in case reading or writing the file failed



slurpProperties
public static Properties slurpProperties(AntProjectHelper h, String path) throws IOException(Code)
Load a properties file from disk.
Parameters:
  h - a project reference
Parameters:
  path - the relative file path properties available at that location, or null if no such file
throws:
  IOException - if there is any problem loading it



slurpText
public static String slurpText(AntProjectHelper h, String path) throws IOException(Code)
Load a text file from disk. Assumes UTF-8 encoding.
Parameters:
  h - a project reference
Parameters:
  path - the relative file path the raw contents of the text file at that point, or null if no such file
throws:
  IOException - if there is any problem loading it



slurpXml
public static Document slurpXml(AntProjectHelper h, String path) throws IOException, SAXException(Code)
Load an XML file from disk.
Parameters:
  h - a project reference
Parameters:
  path - the relative file path an XML document available at that location, or null if no such file
throws:
  IOException - if there is any problem loading it
throws:
  SAXException - if it is malformed



testAntBasedProjectType
public static AntBasedProjectType testAntBasedProjectType()(Code)
Create an AntBasedProjectType instance suitable for testing. It has the type code test. It uses <data> as the configuration data element, with namespaces urn:test:shared and urn:test:private. Loading the project succeeds unless there is a file in it nbproject/broken. The project's methods mostly delegate to the helper; its lookup uses the helper's supports for AuxiliaryConfiguration, CacheDirectoryProvider, and SubprojectProvider, and also adds an instance of String, namely "hello". It also puts the AntProjectHelper into its lookup to assist in testing. build-impl.xml is generated from data/build-impl.xsl by a ProjectXmlSavedHook using GeneratedFilesHelper.refreshBuildScript. A ReferenceHelper is also added to its lookup for testing purposes. An AntArtifactProviderMutable is added which initially publishes two artifacts: one of target 'dojar' type 'jar' with artifact ${build.jar}; one of target 'dojavadoc' type 'javadoc' with artifact ${build.javadoc}; both using clean target 'clean'. A GeneratedFilesHelper is added to its lookup for testing purposes. a project type object for testing purposes



testAntBasedProjectType
public static AntBasedProjectType testAntBasedProjectType(AntBuildExtenderImplementation extender)(Code)



testBuildXmlStylesheet
public static URL testBuildXmlStylesheet()(Code)
Get a sample build.xsl. a URL to a stylesheet



testCollocationQueryImplementation
public static CollocationQueryImplementation testCollocationQueryImplementation(File root)(Code)
Get a sample file collocation query provider. Files under the supplied root are normally considered to be collocated. However the subdirectory separate (if it exists) forms its own root. And the subdirectory transient (if it exists) does not form a root, but any files in there are not considered collocated with anything.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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