Java Doc for Assert.java in  » Testing » DepUnit » org » junit » 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 » Testing » DepUnit » org.junit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.junit.Assert

Assert
public class Assert (Code)
A set of assertion methods useful for writing tests. Only failed assertions are recorded. These methods can be used directly: Assert.assertEquals(...), however, they read better if they are referenced through static import:
 import static org.junit.Assert.*;
 ...
 assertEquals(...);
 

See Also:   AssertionError



Constructor Summary
protected  Assert()
    

Method Summary
public static  voidassertArrayEquals(String message, Object[] expecteds, Object[] actuals)
     Asserts that two object arrays are equal.
public static  voidassertArrayEquals(Object[] expecteds, Object[] actuals)
     Asserts that two object arrays are equal.
public static  voidassertArrayEquals(String message, byte[] expecteds, byte[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(byte[] expecteds, byte[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(String message, char[] expecteds, char[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(char[] expecteds, char[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(String message, short[] expecteds, short[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(short[] expecteds, short[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(String message, int[] expecteds, int[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(int[] expecteds, int[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(long[] expecteds, long[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertArrayEquals(String message, long[] expecteds, long[] actuals)
     TODO: fix javadoc Asserts that two object arrays are equal.
public static  voidassertEquals(String message, Object expected, Object actual)
     Asserts that two objects are equal.
public static  voidassertEquals(Object expected, Object actual)
     Asserts that two objects are equal.
public static  voidassertEquals(String message, double expected, double actual, double delta)
     Asserts that two doubles or floats are equal to within a positive delta.
public static  voidassertEquals(double expected, double actual, double delta)
     Asserts that two doubles or floats are equal to within a positive delta.
public static  voidassertEquals(String message, Object[] expecteds, Object[] actuals)
     Asserts that two object arrays are equal.
public static  voidassertEquals(Object[] expecteds, Object[] actuals)
     Asserts that two object arrays are equal.
public static  voidassertFalse(String message, boolean condition)
     Asserts that a condition is false.
public static  voidassertFalse(boolean condition)
     Asserts that a condition is false.
public static  voidassertNotNull(String message, Object object)
     Asserts that an object isn't null.
public static  voidassertNotNull(Object object)
     Asserts that an object isn't null.
public static  voidassertNotSame(String message, Object unexpected, Object actual)
     Asserts that two objects do not refer to the same object.
public static  voidassertNotSame(Object unexpected, Object actual)
     Asserts that two objects do not refer to the same object.
public static  voidassertNull(String message, Object object)
     Asserts that an object is null.
public static  voidassertNull(Object object)
     Asserts that an object is null.
public static  voidassertSame(String message, Object expected, Object actual)
     Asserts that two objects refer to the same object.
public static  voidassertSame(Object expected, Object actual)
     Asserts that two objects refer to the same object.
public static  voidassertTrue(String message, boolean condition)
     Asserts that a condition is true.
public static  voidassertTrue(boolean condition)
     Asserts that a condition is true.
public static  voidfail(String message)
     Fails a test with the given message.
public static  voidfail()
     Fails a test with no message.
static  Stringformat(String message, Object expected, Object actual)
    


Constructor Detail
Assert
protected Assert()(Code)
Protect constructor since it is a static only class




Method Detail
assertArrayEquals
public static void assertArrayEquals(String message, Object[] expecteds, Object[] actuals) throws ArrayComparisonFailure(Code)
Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(Object[] expecteds, Object[] actuals)(Code)
Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(String message, byte[] expecteds, byte[] actuals) throws ArrayComparisonFailure(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(byte[] expecteds, byte[] actuals)(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(String message, char[] expecteds, char[] actuals) throws ArrayComparisonFailure(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(char[] expecteds, char[] actuals)(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(String message, short[] expecteds, short[] actuals) throws ArrayComparisonFailure(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(short[] expecteds, short[] actuals)(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(String message, int[] expecteds, int[] actuals) throws ArrayComparisonFailure(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(int[] expecteds, int[] actuals)(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(long[] expecteds, long[] actuals)(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertArrayEquals
public static void assertArrayEquals(String message, long[] expecteds, long[] actuals) throws ArrayComparisonFailure(Code)
TODO: fix javadoc Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertEquals
public static void assertEquals(String message, Object expected, Object actual)(Code)
Asserts that two objects are equal. If they are not, an AssertionError is thrown with the given message. If expected and actual are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expected - expected value
Parameters:
  actual - actual value



assertEquals
public static void assertEquals(Object expected, Object actual)(Code)
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expected - expected value
Parameters:
  actual - the value to check against expected



assertEquals
public static void assertEquals(String message, double expected, double actual, double delta)(Code)
Asserts that two doubles or floats are equal to within a positive delta. If they are not, an AssertionError is thrown with the given message. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expected - expected value
Parameters:
  actual - the value to check against expected
Parameters:
  delta - the maximum delta between expected and actual for which both numbers are still considered equal.



assertEquals
public static void assertEquals(double expected, double actual, double delta)(Code)
Asserts that two doubles or floats are equal to within a positive delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes
Parameters:
  expected - expected value
Parameters:
  actual - the value to check against expected
Parameters:
  delta - the maximum delta between expected and actual for which both numbers are still considered equal.



assertEquals
public static void assertEquals(String message, Object[] expecteds, Object[] actuals)(Code)
Asserts that two object arrays are equal. If they are not, an AssertionError is thrown with the given message. If expecteds and actuals are null, they are considered equal.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values.
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertEquals
public static void assertEquals(Object[] expecteds, Object[] actuals)(Code)
Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.
Parameters:
  expecteds - Object array or array of arrays (multi-dimensional array) with expected values
Parameters:
  actuals - Object array or array of arrays (multi-dimensional array) with actual values



assertFalse
public static void assertFalse(String message, boolean condition)(Code)
Asserts that a condition is false. If it isn't it throws an AssertionError with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  condition - condition to be checked



assertFalse
public static void assertFalse(boolean condition)(Code)
Asserts that a condition is false. If it isn't it throws an AssertionError without a message.
Parameters:
  condition - condition to be checked



assertNotNull
public static void assertNotNull(String message, Object object)(Code)
Asserts that an object isn't null. If it is an AssertionError is thrown with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  object - Object to check or null



assertNotNull
public static void assertNotNull(Object object)(Code)
Asserts that an object isn't null. If it is an AssertionError is thrown.
Parameters:
  object - Object to check or null



assertNotSame
public static void assertNotSame(String message, Object unexpected, Object actual)(Code)
Asserts that two objects do not refer to the same object. If they do refer to the same object, an AssertionError is thrown with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  unexpected - the object you don't expect
Parameters:
  actual - the object to compare to unexpected



assertNotSame
public static void assertNotSame(Object unexpected, Object actual)(Code)
Asserts that two objects do not refer to the same object. If they do refer to the same object, an AssertionError without a message is thrown.
Parameters:
  unexpected - the object you don't expect
Parameters:
  actual - the object to compare to unexpected



assertNull
public static void assertNull(String message, Object object)(Code)
Asserts that an object is null. If it is not, an AssertionError is thrown with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  object - Object to check or null



assertNull
public static void assertNull(Object object)(Code)
Asserts that an object is null. If it isn't an AssertionError is thrown.
Parameters:
  object - Object to check or null



assertSame
public static void assertSame(String message, Object expected, Object actual)(Code)
Asserts that two objects refer to the same object. If they are not, an AssertionError is thrown with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  expected - the expected object
Parameters:
  actual - the object to compare to expected



assertSame
public static void assertSame(Object expected, Object actual)(Code)
Asserts that two objects refer to the same object. If they are not the same, an AssertionError without a message is thrown.
Parameters:
  expected - the expected object
Parameters:
  actual - the object to compare to expected



assertTrue
public static void assertTrue(String message, boolean condition)(Code)
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
Parameters:
  condition - condition to be checked



assertTrue
public static void assertTrue(boolean condition)(Code)
Asserts that a condition is true. If it isn't it throws an AssertionError without a message.
Parameters:
  condition - condition to be checked



fail
public static void fail(String message)(Code)
Fails a test with the given message.
Parameters:
  message - the identifying message or null for the AssertionError
See Also:   AssertionError



fail
public static void fail()(Code)
Fails a test with no message.



format
static String format(String message, Object expected, Object actual)(Code)



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.