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


java.lang.Object
   org.testng.Assert

Assert
public class Assert (Code)
Assertion tool class. Presents assertion methods with a more natural parameter order. The order is always actualValue, expectedValue [, message].
author:
   Alexandru Popescu



Constructor Summary
protected  Assert()
    

Method Summary
public static  voidassertEquals(Object actual, Object expected, String message)
     Asserts that two objects are equal.
public static  voidassertEquals(Object actual, Object expected)
     Asserts that two objects are equal.
public static  voidassertEquals(String actual, String expected, String message)
     Asserts that two Strings are equal.
public static  voidassertEquals(String actual, String expected)
     Asserts that two Strings are equal.
public static  voidassertEquals(double actual, double expected, double delta, String message)
     Asserts that two doubles are equal concerning a delta.
public static  voidassertEquals(double actual, double expected, double delta)
     Asserts that two doubles are equal concerning a delta.
public static  voidassertEquals(float actual, float expected, float delta, String message)
     Asserts that two floats are equal concerning a delta.
public static  voidassertEquals(float actual, float expected, float delta)
     Asserts that two floats are equal concerning a delta.
public static  voidassertEquals(long actual, long expected, String message)
     Asserts that two longs are equal.
public static  voidassertEquals(long actual, long expected)
     Asserts that two longs are equal.
public static  voidassertEquals(boolean actual, boolean expected, String message)
     Asserts that two booleans are equal.
public static  voidassertEquals(boolean actual, boolean expected)
     Asserts that two booleans are equal.
public static  voidassertEquals(byte actual, byte expected, String message)
     Asserts that two bytes are equal.
public static  voidassertEquals(byte actual, byte expected)
     Asserts that two bytes are equal.
public static  voidassertEquals(char actual, char expected, String message)
     Asserts that two chars are equal.
public static  voidassertEquals(char actual, char expected)
     Asserts that two chars are equal.
public static  voidassertEquals(short actual, short expected, String message)
     Asserts that two shorts are equal.
public static  voidassertEquals(short actual, short expected)
     Asserts that two shorts are equal.
public static  voidassertEquals(int actual, int expected, String message)
     Asserts that two ints are equal.
public static  voidassertEquals(int actual, int expected)
     Asserts that two ints are equal.
public static  voidassertEquals(Collection actual, Collection expected)
     Asserts that two collections contain the same elements in the same order.
public static  voidassertEquals(Collection actual, Collection expected, String message)
     Asserts that two collections contain the same elements in the same order.
public static  voidassertEquals(Object[] actual, Object[] expected, String message)
     Asserts that two arrays contain the same elements in the same order.
public static  voidassertEquals(Object[] actual, Object[] expected)
     Asserts that two arrays contain the same elements in the same order.
public static  voidassertEquals(byte[] actual, byte[] expected)
     Asserts that two arrays contain the same elements in the same order.
public static  voidassertEquals(byte[] actual, byte[] expected, String message)
     Asserts that two arrays contain the same elements in the same order.
public static  voidassertEqualsNoOrder(Object[] actual, Object[] expected, String message)
     Asserts that two arrays contain the same elements in no particular order.
public static  voidassertEqualsNoOrder(Object[] actual, Object[] expected)
     Asserts that two arrays contain the same elements in no particular order.
public static  voidassertFalse(boolean condition, String message)
     Asserts that a condition is false.
public static  voidassertFalse(boolean condition)
     Asserts that a condition is false.
public static  voidassertNotNull(Object object)
     Asserts that an object isn't null.
public static  voidassertNotNull(Object object, String message)
     Asserts that an object isn't null.
public static  voidassertNotSame(Object actual, Object expected, String message)
     Asserts that two objects do not refer to the same objects.
public static  voidassertNotSame(Object actual, Object expected)
     Asserts that two objects do not refer to the same object.
public static  voidassertNull(Object object)
     Asserts that an object is null.
public static  voidassertNull(Object object, String message)
     Asserts that an object is null.
public static  voidassertSame(Object actual, Object expected, String message)
     Asserts that two objects refer to the same object.
public static  voidassertSame(Object actual, Object expected)
     Asserts that two objects refer to the same object.
public static  voidassertTrue(boolean condition, String message)
     Asserts that a condition is true.
public static  voidassertTrue(boolean condition)
     Asserts that a condition is true.
public static  voidfail(String message, Throwable realCause)
     Fails a test with the given message and wrapping the original exception.
public static  voidfail(String message)
     Fails a test with the given message.
public static  voidfail()
     Fails a test with no message.
static  Stringformat(Object actual, Object expected, String message)
    


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




Method Detail
assertEquals
public static void assertEquals(Object actual, Object expected, String message)(Code)
Asserts that two objects are equal. If they are not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(Object actual, Object expected)(Code)
Asserts that two objects are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(String actual, String expected, String message)(Code)
Asserts that two Strings are equal. If they are not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(String actual, String expected)(Code)
Asserts that two Strings are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(double actual, double expected, double delta, String message)(Code)
Asserts that two doubles are equal concerning a delta. If they are not, an AssertionError, with the given message, is thrown. If the expected value is infinity then the delta value is ignored.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  delta - the absolute tolerate value value between the actual and expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(double actual, double expected, double delta)(Code)
Asserts that two doubles are equal concerning a delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  delta - the absolute tolerate value value between the actual and expected value



