mumuki-java-runner 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3e49fce3563aa66a7604c91f88cdd8f1d8410c0531c7c03973cbdb9f86311e8
4
- data.tar.gz: 970a07892790c2d723436f3a3cce059345ca8f82d9f3cfefef6b23b89c88843b
3
+ metadata.gz: ea14e747f1b581e7397d867462a61def7085269acefb29add2af30f895b78605
4
+ data.tar.gz: aa652048741ffd0958cd631f81ffb7faebfb50f25b73b70b39642bf321b84d67
5
5
  SHA512:
6
- metadata.gz: 9f16499caf666e4d009b921f5be08407a5c7be624b1db52bfd4c6d7b2d46ca04f14fb8771f63086988485dd5aadb11e2e4accfbbf9a6a066d174c03ca89186d1
7
- data.tar.gz: ab72b1133f8c40c567ed87d08a957615cce92e36b2eff9991460b1899fe5a762a1c836bedcee173474514a63f26f553da48a1215ba14bcbfaffb2fae81f6087c
6
+ metadata.gz: 1b27e08aee218d3bc4cf31569d5c8ecc95d0b144a6333c29f09752b684ef18e96e0d62effb32f0a917940c66d15915743462bfa0a29feefe96361cfe77d2b625
7
+ data.tar.gz: '004778f490a77cd4dfb7e70656277b22ca7cdf7c47a2fbbf9c87b35be90d5d4185ee2c86c38fac308fed4c3608ee3bf4d3a37552ef0ec2d3c1b22a54a736e237'
@@ -5,6 +5,12 @@ class JavaExpectationsHook < Mumukit::Templates::MulangExpectationsHook
5
5
  'Java'
6
6
  end
7
7
 
8
+ def compile_content(content)
9
+ return content unless content.is_a?(Hash)
10
+
11
+ content.values.join("\n").gsub(/import .+/, '')
12
+ end
13
+
8
14
  def default_smell_exceptions
9
15
  LOGIC_SMELLS + FUNCTIONAL_SMELLS
10
16
  end
@@ -4,8 +4,9 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
4
4
 
5
5
  Mumukit.runner_name = 'java'
6
6
  Mumukit.configure do |config|
7
- config.docker_image = 'mumuki/mumuki-junit-worker:2.0'
7
+ config.docker_image = 'mumuki/mumuki-junit-worker:2.1'
8
8
  config.content_type = 'markdown'
9
+ config.multifile = true
9
10
  end
10
11
 
11
12
  require_relative './version'
@@ -1,4 +1,4 @@
1
- class JavaTestHook < Mumukit::Templates::FileHook
1
+ class JavaTestHook < Mumukit::Templates::MultiFileHook
2
2
  COMPILATION_ERROR_FLAG = '!!TEST FINISHED WITH COMPILATION ERROR!!'
3
3
  isolated true
4
4
  structured true, separator: '!!!JAVA-MUMUKI-OUTPUT!!!'
@@ -7,12 +7,13 @@ class JavaTestHook < Mumukit::Templates::FileHook
7
7
  '.java'
8
8
  end
9
9
 
10
- def command_line(filename)
11
- "runjunit #{filename}"
10
+ def command_line(*filenames)
11
+ "runjunit #{filenames.join(' ')}"
12
12
  end
13
13
 
14
14
  def to_structured_result(result)
15
- transform(JSON.parse(result))
15
+ clean_json = result.strip.gsub("\n", '\n')
16
+ transform(JSON.parse(clean_json))
16
17
  end
17
18
 
18
19
  def transform(examples)
@@ -32,7 +33,7 @@ class JavaTestHook < Mumukit::Templates::FileHook
32
33
  end
33
34
 
34
35
  def compile_file_content(request)
35
- <<EOF
36
+ test = <<EOF
36
37
  import java.util.*;
37
38
  import java.util.function.*;
38
39
  import java.util.stream.*;
@@ -45,7 +46,7 @@ import org.junit.runner.notification.*;
45
46
  import org.junit.runners.*;
46
47
  import org.junit.runners.model.InitializationError;
47
48
  import org.apache.commons.text.StringEscapeUtils;
48
- #{request.content}
49
+ #{has_files?(request) ? '' : request.content}
49
50
  #{request.extra}
50
51
 
51
52
  public class SubmissionTest {
@@ -92,6 +93,9 @@ class MuListener extends RunListener {
92
93
  }
93
94
  }
94
95
  EOF
95
- end
96
96
 
97
+ has_files?(request) ?
98
+ files_of(request).merge('SubmissionTest.java' => test) :
99
+ test
100
+ end
97
101
  end
@@ -1,3 +1,3 @@
1
1
  module JavaVersionHook
2
- VERSION = '1.6.0'
2
+ VERSION = '1.7.0'
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-java-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '2.17'
19
+ version: '2.29'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '2.17'
26
+ version: '2.29'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement