()
| 43 | private final BagFactory bf_ = BagFactory.getInstance(); |
| 44 | |
| 45 | @Test |
| 46 | public void testStringInvoker() throws SecurityException, ClassNotFoundException, NoSuchMethodException, IOException { |
| 47 | |
| 48 | // Test non-static method |
| 49 | InvokeForString is = new InvokeForString("java.lang.String.toUpperCase", "String", "false"); |
| 50 | assertEquals("FOO", is.exec(tf_.newTuple("foo"))); |
| 51 | |
| 52 | // both "static" and "true" should work |
| 53 | // Test static method |
| 54 | is = new InvokeForString("java.lang.String.valueOf", "int", "true"); |
| 55 | Tuple t = tf_.newTuple(1); |
| 56 | t.set(0,231); |
| 57 | assertEquals("231", is.exec(t)); |
| 58 | |
| 59 | // test default (should be static) |
| 60 | is = new InvokeForString("java.lang.String.valueOf", "int"); |
| 61 | assertEquals("231", is.exec(t)); |
| 62 | |
| 63 | // Test method with multiple args |
| 64 | is = new InvokeForString(TestInvoker.class.getName()+".concatStrings", "String String"); |
| 65 | t = tf_.newTuple(2); |
| 66 | t.set(0, "foo"); |
| 67 | t.set(1, "bar"); |
| 68 | assertEquals("foobar", is.exec(t)); |
| 69 | } |
| 70 | |
| 71 | @Test |
| 72 | public void testNoArgInvoker() throws SecurityException, ClassNotFoundException, NoSuchMethodException, IOException { |
nothing calls this directly
no test coverage detected