Skip to content

Commit 4751b95

Browse files
committed
Arquillian example
1 parent f1bf2eb commit 4751b95

File tree

10 files changed

+346
-12
lines changed

10 files changed

+346
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one or more
5+
contributor license agreements. See the NOTICE file distributed with
6+
this work for additional information regarding copyright ownership.
7+
The ASF licenses this file to You under the Apache License, Version 2.0
8+
(the "License"); you may not use this file except in compliance with
9+
the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
22+
23+
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
24+
25+
<appender name="console" class="org.apache.log4j.ConsoleAppender">
26+
<param name="Target" value="System.out"/>
27+
<layout class="org.apache.log4j.PatternLayout">
28+
<param name="ConversionPattern" value="[%t] %-5p: %c - %m%n"/>
29+
</layout>
30+
</appender>
31+
32+
<logger name="org.reficio">
33+
<level value="warn"/>
34+
</logger>
35+
36+
<logger name="org.springframework">
37+
<level value="error"/>
38+
</logger>
39+
40+
<root>
41+
<priority value="error"/>
42+
<appender-ref ref="console"/>
43+
</root>
44+
45+
</log4j:configuration>

soap-examples/quickstart/pom.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,17 @@
5353
<artifactId>spring-test</artifactId>
5454
<version>${spring.version}</version>
5555
</dependency>
56+
<dependency>
57+
<groupId>org.codehaus.groovy</groupId>
58+
<artifactId>groovy-all</artifactId>
59+
</dependency>
5660
</dependencies>
5761

5862
<properties>
5963
<spring.version>3.1.2.RELEASE</spring.version>
6064
</properties>
6165

62-
<build>
66+
<build>
6367
<plugins>
6468
<plugin>
6569
<groupId>org.apache.maven.plugins</groupId>

soap-examples/quickstart/src/test/groovy/org/reficio/ws/quickstart/QuickStart.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2012 Reficio (TM) - Reestablish your software!. All Rights Reserved.
2+
* Copyright (c) 2012-2013 Reficio (TM) - Reestablish your software!. All Rights Reserved.
33
*
44
* Licensed to the Apache Software Foundation (ASF) under one or more
55
* contributor license agreements. See the NOTICE file distributed with

soap-examples/quickstart/src/test/java/org/reficio/ws/quickstart/SoapClientExamplesTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2012 Reficio (TM) - Reestablish your software!. All Rights Reserved.
2+
* Copyright (c) 2012-2013 Reficio (TM) - Reestablish your software!. All Rights Reserved.
33
*
44
* Licensed to the Apache Software Foundation (ASF) under one or more
55
* contributor license agreements. See the NOTICE file distributed with

soap-examples/quickstart/src/test/java/org/reficio/ws/quickstart/SoapServerExamplesTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2012 Reficio (TM) - Reestablish your software!. All Rights Reserved.
2+
* Copyright (c) 2012-2013 Reficio (TM) - Reestablish your software!. All Rights Reserved.
33
*
44
* Licensed to the Apache Software Foundation (ASF) under one or more
55
* contributor license agreements. See the NOTICE file distributed with

soap-examples/quickstart/src/test/java/org/reficio/ws/quickstart/SpringExampleTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2012 Reficio (TM) - Reestablish your software!. All Rights Reserved.
2+
* Copyright (c) 2012-2013 Reficio (TM) - Reestablish your software!. All Rights Reserved.
33
*
44
* Licensed to the Apache Software Foundation (ASF) under one or more
55
* contributor license agreements. See the NOTICE file distributed with

soap-test/src/main/java/org/reficio/ws/test/ServerProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public SoapServer initServer() {
7878
URL wsdlUrl = getWsdlUrl(testClass);
7979
Wsdl parser = Wsdl.parse(wsdlUrl);
8080
SoapBuilder builder = getBuilder(parser);
81-
SoapServer server = construct();
81+
server = construct();
8282
AutoResponder responder = getAutoResponder(builder);
8383
registerService(server, responder);
8484

soap-test/src/test/groovy/org/reficio/ws/test/spock/SpockExtensionTest.groovy

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ import org.reficio.ws.builder.SoapBuilder
2323
import org.reficio.ws.builder.SoapOperation
2424
import org.reficio.ws.builder.core.Wsdl
2525
import org.reficio.ws.client.core.SoapClient
26+
import org.reficio.ws.common.ResourceUtils
2627
import spock.lang.Specification
2728

2829
@Log4j
29-
@Server(wsdl = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL", binding = "CurrencyConvertorSoap")
30+
@Server(wsdl = "classpath:wsdl/currency-convertor.wsdl", binding = "CurrencyConvertorSoap")
3031
class SpockExtensionTest extends Specification {
3132

32-
static final String WSDL = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL";
33+
static final String WSDL = ResourceUtils.getResource("wsdl/currency-convertor.wsdl").toString();
3334

34-
@Server(wsdl = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL", binding = "CurrencyConvertorSoap", port = 41414)
35+
@Server(wsdl = "classpath:wsdl/currency-convertor.wsdl", binding = "CurrencyConvertorSoap", port = 41414)
3536
def "method specific server"() {
3637
setup:
3738
SoapClient client = SoapClient.builder().endpointUri("http://localhost:41414/service").build();

soap-test/src/test/java/org/reficio/ws/test/junit/SoapRuleTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.reficio.ws.builder.SoapOperation;
2727
import org.reficio.ws.builder.core.Wsdl;
2828
import org.reficio.ws.client.core.SoapClient;
29+
import org.reficio.ws.common.ResourceUtils;
2930

3031
// @Server annotation spawns an instance of a SoapServer for the lifespan of the test / method.
3132
// The SOAP server provides a SOAP auto-responder for the specified binding -> messages are generated and send automatically.
@@ -34,11 +35,11 @@
3435
// In order to enable the @Server annotation a junit @Rule has to be defined (JUnit requirement):
3536
// - org.junit.ClassRule in order to enable the @Server on a per-class basis
3637
// - org.junit.Rule in order to enable the @Server on a per-class basis
37-
@Server(wsdl = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL", binding = "CurrencyConvertorSoap")
38+
@Server(wsdl = "classpath:wsdl/currency-convertor.wsdl", binding = "CurrencyConvertorSoap")
3839
public class SoapRuleTest {
3940

4041
private final static Logger log = Logger.getLogger(SoapRuleTest.class);
41-
private static final String WSDL = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL";
42+
private static final String WSDL = ResourceUtils.getResource("wsdl/currency-convertor.wsdl").toString();
4243

4344
@Rule
4445
// define an instance rule if the @Server annotation is used per method
@@ -49,7 +50,7 @@ public class SoapRuleTest {
4950
public static SoapRule classRule = new SoapRule();
5051

5152
@Test
52-
@Server(wsdl = WSDL, binding = "CurrencyConvertorSoap", port = 41414)
53+
@Server(wsdl = "classpath:wsdl/currency-convertor.wsdl", binding = "CurrencyConvertorSoap", port = 41414)
5354
public void testSoapMock_perMethodServer() {
5455
SoapClient client = SoapClient.builder().endpointUri("http://localhost:41414/service").build();
5556
SoapBuilder builder = Wsdl.parse(WSDL).binding().localPart("CurrencyConvertorSoap").find();

soap-test/src/test/resources/wsdl/currency-convertor.wsdl

+283
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)