Skip to content

Commit ce88449

Browse files
authored
Merge pull request #171 from cconlon/junitTimes
Add time taken per JUnit test in ms
2 parents 8b7469d + 49d150b commit ce88449

File tree

61 files changed

+187
-312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+187
-312
lines changed

src/test/java/com/wolfssl/provider/jce/test/WolfCryptASN1UtilTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,15 @@
3333
import java.math.BigInteger;
3434

3535
import com.wolfssl.provider.jce.WolfCryptASN1Util;
36+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
3637

3738
/**
3839
* JUnit test class for WolfCryptASN1Util DER encoding utilities.
3940
*/
4041
public class WolfCryptASN1UtilTest {
4142

4243
@Rule(order = Integer.MIN_VALUE)
43-
public TestRule testWatcher = new TestWatcher() {
44-
protected void starting(Description desc) {
45-
System.out.println("\t" + desc.getMethodName());
46-
}
47-
};
44+
public TestRule testWatcher = TimedTestWatcher.create();
4845

4946
/* ASN.1 Universal Tags */
5047
private static final byte ASN1_INTEGER = 0x02;

src/test/java/com/wolfssl/provider/jce/test/WolfCryptAlgorithmParameterGeneratorTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@
4646

4747
import com.wolfssl.wolfcrypt.Fips;
4848
import com.wolfssl.provider.jce.WolfCryptProvider;
49+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
4950

5051
public class WolfCryptAlgorithmParameterGeneratorTest {
5152

5253
private static SecureRandom rand = null;
5354

5455
@Rule(order = Integer.MIN_VALUE)
55-
public TestRule testWatcher = new TestWatcher() {
56-
protected void starting(Description desc) {
57-
System.out.println("\t" + desc.getMethodName());
58-
}
59-
};
56+
public TestRule testWatcher = TimedTestWatcher.create();
6057

6158
@BeforeClass
6259
public static void testProviderInstallationAtRuntime()

src/test/java/com/wolfssl/provider/jce/test/WolfCryptAlgorithmParametersTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,12 @@
4545
import javax.crypto.spec.IvParameterSpec;
4646

4747
import com.wolfssl.provider.jce.WolfCryptProvider;
48+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
4849

4950
public class WolfCryptAlgorithmParametersTest {
5051

5152
@Rule(order = Integer.MIN_VALUE)
52-
public TestRule testWatcher = new TestWatcher() {
53-
protected void starting(Description desc) {
54-
System.out.println("\t" + desc.getMethodName());
55-
}
56-
};
53+
public TestRule testWatcher = TimedTestWatcher.create();
5754

5855
@BeforeClass
5956
public static void testProviderInstallationAtRuntime()

src/test/java/com/wolfssl/provider/jce/test/WolfCryptCipherTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
import com.wolfssl.wolfcrypt.Fips;
8181
import com.wolfssl.provider.jce.WolfCryptProvider;
8282
import com.wolfssl.wolfcrypt.WolfCryptException;
83+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
8384

8485
public class WolfCryptCipherTest {
8586

@@ -116,11 +117,7 @@ public class WolfCryptCipherTest {
116117
private static SecureRandom secureRandom = new SecureRandom();
117118

118119
@Rule(order = Integer.MIN_VALUE)
119-
public TestRule testWatcher = new TestWatcher() {
120-
protected void starting(Description desc) {
121-
System.out.println("\t" + desc.getMethodName());
122-
}
123-
};
120+
public TestRule testWatcher = TimedTestWatcher.create();
124121

125122
@BeforeClass
126123
public static void testProviderInstallationAtRuntime()

src/test/java/com/wolfssl/provider/jce/test/WolfCryptDHKeyFactoryTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
import com.wolfssl.provider.jce.WolfCryptProvider;
5353
import com.wolfssl.wolfcrypt.FeatureDetect;
54+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
5455

5556
/**
5657
* JUnit4 test cases for WolfCryptDHKeyFactory
@@ -64,12 +65,7 @@ public class WolfCryptDHKeyFactoryTest {
6465
new ArrayList<Integer>();
6566

6667
@Rule(order = Integer.MIN_VALUE)
67-
public TestRule testWatcher = new TestWatcher() {
68-
69-
protected void starting(Description desc) {
70-
System.out.println("\t" + desc.getMethodName());
71-
}
72-
};
68+
public TestRule testWatcher = TimedTestWatcher.create();
7369

7470
@BeforeClass
7571
public static void testProviderInstallation() {

src/test/java/com/wolfssl/provider/jce/test/WolfCryptECKeyFactoryTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import com.wolfssl.provider.jce.WolfCryptECParameterSpec;
5555
import com.wolfssl.wolfcrypt.FeatureDetect;
5656
import com.wolfssl.wolfcrypt.Ecc;
57+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
5758

5859
/**
5960
* JUnit4 test cases for WolfCryptECKeyFactory
@@ -96,12 +97,7 @@ public class WolfCryptECKeyFactoryTest {
9697
new ArrayList<String>();
9798

9899
@Rule(order = Integer.MIN_VALUE)
99-
public TestRule testWatcher = new TestWatcher() {
100-
101-
protected void starting(Description desc) {
102-
System.out.println("\t" + desc.getMethodName());
103-
}
104-
};
100+
public TestRule testWatcher = TimedTestWatcher.create();
105101

106102
@BeforeClass
107103
public static void testProviderInstallation() {

src/test/java/com/wolfssl/provider/jce/test/WolfCryptKeyAgreementTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import com.wolfssl.wolfcrypt.Ecc;
7070
import com.wolfssl.wolfcrypt.Fips;
7171
import com.wolfssl.provider.jce.WolfCryptProvider;
72+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
7273

7374
public class WolfCryptKeyAgreementTest {
7475

@@ -136,11 +137,7 @@ public class WolfCryptKeyAgreementTest {
136137
}*/
137138

138139
@Rule(order = Integer.MIN_VALUE)
139-
public TestRule testWatcher = new TestWatcher() {
140-
protected void starting(Description desc) {
141-
System.out.println("\t" + desc.getMethodName());
142-
}
143-
};
140+
public TestRule testWatcher = TimedTestWatcher.create();
144141

145142
@BeforeClass
146143
public static void testProviderInstallationAtRuntime() {

src/test/java/com/wolfssl/provider/jce/test/WolfCryptKeyGeneratorTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.wolfssl.wolfcrypt.Sha512;
5050
import com.wolfssl.wolfcrypt.Sha3;
5151
import com.wolfssl.provider.jce.WolfCryptProvider;
52+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
5253

5354
public class WolfCryptKeyGeneratorTest {
5455

@@ -69,11 +70,7 @@ public class WolfCryptKeyGeneratorTest {
6970
private static SecureRandom rand = null;
7071

7172
@Rule(order = Integer.MIN_VALUE)
72-
public TestRule testWatcher = new TestWatcher() {
73-
protected void starting(Description desc) {
74-
System.out.println("\t" + desc.getMethodName());
75-
}
76-
};
73+
public TestRule testWatcher = TimedTestWatcher.create();
7774

7875
@BeforeClass
7976
public static void testProviderInstallationAtRuntime()

src/test/java/com/wolfssl/provider/jce/test/WolfCryptKeyPairGeneratorTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import com.wolfssl.wolfcrypt.test.Util;
6969
import com.wolfssl.wolfcrypt.WolfCryptException;
7070
import com.wolfssl.provider.jce.WolfCryptProvider;
71+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
7172

7273
public class WolfCryptKeyPairGeneratorTest {
7374

@@ -138,11 +139,7 @@ public class WolfCryptKeyPairGeneratorTest {
138139
private static byte[] base = new byte[] { 0x02 };
139140

140141
@Rule(order = Integer.MIN_VALUE)
141-
public TestRule testWatcher = new TestWatcher() {
142-
protected void starting(Description desc) {
143-
System.out.println("\t" + desc.getMethodName());
144-
}
145-
};
142+
public TestRule testWatcher = TimedTestWatcher.create();
146143

147144
@BeforeClass
148145
public static void testProviderInstallationAtRuntime() {

src/test/java/com/wolfssl/provider/jce/test/WolfCryptMacTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import com.wolfssl.wolfcrypt.Fips;
5353
import com.wolfssl.provider.jce.WolfCryptProvider;
5454
import com.wolfssl.wolfcrypt.test.Util;
55+
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
5556

5657
public class WolfCryptMacTest {
5758

@@ -93,11 +94,7 @@ public class WolfCryptMacTest {
9394
new ArrayList<Integer>();
9495

9596
@Rule(order = Integer.MIN_VALUE)
96-
public TestRule testWatcher = new TestWatcher() {
97-
protected void starting(Description desc) {
98-
System.out.println("\t" + desc.getMethodName());
99-
}
100-
};
97+
public TestRule testWatcher = TimedTestWatcher.create();
10198

10299
@BeforeClass
103100
public static void testProviderInstallationAtRuntime()

0 commit comments

Comments
 (0)