Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2161792

Browse files
author
Bruce Eckel
committed
moving to Junit 5
1 parente89d177 commit2161792

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

‎build.gradle

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ class Tags {
125125
}
126126
}
127127

128-
ext.junit4Version='4.12'
129-
ext.junitVintageVersion='4.12.0-M2'
130-
ext.junitPlatformVersion='1.0.0-M2'
131-
ext.junitJupiterVersion='5.0.0-M2'
128+
ext {
129+
junit4Version='4.12'
130+
junitVintageVersion='4.12.0-M2'
131+
junitPlatformVersion='1.0.0-M2'
132+
junitJupiterVersion='5.0.0-M2'
133+
}
132134

133135
subprojects {
134136
applyplugin:'com.github.johnrengelman.shadow'
@@ -146,7 +148,7 @@ subprojects {
146148
}
147149

148150
dependencies {
149-
//compile 'junit:junit:4.12'
151+
//compile 'junit:junit:4.12'
150152
compilegroup:'org.slf4j',name:'slf4j-api',version:'1.7.+'
151153
compilegroup:'ch.qos.logback',name:'logback-classic',version:'1.+'
152154
// You can also use the JDK's built-in logging as the back end:
@@ -159,11 +161,12 @@ subprojects {
159161
// If you also want to support JUnit 3 and JUnit 4 tests
160162
testCompile("junit:junit:${junit4Version}")
161163
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}")*/
164+
compile"org.junit.jupiter:junit-jupiter-api:5.0.0-M2"
162165
testCompile"org.junit.jupiter:junit-jupiter-api:5.0.0-M2"
163166
testRuntime"org.junit.jupiter:junit-jupiter-engine:5.0.0-M2"
164-
testCompile"junit:junit:4.12"
167+
/* testCompile "junit:junit:4.12"
165168
testRuntime "org.junit.vintage:junit-vintage-engine:4.12.0-M2"
166-
/* compile "org.junit.jupiter:junit-jupiter-api:5.0.0-M2"
169+
*//* compile "org.junit.jupiter:junit-jupiter-api:5.0.0-M2"
167170
compile "org.junit.vintage:junit-vintage-engine:4.12.0-M2"*/
168171
}
169172

‎references/DeepCopy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Cloning a composed object
66
// (Install libraries from junit.org)
7-
importorg.junit.Test;
8-
importstaticorg.junit.Assert.assertEquals;
7+
importorg.junit.jupiter.api.*;
8+
importstaticorg.junit.jupiter.api.Assertions.*;
99

1010
classDepthReadingimplementsCloneable {
1111
privatedoubledepth;

‎verifying/FirstJUnit5Tests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
packageverifying;
6-
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
7-
importorg.junit.jupiter.api.Test;
6+
importorg.junit.jupiter.api.*;
7+
importstaticorg.junit.jupiter.api.Assertions.*;
88

99
classFirstJUnit5Tests {
1010
@Test

‎verifying/QueueTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
packageverifying;
66
importverifying.Queue;
7-
importorg.junit.Test;
8-
importstaticorg.junit.Assert.*;
7+
importorg.junit.jupiter.api.*;
8+
importstaticorg.junit.jupiter.api.Assertions.*;
99

1010
publicclassQueueTest {
1111
privateQueuequeue =newQueue(10);

‎verifying/SimpleJUnit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Simple use of JUnit to test ArrayList
66
packageverifying;
77
importjava.util.*;
8-
importorg.junit.*;
9-
importstaticorg.junit.Assert.*;
8+
importorg.junit.jupiter.api.*;
9+
importstaticorg.junit.jupiter.api.Assertions.*;
1010

1111
// Keeps track of list objects as they are
1212
// created and cleaned up:

‎verifying/StringInverterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// {ValidateByHand} // Don't run by itself
66
importjava.util.*;
7-
importorg.junit.*;
8-
importstaticorg.junit.Assert.*;
9-
importorg.junit.runner.*;
10-
importorg.junit.runner.notification.Failure;
7+
importorg.junit.jupiter.api.*;
8+
importstaticorg.junit.jupiter.api.Assertions.*;
9+
importorg.junit.jupiter.runner.*;
10+
importorg.junit.jupiter.runner.notification.Failure;
1111

1212
publicclassStringInverterTest {
1313
staticStringInverterinverter;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp