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 +4 -4
- data/lib/expectations_hook.rb +6 -0
- data/lib/java_runner.rb +2 -1
- data/lib/test_hook.rb +11 -7
- data/lib/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea14e747f1b581e7397d867462a61def7085269acefb29add2af30f895b78605
|
4
|
+
data.tar.gz: aa652048741ffd0958cd631f81ffb7faebfb50f25b73b70b39642bf321b84d67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b27e08aee218d3bc4cf31569d5c8ecc95d0b144a6333c29f09752b684ef18e96e0d62effb32f0a917940c66d15915743462bfa0a29feefe96361cfe77d2b625
|
7
|
+
data.tar.gz: '004778f490a77cd4dfb7e70656277b22ca7cdf7c47a2fbbf9c87b35be90d5d4185ee2c86c38fac308fed4c3608ee3bf4d3a37552ef0ec2d3c1b22a54a736e237'
|
data/lib/expectations_hook.rb
CHANGED
@@ -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
|
data/lib/java_runner.rb
CHANGED
@@ -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.
|
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'
|
data/lib/test_hook.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
class JavaTestHook < Mumukit::Templates::
|
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(
|
11
|
-
"runjunit #{
|
10
|
+
def command_line(*filenames)
|
11
|
+
"runjunit #{filenames.join(' ')}"
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_structured_result(result)
|
15
|
-
|
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
|
data/lib/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
26
|
+
version: '2.29'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|