Java Doc for TestData.java in  » GIS » GeoTools-2.4.1 » org » geotools » 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 » GIS » GeoTools 2.4.1 » org.geotools 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.test.TestData
      org.geotools.TestData

TestData
final public class TestData extends org.geotools.test.TestData (Code)
Provides access to the common test-data directories provided in the sample-data module. This directory is shared by test suites in other modules.

This file has to live in the org.geotools root package in order to get access to the org/geotools/test-data directory. If you don't need this directory, then use the org.geotools.test.TestData class provided in the org.geotools.resources directory.
since:
   2.2
version:
   $Id: TestData.java 24085 2007-01-27 21:19:05Z desruisseaux $
author:
   Martin Desruisseaux





Method Summary
public static  Filecopy(Object caller, String name)
     Copies the named resources from the sample-data module to the test-data directory in an other module.
public static  Filefile(String name)
     Access to (name) as a non-null File .
public static  ReadableByteChannelopenChannel(String name)
     Provides a channel for named test data.
public static  LineNumberReaderopenReader(String name)
     Provides a BufferedReader for named test data.
public static  InputStreamopenStream(String name)
     Provides a non-null InputStream for named test data. It is the caller responsability to close this stream after usage.
Parameters:
  name - Path to file in org/geotools/test-data .
public static  URLurl(String name)
     Access to (name) as a non-null URL .



Method Detail
copy
public static File copy(Object caller, String name) throws IOException(Code)
Copies the named resources from the sample-data module to the test-data directory in an other module. For example if TestData.copy(this, "foo.txt") is invoked inside a test suite in the org.geotools.foo package, then this method copies org/geotools/test-data/foo.txt (from sample-data module) to org/geotools/foo/test-data/foo.txt (in the foo module).

This method is useful when a test case needs to access a resource through a File , for example because it want to open it using java.io.RandomAccess . Because the resources provided in the sample-data module are available to other modules as a JAR file, other modules can only access them through an URL unless they copy them in their own test-data directory.

If the named file already exists in the caller test-data directory, then this method does nothing. It make it safe to invoke this method many time in a test suite, since this method should not copy the file more than once for a given JVM execution.

The file will be if and only if it has been modified. Callers don't need to worry about cleanup, because the files are copied in the target/.../test-data directory, which is not versionned by SVN and is cleaned by Maven on mvn clean execution.
Parameters:
  caller - Calling class or object used to locate the destination test-data .
Parameters:
  name - Path to file in org/geotools/test-data . The file to the org/geotools/caller-package/test-dataresource copy, returned for convenience.
throws:
  FileNotFoundException - if the file is not found.
throws:
  IOException - if the resource can't be fetched for an other reason.




file
public static File file(String name) throws IOException(Code)
Access to (name) as a non-null File . You can access the test-data directory with:
 TestData.file(null);
 

Parameters:
  name - Path to file in org/geotools/test-data . The file to the test-data resource.
throws:
  FileNotFoundException - if the file is not found.
throws:
  IOException - if the resource can't be fetched for an other reason.



openChannel
public static ReadableByteChannel openChannel(String name) throws IOException(Code)
Provides a channel for named test data. It is the caller responsability to close this chanel after usage.
Parameters:
  name - Path to file in org/geotools/test-data . The chanel.
throws:
  FileNotFoundException - if the resource is not found.
throws:
  IOException - if an error occurs during an input operation.



openReader
public static LineNumberReader openReader(String name) throws IOException(Code)
Provides a BufferedReader for named test data. The buffered reader is provided as an LineNumberReader instance, which is useful for displaying line numbers where error occur. It is the caller responsability to close this reader after usage.
Parameters:
  name - Path to file in org/geotools/test-data . The buffered reader.
throws:
  FileNotFoundException - if the resource is not found.
throws:
  IOException - if an error occurs during an input operation.



openStream
public static InputStream openStream(String name) throws IOException(Code)
Provides a non-null InputStream for named test data. It is the caller responsability to close this stream after usage.
Parameters:
  name - Path to file in org/geotools/test-data . The input stream.
throws:
  FileNotFoundException - if the resource is not found.
throws:
  IOException - if an error occurs during an input operation.



url
public static URL url(String name) throws FileNotFoundException(Code)
Access to (name) as a non-null URL . At the difference of getResource , this method throws an exception if the resource is not found. This provides a more explicit explanation about the failure reason than the infamous NullPointerException .
Parameters:
  name - Path to file in org/geotools/test-data . The URL to the test-data resource.
throws:
  FileNotFoundException - if the resource is not found.



Fields inherited from org.geotools.test.TestData
final public static String EXTENSIVE_TEST_KEY(Code)(Java Doc)
final public static String INTERACTIVE_TEST_KEY(Code)(Java Doc)

Methods inherited from org.geotools.test.TestData
protected static void deleteOnExit(File file)(Code)(Java Doc)
protected static void deleteOnExit(File file, boolean force)(Code)(Java Doc)
public static File file(Object caller, String path) throws IOException(Code)(Java Doc)
public static BufferedReader getReader(Object caller, String name) throws IOException(Code)(Java Doc)
public static URL getResource(Object caller, String name)(Code)(Java Doc)
public static boolean isBaseJavaPlatform()(Code)(Java Doc)
public static boolean isExtensiveTest()(Code)(Java Doc)
public static boolean isInteractiveTest()(Code)(Java Doc)
public static boolean isMediaLibAvailable()(Code)(Java Doc)
public static ReadableByteChannel openChannel(Object caller, String name) throws IOException(Code)(Java Doc)
public static LineNumberReader openReader(Object caller, String name) throws IOException(Code)(Java Doc)
public static InputStream openStream(Object caller, String name) throws IOException(Code)(Java Doc)
public void run()(Code)(Java Doc)
public static File temp(Object caller, String name) throws IOException(Code)(Java Doc)
public static void unzipFile(Object caller, String name) throws IOException(Code)(Java Doc)
public static URL url(Object caller, String path) throws FileNotFoundException(Code)(Java Doc)

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.