Skip to content

Commit

Permalink
Merge branch 'master' into OAuth2redirectTest
Browse files Browse the repository at this point in the history
  • Loading branch information
t-burch authored Nov 11, 2024
2 parents 62d9808 + d457ad2 commit e68f5c7
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 234 deletions.
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,12 @@
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>1.42.1</version>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<version>1.42.1</version>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.predic8.membrane.core.interceptor.AdjustContentLengthIntegrationTest;
import com.predic8.membrane.core.interceptor.RegExReplaceInterceptorTest;
import com.predic8.membrane.core.rules.UnavailableSoapProxyTest;
import com.predic8.membrane.core.transport.http.InterceptorInvocationTest;
import com.predic8.membrane.integration.ProxySSLConnectionMethodTest;
import com.predic8.membrane.integration.SoapAndInternalProxyTest;
import com.predic8.membrane.integration.ViaProxyTest;
Expand All @@ -32,7 +31,6 @@
MethodTest.class,
RegExReplaceInterceptorTest.class,
LoadBalancingInterceptorTest.class,
InterceptorInvocationTest.class,
ViaProxyTest.class,
ProxySSLConnectionMethodTest.class,
AdjustContentLengthIntegrationTest.class,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
limitations under the License. */
package com.predic8.membrane.core.transport.http;


import java.io.IOException;

import com.predic8.membrane.core.interceptor.misc.ReturnInterceptor;
import com.predic8.membrane.core.interceptor.templating.StaticInterceptor;
import com.predic8.membrane.core.rules.InternalProxy;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -59,35 +62,44 @@ public void tearDown() throws Exception {
}

private ServiceProxy createFirstRule() {
ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost", Request.METHOD_POST, "*", 3016), "thomas-bayer.com", 80);
ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost", Request.METHOD_POST, "*", 2000), "localhost", 80);
rule.setTargetURL("service:log");
rule.getInterceptors().add(new MockInterceptor("process"));
return rule;
}

private ServiceProxy createServiceRule() {
ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost","*", "*", 3012), "thomas-bayer.com", 80);
ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost","*", "*", 3000), "localhost", 4000);
rule.setName("log");
rule.getInterceptors().add(new MockInterceptor("log"));
return rule;
}

private void callService() throws HttpException, IOException {
private ServiceProxy createEndpointRule() {
ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost","*", "*", 4000), "localhost", 80);
rule.getInterceptors().add(new StaticInterceptor() {{
setTextTemplate("Pong");
}});
rule.getInterceptors().add(new ReturnInterceptor());
return rule;
}

private void callService() throws IOException {
new HttpClient().executeMethod(createPostMethod());
}

private PostMethod createPostMethod() {
PostMethod post = new PostMethod("http://localhost:3016/axis2/services/BLZService?wsdl");
post.setRequestEntity(new InputStreamRequestEntity(this.getClass().getResourceAsStream("/getBank.xml")));
post.setRequestHeader(Header.CONTENT_TYPE, MimeType.TEXT_XML_UTF8);
post.setRequestHeader(Header.SOAP_ACTION, "");
PostMethod post = new PostMethod("http://localhost:2000");
post.setRequestEntity(new StringRequestEntity("Ping"));
post.setRequestHeader(Header.CONTENT_TYPE, MimeType.TEXT_PLAIN_UTF8);
return post;
}

private HttpRouter createRouter() throws Exception {
HttpRouter router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(createFirstRule());
router.getRuleManager().addProxyAndOpenPortIfNew(createServiceRule());
router.getRuleManager().addProxyAndOpenPortIfNew(createEndpointRule());
router.getTransport().getInterceptors().add(router.getTransport().getInterceptors().size()-1, new MockInterceptor("transport-log"));
router.init();
return router;
Expand Down
2 changes: 1 addition & 1 deletion distribution/examples/embedding-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.9</version>
<version>1.5.11</version>
</dependency>
<dependency>
<groupId>org.membrane-soa</groupId>
Expand Down
Loading

0 comments on commit e68f5c7

Please sign in to comment.