Skip to content

Commit 84c8591

Browse files
committed
#414 Re-enable testIti56 testcase
* side note: Logging must be disabled, otherwise jetty throws a failure
1 parent 560aa98 commit 84c8591

File tree

2 files changed

+30
-37
lines changed

2 files changed

+30
-37
lines changed

platform-camel/ihe/hl7v3/src/test/groovy/org/openehealth/ipf/platform/camel/ihe/hl7v3/iti56/Iti56TestRouteBuilder.groovy

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ import static org.openehealth.ipf.platform.camel.ihe.hl7v3.PixPdqV3CamelValidato
3232
*/
3333
class Iti56TestRouteBuilder extends RouteBuilder {
3434

35-
static final AtomicInteger responseCount = new AtomicInteger()
35+
static final AtomicInteger responseCount = new AtomicInteger()
3636
static final AtomicInteger asyncResponseCount = new AtomicInteger()
37-
37+
3838
static final String RESPONSE = StandardTestContainer.readFile('iti56/iti56-sample-response.xml')
3939

4040
final CountDownLatch countDownLatch, asyncCountDownLatch
@@ -45,15 +45,13 @@ class Iti56TestRouteBuilder extends RouteBuilder {
4545
countDownLatch = new CountDownLatch(TASKS_COUNT)
4646
asyncCountDownLatch = new CountDownLatch(TASKS_COUNT)
4747
}
48-
48+
4949
@Override
5050
public void configure() throws Exception {
5151

5252
// receiver of asynchronous responses
5353
from('xcpd-iti56-async-response:iti56service-response' +
54-
'?correlator=#correlator' +
55-
'&inInterceptors=#inLogInterceptor' +
56-
'&outInterceptors=#outLogInterceptor')
54+
'?correlator=#correlator')
5755
.process(iti56ResponseValidator())
5856
.process {
5957
if (! it.in.body.contains('<soap:Fault')) {
@@ -66,9 +64,7 @@ class Iti56TestRouteBuilder extends RouteBuilder {
6664

6765

6866
// responding route
69-
from('xcpd-iti56:iti56service' +
70-
'?inInterceptors=#inLogInterceptor' +
71-
'&outInterceptors=#outLogInterceptor')
67+
from('xcpd-iti56:iti56service')
7268
.process(iti56RequestValidator())
7369
.process {
7470
it.message.body = RESPONSE
@@ -79,9 +75,7 @@ class Iti56TestRouteBuilder extends RouteBuilder {
7975

8076

8177
// responding route for testing errors
82-
from('xcpd-iti56:iti56service-error' +
83-
'?inInterceptors=#inLogInterceptor' +
84-
'&outInterceptors=#outLogInterceptor')
78+
from('xcpd-iti56:iti56service-error')
8579
.throwException(new RuntimeException("abcd"))
8680
}
8781

platform-camel/ihe/hl7v3/src/test/groovy/org/openehealth/ipf/platform/camel/ihe/hl7v3/iti56/TestIti56.groovy

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
* Copyright 2010 the original author or authors.
3-
*
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,7 +20,6 @@ import org.apache.camel.support.DefaultExchange
2020
import org.apache.cxf.binding.soap.SoapFault
2121
import org.apache.cxf.transport.servlet.CXFServlet
2222
import org.junit.jupiter.api.BeforeAll
23-
import org.junit.jupiter.api.Disabled
2423
import org.junit.jupiter.api.MethodOrderer
2524
import org.junit.jupiter.api.Test
2625
import org.junit.jupiter.api.TestMethodOrder
@@ -37,27 +36,27 @@ import java.util.concurrent.TimeUnit
3736
@DirtiesContext
3837
@TestMethodOrder(MethodOrderer.MethodName)
3938
class TestIti56 extends HL7v3StandardTestContainer {
40-
39+
4140
def static CONTEXT_DESCRIPTOR = 'iti56/iti-56.xml'
42-
43-
final String SERVICE1_URI = "xcpd-iti56://localhost:${port}/iti56service?correlator=#correlator"
44-
final String SERVICE1_RESPONSE_URI = "http://localhost:${port}/iti56service-response"
45-
final String SERVICE_URI_ERROR = "xcpd-iti56://localhost:${port}/iti56service-error?correlator=#correlator"
46-
41+
42+
final String SERVICE1_URI = "xcpd-iti56://localhost:${port}/iti56service?correlator=#correlator"
43+
final String SERVICE1_RESPONSE_URI = "http://localhost:${port}/iti56service-response"
44+
final String SERVICE_URI_ERROR = "xcpd-iti56://localhost:${port}/iti56service-error?correlator=#correlator"
45+
4746
static final String REQUEST = readFile('iti56/iti56-sample-request.xml')
4847

4948
static final long AWAIT_DELAY = 20 * 1000L
5049

5150
static void main(args) {
5251
startServer(new CXFServlet(), CONTEXT_DESCRIPTOR, false, DEMO_APP_PORT)
5352
}
54-
53+
5554
@BeforeAll
5655
static void setUpClass() {
5756
startServer(new CXFServlet(), CONTEXT_DESCRIPTOR)
5857
}
59-
60-
58+
59+
6160
/**
6261
* Test whether:
6362
* <ol>
@@ -70,11 +69,11 @@ class TestIti56 extends HL7v3StandardTestContainer {
7069
* <li> ATNA auditing works.
7170
* </ol>
7271
*/
73-
@Test @Disabled
72+
@Test
7473
void testIti56() {
7574
final int N = Iti56TestRouteBuilder.TASKS_COUNT
7675
int i = 0
77-
76+
7877
N.times {
7978
send(SERVICE1_URI, i++, SERVICE1_RESPONSE_URI)
8079
send(SERVICE1_URI, i++)
@@ -88,11 +87,11 @@ class TestIti56 extends HL7v3StandardTestContainer {
8887

8988
assert Iti56TestRouteBuilder.responseCount.get() == N * 2
9089
assert Iti56TestRouteBuilder.asyncResponseCount.get() == N
91-
90+
9291
assert auditSender.messages.size() == N * 4
9392
}
94-
95-
93+
94+
9695
@Test
9796
void testWithErrorSync() {
9897
def requestExchange = new DefaultExchange(camelContext)
@@ -101,8 +100,8 @@ class TestIti56 extends HL7v3StandardTestContainer {
101100
assert responseExchange.exception instanceof SoapFault
102101
assert responseExchange.exception.message == 'abcd'
103102
}
104-
105-
103+
104+
106105
@Test
107106
void testWithErrorAsync() {
108107
def requestExchange = new DefaultExchange(camelContext)
@@ -112,29 +111,29 @@ class TestIti56 extends HL7v3StandardTestContainer {
112111
assert responseExchange.exception == null
113112
assert responseExchange.pattern == ExchangePattern.InOnly
114113
}
115-
116-
114+
115+
117116
private static void send(
118117
String endpointUri,
119118
int n,
120119
String responseEndpointUri = null)
121120
{
122121
def requestExchange = new DefaultExchange(camelContext)
123122
requestExchange.in.body = REQUEST
124-
123+
125124
// set WSA ReplyTo header, when necessary
126125
if (responseEndpointUri) {
127126
requestExchange.in.headers[AbstractWsEndpoint.WSA_REPLYTO_HEADER_NAME] = responseEndpointUri
128127
}
129-
128+
130129
// set correlation key
131130
requestExchange.in.headers[AbstractWsEndpoint.CORRELATION_KEY_HEADER_NAME] = "corr ${n}"
132-
131+
133132
// send and check timing
134133
long startTimestamp = System.currentTimeMillis()
135134
def resultMessage = producerTemplate.send(endpointUri, requestExchange).message
136135
// TODO: reactivate test
137136
//assert (System.currentTimeMillis() - startTimestamp < Iti55TestRouteBuilder.ASYNC_DELAY)
138137
}
139-
138+
140139
}

0 commit comments

Comments
 (0)