test_class.file: cli/src/test/java/com/github/olivergondza/dumpling/cli/GroovyCommandTest.java
test_class.identifier: GroovyCommandTest
test_class.superclass: extends AbstractCliTest
test_case.body: @Test
      public void porcelain() throws Exception {
          final String log = Util.asFile(Util.resource("jstack/producer-consumer.log")).getAbsolutePath();
  
          stdin("D.runtime.threads%n");
          run("groovy", "--in", "threaddump:" + log);
          assertThat(this, succeeded());
          assertThat(out.toString(), containsString("\"blocked_thread\" prio=10 tid=0x2ad39c16b800 nid=32297"));
          assertThat(out.toString(), containsString("- waiting to lock <0x4063a9378> (a hudson.model.Queue)"));
  
          stdin("D.runtime.threads%n");
          run("groovy", "--in", "threaddump:" + log, "--porcelain");
          assertThat(this, succeeded());
          assertThat(out.toString(), containsString("\"blocked_thread\" prio=10 tid=0x00002ad39c16b800 nid=0x7e29"));
          assertThat(out.toString(), containsString("- waiting to lock <0x00000004063a9378> (a hudson.model.Queue)"));
      }
test_case.class_method_signature: GroovyCommandTest.porcelain()
test_case.full_signature: @Test public void porcelain()
test_case.identifier: porcelain
test_case.invocations: getAbsolutePath asFile resource stdin run assertThat succeeded assertThat toString containsString assertThat toString containsString stdin run assertThat succeeded assertThat toString containsString assertThat toString containsString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void porcelain()
focal_class.declarator: CONFIG = new InterpretterConfig()
focal_class.modifier: private static final
focal_class.original_string: private static final InterpretterConfig CONFIG = new InterpretterConfig();
focal_class.type: InterpretterConfig
focal_class.var_name: CONFIG
focal_class.declarator: runtime
focal_class.modifier: @Option(name = "-i", aliases = {"--in"}, usage = "Input for process runtime")
      private
focal_class.original_string: @Option(name = "-i", aliases = {"--in"}, usage = "Input for process runtime")
      private ProcessRuntime<?, ?, ?> runtime;
focal_class.type: ProcessRuntime<?, ?, ?>
focal_class.var_name: runtime
focal_class.declarator: script
focal_class.modifier: @Option(name = "-s", aliases = {"--script"}, usage = "Script file to execute")
      private
focal_class.original_string: @Option(name = "-s", aliases = {"--script"}, usage = "Script file to execute")
      private String script;
focal_class.type: String
focal_class.var_name: script
focal_class.declarator: expression
focal_class.modifier: @Option(name = "-e", aliases = {"--expression"}, usage = "Script expression to execute")
      private
focal_class.original_string: @Option(name = "-e", aliases = {"--expression"}, usage = "Script expression to execute")
      private String expression;
focal_class.type: String
focal_class.var_name: expression
focal_class.declarator: porcelain = false
focal_class.modifier: @Option(name = "-p", aliases = {"--porcelain"}, usage = "Show in a format designed for machine consumption")
      private
focal_class.original_string: @Option(name = "-p", aliases = {"--porcelain"}, usage = "Show in a format designed for machine consumption")
      private boolean porcelain = false;
focal_class.type: boolean
focal_class.var_name: porcelain
focal_class.declarator: args = new ArrayList<String>()
focal_class.modifier: @Argument(metaVar = "SCRIPT_ARGS", multiValued = true, usage = "Arguments to be passed to the script")
      private @Nonnull
focal_class.original_string: @Argument(metaVar = "SCRIPT_ARGS", multiValued = true, usage = "Arguments to be passed to the script")
      private @Nonnull List<String> args = new ArrayList<String>();
focal_class.type: List<String>
focal_class.var_name: args
focal_class.file: cli/src/main/java/com/github/olivergondza/dumpling/cli/GroovyCommand.java
focal_class.identifier: GroovyCommand
focal_class.interfaces: implements CliCommand
focal_class.class_method_signature: GroovyCommand.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: GroovyCommand.getDescription()
focal_class.full_signature: @Override public String getDescription()
focal_class.identifier: getDescription
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDescription()
focal_class.class_method_signature: GroovyCommand.run(ProcessStream process)
focal_class.full_signature: @Override public int run(ProcessStream process)
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: (ProcessStream process)
focal_class.return: int
focal_class.signature: int run(ProcessStream process)
focal_class.class_method_signature: GroovyCommand.getScript(ProcessStream process)
focal_class.full_signature: private InputStreamReader getScript(ProcessStream process)
focal_class.identifier: getScript
focal_class.modifiers: private
focal_class.parameters: (ProcessStream process)
focal_class.return: InputStreamReader
focal_class.signature: InputStreamReader getScript(ProcessStream process)
focal_method.body: @Override
      public int run(ProcessStream process) throws CmdLineException {
          Binding binding = CONFIG.getDefaultBinding(process, args, runtime);
          if (runtime != null) {
              binding.setProperty("runtime", runtime); // Compatibility
          }
  
          GroovyShell shell = new GroovyShell(binding, CONFIG.getCompilerConfiguration());
          CONFIG.setupDecorateMethods();
          Object exitVal = shell.run(getScript(process), "dumpling-script", args.toArray(new String[args.size()]));
          if (exitVal != null) {
              if (exitVal instanceof ModelObject) {
                  final ModelObject model = (ModelObject) exitVal;
                  model.toString(process.out(), porcelain ? Mode.MACHINE : Mode.HUMAN);
              } else {
                  process.out().println(exitVal);
              }
          }
  
          if (exitVal instanceof Boolean) {
              return Boolean.TRUE.equals(exitVal) ? 0 : -1;
          } else if (exitVal instanceof Integer) {
              return ((Integer) exitVal);
          }
  
          return 0;
      }
focal_method.class_method_signature: GroovyCommand.run(ProcessStream process)
focal_method.full_signature: @Override public int run(ProcessStream process)
focal_method.identifier: run
focal_method.invocations: getDefaultBinding setProperty getCompilerConfiguration setupDecorateMethods run getScript toArray size toString out println out equals
focal_method.modifiers: @Override public
focal_method.parameters: (ProcessStream process)
focal_method.return: int
focal_method.signature: int run(ProcessStream process)