forked from ls1intum/Artemis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/Programming Exercise/Sequential test runs (ls1intum#495)
- Loading branch information
1 parent
ddb5d3f
commit 785a4ca
Showing
95 changed files
with
2,068 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"fluentMethods": true, | ||
"clientRootFolder": "", | ||
"relationships": [ | ||
{ | ||
"relationshipName": "exercise", | ||
"otherEntityName": "exercise", | ||
"relationshipType": "many-to-one", | ||
"relationshipValidateRules": [], | ||
"otherEntityField": "id" | ||
} | ||
], | ||
"fields": [ | ||
{ | ||
"fieldName": "testName", | ||
"fieldType": "String", | ||
"fieldValidateRules": [] | ||
}, | ||
{ | ||
"fieldName": "weight", | ||
"fieldType": "Integer", | ||
"fieldValidateRules": [] | ||
}, | ||
{ | ||
"fieldName": "active", | ||
"fieldType": "Boolean", | ||
"fieldValidateRules": [] | ||
} | ||
], | ||
"changelogDate": "20190526152122", | ||
"dto": "no", | ||
"searchEngine": false, | ||
"service": "yes", | ||
"entityTableName": "programming_exercise_test_case", | ||
"databaseType": "sql", | ||
"jpaMetamodelFiltering": false, | ||
"pagination": "no" | ||
} |
242 changes: 123 additions & 119 deletions
242
src/main/java/de/tum/in/www1/artemis/config/CacheConfiguration.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
src/main/java/de/tum/in/www1/artemis/domain/ProgrammingExerciseTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
package de.tum.in.www1.artemis.domain; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
import javax.persistence.*; | ||
|
||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* A ProgrammingExerciseTestCase. | ||
*/ | ||
@Entity | ||
@Table(name = "programming_exercise_test_case") | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
public class ProgrammingExerciseTestCase implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "test_name") | ||
private String testName; | ||
|
||
@Column(name = "weight") | ||
private Integer weight; | ||
|
||
@Column(name = "active") | ||
private Boolean active; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JsonIgnoreProperties("programmingExerciseTestCase") | ||
private ProgrammingExercise exercise; | ||
|
||
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public ProgrammingExerciseTestCase id(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public String getTestName() { | ||
return testName; | ||
} | ||
|
||
public ProgrammingExerciseTestCase testName(String testName) { | ||
this.testName = testName; | ||
return this; | ||
} | ||
|
||
public void setTestName(String testName) { | ||
this.testName = testName; | ||
} | ||
|
||
public Integer getWeight() { | ||
return weight; | ||
} | ||
|
||
public ProgrammingExerciseTestCase weight(Integer weight) { | ||
this.weight = weight; | ||
return this; | ||
} | ||
|
||
public void setWeight(Integer weight) { | ||
this.weight = weight; | ||
} | ||
|
||
public Boolean isActive() { | ||
return active; | ||
} | ||
|
||
public ProgrammingExerciseTestCase active(Boolean active) { | ||
this.active = active; | ||
return this; | ||
} | ||
|
||
public void setActive(Boolean active) { | ||
this.active = active; | ||
} | ||
|
||
public Exercise getExercise() { | ||
return exercise; | ||
} | ||
|
||
public ProgrammingExerciseTestCase exercise(ProgrammingExercise exercise) { | ||
this.exercise = exercise; | ||
return this; | ||
} | ||
|
||
public void setExercise(ProgrammingExercise exercise) { | ||
this.exercise = exercise; | ||
} | ||
|
||
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | ||
|
||
/** | ||
* This method needs to be checked and updated if there is a new class attribute. Creates a clone with all attributes set to the value of the object, including the id. | ||
* | ||
* @return a clone of the object. | ||
*/ | ||
public ProgrammingExerciseTestCase clone() { | ||
ProgrammingExerciseTestCase clone = new ProgrammingExerciseTestCase().testName(this.getTestName()).weight(this.getWeight()).active(this.isActive()).exercise(this.exercise); | ||
clone.setId(this.getId()); | ||
return clone; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
ProgrammingExerciseTestCase programmingExerciseTestCase = (ProgrammingExerciseTestCase) o; | ||
if (programmingExerciseTestCase.getTestName().equals(this.getTestName()) && this.getExercise().getId().equals(programmingExerciseTestCase.getExercise().getId())) { | ||
return true; | ||
} | ||
if (getId() == null && programmingExerciseTestCase.getId() == null) { | ||
return false; | ||
} | ||
return Objects.equals(getId(), programmingExerciseTestCase.getId()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(testName) + Objects.hashCode(getExercise().getId()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ProgrammingExerciseTestCase{" + "id=" + getId() + ", testName='" + getTestName() + "'" + ", weight=" + getWeight() + ", active='" + isActive() + "'" + "}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/de/tum/in/www1/artemis/domain/enumeration/RepositoryType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package de.tum.in.www1.artemis.domain.enumeration; | ||
|
||
public enum RepositoryType { | ||
|
||
TEMPLATE("BASE"), SOLUTION("SOLUTION"), TESTS("TESTS"); | ||
|
||
private String name; | ||
|
||
RepositoryType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseTestCaseRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package de.tum.in.www1.artemis.repository; | ||
|
||
import java.util.Set; | ||
|
||
import org.springframework.data.jpa.repository.*; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; | ||
|
||
/** | ||
* Spring Data repository for the ProgrammingExerciseTestCase entity. | ||
*/ | ||
@SuppressWarnings("unused") | ||
@Repository | ||
public interface ProgrammingExerciseTestCaseRepository extends JpaRepository<ProgrammingExerciseTestCase, Long> { | ||
|
||
Set<ProgrammingExerciseTestCase> findByExerciseId(Long exerciseId); | ||
|
||
Set<ProgrammingExerciseTestCase> findByExerciseIdAndActive(Long exerciseId, Boolean active); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.