Skip to content

Commit 75679a8

Browse files
#2175 review unit tests and add exclusion cause (#2198)
* checkpoint * Improve test annotations and clarify reasons for disabling specific tests
1 parent fbf0363 commit 75679a8

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

core/src/test/java/com/predic8/membrane/core/UnitTests.java

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,27 @@
1515

1616
import org.junit.platform.suite.api.*;
1717

18-
/**
19-
* TODO Fix:
20-
* - com.predic8.membrane.core.interceptor.opentelemetry.OpenTelemetryInterceptorTest
21-
* - com.predic8.membrane.core.interceptor.rewrite.RewriteInterceptorIntegrationTest // Rewrite as UnitTest with sampleSOAPService
22-
* Still in use?
23-
* - com.predic8.membrane.core.interceptor.oauth2client.OAuth2Resource2InterceptorTest
24-
* - com.predic8.membrane.core.interceptor.shadowing.ShadowingInterceptorTest
25-
*/
2618
@Suite
2719
@SelectPackages({"com.predic8"})
2820
@ExcludeClassNamePatterns({
29-
"com.predic8.membrane.AllTests",
30-
"com.predic8.membrane.core.interceptor.opentelemetry.OpenTelemetryInterceptorTest",
31-
"com.predic8.membrane.core.interceptor.balancer.NodeOnlineCheckerTest",
32-
"com.predic8.membrane.core.interceptor.tunnel.WebsocketStompTest",
33-
"com.predic8.membrane.core.interceptor.oauth2client.OAuth2Resource2InterceptorTest",
34-
"com.predic8.membrane.core.interceptor.shadowing.ShadowingInterceptorTest",
35-
"com.predic8.membrane.core.interceptor.rewrite.RewriteInterceptorIntegrationTest",
36-
//
37-
// From includes, weren't run before!
38-
// TODO: Fix or delete
39-
"com.predic8.membrane.core.transport.http.ConnectionTest",
40-
"com.predic8.membrane.core.util.MemcachedConnectorTest"
41-
21+
"com.predic8.membrane.AllTests", // Replaced with package scan
22+
"com.predic8.membrane.core.transport.http.ConnectionTest", // #2180 should fix it
23+
"com.predic8.membrane.core.interceptor.rewrite.RewriteInterceptorIntegrationTest", // Rewrite as UnitTest with sampleSOAPService
24+
"com.predic8.membrane.core.interceptor.tunnel.WebsocketStompTest", // Fails: not standalone; depends on external WS+STOMP setup
25+
"com.predic8.membrane.core.interceptor.oauth2client.OAuth2Resource2InterceptorTest", // Disabled: incomplete setup; AuthorizationService (and other) not configured
26+
"com.predic8.membrane.core.util.MemcachedConnectorTest" // Disabled: not standalone; needs Memcached at 127.0.0.1:11211 (fails with Connection refused)
4227
})
4328
public class UnitTests {
4429
/*
4530
* Uncomment below to speed up test execution!
4631
*
4732
*/
48-
/*
49-
* @BeforeClass public static void forbidScreenOutput() { PrintStream ps =
50-
* new PrintStream(new OutputStream() {
51-
*
52-
* @Override public void write(int b) throws IOException { throw new
53-
* RuntimeException("this test uses stdout"); } }); System.setOut(ps);
54-
* System.setErr(ps); }
55-
*/
33+
/*
34+
* @BeforeClass public static void forbidScreenOutput() { PrintStream ps =
35+
* new PrintStream(new OutputStream() {
36+
*
37+
* @Override public void write(int b) throws IOException { throw new
38+
* RuntimeException("this test uses stdout"); } }); System.setOut(ps);
39+
* System.setErr(ps); }
40+
*/
5641
}

core/src/test/java/com/predic8/membrane/core/interceptor/tunnel/WebsocketStompTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class WebsocketStompTest {
2424
@Test
2525
public void testWebsocketStomp() throws Exception{
26-
// Preparation: tart the Websocket-Stomp example from an external source
26+
// Preparation: Start the Websocket-Stomp example from an external source
2727

2828
// Starts embedded ActiveMQ and places "Hello world!" into the "foo" queue
2929
// Verification: If you open "localhost:4333" with running example the message appears -> Server part works

distribution/examples/websockets/websocket-stomp/proxies.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
<serviceProxy port="4443">
1010
<ssl>
11-
<keystore location="../../conf/membrane.p12" password="secret" keyPassword="secret" />
12-
<truststore location="../../conf/membrane.p12" password="secret" />
11+
<keystore location="../../../conf/membrane.p12" password="secret" keyPassword="secret" />
12+
<truststore location="../../../conf/membrane.p12" password="secret" />
1313
</ssl>
1414

1515
<log />

0 commit comments

Comments
 (0)