Java Doc for AssertTestFactory.java in  » Test-Coverage » GroboUtils » net » sourceforge » groboutils » junit » v1 » 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 » Test Coverage » GroboUtils » net.sourceforge.groboutils.junit.v1 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.groboutils.junit.v1.AssertTestFactory

AssertTestFactory
public class AssertTestFactory (Code)
A factory that creates test instances for the standard set of assert methods. The created test instances should have their setName() method invoked to properly set the name of the test. Alternatively, the factory instance can have the name set so that all tests will have the same name.

To support JUnit 3.8 functionality, but remain backwards compatible with earlier JUnit libraries, the names for the JUnit 3.8 methods will be allowed, but they will call JUnit 3.7 compatible methods.

As of Dec 8, 2002, the factory can uniquely (per instance) name each generated test via an index. This can help traceability in identifying each created test. Alternatively, the user can set the factory's name before invoking a create method.
author:
   Matt Albrecht groboclown@users.sourceforge.net
version:
   $Date: 2004/01/09 20:32:26 $
since:
   July 26, 2002


Inner Class :abstract public static class InnerTest extends TestCase


Constructor Summary
public  AssertTestFactory()
     Creates a new factory that can generate assertions as independent test objects.
public  AssertTestFactory(String name)
     Creates a new factory with a specific name for each generated test, but will not add an index to each generated test's name.
public  AssertTestFactory(String name, boolean useIndexWithName)
     Creates a new factory with a specific name for each generated test, and can optionally add an index to each generated test's name.

Method Summary
public  InnerTestcreateAssertEquals(String message, Object expected, Object actual)
     Asserts that two objects are equal.
public  InnerTestcreateAssertEquals(Object expected, Object actual)
     Asserts that two objects are equal.
public  InnerTestcreateAssertEquals(String message, String expected, String actual)
     Asserts that two objects are equal.
public  InnerTestcreateAssertEquals(String expected, String actual)
     Asserts that two objects are equal.
public  InnerTestcreateAssertEquals(String message, double expected, double actual, double delta)
     Asserts that two doubles are equal concerning a delta.
public  InnerTestcreateAssertEquals(double expected, double actual, double delta)
     Asserts that two doubles are equal concerning a delta.
public  InnerTestcreateAssertEquals(String message, float expected, float actual, float delta)
     Asserts that two floats are equal concerning a delta.
public  InnerTestcreateAssertEquals(float expected, float actual, float delta)
     Asserts that two floats are equal concerning a delta.
public  InnerTestcreateAssertEquals(String message, long expected, long actual)
     Asserts that two longs are equal.
public  InnerTestcreateAssertEquals(long expected, long actual)
     Asserts that two longs are equal.
public  InnerTestcreateAssertEquals(String message, boolean expected, boolean actual)
     Asserts that two booleans are equal.
public  InnerTestcreateAssertEquals(boolean expected, boolean actual)
     Asserts that two booleans are equal.
public  InnerTestcreateAssertEquals(String message, byte expected, byte actual)
     Asserts that two bytes are equal.
public  InnerTestcreateAssertEquals(byte expected, byte actual)
     Asserts that two bytes are equal.
public  InnerTestcreateAssertEquals(String message, char expected, char actual)
     Asserts that two chars are equal.
public  InnerTestcreateAssertEquals(char expected, char actual)
     Asserts that two chars are equal.
public  InnerTestcreateAssertEquals(String message, short expected, short actual)
     Asserts that two shorts are equal.
public  InnerTestcreateAssertEquals(short expected, short actual)
     Asserts that two shorts are equal.
public  InnerTestcreateAssertEquals(String message, int expected, int actual)
     Asserts that two ints are equal.
public  InnerTestcreateAssertEquals(int expected, int actual)
     Asserts that two ints are equal.
public  InnerTestcreateAssertFalse(String message, boolean condition)
     Asserts that a condition is false.
public  InnerTestcreateAssertFalse(boolean condition)
     Asserts that a condition is true.
public  InnerTestcreateAssertNotNull(String message, Object object)
     Asserts that an object isn't null.
public  InnerTestcreateAssertNotNull(Object object)
     Asserts that an object isn't null.
public  InnerTestcreateAssertNotSame(String message, Object expected, Object actual)
     Asserts that two objects refer to the same object.
public  InnerTestcreateAssertNotSame(Object expected, Object actual)
     Asserts that two objects refer to the same object.
public  InnerTestcreateAssertNull(String message, Object object)
     Asserts that an object is null.
public  InnerTestcreateAssertNull(Object object)
     Asserts that an object is null.
public  InnerTestcreateAssertSame(String message, Object expected, Object actual)
     Asserts that two objects refer to the same object.
public  InnerTestcreateAssertSame(Object expected, Object actual)
     Asserts that two objects refer to the same object.
public  InnerTestcreateAssertTrue(String message, boolean condition)
     Asserts that a condition is true.
public  InnerTestcreateAssertTrue(boolean condition)
     Asserts that a condition is true.
public  InnerTestcreateFail(String message)
     Fails a test with the given message.
public  InnerTestcreateFail()
     Fails a test with no message.
public  StringgetName()
     Returns the default test name.
public  booleangetUseIndexWithName()
     Returns whether each generated test will add a unique (for this instance) index to the test's name.
public  voidsetName(String name)
     Sets the default test name.
public  voidsetUseIndexWithName(boolean useIndexWithName)
     Sets whether each generated test will add a unique (for this instance) index to the test's name.


Constructor Detail
AssertTestFactory
public AssertTestFactory()(Code)
Creates a new factory that can generate assertions as independent test objects.



AssertTestFactory
public AssertTestFactory(String name)(Code)
Creates a new factory with a specific name for each generated test, but will not add an index to each generated test's name.
Parameters:
  name - default name shared by all generated assertion tests.



AssertTestFactory
public AssertTestFactory(String name, boolean useIndexWithName)(Code)
Creates a new factory with a specific name for each generated test, and can optionally add an index to each generated test's name.
Parameters:
  name - default name shared by all generated assertion tests.
Parameters:
  useIndexWithName - true if indecies will be appendedto each generated test's name, or false if theywill use the passed-in name exactly.
since:
   08-Dec-2002




Method Detail
createAssertEquals
public InnerTest createAssertEquals(String message, Object expected, Object actual)(Code)
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(Object expected, Object actual)(Code)
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, String expected, String actual)(Code)
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown.
since:
   30-Oct-2002
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String expected, String actual)(Code)
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown.
since:
   30-Oct-2002
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, double expected, double actual, double delta)(Code)
Asserts that two doubles are equal concerning a delta. If the expected value is infinity then the delta value is ignored.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.
Parameters:
  delta - maximum distance between expected and actual such thatthe two values are considered equivalent. Necessary sincefloating-point numbers on computers are approximations of theirequivalent values; that is, storing 1.1 may actually bestored as 1.099999999999.



createAssertEquals
public InnerTest createAssertEquals(double expected, double actual, double delta)(Code)
Asserts that two doubles are equal concerning a delta. If the expected value is infinity then the delta value is ignored.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.
Parameters:
  delta - maximum distance between expected and actual such thatthe two values are considered equivalent. Necessary sincefloating-point numbers on computers are approximations of theirequivalent values; that is, storing 1.1 may actually bestored as 1.099999999999.



createAssertEquals
public InnerTest createAssertEquals(String message, float expected, float actual, float delta)(Code)
Asserts that two floats are equal concerning a delta. If the expected value is infinity then the delta value is ignored.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.
Parameters:
  delta - maximum distance between expected and actual such thatthe two values are considered equivalent. Necessary sincefloating-point numbers on computers are approximations of theirequivalent values; that is, storing 1.1 may actually bestored as 1.099999999999.



createAssertEquals
public InnerTest createAssertEquals(float expected, float actual, float delta)(Code)
Asserts that two floats are equal concerning a delta. If the expected value is infinity then the delta value is ignored.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.
Parameters:
  delta - maximum distance between expected and actual such thatthe two values are considered equivalent. Necessary sincefloating-point numbers on computers are approximations of theirequivalent values; that is, storing 1.1 may actually bestored as 1.099999999999.



