From 7b24f6afae8c9aab430373d87d8cec1fa7dd2430 Mon Sep 17 00:00:00 2001
From: vharseko <vharseko@3a-systems.ru>
Date: Sat, 23 Sep 2023 04:33:40 +0000
Subject: [PATCH] ADD IT test for wars #110 (#306)

---
 opendj-rest2ldap-servlet/pom.xml                                                            |   47 +++++++++++++++++++++++
 opendj-dsml-servlet/pom.xml                                                                 |   47 +++++++++++++++++++++++
 opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LdapHttpApplication.java |    2 
 3 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/opendj-dsml-servlet/pom.xml b/opendj-dsml-servlet/pom.xml
index d8d2766..98ad247 100644
--- a/opendj-dsml-servlet/pom.xml
+++ b/opendj-dsml-servlet/pom.xml
@@ -310,6 +310,53 @@
                     </webResources>
                 </configuration>
             </plugin>
+            <plugin>
+		      <groupId>org.codehaus.cargo</groupId>
+	          <artifactId>cargo-maven3-plugin</artifactId>
+	          <version>1.10.9</version>
+	          <extensions>true</extensions>
+			  <executions>
+				    <execution>
+				      <id>start</id>
+				      <phase>pre-integration-test</phase>
+				      <goals>
+				        <goal>start</goal>
+				      </goals>
+				    </execution>
+				    <execution>
+				      <id>stop</id>
+				      <phase>post-integration-test</phase>
+				      <goals>
+				        <goal>stop</goal>
+				      </goals>
+				    </execution>
+				</executions>
+	            <configuration>
+	                <container>
+	                    <containerId>tomcat9x</containerId>
+	                    <type>embedded</type>
+	                    <systemProperties>
+	                        <file.encoding>UTF-8</file.encoding>
+	                    </systemProperties>
+	                    <timeout>350000</timeout>
+	                </container>
+	                <deployables>
+	                    <deployable>
+	                    	<type>war</type>
+	                        <properties>
+	                            <context>dsml</context>
+	                        </properties>
+<!--	                        <pingURL>http://localhost:8080/dsml/</pingURL> only POST-->
+	                    </deployable>
+	                </deployables>
+					<configuration>
+				    	<properties>
+				        	<cargo.rmi.port>8206</cargo.rmi.port>
+				        	<cargo.jvmargs>-XX:+UseG1GC -server</cargo.jvmargs>
+				        </properties>
+				    </configuration>
+	            </configuration>
+	        </plugin>
         </plugins>
     </build>
 
diff --git a/opendj-rest2ldap-servlet/pom.xml b/opendj-rest2ldap-servlet/pom.xml
index 5644811..3bc01bc 100644
--- a/opendj-rest2ldap-servlet/pom.xml
+++ b/opendj-rest2ldap-servlet/pom.xml
@@ -98,6 +98,53 @@
           </webResources>
         </configuration>
       </plugin>
+      <plugin>
+	      <groupId>org.codehaus.cargo</groupId>
+          <artifactId>cargo-maven3-plugin</artifactId>
+          <version>1.10.9</version>
+          <extensions>true</extensions>
+		  <executions>
+			    <execution>
+			      <id>start</id>
+			      <phase>pre-integration-test</phase>
+			      <goals>
+			        <goal>start</goal>
+			      </goals>
+			    </execution>
+			    <execution>
+			      <id>stop</id>
+			      <phase>post-integration-test</phase>
+			      <goals>
+			        <goal>stop</goal>
+			      </goals>
+			    </execution>
+			</executions>
+            <configuration>
+                <container>
+                    <containerId>tomcat9x</containerId>
+                    <type>embedded</type>
+                    <systemProperties>
+                        <file.encoding>UTF-8</file.encoding>
+                    </systemProperties>
+                    <timeout>350000</timeout>
+                </container>
+                <deployables>
+                    <deployable>
+                    	<type>war</type>
+                        <properties>
+                            <context>rest2ldap</context>
+                        </properties>
+                        <pingURL>http://localhost:8080/rest2ldap/</pingURL>
+                    </deployable>
+                </deployables>
+				<configuration>
+			    	<properties>
+			        	<cargo.rmi.port>8206</cargo.rmi.port>
+			        	<cargo.jvmargs>-XX:+UseG1GC -server</cargo.jvmargs>
+			        </properties>
+			    </configuration>
+            </configuration>
+        </plugin>
     </plugins>
   </build>
 </project>
diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LdapHttpApplication.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LdapHttpApplication.java
index 5efd956..c70ec32 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LdapHttpApplication.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LdapHttpApplication.java
@@ -179,7 +179,7 @@
             final URL configUrl = getClass().getResource("/config.json");
             this.configDirectory = configUrl != null ? new File(configUrl.toURI()).getParentFile() : null;
         } catch (final URISyntaxException e) {
-            throw new IllegalStateException(e);
+            throw new IllegalStateException(""+getClass().getResource("/config.json"),e);
         }
         this.schema = Schema.getDefaultSchema();
     }

--
Gitblit v1.10.0