Share Pastebin
Guest
Public paste!

respecting

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 0.65 KB | Hits: 100 | Expires: Never
Copy text to clipboard
  1.  
  2. public class MathOperation {
  3. public Integer sum(int x,int y)
  4. {
  5.         return x+y;
  6. }
  7. public Integer multiply(int x,int y)
  8. {
  9.         return x*y;
  10. }
  11.  
  12. }
  13.  
  14.  
  15.  
  16.  
  17.  
  18. import org.junit.Test;
  19.  
  20. import junit.framework.TestCase;
  21.  
  22.  
  23.  
  24. public class Test123 extends TestCase{
  25.         public Integer resultOfSum;
  26.         @Test
  27. public void testSum()
  28. {
  29.         MathOperation mo = new MathOperation();
  30.         resultOfSum = mo.sum(12, 21);
  31. }
  32.         /**
  33.          * I want that the sum test executed first
  34.          */
  35.         @Test
  36. public void  testMultiply()
  37. {
  38.         MathOperation mo = new MathOperation();
  39.         Integer resultofMultiply = mo.multiply(resultOfSum, 2);
  40.         System.out.println("resultofMultiply "+resultofMultiply);
  41. }
  42. }