Skip to content

Commit a053b97

Browse files
authored
Add IT test (#25)
1 parent 0da140e commit a053b97

File tree

20 files changed

+644
-829
lines changed

20 files changed

+644
-829
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,36 @@ jobs:
3333
env:
3434
MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10
3535
run: mvn --batch-mode --errors --update-snapshots verify --file pom.xml
36+
- name: Test on Unix
37+
if: runner.os != 'Windows'
38+
run: |
39+
if [ "$RUNNER_OS" == "Linux" ]; then
40+
sudo apt-get install jsvc
41+
else
42+
brew install coreutils jsvc
43+
fi
44+
unzip OpenICF-java-framework/openicf-zip/target/openicf-*.zip
45+
openicf/bin/ConnectorServer.sh
46+
openicf/bin/openicf.sh start
47+
openicf/bin/openicf.sh stop
48+
rm -rf openicf/logs
49+
openicf/bin/ConnectorServer.sh /run &
50+
timeout 2m bash -c 'until grep -q "ConnectorServer listening on" openicf/logs/ConnectorServer.log ; do sleep 5; done'
51+
! grep " ERROR " openicf/logs/ConnectorServer.log
52+
- name: Test on Windows
53+
if: runner.os == 'Windows'
54+
run: |
55+
unzip OpenICF-java-framework/openicf-zip/target/openicf-*.zip
56+
openicf\bin\ConnectorServer.bat
57+
openicf\bin\ConnectorServer.bat /install openicf
58+
net start openicf
59+
net stop openicf
60+
openicf\bin\ConnectorServer.bat /uninstall openicf
61+
Remove-Item -Path openicf\logs -Force -Recurse
62+
cmd /c "START /b openicf\bin\ConnectorServer.bat /run"
63+
Start-Sleep -s 15
64+
findstr "ConnectorServer listening on" openicf\logs\ConnectorServer.log
65+
findstr " ERROR " openicf\logs\ConnectorServer.log | find /c '"ERROR"' | findstr "0"
3666
- name: Upload failure artifacts
3767
uses: actions/upload-artifact@v4
3868
if: ${{ failure() }}

OpenICF-java-framework/.gitignore

Lines changed: 0 additions & 126 deletions
This file was deleted.

OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/framework/impl/api/local/LocalConnectorInfoManagerImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ public static List<ConnectorInfo> createConnectorInfo(
258258
// it might be from a bundle
259259
// fragment ( a bundle only included by other bundles ).
260260
// However, we should definitely warn
261-
LOG.info(LOG.isOk() ?
261+
LOG.error(LOG.isOk() ?
262262
e : null,
263-
"Unable to load class {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.",
264-
className, bundleInfo.getOriginalLocation());
263+
"Unable to load class {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors. {2}",
264+
className, bundleInfo.getOriginalLocation(),e);
265265
}
266266
if (connectorClass != null && options == null) {
267267
for (Annotation annotation: connectorClass.getAnnotations()) {
@@ -298,15 +298,15 @@ public static List<ConnectorInfo> createConnectorInfo(
298298
LOG.info("Add ConnectorInfo {0} to Local Connector Info Manager from {1}",
299299
info.getConnectorKey(), bundleInfo.getOriginalLocation());
300300
} catch (final NoClassDefFoundError e) {
301-
LOG.info(LOG.isOk() ?
301+
LOG.error(LOG.isOk() ?
302302
e : null,
303-
"Unable to load configuration class of connector {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.",
304-
connectorClass, bundleInfo.getOriginalLocation());
303+
"Unable to load configuration class of connector {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.{2}",
304+
connectorClass, bundleInfo.getOriginalLocation(),e);
305305
} catch (final TypeNotPresentException e) {
306-
LOG.info(LOG.isOk() ?
306+
LOG.error(LOG.isOk() ?
307307
e : null,
308-
"Unable to load configuration class of connector {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.",
309-
connectorClass, bundleInfo.getOriginalLocation());
308+
"Unable to load configuration class of connector {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors. {2}",
309+
connectorClass, bundleInfo.getOriginalLocation(),e);
310310
}
311311
}
312312
}

OpenICF-java-framework/connector-framework-rpc/src/test/java/org/forgerock/openicf/common/rpc/RequestDistributorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public void testSimpleRequest() throws Exception {
147147

148148
Assert.assertEquals(request.getPromise()
149149
.getOrThrowUninterruptibly(5, TimeUnit.SECONDS), "OK");
150+
Thread.sleep(3000); // Wait to complete all other threads
150151
Assert.assertTrue(client.getRemoteRequests().isEmpty());
151152
Assert.assertTrue(server.getLocalRequests().isEmpty());
152153
} finally {

OpenICF-java-framework/openicf-zip/pom.xml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,75 @@
6363
<groupId>com.google.guava</groupId>
6464
<artifactId>guava</artifactId>
6565
</dependency>
66+
<dependency>
67+
<groupId>commons-daemon</groupId>
68+
<artifactId>commons-daemon</artifactId>
69+
<version>1.3.4</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>com.github.cverges</groupId>
73+
<artifactId>expect4j</artifactId>
74+
<version>1.9</version>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.openidentityplatform.commons</groupId>
78+
<artifactId>json-resource</artifactId>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.openidentityplatform.commons.http-framework</groupId>
82+
<artifactId>client-apache-async</artifactId>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.apache.tomcat</groupId>
86+
<artifactId>tomcat-jdbc</artifactId>
87+
<version>7.0.53</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>net.sf.supercsv</groupId>
91+
<artifactId>super-csv</artifactId>
92+
<version>2.3.1</version>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
96+
<artifactId>http-builder</artifactId>
97+
<version>0.7.1</version>
98+
</dependency>
99+
<!-- connectors -->
100+
<dependency>
101+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
102+
<artifactId>csvfile-connector</artifactId>
103+
<version>${project.version}</version>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
107+
<artifactId>databasetable-connector</artifactId>
108+
<version>${project.version}</version>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
112+
<artifactId>groovy-connector</artifactId>
113+
<version>${project.version}</version>
114+
</dependency>
115+
<dependency>
116+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
117+
<artifactId>kerberos-connector</artifactId>
118+
<version>${project.version}</version>
119+
</dependency>
120+
<dependency>
121+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
122+
<artifactId>ldap-connector</artifactId>
123+
<version>${project.version}</version>
124+
</dependency>
125+
<dependency>
126+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
127+
<artifactId>ssh-connector</artifactId>
128+
<version>${project.version}</version>
129+
</dependency>
130+
<dependency>
131+
<groupId>org.openidentityplatform.openicf.connectors</groupId>
132+
<artifactId>xml-connector</artifactId>
133+
<version>${project.version}</version>
134+
</dependency>
66135
</dependencies>
67136
<properties>
68137
<!-- If we release this project, we need to include the Forgerock binary license -->

OpenICF-java-framework/openicf-zip/src/assembly/zip.xml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,35 +62,46 @@
6262
<directory>${project.build.directory}/maven-shared-archive-resources</directory>
6363
<outputDirectory>/openicf/</outputDirectory>
6464
</fileSet>
65-
<fileSet>
66-
<directory>${project.build.directory}/licenseResource</directory>
67-
<outputDirectory>/openicf/</outputDirectory>
68-
</fileSet>
69-
<!-- Include the Forgerock binary license file if exists -->
7065
<fileSet>
71-
<directory>${project.build.directory}</directory>
72-
<outputDirectory>/openicf/legal-notices/</outputDirectory>
66+
<directory>${basedir}/../../</directory>
67+
<outputDirectory>/openicf/</outputDirectory>
7368
<includes>
74-
<include>license.txt</include>
69+
<include>LICENSE.md</include>
7570
</includes>
7671
</fileSet>
7772
</fileSets>
7873
<dependencySets>
7974
<dependencySet>
8075
<useProjectArtifact>false</useProjectArtifact>
8176
<outputDirectory>/openicf/lib/framework</outputDirectory>
82-
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
77+
<outputFileNameMapping>${artifact.groupId}.${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
8378
<includes>
8479
<include>org.openidentityplatform.openicf.framework:*</include>
8580
<include>org.glassfish.grizzly:*</include>
86-
<include>javax.servlet:javax.servlet-api</include>
8781
<include>org.openidentityplatform.commons:*</include>
82+
<include>org.openidentityplatform.commons.http-framework:*</include>
8883
<include>com.google.protobuf:*</include>
8984
<include>org.bouncycastle:*</include>
9085
<include>org.slf4j:*</include>
9186
<include>ch.qos.logback:*</include>
9287
<include>org.codehaus.groovy:groovy-all</include>
9388
<include>com.google.guava:*</include>
89+
<include>commons-daemon:*</include>
90+
<include>com.github.cverges:expect4j</include>
91+
<include>org.apache.httpcomponents:*</include>
92+
<include>org.apache.tomcat:*</include>
93+
<include>net.sf.supercsv:*</include>
94+
<include>org.codehaus.groovy.modules.http-builder:*</include>
95+
<include>org.openidentityplatform.openicf.connectors:ssh-connector:jar</include>
96+
<include>org.openidentityplatform.openicf.connectors:groovy-connector:jar</include>
97+
</includes>
98+
</dependencySet>
99+
<dependencySet>
100+
<useProjectArtifact>false</useProjectArtifact>
101+
<outputDirectory>/openicf/bundles</outputDirectory>
102+
<outputFileNameMapping>${artifact.groupId}.${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
103+
<includes>
104+
<include>org.openidentityplatform.openicf.connectors:*-connector:jar</include>
94105
</includes>
95106
</dependencySet>
96107
</dependencySets>

0 commit comments

Comments
 (0)