Package org.springframework.integration.scripting

Examples of org.springframework.integration.scripting.ScriptExecutor


*
*/
public class ScriptTests {
  @Test
  public void testRuby() {
    ScriptExecutor executor = ScriptExecutorFactory.getScriptExecutor("ruby");

    Order order = new Order(0);
    order.addItem(DrinkType.LATTE, 2, false);
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("payload", order.getItems().get(0));
    variables.put("timeToPrepare", 1L);

    Object obj = executor.executeScript(
        new ResourceScriptSource(new FileSystemResource("scripts/ruby/barista.rb")), variables);
    assertNotNull(obj);
    assertTrue(obj instanceof Drink);

  }
View Full Code Here


  }

  @Test
  @Ignore
  public void testPython() {
    ScriptExecutor executor = ScriptExecutorFactory.getScriptExecutor("python");
    Order order = new Order(0);
    order.addItem(DrinkType.LATTE, 2, false);
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("payload", order.getItems().get(0));
    variables.put("timeToPrepare", "1");

    Object obj = executor.executeScript(new ResourceScriptSource(
        new FileSystemResource("scripts/python/barista.py")), variables);
    assertNotNull(obj);
    assertTrue(obj instanceof Drink);

  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.scripting.ScriptExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.