Class: CIAT::Executors::Java

Inherits:
Object
  • Object
show all
Includes:
Differs::HtmlDiffer, Processors::BasicProcessing
Defined in:
lib/ciat/executors/java.rb

Overview

Executor class for Java interpreters.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Differs::HtmlDiffer

#diff_options, #html_diff

Methods included from Processors::BasicProcessing

#command_line_args, #diff, #error_file, #execute, #for_test, #input_file, #output_file, #process, #relevant_element_names, #relevant_elements

Constructor Details

#initialize(classpath, interpreter_class, options = {}) ⇒ Java

Creates a Java executor.

Possible options:

  • :description is the description used in the HTML report for this processor (default: "Parrot virtual machine").



18
19
20
21
22
23
24
# File 'lib/ciat/executors/java.rb', line 18

def initialize(classpath, interpreter_class, options={})
  @processor_kind = options[:processor_kind] || CIAT::Processors::Interpreter.new
  @classpath = classpath
  @interpreter_class = interpreter_class
  @description = options[:description] || "in-Java interpreter"
  @light = CIAT::TrafficLight.new
end

Instance Attribute Details

#lightObject

Traffic light



10
11
12
# File 'lib/ciat/executors/java.rb', line 10

def light
  @light
end

#processor_kindObject (readonly)

Returns the value of attribute processor_kind.



11
12
13
# File 'lib/ciat/executors/java.rb', line 11

def processor_kind
  @processor_kind
end

Instance Method Details

#describeObject

Provides a description of the processor.



27
28
29
# File 'lib/ciat/executors/java.rb', line 27

def describe
  @description
end

#executableObject



31
32
33
# File 'lib/ciat/executors/java.rb', line 31

def executable
  "java -cp '#{@classpath}' #{@interpreter_class}"
end