Skip to content

Commit 9db8f1d

Browse files
committed
Tests improved
1 parent e167fa7 commit 9db8f1d

File tree

8 files changed

+35
-30
lines changed

8 files changed

+35
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ hs_err_pid*
1313
/target/
1414
/**/.pmd
1515
/**/*.iml
16+
/**/*.rar

ph-as4-lib/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,6 @@
9090
<groupId>org.bouncycastle</groupId>
9191
<artifactId>bcmail-jdk15on</artifactId>
9292
</dependency>
93-
<dependency>
94-
<groupId>org.apache.wss4j</groupId>
95-
<artifactId>wss4j-ws-security-dom</artifactId>
96-
<exclusions>
97-
<exclusion>
98-
<groupId>javax.xml.stream</groupId>
99-
<artifactId>stax-api</artifactId>
100-
</exclusion>
101-
</exclusions>
102-
</dependency>
10393
<dependency>
10494
<groupId>javax.servlet</groupId>
10595
<artifactId>javax.servlet-api</artifactId>

ph-as4-lib/src/main/java/com/helger/as4/http/HttpMimeMessageEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public long getContentLength ()
6868

6969
public boolean isStreaming ()
7070
{
71-
return true;
71+
return false;
7272
}
7373

7474
public InputStream getContent () throws IOException

ph-as4-server-webapp-test/src/test/java/com/helger/as4/server/MockJettySetup.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636

3737
public final class MockJettySetup extends AbstractClientSetUp
3838
{
39+
public static final String SETTINGS_SERVER_JETTY_ENABLED = "server.jetty.enabled";
40+
public static final String SETTINGS_SERVER_ADDRESS = "server.address";
41+
3942
private static JettyRunner s_aJetty;
4043
private static AS4ResourceManager s_aResMgr;
4144

@@ -44,12 +47,12 @@ private MockJettySetup ()
4447

4548
private static boolean _isRunJetty ()
4649
{
47-
return AS4ServerConfiguration.getSettings ().getAsBoolean ("server.jetty.enabled", false);
50+
return AS4ServerConfiguration.getSettings ().getAsBoolean (SETTINGS_SERVER_JETTY_ENABLED, false);
4851
}
4952

5053
private static int _getJettyPort ()
5154
{
52-
return URLHelper.getAsURL (AS4ServerConfiguration.getSettings ().getAsString ("server.address")).getPort ();
55+
return URLHelper.getAsURL (AS4ServerConfiguration.getSettings ().getAsString (SETTINGS_SERVER_ADDRESS)).getPort ();
5356
}
5457

5558
@BeforeClass

ph-as4-server-webapp-test/src/test/java/com/helger/as4/server/message/AbstractUserMessageTestSetUp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private HttpPost _createPost ()
124124
LOG.info ("The following test case will only work if there is a local AS4 server running @ " + sURL);
125125
final HttpPost aPost = new HttpPost (sURL);
126126

127-
if (m_aSettings.getAsBoolean ("server.proxy.enabled", false))
127+
if (m_aSettings.getAsBoolean ("server.proxy.enabled", false) && !"localhost".equals (aPost.getURI ().getHost ()))
128128
{
129129
aPost.setConfig (RequestConfig.custom ()
130130
.setProxy (new HttpHost (m_aSettings.getAsString ("server.proxy.address"),

ph-as4-servlet/src/main/java/com/helger/as4/servlet/AS4Handler.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,10 +1374,8 @@ private static Document _readXML (@Nonnull final InputStream aRequestIS) throws
13741374
if (true || isDebug ())
13751375
{
13761376
final byte [] aBytes = StreamHelper.getAllBytes (aRequestIS);
1377-
s_aLogger.info ("GOT[" +
1378-
Charset.defaultCharset ().name () +
1379-
"]:\n" +
1380-
new String (aBytes, Charset.defaultCharset ()));
1377+
final Charset aCharset = Charset.defaultCharset ();
1378+
s_aLogger.info ("GOT[" + aCharset.name () + "]:\n" + new String (aBytes, aCharset));
13811379
return DOMReader.readXMLDOM (aBytes);
13821380
}
13831381
return DOMReader.readXMLDOM (aRequestIS);

ph-as4-servlet/src/main/java/com/helger/as4/servlet/mgr/AS4DuplicateCleanupJob.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.helger.commons.collection.impl.ICommonsMap;
3131
import com.helger.commons.datetime.PDTFactory;
3232
import com.helger.commons.lang.ClassHelper;
33-
import com.helger.photon.basic.app.CApplicationID;
3433
import com.helger.photon.core.job.AbstractPhotonJob;
3534
import com.helger.quartz.DisallowConcurrentExecution;
3635
import com.helger.quartz.IJobExecutionContext;
@@ -47,10 +46,7 @@ public final class AS4DuplicateCleanupJob extends AbstractPhotonJob
4746
private static final String KEY_MINUTES = "mins";
4847

4948
public AS4DuplicateCleanupJob ()
50-
{
51-
// Fixed ID
52-
super (CApplicationID.APP_ID_SECURE);
53-
}
49+
{}
5450

5551
@Override
5652
protected void onExecute (@Nonnull final JobDataMap aJobDataMap,

pom.xml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,49 +76,49 @@
7676
<dependency>
7777
<groupId>com.helger</groupId>
7878
<artifactId>ph-commons-parent-pom</artifactId>
79-
<version>9.0.0-b1</version>
79+
<version>9.0.0-SNAPSHOT</version>
8080
<type>pom</type>
8181
<scope>import</scope>
8282
</dependency>
8383
<dependency>
8484
<groupId>com.helger</groupId>
8585
<artifactId>ph-xsds-parent-pom</artifactId>
86-
<version>2.0.0-b1</version>
86+
<version>2.0.0-SNAPSHOT</version>
8787
<type>pom</type>
8888
<scope>import</scope>
8989
</dependency>
9090
<dependency>
9191
<groupId>com.helger</groupId>
9292
<artifactId>ph-schedule-parent-pom</artifactId>
93-
<version>4.0.0-b1</version>
93+
<version>4.0.0-SNAPSHOT</version>
9494
<type>pom</type>
9595
<scope>import</scope>
9696
</dependency>
9797
<dependency>
9898
<groupId>com.helger</groupId>
9999
<artifactId>ph-web-parent-pom</artifactId>
100-
<version>9.0.0-b1</version>
100+
<version>9.0.0-SNAPSHOT</version>
101101
<type>pom</type>
102102
<scope>import</scope>
103103
</dependency>
104104
<dependency>
105105
<groupId>com.helger</groupId>
106106
<artifactId>ph-masterdata-parent-pom</artifactId>
107-
<version>6.0.0-b1</version>
107+
<version>6.0.0-SNAPSHOT</version>
108108
<type>pom</type>
109109
<scope>import</scope>
110110
</dependency>
111111
<dependency>
112112
<groupId>com.helger</groupId>
113113
<artifactId>ph-oton-parent-pom</artifactId>
114-
<version>8.0.0-b1</version>
114+
<version>8.0.0-SNAPSHOT</version>
115115
<type>pom</type>
116116
<scope>import</scope>
117117
</dependency>
118118
<dependency>
119119
<groupId>com.helger</groupId>
120120
<artifactId>peppol-commons-parent-pom</artifactId>
121-
<version>6.0.0-b1</version>
121+
<version>6.0.0-SNAPSHOT</version>
122122
<type>pom</type>
123123
<scope>import</scope>
124124
</dependency>
@@ -139,6 +139,7 @@
139139
<artifactId>wss4j-ws-security-dom</artifactId>
140140
<version>${wss4j.version}</version>
141141
<exclusions>
142+
<!-- Conflicts with javax.mail -->
142143
<exclusion>
143144
<groupId>org.apache.geronimo.specs</groupId>
144145
<artifactId>geronimo-javamail_1.4_spec</artifactId>
@@ -201,4 +202,20 @@
201202
</plugins>
202203
</pluginManagement>
203204
</build>
205+
<dependencies>
206+
<dependency>
207+
<groupId>org.apache.wss4j</groupId>
208+
<artifactId>wss4j-ws-security-dom</artifactId>
209+
<exclusions>
210+
<exclusion>
211+
<groupId>javax.xml.stream</groupId>
212+
<artifactId>stax-api</artifactId>
213+
</exclusion>
214+
<exclusion>
215+
<groupId>org.apache.geronimo.javamail</groupId>
216+
<artifactId>geronimo-javamail_1.4_mail</artifactId>
217+
</exclusion>
218+
</exclusions>
219+
</dependency>
220+
</dependencies>
204221
</project>

0 commit comments

Comments
 (0)