GroovySnippetExecutor extends AbstractSnippetExecutor<GroovySnippetExecutorOptions> { protected boolean makeScript(final CodeSnippet codeSnippet) { if (codeSnippet.getProperties().containsKey(MAKE_SCRIPT)) { return Boolean.parseBoolean(codeSnippet.getProperties().get(MAKE_SCRIPT)); } else { return false; } } GroovySnippetExecutor(); @Override Parent getUI(final CodeSnippet codeSnippet); @Override Node getConfigurationUI(); @Override void saveNewOptions(); @Override ObservableList<String> execute(final CodeSnippet codeSnippet);  }
@Test public void noScript() { final CodeSnippet codeSnippet = new CodeSnippet(); assertFalse(snippetExecutor.makeScript(codeSnippet)); }
@Test public void makeScript() { final CodeSnippet codeSnippet = new CodeSnippet(); codeSnippet.getProperties().put(MAKE_SCRIPT, "true"); assertTrue(snippetExecutor.makeScript(codeSnippet)); }
@Test public void explicitlyNoScript() { final CodeSnippet codeSnippet = new CodeSnippet(); codeSnippet.getProperties().put(MAKE_SCRIPT, "false"); assertFalse(snippetExecutor.makeScript(codeSnippet)); }