Skip to content

Commit 32ef6f9

Browse files
committed
removed 3 trivial getter/setter
1 parent a690cff commit 32ef6f9

3 files changed

Lines changed: 7 additions & 61 deletions

File tree

test/org/apache/catalina/valves/TestLoadBalancerDrainingValveUnit.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,11 @@
3232
import org.easymock.IMocksControl;
3333

3434
/**
35-
* Unit tests for {@link LoadBalancerDrainingValve} covering property getters/setters
36-
* and URI manipulation behaviours not covered by the parameterised integration test.
35+
* Unit tests for {@link LoadBalancerDrainingValve} covering URI manipulation behaviours
36+
* not covered by the parameterised integration test.
3737
*/
3838
public class TestLoadBalancerDrainingValveUnit {
3939

40-
@Test
41-
public void testGetSetProperties() {
42-
LoadBalancerDrainingValve valve = new LoadBalancerDrainingValve();
43-
44-
// setRedirectStatusCode has no corresponding getter; verify it does not throw
45-
valve.setRedirectStatusCode(302);
46-
47-
valve.setIgnoreCookieName("testCookie");
48-
Assert.assertEquals("testCookie", valve.getIgnoreCookieName());
49-
50-
valve.setIgnoreCookieValue("testValue");
51-
Assert.assertEquals("testValue", valve.getIgnoreCookieValue());
52-
}
53-
54-
5540
/**
5641
* collapseLeadingSlashes() is the private static helper that normalises URIs
5742
* before issuing the redirect. Test it directly via reflection.

test/org/apache/catalina/valves/TestSSLValve.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -405,30 +405,6 @@ private void assertCertificateParsed() throws Exception {
405405
}
406406

407407

408-
@Test
409-
public void testGetSetProperties() {
410-
SSLValve v = new SSLValve();
411-
412-
v.setSslClientCertHeader("custom_cert");
413-
Assert.assertEquals("custom_cert", v.getSslClientCertHeader());
414-
415-
v.setSslClientEscapedCertHeader("custom_escaped");
416-
Assert.assertEquals("custom_escaped", v.getSslClientEscapedCertHeader());
417-
418-
v.setSslSecureProtocolHeader("custom_protocol");
419-
Assert.assertEquals("custom_protocol", v.getSslSecureProtocolHeader());
420-
421-
v.setSslCipherHeader("custom_cipher");
422-
Assert.assertEquals("custom_cipher", v.getSslCipherHeader());
423-
424-
v.setSslSessionIdHeader("custom_session");
425-
Assert.assertEquals("custom_session", v.getSslSessionIdHeader());
426-
427-
v.setSslCipherUserKeySizeHeader("custom_keysize");
428-
Assert.assertEquals("custom_keysize", v.getSslCipherUserKeySizeHeader());
429-
}
430-
431-
432408
@Test
433409
public void testCustomHeaderNames() throws Exception {
434410
SSLValve customValve = new SSLValve();

test/org/apache/catalina/valves/TestStuckThreadDetectionValve.java

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -215,18 +215,6 @@ public void run() {
215215
}
216216

217217

218-
@Test
219-
public void testGetSetProperties() {
220-
StuckThreadDetectionValve valve = new StuckThreadDetectionValve();
221-
222-
valve.setThreshold(300);
223-
Assert.assertEquals(300, valve.getThreshold());
224-
225-
valve.setInterruptThreadThreshold(600);
226-
Assert.assertEquals(600, valve.getInterruptThreadThreshold());
227-
}
228-
229-
230218
@Test
231219
public void testGetInterruptedThreadsCount() throws Exception {
232220
StickingServlet stickingServlet = new StickingServlet(TimeUnit.SECONDS.toMillis(20L));
@@ -254,13 +242,10 @@ public void run() {
254242
}
255243
};
256244
asyncThread.start();
257-
try {
258-
asyncThread.join(20000);
259-
Assert.assertFalse(asyncThread.isAlive());
260-
} finally {
261-
// Interrupted thread count should now be > 0
262-
Assert.assertTrue(stickingServlet.wasInterrupted);
263-
Assert.assertTrue(valve.getInterruptedThreadsCount() > 0);
264-
}
245+
asyncThread.join(20000);
246+
// check that we did not reach the join timeout
247+
Assert.assertFalse(asyncThread.isAlive());
248+
Assert.assertTrue(stickingServlet.wasInterrupted);
249+
Assert.assertTrue(valve.getInterruptedThreadsCount() > 0);
265250
}
266251
}

0 commit comments

Comments
 (0)