@Test public void testExpose() throws Exception { Method hi = functions.resolveFunction("test", "hi"); assertEquals("hi", hi.invoke(null)); Method hiAlternate = functions.resolveFunction("test", "hola"); assertEquals("hi", hiAlternate.invoke(null)); Method bonjour = functions.resolveFunction("other", "bonjour"); assertEquals("French hello", bonjour.invoke(null)); }
@Test public void testExpose() throws Exception { Method hi = functions.resolveFunction("test", "hi"); assertEquals("hi", hi.invoke(null)); Method hiAlternate = functions.resolveFunction("test", "hola"); assertEquals("hi", hiAlternate.invoke(null)); Method bonjour = functions.resolveFunction("other", "bonjour"); assertEquals("French hello", bonjour.invoke(null)); }
@Test public void testExpose() throws Exception { Method hi = functions.resolveFunction("test", "hi"); assertEquals("hi", hi.invoke(null)); Method hiAlternate = functions.resolveFunction("test", "hola"); assertEquals("hi", hiAlternate.invoke(null)); Method bonjour = functions.resolveFunction("other", "bonjour"); assertEquals("French hello", bonjour.invoke(null)); }
@Test public void testExpose() throws Exception { Method hi = functions.resolveFunction("test", "hi"); assertEquals("hi", hi.invoke(null)); Method hiAlternate = functions.resolveFunction("test", "hola"); assertEquals("hi", hiAlternate.invoke(null)); Method bonjour = functions.resolveFunction("other", "bonjour"); assertEquals("French hello", bonjour.invoke(null)); }
@Test public void testExpose() throws Exception { Method hi = functions.resolveFunction("test", "hi"); assertEquals("hi", hi.invoke(null)); Method hiAlternate = functions.resolveFunction("test", "hola"); assertEquals("hi", hiAlternate.invoke(null)); Method bonjour = functions.resolveFunction("other", "bonjour"); assertEquals("French hello", bonjour.invoke(null)); }
@Test public void testDefaultBinding() throws Exception { Injector injector = Guice.createInjector(); functions = injector.getInstance(Functions.class); Method toJson = functions.resolveFunction("osx", "parseJson"); Object o = toJson.invoke(null, "{a : 1}"); assertTrue(o instanceof JSONObject); assertEquals(1, ((JSONObject) o).getInt("a")); }
@Test public void testDefaultBinding() throws Exception { Injector injector = Guice.createInjector(); functions = injector.getInstance(Functions.class); Method toJson = functions.resolveFunction("osx", "parseJson"); Object o = toJson.invoke(null, "{a : 1}"); assertTrue(o instanceof JSONObject); assertEquals(1, ((JSONObject) o).getInt("a")); }
@Test public void testDefaultBinding() throws Exception { Injector injector = Guice.createInjector(); functions = injector.getInstance(Functions.class); Method toJson = functions.resolveFunction("osx", "parseJson"); Object o = toJson.invoke(null, "{a : 1}"); assertTrue(o instanceof JSONObject); assertEquals(1, ((JSONObject) o).getInt("a")); }
@Test public void testDefaultBinding() throws Exception { Injector injector = Guice.createInjector(); functions = injector.getInstance(Functions.class); Method toJson = functions.resolveFunction("osx", "parseJson"); Object o = toJson.invoke(null, "{a : 1}"); assertTrue(o instanceof JSONObject); assertEquals(1, ((JSONObject) o).getInt("a")); }
@Test public void testDefaultBinding() throws Exception { Injector injector = Guice.createInjector(); functions = injector.getInstance(Functions.class); Method toJson = functions.resolveFunction("osx", "parseJson"); Object o = toJson.invoke(null, "{a : 1}"); assertTrue(o instanceof JSONObject); assertEquals(1, ((JSONObject) o).getInt("a")); }
@Test public void testNonStaticNotExposed() { assertNull(functions.resolveFunction("test", "goodbye")); }
@Test public void testNonStaticNotExposed() { assertNull(functions.resolveFunction("test", "goodbye")); }
@Test public void testNonStaticNotExposed() { assertNull(functions.resolveFunction("test", "goodbye")); }
@Test public void testNonStaticNotExposed() { assertNull(functions.resolveFunction("test", "goodbye")); }
@Test public void testNonStaticNotExposed() { assertNull(functions.resolveFunction("test", "goodbye")); }