createAssertEquals
public InnerTest createAssertEquals(String message, long expected, long actual)(Code)
Asserts that two longs are equal.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(long expected, long actual)(Code)
Asserts that two longs are equal.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, boolean expected, boolean actual)(Code)
Asserts that two booleans are equal.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(boolean expected, boolean actual)(Code)
Asserts that two booleans are equal.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, byte expected, byte actual)(Code)
Asserts that two bytes are equal.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(byte expected, byte actual)(Code)
Asserts that two bytes are equal.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, char expected, char actual)(Code)
Asserts that two chars are equal.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(char expected, char actual)(Code)
Asserts that two chars are equal.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, short expected, short actual)(Code)
Asserts that two shorts are equal.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(short expected, short actual)(Code)
Asserts that two shorts are equal.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(String message, int expected, int actual)(Code)
Asserts that two ints are equal.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertEquals
public InnerTest createAssertEquals(int expected, int actual)(Code)
Asserts that two ints are equal.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertFalse
public InnerTest createAssertFalse(String message, boolean condition)(Code)
Asserts that a condition is false. If it isn't it throws an AssertionFailedError with the given message.
since:
   30-Oct-2002
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  condition - boolean to check for failure



createAssertFalse
public InnerTest createAssertFalse(boolean condition)(Code)
Asserts that a condition is true. If it isn't it throws an AssertionFailedError.
since:
   30-Oct-2002
Parameters:
  condition - boolean to check for failure



createAssertNotNull
public InnerTest createAssertNotNull(String message, Object object)(Code)
Asserts that an object isn't null.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  object - test object that must not be null.



createAssertNotNull
public InnerTest createAssertNotNull(Object object)(Code)
Asserts that an object isn't null.
Parameters:
  object - test object that must not be null.



createAssertNotSame
public InnerTest createAssertNotSame(String message, Object expected, Object actual)(Code)
Asserts that two objects refer to the same object. If they are not an AssertionFailedError is thrown.
since:
   30-Oct-2002
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to not find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertNotSame
public InnerTest createAssertNotSame(Object expected, Object actual)(Code)
Asserts that two objects refer to the same object. If they are not the same an AssertionFailedError is thrown.
since:
   30-Oct-2002
Parameters:
  expected - value that the test expects to not find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertNull
public InnerTest createAssertNull(String message, Object object)(Code)
Asserts that an object is null.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  object - test object that must be null.



createAssertNull
public InnerTest createAssertNull(Object object)(Code)
Asserts that an object is null.
Parameters:
  object - test object that must be null.



createAssertSame
public InnerTest createAssertSame(String message, Object expected, Object actual)(Code)
Asserts that two objects refer to the same object. If they are not an AssertionFailedError is thrown.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertSame
public InnerTest createAssertSame(Object expected, Object actual)(Code)
Asserts that two objects refer to the same object. If they are not the same an AssertionFailedError is thrown.
Parameters:
  expected - value that the test expects to find from the testedcode.
Parameters:
  actual - actual value generated by tested code.



createAssertTrue
public InnerTest createAssertTrue(String message, boolean condition)(Code)
Asserts that a condition is true. If it isn't it throws an AssertionFailedError with the given message.
Parameters:
  message - message that describes what failed if the assertionfails.
Parameters:
  condition - boolean to check for failure



createAssertTrue
public InnerTest createAssertTrue(boolean condition)(Code)
Asserts that a condition is true. If it isn't it throws an AssertionFailedError.
Parameters:
  condition - boolean to check for failure



createFail
public InnerTest createFail(String message)(Code)
Fails a test with the given message.
Parameters:
  message - message that describes what failed if the assertionfails.



createFail
public InnerTest createFail()(Code)
Fails a test with no message.



getName
public String getName()(Code)
Returns the default test name. If the name has never been set, then this will return null. default name shared by all generated assertion tests.



getUseIndexWithName
public boolean getUseIndexWithName()(Code)
Returns whether each generated test will add a unique (for this instance) index to the test's name. true if an index is appended to the name, orfalse if the test's name is exactly the factory's name.
since:
   08-Dec-2002



setName
public void setName(String name)(Code)
Sets the default test name. This will not reset the generated index.
Parameters:
  name - default name shared by all generated assertion tests.



setUseIndexWithName
public void setUseIndexWithName(boolean useIndexWithName)(Code)
Sets whether each generated test will add a unique (for this instance) index to the test's name. Reseting this value will not affect the index's value.
Parameters:
  useIndexWithName - true if indecies will be appendedto each generated test's name, or false if theywill use the passed-in name exactly.
since:
   08-Dec-2002



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.