Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 17th, 2011  |  syntax: Java  |  size: 0.75 KB  |  views: 68  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package org.references;
  2.  
  3. import org.testng.*;
  4. import org.testng.AssertJUnit.*;
  5. import org.testng.annotations.Test;
  6.  
  7.  
  8.  
  9. public class NewTest
  10. {
  11.        
  12.         @Test
  13.         public void f() {
  14.                 AssertJUnit.assertTrue( 1 == 2 );
  15.                 assertTrue( 1 == 2 );// compiler error: The method assertTrue(boolean) is undefined for the type NewTest
  16.         }
  17. }
  18.  
  19. ============
  20. public class AssertJUnit extends ArrayAsserts {
  21.  
  22. /**
  23.    * Protect constructor since it is a static only class
  24.    */
  25.   protected AssertJUnit() {
  26.   }
  27.  
  28.   /**
  29.    * Asserts that a condition is true. If it isn't it throws
  30.    * an AssertionFailedError with the given message.
  31.    */
  32.   static public void assertTrue(String message, boolean condition) {
  33.     if(!condition) {
  34.       fail(message);
  35.     }
  36.   }
  37.  
  38. ...
  39. }
clone this paste RAW Paste Data