This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 270a53b3 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Fixing Tests

parent 17420a24
Branches
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -48,7 +48,7 @@ public class GitLabServiceIT {
@Test
public void getREADMEmd() throws GitLabApiException, IOException {
final InputStream repositoryFile = gitlabService.getRepositoryFile(new ExerciseId("272", null), "README.md");
final InputStream repositoryFile = gitlabService.getRepositoryFile(new ExerciseId("318", null), "README.md");
Assert.assertNotNull(repositoryFile);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
......
......@@ -34,7 +34,7 @@ public class PluginManagerActionIT {
public void initConfig() {
config = new ConnectorConfigWrapper(
new SharingPluginConfig("TestPlugin", new Action[] { new Action("someId", "someImportURL",
"someActionName", "metadata.type.externalName=='programming exercise'") }),
"someActionName", "metadata.learningResourceType=='programming exercise'") }),
"http://localhost:8080/xxx");
}
......
......@@ -45,7 +45,7 @@ public class ExerciseResourceIT {
@Test
public void getREADME() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-(
String exerciseId = "318"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "README.md")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
......@@ -59,7 +59,7 @@ public class ExerciseResourceIT {
@Test
public void getExercisemd() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-(
String exerciseId = "318"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "exercise.md")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
......@@ -72,8 +72,8 @@ public class ExerciseResourceIT {
@Test
public void getNestedPath() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "solution/src/at/ac/uibk/ac/artemis/Receiver.java")
String exerciseId = "318"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "solution/src/at/ac/uibk/qe/artemis/iotest/HelloWorld.java")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
......@@ -84,8 +84,8 @@ public class ExerciseResourceIT {
@Test
public void getSplitPath() throws Exception {
String exerciseId = "272:solution/src/at"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "ac/uibk/ac/artemis/Receiver.java")
String exerciseId = "318:solution/src/at"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "ac/uibk/qe/artemis/iotest/HelloWorld.java")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
......@@ -135,18 +135,18 @@ public class ExerciseResourceIT {
@Test
public void getExerciseBySubId() throws Exception {
String exerciseId = "272:solution/src/at"; // warning: this depends on the sequence in the current search index :-(
String exerciseId = "318:solution/src/at"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId)
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$.project.project_id").value("272"));
.andExpect(jsonPath("$.project.project_id").value("318"));
}
@Test
public void getExerciseByNotFound1() throws Exception {
String exerciseId = "272:solution/src/atX"; // warning: this depends on the sequence in the current search index :-(
String exerciseId = "318:solution/src/atX"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId)
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
......@@ -156,7 +156,7 @@ public class ExerciseResourceIT {
@Test
public void getExerciseByNotFound2() throws Exception {
String exerciseId = "xxx272:solution/src/atX"; // warning: this depends on the sequence in the current search index :-(
String exerciseId = "xxx271:solution/src/atX"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId)
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
......
metadataVersion: "0.4"
learningResourceType: "programming exercise"
programmingLanguage: [java]
language: [de]
identifier: artemisOriginalCourseAndTitle
structure: atomic # one from atomic, networked, hierarchical, linear
version: "0.1.6" # just a version tag
title: JUnit Quality Tests Exercise2 (cloned)
format:
- Artemis
description: "Dies ist ein Beispiel, wie Tests die JUnit Test Coverage testen."
status: final # one fo draft, final, revised, unavalable
keyword: ["Example", "JUnit Tests", "JUnit", "Test Coverage Tests"]
license: CC-SA-BY 4.0
creator:
- {name: "Michael Breu", affiliation: "Universität Innsbruck", email: "admin@localhost"}
publisher:
- {name: "Michael Breu", affiliation: "Universität Innsbruck", email: "michael.breu@uibk.ac.at"}
difficulty: medium
requires: [Java8, JUnit]
project_id: 318
project_name: junit-quality-tests-exercise2
namespace: sharing/university-innsbruck/java/junit-quality-tests-exercise2
main_group: sharing
sub_group: university-innsbruck
url: https://sharing.codeability-austria.uibk.ac.at/sharing/university-innsbruck/java/junit-quality-tests-exercise2/
visibility: public
archived: false
star_count: 0
open_issues_count: 0
forks_count: 1
last_activity_at: 2021-04-08T15:13:27.123Z
description: Just a test project
metadataVersion: 0.4
learningResourceType: "programming exercise"
# format (not used here)
identifier: simpleIO
structure: atomic # one from atomic, networked, hierarchical, linear
version: "1.0" # just a version tag
status: final # one fo draft, final, revised, unavailable
title: Just another sub exercise Demo
description: Not a really good structured example.
programmingLanguage: [JAVA]
language: [de]
timeRequired: 0:05:00 # [hh:mm:ss]
keyword: [Java, IOTest, artemis]
license: CC-SA-BY 4.0 # mandatory
creator:
- {name: "Breu Michael", affiliation: "University of Innsbruck", email: "c703257@uibk.ac.at"}
publisher:
- {name: "Breu Michael", affiliation: "University of Innsbruck", email: "c703257@uibk.ac.at"}
difficulty: simple
contributor:
- {name: "Manuel Seywald", affiliation: "University of Klagenfurt", email: "maseywald@edu.aau.at"}
requires: [] # empty, t.b.d. later
image: 'https://sharing-codeability.uibk.ac.at/static/CodeAbility%20Austria-Dateien/Partner_UIBK.png'
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment