Project for coding dojos with tests in junit
- Maven 3 or +
- Java 8
- Npm
- Angular 4
Library to let launch test junit with a Score Mode
Let use de Runner ScoreBlockJUnit4ClassRunner for launch test with a Score mode, you can choose if the test only score when is ok or ko with a maxtime.
Persist your results on a database.
Exemple :
@RunWith(ScoreBlockJUnit4ClassRunner.class)
@Persist(Couchbase.class)
public class BattleCode2016Test {
@InjectImpl
protected IBattleCode2016 battleCode2016;
@Test
@Score(10)
public void checkSum_For2and2_then4() {
// Setup
int expected = 4;
// Test
int result = battleCode2016.sum(2,2);
// Assertions
Assertions.assertThat(result).isEqualTo(expected);
}
@Test(timeout = 1)
@Score(value = 500, maxTimeOnly = true)
public void checkSum_longTretment() throws InterruptedException {
// Setup
int expected = 9;
for (int i = 0; i < 100000; i++) {
// System.out.println("EO");
}
// Test
int result = battleCode2016.sum(2,2);
// Assertions
Assertions.assertThat(result).isEqualTo(expected);
}
}
Spring boot application for share resuts form SCORE JUNIT
IHM on Angular to show the SCORE JUNIT results using the SCORE REST API
npm install
npm start
Example projects for
- https://github.com/emmanuel-vasseur/score-exercise-example : Interfaces and models to implement.
- https://github.com/emmanuel-vasseur/score-exercise-team1-impl : Implementation of the solution.
- https://github.com/emmanuel-vasseur/score-exercise-team2-impl : Another implementation of the solution.
- https://github.com/emmanuel-vasseur/score-exercise-example-validation : Validation test with jenkins configuration for scoring.