FileDocCategorySizeDatePackage
DbcTest.javaAPI DocJBoss 4.2.13217Fri Jul 13 21:02:22 BST 2007test.dbc

DbcTest

public class DbcTest extends TestCase
author
Kabir Khan
version
$Revision: 57186 $

Fields Summary
Constructors Summary
public DbcTest(String name)

		super(name);

	
Methods Summary
public voidtestJavaExpression()

	   System.out.println("****************** TEST SORTER ******************");
	   
	   int[] unsorted = new int[]{4, 1, 5, 3};
	   Sorter.sort(unsorted);
	   
	   try
	   {
	      Sorter.brokenSort(unsorted);
	      throw new Exception("Did not validate list was not sorted");
	   }
	   catch(RuntimeException e)
	   {
         System.out.println(e.getMessage());
	   }
   
public voidtestOffice()

	   System.out.println("****************** TEST OFFICE ******************");
	   OfficeManager officeManager = new OfficeManager();

	   Computer compA = officeManager.createComputer("comp A");
	   //officeManager.createComputer("comp B");
	   Developer kabir = officeManager.createDeveloper("Kabir");

	   officeManager.assignComputer(compA, kabir);

	   
	   Developer bill = officeManager.createDeveloper("Bill");

	   Computer compB = officeManager.createComputer("comp B");
	   officeManager.assignComputer(compB, bill);
            
	   try
	   {
	      officeManager.createDeveloper(null);
	      if (true)throw new Exception("Did not validate developer null name");
	   }
	   catch(RuntimeException e)
	   {  
	   }
	   
	
public voidtestStack()

	   System.out.println("****************** TEST STACK ******************");
      Stack s = new StackImpl();
      s.push("one");
      s.push("two");
      s.pop();

      s.push("two");
      s.push("three");
      s.pop();
      s.pop();
      s.pop(); 
      try
      {
         s.pop(); 
	      throw new Exception("Did not validate empty stack before pop");
      }
      catch(RuntimeException e)
      {
         System.out.println(e.getMessage());
      }