com.a.b
package com.a.b;
public class Math {
public static int div(int x, int y) throws Exception {
return x / y;
}
}
com.a.test
package com.a.test;
import static org.junit.Assert.*;
import org.junit.Test;
public class MathTest {
@Test
public void test() {
fail("Not yet implemented");
}
}
com.a.testA
package com.a.testA;
import com.a.b.Math;
import org.junit.Test;
import junit.framework.TestCase;
public class MathTestA {
@Test
public void testDiv() {
try {
TestCase.assertEquals(Math.div(10,2),5);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}