assertEquals
public static void assertEquals(float actual, float expected, float delta, String message)(Code)
Asserts that two floats are equal concerning a delta. If they are not, an AssertionError, with the given message, is thrown. If the expected value is infinity then the delta value is ignored.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  delta - the absolute tolerate value value between the actual and expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(float actual, float expected, float delta)(Code)
Asserts that two floats are equal concerning a delta. If they are not, an AssertionError is thrown. If the expected value is infinity then the delta value is ignored.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  delta - the absolute tolerate value value between the actual and expected value



assertEquals
public static void assertEquals(long actual, long expected, String message)(Code)
Asserts that two longs are equal. If they are not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(long actual, long expected)(Code)
Asserts that two longs are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(boolean actual, boolean expected, String message)(Code)
Asserts that two booleans are equal. If they are not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(boolean actual, boolean expected)(Code)
Asserts that two booleans are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(byte actual, byte expected, String message)(Code)
Asserts that two bytes are equal. If they are not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(byte actual, byte expected)(Code)
Asserts that two bytes are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(char actual, char expected, String message)(Code)
Asserts that two chars are equal. If they are not, an AssertionFailedError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(char actual, char expected)(Code)
Asserts that two chars are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(short actual, short expected, String message)(Code)
Asserts that two shorts are equal. If they are not, an AssertionFailedError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(short actual, short expected)(Code)
Asserts that two shorts are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(int actual, int expected, String message)(Code)
Asserts that two ints are equal. If they are not, an AssertionFailedError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(int actual, int expected)(Code)
Asserts that two ints are equal. If they are not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(Collection actual, Collection expected)(Code)
Asserts that two collections contain the same elements in the same order. If they do not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(Collection actual, Collection expected, String message)(Code)
Asserts that two collections contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(Object[] actual, Object[] expected, String message)(Code)
Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEquals
public static void assertEquals(Object[] actual, Object[] expected)(Code)
Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(byte[] actual, byte[] expected)(Code)
Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertEquals
public static void assertEquals(byte[] actual, byte[] expected, String message)(Code)
Asserts that two arrays contain the same elements in the same order. If they do not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEqualsNoOrder
public static void assertEqualsNoOrder(Object[] actual, Object[] expected, String message)(Code)
Asserts that two arrays contain the same elements in no particular order. If they do not, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertEqualsNoOrder
public static void assertEqualsNoOrder(Object[] actual, Object[] expected)(Code)
Asserts that two arrays contain the same elements in no particular order. If they do not, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertFalse
public static void assertFalse(boolean condition, String message)(Code)
Asserts that a condition is false. If it isn't, an AssertionError, with the given message, is thrown.
Parameters:
  condition - the condition to evaluate
Parameters:
  message - the assertion error message



assertFalse
public static void assertFalse(boolean condition)(Code)
Asserts that a condition is false. If it isn't, an AssertionError is thrown.
Parameters:
  condition - the condition to evaluate



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



assertNotNull
public static void assertNotNull(Object object, String message)(Code)
Asserts that an object isn't null. If it is, an AssertionFailedError, with the given message, is thrown.
Parameters:
  object - the assertion object
Parameters:
  message - the assertion error message



assertNotSame
public static void assertNotSame(Object actual, Object expected, String message)(Code)
Asserts that two objects do not refer to the same objects. If they do, an AssertionError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



assertNotSame
public static void assertNotSame(Object actual, Object expected)(Code)
Asserts that two objects do not refer to the same object. If they do, an AssertionError is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value



assertNull
public static void assertNull(Object object)(Code)
Asserts that an object is null. If it is, an AssertionError, with the given message, is thrown.
Parameters:
  object - the assertion object



assertNull
public static void assertNull(Object object, String message)(Code)
Asserts that an object is null. If it is not, an AssertionFailedError, with the given message, is thrown.
Parameters:
  object - the assertion object
Parameters:
  message - the assertion error message



assertSame
public static void assertSame(Object actual, Object expected, String message)(Code)
Asserts that two objects refer to the same object. If they do not, an AssertionFailedError, with the given message, is thrown.
Parameters:
  actual - the actual value
Parameters:
  expected - the expected value
Parameters:
  message - the assertion error message



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



assertTrue
public static void assertTrue(boolean condition, String message)(Code)
Asserts that a condition is true. If it isn't, an AssertionError, with the given message, is thrown.
Parameters:
  condition - the condition to evaluate
Parameters:
  message - the assertion error message



assertTrue
public static void assertTrue(boolean condition)(Code)
Asserts that a condition is true. If it isn't, an AssertionError is thrown.
Parameters:
  condition - the condition to evaluate



fail
public static void fail(String message, Throwable realCause)(Code)
Fails a test with the given message and wrapping the original exception.
Parameters:
  message - the assertion error message
Parameters:
  realCause - the original exception



fail
public static void fail(String message)(Code)
Fails a test with the given message.
Parameters:
  message - the assertion error message



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



format
static String format(Object actual, Object expected, String message)(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.