mumuki-java-runner 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2bf0c7e563b47d1319d58d5182df60adbb288de8
4
+ data.tar.gz: 25b86a5e426eadd2773e0c9d8500b69678555951
5
+ SHA512:
6
+ metadata.gz: bf17f20de127e1365e33524ee8a9be1bb9cd2680ce68e17a92b5f899af84be457ff3309ee50761a73263ef193e349f3eebf5af00c3ab092b991ffe1457460b39
7
+ data.tar.gz: 01e4f8236d9938835f2e1f3a9d1351403f00516a13346e53766c1f2ecf0c676f4990d26d817ac47b6b3bc0dfc99b0b4ca91095b0a3d31236ea1d5b122ca33e38
@@ -0,0 +1,10 @@
1
+ require 'mumukit'
2
+
3
+ Mumukit.runner_name = 'java'
4
+ Mumukit.configure do |config|
5
+ config.docker_image = 'mumuki/mumuki-junit-worker'
6
+
7
+ end
8
+
9
+ require_relative './test_hook'
10
+ require_relative './metadata_hook'
@@ -0,0 +1,16 @@
1
+ class JavaMetadataHook < Mumukit::Hook
2
+ def metadata
3
+ {language: {
4
+ name: 'java',
5
+ icon: {type: 'devicon', name: 'java'},
6
+ version: 'openjdk-8',
7
+ extension: 'java',
8
+ ace_mode: 'java'
9
+ },
10
+ test_framework: {
11
+ name: 'junit',
12
+ version: '4.12',
13
+ test_extension: 'java'
14
+ }}
15
+ end
16
+ end
@@ -0,0 +1,42 @@
1
+ class JavaTestHook < Mumukit::Templates::FileHook
2
+ isolated true
3
+
4
+ def tempfile_extension
5
+ '.java'
6
+ end
7
+
8
+ def command_line(filename)
9
+ "runjunit #{filename}"
10
+ end
11
+
12
+ def post_process_file(file, result, status)
13
+ if result.include? '!!TEST FINISHED WITH COMPILATION ERROR!!'
14
+ [result, :errored]
15
+ else
16
+ super
17
+ end
18
+ end
19
+
20
+ def compile_file_content(request)
21
+ <<EOF
22
+ import java.util.*;
23
+ import java.util.function.*;
24
+ import java.util.stream.*;
25
+ import java.time.*;
26
+ import org.junit.*;
27
+
28
+ #{request.content}
29
+
30
+ #{request.extra}
31
+
32
+ public class SubmissionTest {
33
+ #{request.test}
34
+
35
+ public static void main(String args[]) {
36
+ org.junit.runner.JUnitCore.main("SubmissionTest");
37
+ }
38
+ }
39
+ EOF
40
+ end
41
+
42
+ end
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mumuki-java-runner
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Franco Leonardo Bulgarelli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mumukit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.4'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: codeclimate-test-reporter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mumukit-bridge
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
97
+ description:
98
+ email:
99
+ - franco@mumuki.org
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - lib/java_runner.rb
105
+ - lib/metadata_hook.rb
106
+ - lib/test_hook.rb
107
+ homepage: http://github.com/mumuki/mumuki-java-server
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.4.8
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: Java Runner for Mumuki
131
+ test_files: []