Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fixed tests

Christian Bauer7e571aa277b0
diff --git a/manager/Dockerfile b/manager/Dockerfile
index 197f80487..82ba5ca81 100644
--- a/manager/Dockerfile
+++ b/manager/Dockerfile
@@ -2,6 +2,7 @@ FROM centos:7
RUN yum update -y && yum -y install java-1.8.0-openjdk-devel && yum clean all
ENV JAVA_HOME /usr/lib/jvm/java
+ENV JAVA_OPTS -Xmx1024m
ENV MANAGER_DOCROOT webapp
ENV CONSOLE_DOCROOT /deployment/consoles
@@ -13,9 +14,11 @@ EXPOSE 8080
HEALTHCHECK --interval=3s --timeout=3s --start-period=2s --retries=30 CMD curl --fail http://localhost:8080 || exit 1
+RUN mkdir -p /deployment/extensions
+
WORKDIR /opt/app
ADD server /opt/app
ADD client /opt/app
-ENTRYPOINT ["java", "-cp", "/opt/app/lib/*", "org.openremote.manager.server.Main"]
+ENTRYPOINT java $JAVA_OPTS -cp /opt/app/lib/*:/deployment/extensions org.openremote.manager.server.Main
diff --git a/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy
index 521096640..b7106ec21 100644
--- a/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy
@@ -68,7 +68,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine
).token
}
def securityService = new ClientSecurityService(keycloakProvider.getKeycloakDeployment(realm, KEYCLOAK_CLIENT_ID), accessToken)
- def currentTenant = identityService.initIdentityProvider.getTenantForRealm(realm)
+ def currentTenant = identityService.getIdentityProvider().getTenantForRealm(realm)
and: "a client request service and target"
def constraintViolationReader = new ClientObjectMapper(container.JSON, ConstraintViolationReport.class) as EntityReader<ConstraintViolationReport>
@@ -238,7 +238,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine
1 * assetBrowser.refresh(asset.id, managerDemoSetup.smartOfficeId)
cleanup: "the client should be stopped"
- clientEventService.close()
+ if (clientEventService != null) clientEventService.close()
and: "the server should be stopped"
stopContainer(container)
@@ -267,7 +267,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine
).token
}
def securityService = new ClientSecurityService(keycloakProvider.getKeycloakDeployment(realm, KEYCLOAK_CLIENT_ID), accessToken)
- def currentTenant = identityService.initIdentityProvider.getTenantForRealm(realm)
+ def currentTenant = identityService.getIdentityProvider().getTenantForRealm(realm)
and: "a client request service and target"
def constraintViolationReader = new ClientObjectMapper(container.JSON, ConstraintViolationReport.class) as EntityReader<ConstraintViolationReport>
@@ -419,7 +419,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine
}
cleanup: "the client should be stopped"
- clientEventService.close()
+ if (clientEventService != null) clientEventService.close()
and: "the server should be stopped"
stopContainer(container)
@@ -446,7 +446,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine
).token
}
def securityService = new ClientSecurityService(keycloakProvider.getKeycloakDeployment(realm, KEYCLOAK_CLIENT_ID), accessToken)
- def currentTenant = identityService.initIdentityProvider.getTenantForRealm(realm)
+ def currentTenant = identityService.getIdentityProvider().getTenantForRealm(realm)
and: "a client request service and target"
def constraintViolationReader = new ClientObjectMapper(container.JSON, ConstraintViolationReport.class) as EntityReader<ConstraintViolationReport>
@@ -530,7 +530,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine
}
cleanup: "the client should be stopped"
- clientEventService.close()
+ if (clientEventService != null) clientEventService.close()
and: "the server should be stopped"
stopContainer(container)
diff --git a/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy
index 89d96976e..8a49d6f80 100644
--- a/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy
@@ -43,9 +43,9 @@ class AssetUserLinkingTest extends Specification implements ManagerContainerTrai
/* ############################################## READ ####################################### */
expect: "some users to be restricted"
- !identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser1Id)
- !identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser2Id)
- identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser3Id)
+ !identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser1Id)
+ !identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser2Id)
+ identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser3Id)
when: "all user assets are retrieved of a realm"
def userAssets = assetResource.getUserAssetLinks(null, keycloakDemoSetup.customerATenant.id, null, null)
@@ -147,7 +147,7 @@ class AssetUserLinkingTest extends Specification implements ManagerContainerTrai
userAssets = assetResource.getUserAssetLinks(null, keycloakDemoSetup.customerATenant.id, keycloakDemoSetup.testuser2Id, null)
then: "result should match"
- identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser2Id)
+ identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser2Id)
userAssets.length == 1
userAssets.any {
it.id.realmId == keycloakDemoSetup.customerATenant.id &&
@@ -164,7 +164,7 @@ class AssetUserLinkingTest extends Specification implements ManagerContainerTrai
userAssets = assetResource.getUserAssetLinks(null, keycloakDemoSetup.customerATenant.id, keycloakDemoSetup.testuser2Id, null)
then: "result should match"
- !identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser2Id)
+ !identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser2Id)
userAssets.length == 0
cleanup: "the server should be stopped"
diff --git a/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy b/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy
index fc007b7d7..da753fb33 100644
--- a/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy
@@ -441,7 +441,7 @@ class BasicProtocolTest extends Specification implements ManagerContainerTrait,
}
cleanup: "the client should be stopped"
- clientEventService.close()
+ if (clientEventService != null) clientEventService.close()
and: "the server should be stopped"
stopContainer(container)
diff --git a/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy b/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy
index 613299c0c..5e8d62a2b 100644
--- a/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy
@@ -210,7 +210,7 @@ class BasicRulesDeploymentTest extends Specification implements ManagerContainer
def apartment3Engine = rulesService.assetEngines.get(managerDemoSetup.apartment3Id)
def customerATenant = keycloakDemoSetup.customerATenant
customerATenant.setEnabled(false)
- identityService.initIdentityProvider.updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)
+ identityService.getIdentityProvider().updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)
then: "the tenants rule engine should stop and all asset rule engines in this realm should also stop"
conditions.eventually {
@@ -236,7 +236,7 @@ class BasicRulesDeploymentTest extends Specification implements ManagerContainer
when: "the disabled tenant is re-enabled"
customerATenant.setEnabled(true)
- identityService.initIdentityProvider.updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)
+ identityService.getIdentityProvider().updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)
then: "the tenants rule engine should start and all asset rule engines from this realm should also start"
conditions.eventually {