
Untitled
By: a guest on
Aug 17th, 2011 | syntax:
Java | size: 0.95 KB | views:
47 | expires: Never
package org.references;
import org.testng.*;
import org.testng.AssertJUnit.*;
import org.testng.annotations.Test;
public class NewTest
{
@Test
public void f() {
AssertJUnit.assertTrue( 1 == 2 );
assertTrue( 1 == 2 );// compiler error: The method assertTrue(boolean) is undefined for the type NewTest
}
}
============
public class AssertJUnit extends ArrayAsserts {
/**
* Protect constructor since it is a static only class
*/
protected AssertJUnit() {
}
/**
* Asserts that a condition is true. If it isn't it throws
* an AssertionFailedError with the given message.
*/
static public void assertTrue(String message, boolean condition) {
if(!condition) {
fail(message);
}
}
/**
* Asserts that a condition is true. If it isn't it throws
* an AssertionFailedError.
*/
static public void assertTrue(boolean condition) {
assertTrue(null, condition);
}
...
}