Package: icb-utils / 2.0.1+git20161002.afee1d9-5

modify_testing.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Description: Change tests not applicable for Debian packaging
 The test getNoImplementationVersion is ignored, as the junit jar has an
 implementation version attribute.
 The tests testResrouceFinderClasspathFileNoArgsConstructor and
 testResrouceFinderClasspathFileNullToMultiArgsConstructor are ignored because
 ant is not used for the build.
 The method testResrouceExistingFileInDir is wrongly defined: the comment above
 it suggests that it expects a null result.
 The tests in TestIpUtils are ignored because inspecting the source code of
 validateIpAddress shows this method never throws an UnknownHostException.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: https://github.com/CampagneLaboratory/icb-utils/issues/1
Last-Update: 2020-08-29

--- a/test-src/edu/cornell/med/icb/ip/TestIpUtils.java
+++ b/test-src/edu/cornell/med/icb/ip/TestIpUtils.java
@@ -19,6 +19,7 @@
 package edu.cornell.med.icb.ip;
 
 import static junit.framework.Assert.assertEquals;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.net.InetAddress;
@@ -111,6 +112,7 @@
      * Invalid ip with comment.
      * @throws UnknownHostException error parsing ip address
      */
+    @Ignore("validateIpAddress never throws UnknownHostException.")
     @Test(expected = UnknownHostException.class)
     public void testInvalidIpWithComment() throws UnknownHostException {
         IpUtils.validateIpAddress("   192.168.256.1   #    some comment     ");
@@ -130,6 +132,7 @@
      * Long ip, no comment. Invalid.
      * @throws UnknownHostException error parsing ip address
      */
+    @Ignore("validateIpAddress never throws UnknownHostException.")
     @Test(expected = UnknownHostException.class)
     public void testInvalidIpLongNoComment() throws UnknownHostException {
         IpUtils.validateIpAddress("168.254.1.53.23");
@@ -139,6 +142,7 @@
      * Bad ip.
      * @throws UnknownHostException error parsing ip address
      */
+    @Ignore("validateIpAddress never throws UnknownHostException.")
     @Test(expected = UnknownHostException.class)
     public void testInvalidIpLettersNoComment() throws UnknownHostException {
         IpUtils.validateIpAddress("254.abc.53.23");
@@ -148,6 +152,7 @@
      * Bad ip with comment.
      * @throws UnknownHostException error parsing ip address
      */
+    @Ignore("validateIpAddress never throws UnknownHostException.")
     @Test(expected = UnknownHostException.class)
     public void testInvalidIpLettersComment() throws UnknownHostException {
         IpUtils.validateIpAddress("254.abc.53.23  #  another comment");
@@ -157,6 +162,7 @@
      * Test reading from a stream, ignoring errors.
      * @throws UnknownHostException error parsing ip address
      */
+    @Ignore("validateIpAddress never throws UnknownHostException.")
     @Test(expected = UnknownHostException.class)
     public void testIgnoreErrors() throws UnknownHostException {
         final StringBuilder source = new StringBuilder();
--- a/test-src/edu/cornell/med/icb/io/TestResourceFinder.java
+++ b/test-src/edu/cornell/med/icb/io/TestResourceFinder.java
@@ -22,6 +22,7 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.BufferedWriter;
@@ -40,6 +41,7 @@
      * This file will be found because it is in config and config is in the classpath
      * (thanks to ant).
      */
+    @Ignore("ant is not used for the Debian build.")
     @Test
     public void testResrouceFinderClasspathFileNoArgsConstructor() {
         // Config is in the class path for test
@@ -52,6 +54,7 @@
      * Different constructor, multi args, but passing a null. The file will be found
      * because config is in the classpath (thanks to ant).
      */
+    @Ignore("ant is not used for the Debian build.")
     @Test
     public void testResrouceFinderClasspathFileNullToMultiArgsConstructor() {
         // Config is in the class path for test
@@ -91,7 +94,7 @@
         // Add testsupport to search path
         final ResourceFinder resrouceFinder = new ResourceFinder("testsupport");
         final URL url =  resrouceFinder.findResource("testsupport.ipr");
-        assertNotNull(url);
+        assertNull(url);
     }
 
     /**
--- a/test-src/edu/cornell/med/icb/util/TestVersionUtils.java
+++ b/test-src/edu/cornell/med/icb/util/TestVersionUtils.java
@@ -23,6 +23,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -73,6 +74,7 @@
      * Validates functionality of {@link VersionUtils#getImplementationVersion(Class<?> )}
      * with a jar is readable but that has no implementation version attribute.
      */
+    @Ignore("Debian-packaged junit jar has an implementation version.")
     @Test
     public void getNoImplementationVersion() {
         final String version = VersionUtils.getImplementationVersion(org.junit.Test.class);