Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IT test #25

Merged
merged 22 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ jobs:
env:
MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10
run: mvn --batch-mode --errors --update-snapshots verify --file pom.xml
- name: Test on Unix
if: runner.os != 'Windows'
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install jsvc
else
brew install coreutils jsvc
fi
unzip OpenICF-java-framework/openicf-zip/target/openicf-*.zip
openicf/bin/ConnectorServer.sh
openicf/bin/openicf.sh start
openicf/bin/openicf.sh stop
rm -rf openicf/logs
openicf/bin/ConnectorServer.sh /run &
timeout 2m bash -c 'until grep -q "ConnectorServer listening on" openicf/logs/ConnectorServer.log ; do sleep 5; done'
! grep " ERROR " openicf/logs/ConnectorServer.log
- name: Test on Windows
if: runner.os == 'Windows'
run: |
unzip OpenICF-java-framework/openicf-zip/target/openicf-*.zip
openicf\bin\ConnectorServer.bat
openicf\bin\ConnectorServer.bat /install openicf
net start openicf
net stop openicf
openicf\bin\ConnectorServer.bat /uninstall openicf
Remove-Item -Path openicf\logs -Force -Recurse
cmd /c "START /b openicf\bin\ConnectorServer.bat /run"
Start-Sleep -s 15
findstr "ConnectorServer listening on" openicf\logs\ConnectorServer.log
findstr " ERROR " openicf\logs\ConnectorServer.log | find /c '"ERROR"' | findstr "0"
- name: Upload failure artifacts
uses: actions/upload-artifact@v4
if: ${{ failure() }}
Expand Down
126 changes: 0 additions & 126 deletions OpenICF-java-framework/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ public static List<ConnectorInfo> createConnectorInfo(
// it might be from a bundle
// fragment ( a bundle only included by other bundles ).
// However, we should definitely warn
LOG.info(LOG.isOk() ?
LOG.error(LOG.isOk() ?
e : null,
"Unable to load class {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.",
className, bundleInfo.getOriginalLocation());
"Unable to load class {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors. {2}",
className, bundleInfo.getOriginalLocation(),e);
}
if (connectorClass != null && options == null) {
for (Annotation annotation: connectorClass.getAnnotations()) {
Expand Down Expand Up @@ -298,15 +298,15 @@ public static List<ConnectorInfo> createConnectorInfo(
LOG.info("Add ConnectorInfo {0} to Local Connector Info Manager from {1}",
info.getConnectorKey(), bundleInfo.getOriginalLocation());
} catch (final NoClassDefFoundError e) {
LOG.info(LOG.isOk() ?
LOG.error(LOG.isOk() ?
e : null,
"Unable to load configuration class of connector {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.",
connectorClass, bundleInfo.getOriginalLocation());
"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}",
connectorClass, bundleInfo.getOriginalLocation(),e);
} catch (final TypeNotPresentException e) {
LOG.info(LOG.isOk() ?
LOG.error(LOG.isOk() ?
e : null,
"Unable to load configuration class of connector {0} from bundle {1}. Class will be ignored and will not be listed in list of connectors.",
connectorClass, bundleInfo.getOriginalLocation());
"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}",
connectorClass, bundleInfo.getOriginalLocation(),e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public void testSimpleRequest() throws Exception {

Assert.assertEquals(request.getPromise()
.getOrThrowUninterruptibly(5, TimeUnit.SECONDS), "OK");
Thread.sleep(3000); // Wait to complete all other threads
Assert.assertTrue(client.getRemoteRequests().isEmpty());
Assert.assertTrue(server.getLocalRequests().isEmpty());
} finally {
Expand Down
69 changes: 69 additions & 0 deletions OpenICF-java-framework/openicf-zip/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,75 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>commons-daemon</groupId>
<artifactId>commons-daemon</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>com.github.cverges</groupId>
<artifactId>expect4j</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.commons</groupId>
<artifactId>json-resource</artifactId>
</dependency>
<dependency>
<groupId>org.openidentityplatform.commons.http-framework</groupId>
<artifactId>client-apache-async</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>7.0.53</version>
</dependency>
<dependency>
<groupId>net.sf.supercsv</groupId>
<artifactId>super-csv</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7.1</version>
</dependency>
<!-- connectors -->
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>csvfile-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>databasetable-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>groovy-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>kerberos-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>ldap-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>ssh-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openidentityplatform.openicf.connectors</groupId>
<artifactId>xml-connector</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<properties>
<!-- If we release this project, we need to include the Forgerock binary license -->
Expand Down
31 changes: 21 additions & 10 deletions OpenICF-java-framework/openicf-zip/src/assembly/zip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,46 @@
<directory>${project.build.directory}/maven-shared-archive-resources</directory>
<outputDirectory>/openicf/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/licenseResource</directory>
<outputDirectory>/openicf/</outputDirectory>
</fileSet>
<!-- Include the Forgerock binary license file if exists -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/openicf/legal-notices/</outputDirectory>
<directory>${basedir}/../../</directory>
<outputDirectory>/openicf/</outputDirectory>
<includes>
<include>license.txt</include>
<include>LICENSE.md</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>/openicf/lib/framework</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
<outputFileNameMapping>${artifact.groupId}.${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>org.openidentityplatform.openicf.framework:*</include>
<include>org.glassfish.grizzly:*</include>
<include>javax.servlet:javax.servlet-api</include>
<include>org.openidentityplatform.commons:*</include>
<include>org.openidentityplatform.commons.http-framework:*</include>
<include>com.google.protobuf:*</include>
<include>org.bouncycastle:*</include>
<include>org.slf4j:*</include>
<include>ch.qos.logback:*</include>
<include>org.codehaus.groovy:groovy-all</include>
<include>com.google.guava:*</include>
<include>commons-daemon:*</include>
<include>com.github.cverges:expect4j</include>
<include>org.apache.httpcomponents:*</include>
<include>org.apache.tomcat:*</include>
<include>net.sf.supercsv:*</include>
<include>org.codehaus.groovy.modules.http-builder:*</include>
<include>org.openidentityplatform.openicf.connectors:ssh-connector:jar</include>
<include>org.openidentityplatform.openicf.connectors:groovy-connector:jar</include>
</includes>
</dependencySet>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>/openicf/bundles</outputDirectory>
<outputFileNameMapping>${artifact.groupId}.${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>org.openidentityplatform.openicf.connectors:*-connector:jar</include>
</includes>
</dependencySet>
</dependencySets>
Expand Down
Loading