@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "admin2_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.exclude", "replication_admin_test.rb,rsgroup_shell_test.rb," + "admin_test.rb,table_test.rb,quotas_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "admin_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { try { // Start only GroupShellTest System.setProperty("shell.test", "Hbase::RSGroupShellTest"); jruby.runScriptlet(PathType.ABSOLUTE, basePath + "/src/test/ruby/tests_runner.rb"); } finally { System.clearProperty("shell.test"); } } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "quotas_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "table_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "replication_admin_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunNoClusterShellTests() throws IOException { // Start ruby tests without cluster jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/no_cluster_tests_runner.rb"); } }
import org.jruby.embed.ScriptingContainer; public class Main { public static void main(String[] args) { ScriptingContainer container = new ScriptingContainer(); container.runScriptlet("require './core.jar'"); container.runScriptlet("require 'core/lib/gui'"); } }
@Override protected RubyTemplateContainer createContainer(ScriptingContainer jruby) { return new RubyTemplateContainer( (RubyClass)jruby.runScriptlet( "require 'org/kohsuke/stapler/jelly/jruby/erb/JRubyJellyERbScript'\n"+ "JRubyJellyScriptImpl::JRubyJellyERbScript"), this, jruby); } }
ScriptingContainer sc = new ScriptingContainer(); sc.setLoadPaths(Arrays.asList("folder1", "folder2")); File server = new File("server.rb"); sc.runScriptlet(new FileReader(server), server.getName());
public class Main { public static void main(String[] args){ ScriptingContainer container = new ScriptingContainer(); container.put("a", 1234); Object v = container.runScriptlet("a += 10; a"); System.out.println(v); } }
public JRubyFacet() { // TODO: is this too early? Shall we allow registrations later? languages.addAll(Facet.discoverExtensions(RubyTemplateLanguage.class, Thread.currentThread().getContextClassLoader(), getClass().getClassLoader())); container = new ScriptingContainer(LocalContextScope.SINGLETHREAD); // we don't want any funny multiplexing from ScriptingContainer. container.runScriptlet("require 'org/kohsuke/stapler/jelly/jruby/JRubyJellyScriptImpl'"); navigator = new RubyKlassNavigator(container.getProvider().getRuntime(), getClass().getClassLoader()); for (RubyTemplateLanguage l : languages) { templateContainers.put(l.getScriptExtension(),l.createContainer(container)); tearOffTypes.add(l.getTearOffClass()); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "replication_admin_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "quotas_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { try { // Start only GroupShellTest System.setProperty("shell.test", "Hbase::RSGroupShellTest"); jruby.runScriptlet(PathType.ABSOLUTE, basePath + "/src/test/ruby/tests_runner.rb"); } finally { System.clearProperty("shell.test"); } } }
@Test public void testRunShellTests() throws IOException { try { // Start only GroupShellTest System.setProperty("shell.test", "Hbase::RSGroupShellTest"); jruby.runScriptlet(PathType.ABSOLUTE, basePath + "/src/test/ruby/tests_runner.rb"); } finally { System.clearProperty("shell.test"); } } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "table_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }
@Test public void testRunNoClusterShellTests() throws IOException { // Start ruby tests without cluster jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/no_cluster_tests_runner.rb"); } }
@Test public void testRunShellTests() throws IOException { System.setProperty("shell.test.include", "replication_admin_test.rb"); // Start all ruby tests jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb"); } }