booking system

  1. /*
  2.  * checkArgumentsTest.java
  3.  * JUnit based test
  4.  *
  5.  * Created on 8 novembre 2004, 11:22
  6.  */
  7.  
  8. package test;
  9. import reservation.system.functions.Functions;
  10.  
  11. import java.util.Vector;
  12. import java.util.ListIterator;
  13. import java.util.LinkedList;
  14. import java.util.Collection;
  15. import java.util.HashSet;
  16. import java.util.Set;
  17. import junit.framework.*;
  18.  
  19. /**
  20.  *
  21.  * @author mathieu
  22.  */
  23. public class checkArgumentsTest extends TestCase {
  24.    
  25.     public checkArgumentsTest (java.lang.String testName) {
  26.         super (testName);
  27.     }
  28.    
  29.     public static Test suite () {
  30.         TestSuite suite = new TestSuite (checkArgumentsTest.class);
  31.         return suite;
  32.     }
  33.    
  34.     /**
  35.      * Test of validityArgument method, of class FlightSystem.checkArguments.
  36.      */
  37.     public void testArgumentisValid () {
  38.         System.out.println ("testArgumentIsValid");
  39.         String errorString = "Error";
  40.         try {
  41.             Functions.ArgumentIsValid (new String[]{"Adam","Caroline"},0,0);
  42.             fail ("Illegal number of argument");
  43.         } catch (Exception e) {System.out.println (errorString + " OK :" + e.getMessage ());}
  44.        
  45.         try {
  46.             Functions.ArgumentIsValid (new String[]{null},0,0);
  47.             fail ("Illegal number of argument and argument null");
  48.         } catch (Exception e) {System.out.println (errorString + " OK :" + e.getMessage ());}
  49.        
  50.         try {
  51.             Functions.ArgumentIsValid (new String[]{"Adam","Caroline"},2,0);
  52.             fail ("The max must be superior to the min.");
  53.         } catch (Exception e) {System.out.println (errorString + " OK :" + e.getMessage ());}
  54.     }
  55. }
  56.  

contact - link to this site