Skip to content

Commit 55c1a2d

Browse files
1 parent 311c442 commit 55c1a2d

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ build/
3232
### VS Code ###
3333
.vscode/
3434

35+
### Executions ###
36+
/executions/utility_*/execution*
37+
3538
### idea ###
3639
.idea
3740

.idea/workspace.xml

+4-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/java/com/cp/compiler/services/CompilerServiceTests.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class CompilerServiceTests {
4040
private CompilerService compilerService;
4141

4242
private MultipartFile file = new MockMultipartFile(
43-
"test.txt.c",
44-
"test.txt",
43+
"test.java",
44+
"test.java",
4545
null,
4646
(byte[]) null);
4747

@@ -132,8 +132,8 @@ void WhenMemoryLimitLessThanMinExecutionMemoryShouldReturnBadRequest() {
132132
void WhenImageBuildFailShouldThrowContainerBuildException() throws Exception {
133133
// Given
134134
MockMultipartFile file = new MockMultipartFile(
135-
"file",
136-
"hello.txt",
135+
"file.java",
136+
"hello.java",
137137
MediaType.TEXT_PLAIN_VALUE,
138138
"Hello, World!".getBytes()
139139
);
@@ -177,7 +177,7 @@ void WhenImageBuildSucceedShouldReturnAResult() throws Exception {
177177

178178
MockMultipartFile file = new MockMultipartFile(
179179
"file",
180-
"hello.txt",
180+
"hello.java",
181181
MediaType.TEXT_PLAIN_VALUE,
182182
output.getBytes()
183183
);
@@ -231,7 +231,7 @@ void WhenItsACorrectAnswerCompileMethodShouldReturnAcceptedVerdict() throws Exce
231231

232232
MockMultipartFile file = new MockMultipartFile(
233233
"file",
234-
"hello.txt",
234+
"hello.java",
235235
MediaType.TEXT_PLAIN_VALUE,
236236
output.getBytes()
237237
);
@@ -283,14 +283,14 @@ void WhenItsAWrongAnswerCompileMethodShouldReturnWrongAnswerVerdict() throws Exc
283283

284284
MockMultipartFile sourceCode = new MockMultipartFile(
285285
"file",
286-
"hello.txt",
286+
"hello.java",
287287
MediaType.TEXT_PLAIN_VALUE,
288288
output.getBytes()
289289
);
290290

291291
MockMultipartFile expectedOutputFile = new MockMultipartFile(
292292
"file",
293-
"hello.txt",
293+
"hello.java",
294294
MediaType.TEXT_PLAIN_VALUE,
295295
expectedOutput.getBytes()
296296
);
@@ -344,7 +344,7 @@ void WhenTheExecutionTimeExceedTheLimitCompileMethodShouldReturnTimeLimitExceede
344344

345345
MockMultipartFile file = new MockMultipartFile(
346346
"file",
347-
"hello.txt",
347+
"hello.java",
348348
MediaType.TEXT_PLAIN_VALUE,
349349
output.getBytes()
350350
);
@@ -400,7 +400,7 @@ void WhenThereIsARuntimeErrorCompileMethodShouldReturnRunTimeErrorVerdict() thro
400400

401401
MockMultipartFile file = new MockMultipartFile(
402402
"file",
403-
"hello.txt",
403+
"hello.java",
404404
MediaType.TEXT_PLAIN_VALUE,
405405
output.getBytes()
406406
);
@@ -460,7 +460,7 @@ void WhenMemoryLimitExceededCompileMethodShouldReturnOutOfMemoryErrorVerdict() t
460460

461461
MockMultipartFile file = new MockMultipartFile(
462462
"file",
463-
"hello.txt",
463+
"hello.java",
464464
MediaType.TEXT_PLAIN_VALUE,
465465
output.getBytes()
466466
);
@@ -517,7 +517,7 @@ void WhenItIsACompilationErrorCompileMethodShouldReturnCompilationErrorVerdict()
517517

518518
MockMultipartFile file = new MockMultipartFile(
519519
"file",
520-
"hello.txt",
520+
"hello.java",
521521
MediaType.TEXT_PLAIN_VALUE,
522522
output.getBytes()
523523
);
@@ -561,7 +561,7 @@ void shouldThrownContainerFailedDependencyException() throws Exception {
561561

562562
MockMultipartFile file = new MockMultipartFile(
563563
"file",
564-
"hello.txt",
564+
"hello.java",
565565
MediaType.TEXT_PLAIN_VALUE,
566566
output.getBytes()
567567
);
@@ -592,7 +592,7 @@ void defaultCompilerShouldThrowContainerOperationTimeoutException() throws Excep
592592

593593
MockMultipartFile file = new MockMultipartFile(
594594
"file",
595-
"hello.txt",
595+
"hello.java",
596596
MediaType.TEXT_PLAIN_VALUE,
597597
output.getBytes()
598598
);
@@ -621,7 +621,7 @@ void defaultCompilerShouldCleanStderrOutput() {
621621

622622
MockMultipartFile file = new MockMultipartFile(
623623
"file",
624-
"hello.txt",
624+
"hello.java",
625625
MediaType.TEXT_PLAIN_VALUE,
626626
"output".getBytes()
627627
);

src/test/java/com/cp/compiler/services/ThrottlingTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class ThrottlingTests {
2323
private CompilerProxy compilerProxy;
2424

2525
private MultipartFile file = new MockMultipartFile(
26-
"test.txt",
27-
"test.txt",
26+
"test.java",
27+
"test.java",
2828
null,
2929
(byte[]) null);
3030

0 commit comments

Comments
 (0)