I have a Bean Shell script and I want to know how can I write test cases like JUnit?
Asked
Active
Viewed 151 times
1 Answers
1
Beanshell project is on github, you can see it's using JUnit for tests
For example
@Test public void testHashCode_contract() { final String name = "testMethod"; final BshMethod method1 = new BshMethod(name, Integer.class, new String[0], new Class[0], new Modifiers[0], null, null, null); final BshMethod method2 = new BshMethod(name, Integer.class, new String[0], new Class[0], new Modifiers[0], null, null, null); Assert.assertTrue("precondition check for test failed.", method2.equals(method1)); Assert.assertEquals("Equal classes should have equal hashcodes", method2.hashCode(), method1.hashCode()); }

Ori Marko
- 56,308
- 23
- 131
- 233