From 00bd6224fa36c7c99ef710517984545a6b26e65c Mon Sep 17 00:00:00 2001 From: Douglas Palmer Date: Thu, 2 May 2024 10:51:07 -0700 Subject: [PATCH] Remove remaining Fuse adapter bits Closes #28787 Signed-off-by: Douglas Palmer --- authz/client/pom.xml | 10 - pom.xml | 14 - .../integration-arquillian/HOW-TO-RUN.md | 115 ----- testsuite/integration-arquillian/README.md | 7 +- testsuite/integration-arquillian/pom.xml | 28 -- .../servers/app-server/karaf/assembly.xml | 47 -- .../servers/app-server/karaf/fuse63/pom.xml | 85 ---- .../Fuse63AppServerArquillianExtension.java | 36 -- .../container/Fuse63AppServerProvider.java | 92 ---- ...boss.arquillian.core.spi.LoadableExtension | 1 - ...llian.container.AppServerContainerProvider | 1 - .../resources/keycloak-direct-access.json | 9 - .../resources/keycloak-hawtio-client.json | 7 - .../src/main/resources/keycloak-hawtio.json | 9 - .../src/main/resources/users.properties | 1 - .../fuse63/src/saml-adapter-not-supported | 1 - .../servers/app-server/karaf/fuse7x/pom.xml | 85 ---- .../Fuse7xAppServerArquillianExtension.java | 36 -- .../container/Fuse7xAppServerProvider.java | 92 ---- ...boss.arquillian.core.spi.LoadableExtension | 1 - ...llian.container.AppServerContainerProvider | 1 - .../cxf-customerservice-keycloak.json | 10 - .../src/main/resources/keycloak-bearer.json | 9 - .../resources/keycloak-direct-access.json | 9 - .../resources/keycloak-hawtio-client.json | 7 - .../src/main/resources/keycloak-hawtio.json | 9 - .../resources/product-portal-keycloak.json | 10 - .../src/main/resources/users.properties | 1 - .../fuse7x/src/saml-adapter-not-supported | 1 - .../servers/app-server/karaf/pom.xml | 178 -------- .../servers/app-server/pom.xml | 1 - .../test-apps/fuse/README.md | 76 ---- .../fuse/camel-fuse7-undertow/pom.xml | 105 ----- .../keycloak/example/CamelHelloProcessor.java | 48 -- .../OSGI-INF/blueprint/blueprint.xml | 69 --- .../src/main/resources/WEB-INF/keycloak.json | 10 - .../test-apps/fuse/camel/pom.xml | 98 ----- .../keycloak/example/CamelHelloProcessor.java | 42 -- .../OSGI-INF/blueprint/blueprint.xml | 125 ------ .../test-apps/fuse/customer-app-fuse/pom.xml | 130 ------ .../org/keycloak/example/CamelClient.java | 115 ----- .../org/keycloak/example/CxfRsClient.java | 91 ---- .../src/main/webapp/WEB-INF/jetty-web.xml | 27 -- .../src/main/webapp/WEB-INF/keycloak.json | 9 - .../src/main/webapp/WEB-INF/web.xml | 51 --- .../src/main/webapp/customers/camel.jsp | 13 - .../src/main/webapp/customers/cxf-rs.jsp | 54 --- .../src/main/webapp/index.html | 32 -- .../fuse/cxf-jaxrs-fuse7-undertow/pom.xml | 95 ---- .../example/rs/CxfCustomerService.java | 46 -- .../resources/META-INF/cxf/bus-extensions.txt | 0 .../OSGI-INF/blueprint/blueprint.xml | 39 -- .../src/main/resources/WEB-INF/keycloak.json | 9 - .../test-apps/fuse/cxf-jaxrs/pom.xml | 92 ---- .../example/rs/CxfCustomerService.java | 46 -- .../resources/META-INF/cxf/bus-extensions.txt | 0 .../OSGI-INF/blueprint/blueprint.xml | 77 ---- .../src/main/resources/WEB-INF/jetty-web.xml | 27 -- .../src/main/resources/WEB-INF/keycloak.json | 9 - .../fuse/cxf-jaxws-fuse7-undertow/pom.xml | 102 ----- .../java/org/keycloak/example/ws/Product.java | 42 -- .../org/keycloak/example/ws/ProductImpl.java | 44 -- .../example/ws/UnknownProductFault.java | 52 --- .../keycloak/example/ws/types/GetProduct.java | 81 ---- .../example/ws/types/GetProductResponse.java | 109 ----- .../example/ws/types/ObjectFactory.java | 73 --- .../example/ws/types/UnknownProductFault.java | 81 ---- .../example/ws/types/package-info.java | 18 - .../OSGI-INF/blueprint/blueprint.xml | 47 -- .../src/main/resources/WEB-INF/keycloak.json | 7 - .../test-apps/fuse/cxf-jaxws/pom.xml | 108 ----- .../java/org/keycloak/example/ws/Product.java | 42 -- .../org/keycloak/example/ws/ProductImpl.java | 44 -- .../example/ws/UnknownProductFault.java | 52 --- .../keycloak/example/ws/types/GetProduct.java | 81 ---- .../example/ws/types/GetProductResponse.java | 109 ----- .../example/ws/types/ObjectFactory.java | 73 --- .../example/ws/types/UnknownProductFault.java | 81 ---- .../example/ws/types/package-info.java | 18 - .../main/resources/META-INF/spring/beans.xml | 85 ---- .../test-apps/fuse/demorealm.json | 321 -------------- .../external-config-keycloak.json | 9 - .../test-apps/fuse/external-config/pom.xml | 132 ------ .../keycloak/examples/ProtectedServlet.java | 58 --- .../src/main/webapp/WEB-INF/jetty-web.xml | 27 -- .../src/main/webapp/WEB-INF/web.xml | 55 --- .../src/main/webapp/index.html | 30 -- .../test-apps/fuse/features/pom.xml | 79 ---- .../features/src/main/resources/features.xml | 58 --- .../test-apps/fuse/fuse-admin/README.md | 51 --- .../fuse-admin/keycloak-direct-access.json | 9 - .../fuse-admin/keycloak-hawtio-client.json | 7 - .../fuse/fuse-admin/keycloak-hawtio.json | 9 - .../test-apps/fuse/pom.xml | 51 --- .../test-apps/fuse/product-app-fuse/pom.xml | 90 ---- .../example/ProductPortalServlet.java | 121 ----- .../OSGI-INF/blueprint/blueprint.xml | 62 --- .../src/main/resources/WEB-INF/jetty-web.xml | 27 -- .../src/main/resources/WEB-INF/keycloak.json | 9 - .../fuse/product-app-fuse7-undertow/pom.xml | 94 ---- .../example/ProductPortalServlet.java | 119 ----- .../OSGI-INF/blueprint/blueprint.xml | 66 --- .../src/main/resources/WEB-INF/keycloak.json | 9 - .../src/main/resources/keycloak.json | 9 - .../integration-arquillian/test-apps/pom.xml | 1 - .../test-apps/test-apps-dist/build.xml | 8 - .../integration-arquillian/tests/base/pom.xml | 157 ------- .../testsuite/adapter/page/Hawtio2Page.java | 45 -- .../testsuite/adapter/page/HawtioPage.java | 71 --- .../page/fuse/AbstractFuseExample.java | 63 --- .../adapter/page/fuse/AdminInterface.java | 31 -- .../adapter/page/fuse/CustomerListing.java | 53 --- .../page/fuse/CustomerPortalFuseExample.java | 51 --- .../page/fuse/ProductPortalFuseExample.java | 67 --- .../arquillian/AppServerTestEnricher.java | 9 - .../KeycloakArquillianExtension.java | 3 - .../adapter/example/fuse/FuseAdapterTest.java | 414 ------------------ .../adapters/karaf/common/xslt/arquillian.xsl | 59 --- .../tests/other/adapters/karaf/fuse61/pom.xml | 41 -- .../example/Fuse61ExampleAdapterTest.java | 12 - .../tests/other/adapters/karaf/fuse62/pom.xml | 41 -- .../example/Fuse62ExampleAdapterTest.java | 28 -- .../tests/other/adapters/karaf/karaf3/pom.xml | 41 -- .../example/Karaf3ExampleAdapterTest.java | 12 - .../tests/other/adapters/karaf/pom.xml | 70 --- .../tests/other/adapters/pom.xml | 4 +- .../integration-arquillian/tests/pom.xml | 7 - testsuite/integration-arquillian/util/pom.xml | 35 -- .../utils/arquillian/ContainerConstants.java | 2 - .../arquillian/fuse/CustomFuseContainer.java | 253 ----------- ...ycloakOSGiApplicationArchiveProcessor.java | 56 --- .../testsuite/utils/fuse/FuseUtils.java | 291 ------------ 132 files changed, 3 insertions(+), 7221 deletions(-) delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/assembly.xml delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/pom.xml delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse63AppServerArquillianExtension.java delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse63AppServerProvider.java delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-direct-access.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio-client.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/users.properties delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/saml-adapter-not-supported delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/pom.xml delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse7xAppServerArquillianExtension.java delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse7xAppServerProvider.java delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/cxf-customerservice-keycloak.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-bearer.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-direct-access.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio-client.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/product-portal-keycloak.json delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/users.properties delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/saml-adapter-not-supported delete mode 100644 testsuite/integration-arquillian/servers/app-server/karaf/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/README.md delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/java/org/keycloak/example/CamelHelloProcessor.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/camel/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/jetty-web.xml delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/web.xml delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/index.html delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/java/org/keycloak/example/rs/CxfCustomerService.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/META-INF/cxf/bus-extensions.txt delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/jetty-web.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/Product.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/ProductImpl.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/UnknownProductFault.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProduct.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/package-info.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/ProductImpl.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/UnknownProductFault.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProduct.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/package-info.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/demorealm.json delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/external-config/external-config-keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/external-config/pom.xml delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/java/org/keycloak/examples/ProtectedServlet.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/jetty-web.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/web.xml delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/index.html delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/features/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/features/src/main/resources/features.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/fuse-admin/README.md delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-direct-access.json delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio-client.json delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/pom.xml delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/jetty-web.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/keycloak.json delete mode 100755 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/pom.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/java/org/keycloak/example/ProductPortalServlet.java delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json delete mode 100644 testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/keycloak.json delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/Hawtio2Page.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/HawtioPage.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerListing.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerPortalFuseExample.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/ProductPortalFuseExample.java delete mode 100644 testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/common/xslt/arquillian.xsl delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/pom.xml delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/src/test/java/org/keycloak/testsuite/adapter/example/Fuse61ExampleAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/pom.xml delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/src/test/java/org/keycloak/testsuite/adapter/example/Fuse62ExampleAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/pom.xml delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/src/test/java/org/keycloak/testsuite/adapter/example/Karaf3ExampleAdapterTest.java delete mode 100644 testsuite/integration-arquillian/tests/other/adapters/karaf/pom.xml delete mode 100644 testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/CustomFuseContainer.java delete mode 100644 testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/KeycloakOSGiApplicationArchiveProcessor.java delete mode 100644 testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/fuse/FuseUtils.java diff --git a/authz/client/pom.xml b/authz/client/pom.xml index 953971db8f..342294ebed 100644 --- a/authz/client/pom.xml +++ b/authz/client/pom.xml @@ -23,16 +23,6 @@ org.keycloak.*;version="${project.version}", - org.apache.http.auth.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.client.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.conn.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.cookie.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.auth.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.client.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.conn.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.cookie.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.execchain.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.*;version=${apache.httpcomponents.httpcore.fuse.version}, *;resolution:=optional diff --git a/pom.xml b/pom.xml index 0fd1e90670..98ada6cdba 100644 --- a/pom.xml +++ b/pom.xml @@ -73,8 +73,6 @@ 1.2.13.Final true - 4.5.2 - 4.4.4 7.2.0.Final 7.5.22.Final-redhat-1 @@ -1270,18 +1268,6 @@ ${project.version} zip - - org.keycloak - keycloak-fuse-adapter-dist - ${project.version} - zip - - - org.keycloak - keycloak-fuse-adapter-dist - ${project.version} - tar.gz - org.keycloak keycloak-saml-wildfly-adapter-dist diff --git a/testsuite/integration-arquillian/HOW-TO-RUN.md b/testsuite/integration-arquillian/HOW-TO-RUN.md index 8662b45d7d..2fb96cd042 100644 --- a/testsuite/integration-arquillian/HOW-TO-RUN.md +++ b/testsuite/integration-arquillian/HOW-TO-RUN.md @@ -150,121 +150,6 @@ and add packages manually. -Papp-server-wildfly \ -Dtest=org.keycloak.testsuite.adapter.** -### JBoss Fuse 6.3 - -1) Download JBoss Fuse 6.3 to your filesystem. It can be downloaded from http://origin-repository.jboss.org/nexus/content/groups/m2-proxy/org/jboss/fuse/jboss-fuse-karaf -Assumed you downloaded `jboss-fuse-karaf-6.3.0.redhat-229.zip` - -2) Install to your local maven repository and change the properties according to your env (This step can be likely avoided if you somehow configure your local maven settings to point directly to Fuse repo): - - mvn install:install-file \ - -DgroupId=org.jboss.fuse \ - -DartifactId=jboss-fuse-karaf \ - -Dversion=6.3.0.redhat-229 \ - -Dpackaging=zip \ - -Dfile=/mydownloads/jboss-fuse-karaf-6.3.0.redhat-229.zip - - -3) Prepare Fuse and run the tests (change props according to your environment, versions etc): - - - # Prepare Fuse server - mvn -f testsuite/integration-arquillian/servers/pom.xml \ - clean install \ - -Papp-server-fuse63 \ - -Dfuse63.version=6.3.0.redhat-229 - - # Run the Fuse adapter tests - mvn -f testsuite/integration-arquillian/tests/base/pom.xml \ - clean install \ - -Pauth-server-wildfly \ - -Papp-server-fuse63 \ - -Dauth.server.ssl.required=false \ - -Dadditional.fuse.repos=,$REPO \ - -Dtest=*.fuse.* - - -### JBoss Fuse 7.X - -1) Download JBoss Fuse 7 to your filesystem. It can be downloaded from http://origin-repository.jboss.org/nexus/content/groups/m2-proxy/org/jboss/fuse/fuse-karaf (Fuse 7.3 or higher is required) -Assumed you downloaded `fuse-karaf-7.3.0.fuse-730065-redhat-00002.zip` - -2) Install to your local maven repository and change the properties according to your env (This step can be likely avoided if you somehow configure your local maven settings to point directly to Fuse repo): - - - mvn install:install-file \ - -DgroupId=org.jboss.fuse \ - -DartifactId=fuse-karaf \ - -Dversion=7.3.0.fuse-730065-redhat-00002 \ - -Dpackaging=zip \ - -Dfile=/mydownloads/fuse-karaf-7.3.0.fuse-730065-redhat-00002.zip - - -3) Prepare Fuse and run the tests (change props according to your environment, versions etc): - - - # Prepare Fuse server - mvn -f testsuite/integration-arquillian/servers/pom.xml \ - clean install \ - -Papp-server-fuse7x \ - -Dfuse7x.version=7.3.0.fuse-730065-redhat-00002 - - # Run the Fuse adapter tests - mvn -f testsuite/integration-arquillian/tests/base/pom.xml \ - clean test \ - -Papp-server-fuse7x \ - -Dauth.server.ssl.required=false \ - -Dadditional.fuse.repos=,$REPO \ - -Dtest=*.fuse.* - - -### EAP6 with Hawtio - -1) Download JBoss EAP 6.4.0.GA zip - -2) Install to your local maven repository and change the properties according to your env (This step can be likely avoided if you somehow configure your local maven settings to point directly to EAP repo): - - - mvn install:install-file \ - -DgroupId=org.jboss.as \ - -DartifactId=jboss-as-dist \ - -Dversion=7.5.21.Final-redhat-1 \ - -Dpackaging=zip \ - -Dfile=/mydownloads/jboss-eap-6.4.0.zip - - -3) Download Fuse EAP installer (for example from http://origin-repository.jboss.org/nexus/content/groups/m2-proxy/com/redhat/fuse/eap/fuse-eap-installer/6.3.0.redhat-220/ ) - -4) Install previously downloaded file manually - - - mvn install:install-file \ - -DgroupId=com.redhat.fuse.eap \ - -DartifactId=fuse-eap-installer \ - -Dversion=6.3.0.redhat-347 \ - -Dpackaging=jar \ - -Dfile=/fuse-eap-installer-6.3.0.redhat-347.jar - - -5) Prepare EAP6 with Hawtio and run the test - - - # Prepare EAP6 and deploy hawtio - mvn -f testsuite/integration-arquillian/servers \ - clean install \ - -Pauth-server-wildfly \ - -Papp-server-eap6 \ - -Dapp.server.jboss.version=7.5.21.Final-redhat-1 \ - -Dfuse63.version=6.3.0.redhat-347 - - # Run the test - mvn -f testsuite/integration-arquillian/tests/base/pom.xml \ - clean install \ - -Pauth-server-wildfly \ - -Papp-server-eap6 \ - -Dtest=EAP6Fuse6HawtioAdapterTest - - ## Migration test ### DB migration test diff --git a/testsuite/integration-arquillian/README.md b/testsuite/integration-arquillian/README.md index 409afa261a..2b35472403 100644 --- a/testsuite/integration-arquillian/README.md +++ b/testsuite/integration-arquillian/README.md @@ -160,8 +160,7 @@ integration-arquillian │ │ └──undertow (arq. extension) │ │ │ ├──app-server -│ │ ├──jboss (wildfly/eap/as) -│ │ └──karaf +│ │ └──jboss (wildfly/eap/as) │ │ │ └──wildfly-balancer │ @@ -172,9 +171,7 @@ integration-arquillian └──other (common settings for all test modules dependent on base) │ ├──adapters (common settings for all adapter test modules - will be moved into base) - │ ├──jboss - │ └──karaf - │ + │ └──jboss ├──console ├──console_no_users └──... diff --git a/testsuite/integration-arquillian/pom.xml b/testsuite/integration-arquillian/pom.xml index a90c09b96a..316acdf095 100644 --- a/testsuite/integration-arquillian/pom.xml +++ b/testsuite/integration-arquillian/pom.xml @@ -49,7 +49,6 @@ 3.0.0-alpha.3 3.0.1.Final 1.0.1.Final - 2.2.0.Final 1.2.0.Beta3 ${undertow-jakarta.version} 1.0.0.Final @@ -218,33 +217,6 @@ keycloak-rest-admin-ui-ext - - - org.jboss.arquillian.container - arquillian-container-karaf-managed - ${arquillian-container-karaf.version} - - - org.jboss.arquillian.container - arquillian-container-osgi - ${arquillian-container-karaf.version} - - - com.google.guava - guava - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - - - diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/assembly.xml b/testsuite/integration-arquillian/servers/app-server/karaf/assembly.xml deleted file mode 100644 index d908d35b66..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/assembly.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - ${app.server.karaf} - - - zip - - - false - - - - ${app.server.karaf.home} - app-server-${app.server.karaf} - - **/*.sh - %regex[.*config/org/ops4j/pax/web/context.*] - - - - ${app.server.karaf.home} - app-server-${app.server.karaf} - - **/*.sh - - 0755 - - - - diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/pom.xml b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/pom.xml deleted file mode 100644 index b57b22e505..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-karaf - 999.0.0-SNAPSHOT - - 4.0.0 - - integration-arquillian-servers-app-server-fuse63 - jar - App Server - Fuse 6.3 - - - fuse63 - org.jboss.fuse - jboss-fuse-karaf - ${fuse63.version} - jboss-fuse-${fuse63.version} - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-spi - ${project.version} - - - org.keycloak.testsuite - integration-arquillian-util - ${project.version} - - - org.jboss.arquillian.container - arquillian-container-osgi - - - com.google.guava - guava - - - - - - - - - maven-enforcer-plugin - - - - enforce - - - - - fuse63.version - - - - - - - - - - diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse63AppServerArquillianExtension.java b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse63AppServerArquillianExtension.java deleted file mode 100644 index 8656770781..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse63AppServerArquillianExtension.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.testsuite.arquillian.fuse; - -import org.jboss.arquillian.container.spi.client.container.DeployableContainer; -import org.jboss.arquillian.core.spi.LoadableExtension; -import org.keycloak.testsuite.utils.arquillian.fuse.CustomFuseContainer; - -/** - * - * @author Vlasta Ramik - */ -public class Fuse63AppServerArquillianExtension implements LoadableExtension { - - @Override - public void register(ExtensionBuilder builder) { - - builder.service(DeployableContainer.class, CustomFuseContainer.class); - - } - -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse63AppServerProvider.java b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse63AppServerProvider.java deleted file mode 100644 index afc0f20d59..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse63AppServerProvider.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.arquillian.fuse.container; - -import java.util.ArrayList; -import java.util.List; -import org.jboss.arquillian.core.spi.Validate; -import org.jboss.shrinkwrap.descriptor.spi.node.Node; -import org.keycloak.testsuite.arquillian.container.AppServerContainerProvider; -import org.keycloak.testsuite.utils.arquillian.fuse.CustomFuseContainer; - -/** - * @author Vlasta Ramik - */ -public class Fuse63AppServerProvider implements AppServerContainerProvider { - - private Node configuration; - private static final String containerName = "fuse63"; - - private final String appServerHome; - private final String appServerJavaHome; - private final String managementUser; - private final String managementPassword; - - public Fuse63AppServerProvider() { - appServerHome = System.getProperty("app.server.home"); - appServerJavaHome = System.getProperty("app.server.java.home"); - managementUser = System.getProperty("app.server.management.user"); - managementPassword = System.getProperty("app.server.management.password"); - - Validate.notNullOrEmpty(appServerHome, "app.server.home is not set."); - Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set."); - Validate.notNullOrEmpty(managementUser, "app.server.management.user is not set."); - Validate.notNullOrEmpty(managementPassword, "app.server.management.password is not set."); - } - - @Override - public String getName() { - return containerName; - } - - @Override - public List getContainers() { - List containers = new ArrayList<>(); - - containers.add(standaloneContainer()); - - return containers; - } - - private void createChild(String name, String text) { - configuration.createChild("property").attribute("name", name).text(text); - } - - private Node standaloneContainer() { - Node container = new Node("container"); - container.attribute("mode", "manual"); - container.attribute("qualifier", AppServerContainerProvider.APP_SERVER + "-" + containerName); - - configuration = container.createChild("configuration"); - createChild("enabled", "true"); - createChild("adapterImplClass", CustomFuseContainer.class.getName()); - createChild("autostartBundle", "false"); - createChild("karafHome", appServerHome); - createChild("javaHome", appServerJavaHome); - createChild("javaVmArguments", - System.getProperty("app.server.karaf.jvm.debug.args", "") + " " + - System.getProperty("adapter.test.props", " ") - ); - - createChild("jmxServiceURL", "service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf-root"); - createChild("jmxUsername", managementUser); - createChild("jmxPassword", managementPassword); - - return container; - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension deleted file mode 100644 index acdc5ffb6b..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.testsuite.arquillian.fuse.Fuse63AppServerArquillianExtension diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider deleted file mode 100644 index fc1bdd722b..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.testsuite.arquillian.fuse.container.Fuse63AppServerProvider diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-direct-access.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-direct-access.json deleted file mode 100644 index 2441134231..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-direct-access.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "ssh-jmx-admin-client", - "ssl-required" : "external", - "auth-server-url" : "http://localhost:8080/auth", - "credentials": { - "secret": "password" - } -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio-client.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio-client.json deleted file mode 100644 index 64d0d57885..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio-client.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "realm" : "demo", - "resource" : "hawtio-client", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "public-client" : true -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio.json deleted file mode 100644 index 36daac064a..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/keycloak-hawtio.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm" : "demo", - "resource" : "jaas", - "bearer-only" : true, - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "use-resource-role-mappings": false, - "principal-attribute": "preferred_username" -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/users.properties b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/users.properties deleted file mode 100644 index f2814f4a3c..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/main/resources/users.properties +++ /dev/null @@ -1 +0,0 @@ -admin=password,admin,manager,viewer,Monitor, Operator, Maintainer, Deployer, Auditor, Administrator, SuperUser \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/saml-adapter-not-supported b/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/saml-adapter-not-supported deleted file mode 100644 index 8b13789179..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse63/src/saml-adapter-not-supported +++ /dev/null @@ -1 +0,0 @@ - diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/pom.xml b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/pom.xml deleted file mode 100644 index 7b2e45786b..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-karaf - 999.0.0-SNAPSHOT - - 4.0.0 - - integration-arquillian-servers-app-server-fuse7x - jar - App Server - Fuse 7.x - - - fuse7x - org.jboss.fuse - fuse-karaf - ${fuse7x.version} - fuse-karaf-${fuse7x.version} - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-spi - ${project.version} - - - org.keycloak.testsuite - integration-arquillian-util - ${project.version} - - - org.jboss.arquillian.container - arquillian-container-osgi - - - com.google.guava - guava - - - - - - - - - maven-enforcer-plugin - - - - enforce - - - - - fuse7x.version - - - - - - - - - - diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse7xAppServerArquillianExtension.java b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse7xAppServerArquillianExtension.java deleted file mode 100644 index 7b2a6fa71a..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/Fuse7xAppServerArquillianExtension.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.testsuite.arquillian.fuse; - -import org.jboss.arquillian.container.spi.client.container.DeployableContainer; -import org.jboss.arquillian.core.spi.LoadableExtension; -import org.keycloak.testsuite.utils.arquillian.fuse.CustomFuseContainer; - -/** - * - * @author Vlasta Ramik - */ -public class Fuse7xAppServerArquillianExtension implements LoadableExtension { - - @Override - public void register(ExtensionBuilder builder) { - - builder.service(DeployableContainer.class, CustomFuseContainer.class); - - } - -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse7xAppServerProvider.java b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse7xAppServerProvider.java deleted file mode 100644 index d7652b11f1..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/java/org/keycloak/testsuite/arquillian/fuse/container/Fuse7xAppServerProvider.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.arquillian.fuse.container; - -import java.util.ArrayList; -import java.util.List; -import org.jboss.arquillian.core.spi.Validate; -import org.jboss.shrinkwrap.descriptor.spi.node.Node; -import org.keycloak.testsuite.arquillian.container.AppServerContainerProvider; -import org.keycloak.testsuite.utils.arquillian.fuse.CustomFuseContainer; - -/** - * @author Vlasta Ramik - */ -public class Fuse7xAppServerProvider implements AppServerContainerProvider { - - private Node configuration; - private static final String containerName = "fuse7x"; - - private final String appServerHome; - private final String appServerJavaHome; - private final String managementUser; - private final String managementPassword; - - public Fuse7xAppServerProvider() { - appServerHome = System.getProperty("app.server.home"); - appServerJavaHome = System.getProperty("app.server.java.home"); - managementUser = System.getProperty("app.server.management.user"); - managementPassword = System.getProperty("app.server.management.password"); - - Validate.notNullOrEmpty(appServerHome, "app.server.home is not set."); - Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set."); - Validate.notNullOrEmpty(managementUser, "app.server.management.user is not set."); - Validate.notNullOrEmpty(managementPassword, "app.server.management.password is not set."); - } - - @Override - public String getName() { - return containerName; - } - - @Override - public List getContainers() { - List containers = new ArrayList<>(); - - containers.add(standaloneContainer()); - - return containers; - } - - private void createChild(String name, String text) { - configuration.createChild("property").attribute("name", name).text(text); - } - - private Node standaloneContainer() { - Node container = new Node("container"); - container.attribute("mode", "manual"); - container.attribute("qualifier", AppServerContainerProvider.APP_SERVER + "-" + containerName); - - configuration = container.createChild("configuration"); - createChild("enabled", "true"); - createChild("adapterImplClass", CustomFuseContainer.class.getName()); - createChild("autostartBundle", "false"); - createChild("karafHome", appServerHome); - createChild("javaHome", appServerJavaHome); - createChild("javaVmArguments", - System.getProperty("app.server.karaf.jvm.debug.args", "") + " " + - System.getProperty("adapter.test.props", " ") - ); - - createChild("jmxServiceURL", "service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf-root"); - createChild("jmxUsername", managementUser); - createChild("jmxPassword", managementPassword); - - return container; - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension deleted file mode 100644 index 68b1252ddb..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.testsuite.arquillian.fuse.Fuse7xAppServerArquillianExtension diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider deleted file mode 100644 index 97783aed9b..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.testsuite.arquillian.fuse.container.Fuse7xAppServerProvider diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/cxf-customerservice-keycloak.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/cxf-customerservice-keycloak.json deleted file mode 100644 index d0e4ad4d32..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/cxf-customerservice-keycloak.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "realm": "demo", - "resource": "builtin-cxf-app", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "bearer-only": true, - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-bearer.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-bearer.json deleted file mode 100644 index b7f6b9ea90..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-bearer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm" : "demo", - "resource" : "jaas", - "bearer-only" : true, - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "use-resource-role-mappings": false, - "principal-attribute": "preferred_username" -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-direct-access.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-direct-access.json deleted file mode 100644 index bc741a9c81..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-direct-access.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm" : "demo", - "resource" : "ssh-jmx-admin-client", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio-client.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio-client.json deleted file mode 100644 index 97fb5c9747..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio-client.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "realm" : "demo", - "clientId" : "hawtio-client", - "url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "public-client" : true -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio.json deleted file mode 100644 index bc741a9c81..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/keycloak-hawtio.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm" : "demo", - "resource" : "ssh-jmx-admin-client", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/product-portal-keycloak.json b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/product-portal-keycloak.json deleted file mode 100644 index 0a28d8c5c4..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/product-portal-keycloak.json +++ /dev/null @@ -1,10 +0,0 @@ - -{ - "realm": "demo", - "resource": "product-portal", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/users.properties b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/users.properties deleted file mode 100644 index a71b022c9e..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/main/resources/users.properties +++ /dev/null @@ -1 +0,0 @@ -admin=password,admin,manager,viewer,ssh,systembundles diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/saml-adapter-not-supported b/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/saml-adapter-not-supported deleted file mode 100644 index 8b13789179..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/fuse7x/src/saml-adapter-not-supported +++ /dev/null @@ -1 +0,0 @@ - diff --git a/testsuite/integration-arquillian/servers/app-server/karaf/pom.xml b/testsuite/integration-arquillian/servers/app-server/karaf/pom.xml deleted file mode 100644 index c36e3c4091..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/karaf/pom.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server - 999.0.0-SNAPSHOT - - 4.0.0 - - integration-arquillian-servers-app-server-karaf - pom - App Server - Karaf - - - ${project.parent.basedir}/common - ${project.parent.basedir}/assembly.xml - ${containers.home}/${app.server.karaf.unpacked.folder.name} - - - - - - app-server-karaf-submodules - - - src - - - - - - - maven-enforcer-plugin - - - - enforce - - - - - app.server.karaf - app.server.karaf.groupId - app.server.karaf.artifactId - app.server.karaf.version - app.server.karaf.unpacked.folder.name - - - !windows - Automated Karaf/Fuse adapter configuration currently doesn't work on Windows. - - - - - - - - - maven-dependency-plugin - - - unpack-karaf - generate-resources - - unpack - - - - - ${app.server.karaf.groupId} - ${app.server.karaf.artifactId} - ${app.server.karaf.version} - zip - ${containers.home} - - - true - - - - - - maven-resources-plugin - - - copy-configs - process-resources - - copy-resources - - - ${app.server.karaf.home}/etc - true - - - src/main/resources - - users.properties - keycloak-bearer.json - cxf-customerservice-keycloak.json - keycloak-direct-access.json - keycloak-hawtio-client.json - keycloak-hawtio.json - product-portal-keycloak.json - - - - - - - - - maven-assembly-plugin - - - create-zip - package - - single - - - - ${assembly.xml} - - false - - - - - - - - - - app-server-fuse63 - - - app.server - fuse63 - - - - fuse63 - - - - app-server-fuse7x - - - app.server - fuse7x - - - - fuse7x - - - - - diff --git a/testsuite/integration-arquillian/servers/app-server/pom.xml b/testsuite/integration-arquillian/servers/app-server/pom.xml index 446e503c4a..30260222ef 100644 --- a/testsuite/integration-arquillian/servers/app-server/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/pom.xml @@ -44,7 +44,6 @@ build-app-servers jboss - karaf undertow diff --git a/testsuite/integration-arquillian/test-apps/fuse/README.md b/testsuite/integration-arquillian/test-apps/fuse/README.md deleted file mode 100644 index c8c810b977..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Keycloak Fuse demo -================== - -Currently Keycloak supports securing your web applications running inside [JBoss Fuse](http://www.jboss.org/products/fuse/overview/) or [Apache Karaf](http://karaf.apache.org/). It leverages: -- Jetty9 adapter for both JBoss Fuse 6.3 and Apache Karaf 4, that include [Jetty9](http://eclipse.org/jetty/) server under the covers and Jetty is used for running various kinds of web applications -- Jetty8 adapter for both JBoss Fuse 6.2 and Apache Karaf 3, that include [Jetty8](http://eclipse.org/jetty/) server under the covers and Jetty is used for running various kinds of web applications - -It's highly recommended to use the JBoss Fuse 6.3.0 Rollup 1 or newer for this tutorial. - -**WARNING:** Running your applications inside standalone Apache Karaf may work, however we are testing just with JBoss Fuse 6.3.0 Rollup 1 and not with standalone Karaf server. Also we -did not test with Fuse versions older than 6.3.0 Rollup 1. So if you really want adapter on standalone Karaf server or older Fuse, it's up to you to figure exact steps to have it working. - -The Fuse example is slightly modified version of Keycloak base demo applications. The main difference among base demo is that for Fuse demo -are applications running on separate Fuse server. Keycloak server is supposed to run separately on Wildfly. - -Fuse demo contains those basic applications: -* **customer-app-fuse** A WAR application that is deployed with [pax-war extender](https://ops4j1.jira.com/wiki/display/ops4j/Pax+Web+Extender+-+War) -* **product-app-fuse** A servlet application deployed with [pax-whiteboard extender](https://ops4j1.jira.com/wiki/display/ops4j/Pax+Web+Extender+-+Whiteboard) -* **camel** [Apache Camel](http://camel.apache.org/) endpoint running on separate Jetty engine on [http://localhost:8383/admin-camel-endpoint](http://localhost:8383/admin-camel-endpoint). -The customer-app-fuse invokes the endpoint to get data. -* **cxf-jaxrs** [Apache CXF](http://cxf.apache.org/) JAX-RS endpoint running on default Jetty on [http://localhost:8181/cxf/customerservice](http://localhost:8181/cxf/customerservice). -The customer-app-fuse invokes the endpoint to get data -* **cxf-jaxws** [Apache CXF](http://cxf.apache.org/) JAX-WS endpoint running on separate Jetty engine on [http://localhost:8282/PersonServiceCF](http://localhost:8282/PersonServiceCF). -The product-app-fuse invokes the endpoint to get data. -* **external-config** A WAR application with external adapter configuration not bundled within the application, but instead in `$FUSE_HOME/etc` directory. - -Running of demo consists of 2 steps. First you need to run separate Keycloak server and then Fuse server with the applications - -Base steps ----------- - -* Run external instance of Keycloak server on WildFly . It's easiest to run and download Keycloak standalone server. Fuse demo suppose that server is running on [http://localhost:8080/auth](http://localhost:8080/auth) -* Import realm `demo` from the file `demorealm.json` on `examples/fuse/demorealm.json` . See [here](../demo-template/README.md#step-3-import-the-test-realm) -the details on how to import the realm -* Then download Keycloak examples and build Fuse example, which is needed so the feature repository is added to your local maven repo: - -``` -unzip -q keycloak-examples-.zip -cd keycloak-examples-/fuse -mvn clean install -``` - - -Running demo on JBoss Fuse 6.3.0 Rollup 1 ------------------------------- -You just need to download and run JBoss Fuse and then run those commands from the karaf terminal to install the needed features and Keycloak fuse demo (Replace Keycloak versions with the current Keycloak version number): - -``` -KEYCLOAK_VERSION="2.2.1.Final" -features:addurl mvn:org.keycloak/keycloak-osgi-features/$KEYCLOAK_VERSION/xml/features -features:addurl mvn:org.keycloak.testsuite/fuse-example-keycloak-features/$KEYCLOAK_VERSION/xml/features -features:install keycloak-fuse-6.3-example -``` - -After that you can test running on [http://localhost:8181/customer-portal](http://localhost:8181/customer-portal) and login as "bburke@redhat.com" with password "password". Customer-portal is able to -receive the response from the endpoints provided by `cxf-jaxrs` and `camel` applications. Note that camel endpoint is available just for users with role `admin` -in this demo, so "bburke@redhat.com" can't access it. You may login as "admin" with password "password" in order to invoke camel endpoint. - -From [http://localhost:8181/product-portal](http://localhost:8181/product-portal) you will see servlet endpoint, which invokes JAX-WS provided by `cxf-jaxws` application. - -Note that this demo also secures whole default CXF endpoint on [http://localhost:8181/cxf](http://localhost:8181/cxf) hence every application running under it is secured too. - -To have the `external-config` example running, you can copy the file `examples/fuse/external-config/external-config-keycloak.json` to the `$FUSE_HOME/etc` directory. -Then go to [http://localhost:8181/external-config/index.html](http://localhost:8181/external-config/index.html) to test the secured application. - -How to secure your own application ----------------------------------- -See [Docs](https://keycloak.gitbooks.io/securing-client-applications-guide/content/v/latest/topics/oidc/java/fuse-adapter.html) for more details. - - -How to secure Fuse admin services ---------------------------------- -It's possible to secure fuse admin services with Keycloak too. See [fuse-admin](fuse-admin/README.md) for info on how to secure -Fuse admin console, remote SSH and JMX access with Keycloak. - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/pom.xml deleted file mode 100755 index debf59b9f1..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-camel-endpoint-fuse7-undertow - bundle - Camel endpoint example - Secured in Karaf/Fuse 7.0 on Undertow - - - - - - - - javax.servlet;version="[3.1,5)", - javax.servlet.http;version="[3.1,5)", - javax.net.ssl, - io.undertow.*;version="[1.4,3)", - org.apache.camel;version="[2.13,3)", - org.keycloak.*;version="${fuse.adapter.version}", - org.osgi.service.blueprint, - org.osgi.service.blueprint.container - - - org.keycloak.example.* - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.keycloak - keycloak-core - - - org.apache.camel - camel-core - ${camel.version} - - - org.apache.camel - camel-blueprint - ${camel.version} - - - org.apache.camel - camel-undertow - ${camel.version} - - - io.undertow - undertow-core - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/java/org/keycloak/example/CamelHelloProcessor.java b/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/java/org/keycloak/example/CamelHelloProcessor.java deleted file mode 100644 index ab637fdbb3..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/java/org/keycloak/example/CamelHelloProcessor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.keycloak.KeycloakPrincipal; -import org.keycloak.representations.AccessToken; -import javax.servlet.http.HttpServletRequest; - -/** - * @author Marek Posolda - */ -public class CamelHelloProcessor implements Processor { - - @Override - public void process(Exchange exchange) throws Exception { - // Fuse 7 - KeycloakPrincipal keycloakPrincipal = (KeycloakPrincipal) exchange.getProperty(KeycloakPrincipal.class.getName(), KeycloakPrincipal.class); - - if (keycloakPrincipal == null) { - // Fuse 6.3 - HttpServletRequest req = exchange.getIn().getBody(HttpServletRequest.class); - keycloakPrincipal = (KeycloakPrincipal) req.getUserPrincipal(); - } - - AccessToken accessToken = keycloakPrincipal.getKeycloakSecurityContext().getToken(); - String username = accessToken.getPreferredUsername(); - String fullName = accessToken.getName(); - - exchange.getOut().setBody("Hello " + username + "! Your full name is " + fullName + "."); - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 83c9131d21..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Hello rest service - - Just a hello - - - - - - - - - - - (__This second sentence is returned from a Camel RestDSL endpoint__) - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json deleted file mode 100644 index a9b9993d63..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "realm": "demo", - "resource": "admin-camel-endpoint", - "bearer-only": "true", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/camel/pom.xml deleted file mode 100755 index c55d5b01db..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - org.keycloak.testsuite - fuse-example-camel-endpoint - bundle - Camel endpoint example - Secured in Karaf/Fuse - - - - - - - - javax.servlet;version="[3.1,5)", - javax.servlet.http;version="[3.1,5)", - org.apache.camel;version="[2.13,3)", - org.eclipse.jetty.security;version="[8,10)", - org.eclipse.jetty.server.nio;version="[8,10)", - org.eclipse.jetty.util.security;version="[8,10)", - org.keycloak.*;version="${fuse.adapter.version}", - org.osgi.service.blueprint, - org.osgi.service.blueprint.container, - org.osgi.service.event, - - - org.keycloak.example.* - - - - - - org.keycloak - keycloak-core - - - org.apache.camel - camel-core - ${camel.version} - - - org.apache.camel - camel-blueprint - ${camel.version} - - org.apache.camel - camel-jetty9 - ${camel.version} - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java b/testsuite/integration-arquillian/test-apps/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java deleted file mode 100644 index ba0d852fbc..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.keycloak.KeycloakPrincipal; -import org.keycloak.representations.AccessToken; - -import javax.servlet.http.HttpServletRequest; - -/** - * @author Marek Posolda - */ -public class CamelHelloProcessor implements Processor { - - @Override - public void process(Exchange exchange) throws Exception { - HttpServletRequest req = exchange.getIn().getBody(HttpServletRequest.class); - KeycloakPrincipal keycloakPrincipal = (KeycloakPrincipal) req.getUserPrincipal(); - AccessToken accessToken = keycloakPrincipal.getKeycloakSecurityContext().getToken(); - String username = accessToken.getPreferredUsername(); - String fullName = accessToken.getName(); - - exchange.getOut().setBody("Hello " + username + "! Your full name is " + fullName + "."); - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 506adaa428..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - admin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Hello rest service - - Just an helllo - - - - - - - - - - - (__This second sentence is returned from a Camel RestDSL endpoint__) - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/pom.xml deleted file mode 100755 index 04c9ea33cd..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/pom.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - org.keycloak.testsuite - fuse-example-customer-portal - war - Customer Portal - Secured in Karaf/Fuse - - - - - - - org.apache.http.auth.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.client.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.conn.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.cookie.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.auth.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.client.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.conn.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.cookie.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.execchain.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.*;version=${apache.httpcomponents.httpcore.fuse.version}, - javax.servlet.*;version="[3.1,5)", - org.keycloak.adapters.authentication;version="${fuse.adapter.version}";resolution:=optional, - org.keycloak.adapters.jetty;version="${fuse.adapter.version}";resolution:=optional, - org.keycloak.adapters;version="${fuse.adapter.version}", - org.keycloak.constants;version="${fuse.adapter.version}", - org.keycloak.util;version="${fuse.adapter.version}", - org.keycloak.*;version="${fuse.adapter.version}", - *;resolution:=optional - - - org.keycloak.example.* - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.keycloak - keycloak-core - provided - - - org.keycloak - keycloak-adapter-core - provided - - - org.apache.httpcomponents - httpclient - provided - - - - - customer-portal-fuse - - - org.apache.maven.plugins - maven-war-plugin - - - ${basedir}/target/classes/META-INF/MANIFEST.MF - - - - - - org.apache.felix - maven-bundle-plugin - true - - - bundle-manifest - process-classes - - manifest - - - - - - war - - - /customer-portal - /customer-portal - WEB-INF/lib - .,WEB-INF/classes - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java deleted file mode 100644 index ae2eea708f..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.adapters.HttpClientBuilder; - -/** - * @author Marek Posolda - */ -public class CamelClient { - - public static String sendRequest(HttpServletRequest req) throws CxfRsClient.Failure { - KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); - - HttpClient client = new HttpClientBuilder() - .disableTrustManager().build(); - - StringBuilder sb = new StringBuilder(); - try { - // Initially let's invoke a simple Camel-Jetty exposed endpoint - HttpGet get = new HttpGet("http://localhost:8383/admin-camel-endpoint"); - get.addHeader("Authorization", "Bearer " + session.getTokenString()); - try { - HttpResponse response = client.execute(get); - if (response.getStatusLine().getStatusCode() != 200) { - return "There was a failure processing request. You either didn't configure Keycloak properly or you don't have admin permission? Status code is " - + response.getStatusLine().getStatusCode(); - } - HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - sb.append(getStringFromInputStream(is)); - } finally { - is.close(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - // Here we invoke a Jetty endpoint, published using Camel RestDSL - get = new HttpGet("http://localhost:8484/restdsl/hello/world"); - get.addHeader("Authorization", "Bearer " + session.getTokenString()); - try { - HttpResponse response = client.execute(get); - if (response.getStatusLine().getStatusCode() != 200) { - return "There was a failure processing request with the RestDSL endpoint. You either didn't configure Keycloak properly or you don't have admin permission? Status code is " - + response.getStatusLine().getStatusCode(); - } - HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - sb.append(getStringFromInputStream(is)); - } finally { - is.close(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } finally { - client.getConnectionManager().shutdown(); - } - - return sb.toString(); - } - - private static String getStringFromInputStream(InputStream is) { - BufferedReader br = null; - StringBuilder sb = new StringBuilder(); - String line; - try { - br = new BufferedReader(new InputStreamReader(is)); - while ((line = br.readLine()) != null) { - sb.append(line); - } - } catch (IOException e) { - throw new RuntimeException(e); - } finally { - if (br != null) { - try { - br.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - return sb.toString(); - - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java deleted file mode 100644 index 8c54a82cca..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.adapters.HttpClientBuilder; -import org.keycloak.common.util.UriUtils; -import org.keycloak.representations.IDToken; -import org.keycloak.util.JsonSerialization; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class CxfRsClient { - - static class TypedList extends ArrayList { - } - - public static class Failure extends Exception { - private int status; - - public Failure(int status) { - this.status = status; - } - - public int getStatus() { - return status; - } - } - - public static IDToken getIDToken(HttpServletRequest req) { - KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); - return session.getIdToken(); - - } - - public static List getCustomers(HttpServletRequest req) throws Failure { - KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); - - HttpClient client = new HttpClientBuilder() - .disableTrustManager().build(); - try { - HttpGet get = new HttpGet(UriUtils.getOrigin(req.getRequestURL().toString()) + "/cxf/customerservice/customers"); - get.addHeader("Authorization", "Bearer " + session.getTokenString()); - try { - HttpResponse response = client.execute(get); - if (response.getStatusLine().getStatusCode() != 200) { - throw new Failure(response.getStatusLine().getStatusCode()); - } - HttpEntity entity = response.getEntity(); - InputStream is = entity.getContent(); - try { - return JsonSerialization.readValue(is, TypedList.class); - } finally { - is.close(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } finally { - client.getConnectionManager().shutdown(); - } - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/jetty-web.xml b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/jetty-web.xml deleted file mode 100644 index 6b42d3f00c..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100755 index c7f61f68e3..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "customer-portal", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/web.xml b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index c41ce2bd94..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - customer-portal - - - index.html - - - - - Customers - /customers/* - - - user - - - - - KEYCLOAK - does-not-matter - - - - admin - - - user - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp deleted file mode 100755 index 938b6e69be..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp +++ /dev/null @@ -1,13 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1" %> -<%@ page import="org.keycloak.example.CamelClient" %> - - - Camel page - - -

You will receive info from camel endpoint. Endpoint is accessible just for user with admin role

-

Response from camel: <%= CamelClient.sendRequest(request) %>

-

- - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp deleted file mode 100755 index 5c4768963f..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp +++ /dev/null @@ -1,54 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1" %> -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> -<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> -<%@ page import="org.keycloak.example.CxfRsClient" %> -<%@ page import="org.keycloak.representations.IDToken" %> -<%@ page import="org.keycloak.common.util.UriUtils"%> -<%@ page import="org.keycloak.KeycloakSecurityContext"%> -<%@ page session="false" %> - - - Customer View Page - - -<% - String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth").path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH) - .build("demo").toString(); - String acctUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth").path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH) - .queryParam("referrer", "customer-portal").build("demo").toString(); - IDToken idToken = CxfRsClient.getIDToken(request); - KeycloakSecurityContext kSession = (KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName()); -%> -

Goto: products | logout | manage acct

-Servlet User Principal <%=request.getUserPrincipal().getName()%> - made this request. -

Caller IDToken values (You can specify what is returned in IDToken in the customer-portal claims page in the admin console:

-

Username: <%=idToken.getPreferredUsername()%>

-

Email: <%=idToken.getEmail()%>

-

Full Name: <%=idToken.getName()%>

-

First: <%=idToken.getGivenName()%>

-

Last: <%=idToken.getFamilyName()%>

-

Customer Listing

-

curl -H "Authorization: Bearer <%=kSession.getTokenString()%>" <%=UriUtils.getOrigin(request.getRequestURL().toString()) + "/cxf/customerservice/customers"%>

-<% - java.util.List list = null; - try { - list = CxfRsClient.getCustomers(request); - } catch (CxfRsClient.Failure failure) { - out.println("There was a failure processing request. You either didn't configure Keycloak properly, or maybe" + - "you just forgot to secure the cxf ws service?"); - out.println("Status from cxf ws service invocation was: " + failure.getStatus()); - return; - } - for (String cust : list) { - out.print("

"); - out.print(cust); - out.println("

"); - - } -%> -

- - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/index.html b/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/index.html deleted file mode 100755 index fc8b469bc9..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/customer-app-fuse/src/main/webapp/index.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Customer portal on Karaf/Fuse - - -

Customer Portal

- -

Customer Listing - CXF RS endpoint

- -

Admin Interface - Apache Camel endpoint

- - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/pom.xml deleted file mode 100755 index 6d2c671651..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-cxf-jaxrs-fuse7-undertow - bundle - CXF JAXRS Example - Secured in Karaf/Fuse 7 on Undertow - - - - - - javax.ws.rs;version="[2,3)", - META-INF.cxf;version="[2.7,3.4)", - META-INF.cxf.osgi;version="[2.7,3.4)";resolution:=optional, - org.apache.cxf.transport.http;version="[2.7,3.4)", - org.apache.cxf.*;version="[2.7,3.4)", - com.fasterxml.jackson.jaxrs.json;version="[2.8,3)", - org.keycloak.*;version="${fuse.adapter.version}", - *;resolution:=optional - - - org.keycloak.example.rs.* - - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf.jaxrs.version} - - - org.apache.cxf - cxf-rt-transports-http - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http-undertow - ${cxf.undertow.version} - - - javax.ws.rs - javax.ws.rs-api - 2.1 - compile - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/java/org/keycloak/example/rs/CxfCustomerService.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/java/org/keycloak/example/rs/CxfCustomerService.java deleted file mode 100644 index 184391fe0d..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/java/org/keycloak/example/rs/CxfCustomerService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.rs; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -@Path("/customers") -public class CxfCustomerService { - - @GET - @Produces("application/json") - public List getCustomers() { - ArrayList rtn = new ArrayList(); - rtn.add("Bill Burke"); - rtn.add("Stian Thorgersen"); - rtn.add("Stan Silvert"); - rtn.add("Gabriel Cardoso"); - rtn.add("Viliam Rockai"); - rtn.add("Marek Posolda"); - rtn.add("Boleslaw Dawidowicz"); - return rtn; - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index ba2c111771..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json deleted file mode 100644 index a8c4b752e1..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "builtin-cxf-app", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/pom.xml deleted file mode 100755 index 2ab0bcf48b..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-cxf-jaxrs - bundle - CXF JAXRS Example - Secured in Karaf/Fuse - - - - - - javax.ws.rs;version="[2,3)", - META-INF.cxf;version="[2.7,3.4)", - META-INF.cxf.osgi;version="[2.7,3.4)";resolution:=optional, - org.apache.cxf.transport.http;version="[2.7,3.4)", - org.apache.cxf.*;version="[2.7,3.4)", - com.fasterxml.jackson.jaxrs.json;version="[2.8,3)", - org.eclipse.jetty.security;version="[8,10)", - org.eclipse.jetty.util.security;version="[8,10)", - org.keycloak.*;version="${fuse.adapter.version}", - org.keycloak.adapters.jetty;version="${fuse.adapter.version}", - *;resolution:=optional - - - org.keycloak.example.rs.* - - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf.jaxrs.version} - - - org.apache.cxf - cxf-rt-transports-http - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http-jetty - ${cxf.jetty.version} - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java deleted file mode 100644 index f737bc4246..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.rs; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -@Path("/customers") -public class CxfCustomerService { - - @GET - @Produces("application/json") - public List getCustomers() { - ArrayList rtn = new ArrayList(); - rtn.add("Bill Burke"); - rtn.add("Stian Thorgersen"); - rtn.add("Stan Silvert"); - rtn.add("Gabriel Cardoso"); - rtn.add("Viliam Rockai"); - rtn.add("Marek Posolda"); - rtn.add("Boleslaw Dawidowicz"); - return rtn; - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/META-INF/cxf/bus-extensions.txt b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/META-INF/cxf/bus-extensions.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 74b5fabf41..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - user - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/jetty-web.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/jetty-web.xml deleted file mode 100644 index 6b42d3f00c..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/keycloak.json deleted file mode 100644 index a8c4b752e1..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxrs/src/main/resources/WEB-INF/keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "builtin-cxf-app", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/pom.xml deleted file mode 100755 index 714b0d3f38..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/pom.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-cxf-jaxws-fuse7-undertow - bundle - CXF JAXWS Example - Secured in Karaf/Fuse 7 on Undertow - - - - - - javax.jws;resolution:=optional, - javax.wsdl, - javax.xml.bind;version="[2.2,3)", - javax.xml.bind.annotation;version="[2.2,3)", - javax.xml.namespace, - javax.xml.ws, - META-INF.cxf;version="[2.7,3.4)", - META-INF.cxf.osgi;version="[2.7,3.4)";resolution:=optional, - org.apache.cxf.transport.http_undertow;version="[2.7,3.4)";resolution:=optional, - org.apache.cxf.transport.http_undertow.blueprint;version="[2.7,3.4)";resolution:=optional, - org.keycloak.*;version="${fuse.adapter.version}", - *;resolution:=optional - - - org.keycloak.example.ws.* - - - - - - org.apache.geronimo.specs - geronimo-ws-metadata_2.0_spec - 1.1.2 - - - org.apache.geronimo.specs - geronimo-jaxws_2.2_spec - 1.0 - - - javax.xml.bind - jaxb-api - 2.2 - - - org.apache.cxf - cxf-rt-frontend-jaxws - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http - ${cxf.version} - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/Product.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/Product.java deleted file mode 100644 index 90023bae34..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/Product.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws; - -import org.keycloak.example.ws.types.ObjectFactory; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - -@WebService -@XmlSeeAlso({ObjectFactory.class}) -public interface Product { - - @RequestWrapper(localName = "GetProduct", className = "GetProduct") - @ResponseWrapper(localName = "GetProductResponse", className = "GetProductResponse") - @WebMethod(operationName = "GetProduct") - public void getProduct( - @WebParam(mode = WebParam.Mode.INOUT, name = "productId") - javax.xml.ws.Holder productId, - @WebParam(mode = WebParam.Mode.OUT, name = "name") - javax.xml.ws.Holder name - ) throws UnknownProductFault; -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/ProductImpl.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/ProductImpl.java deleted file mode 100644 index 8041135478..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/ProductImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws; - -import javax.jws.WebService; -import javax.xml.ws.Holder; - -@WebService(serviceName = "ProductService", endpointInterface = "org.keycloak.example.ws.Product") -public class ProductImpl implements Product { - - public void getProduct(Holder productId, Holder name) - throws UnknownProductFault - { - if (productId.value == null || productId.value.length() == 0) { - org.keycloak.example.ws.types.UnknownProductFault fault = new org.keycloak.example.ws.types.UnknownProductFault(); - fault.setProductId(productId.value); - throw new UnknownProductFault(null,fault); - } else if (productId.value.trim().equals("1")) { - name.value = "IPad"; - } else if (productId.value.trim().equals("2")) { - name.value = "IPhone"; - } else { - org.keycloak.example.ws.types.UnknownProductFault fault = new org.keycloak.example.ws.types.UnknownProductFault(); - fault.setProductId(productId.value); - throw new UnknownProductFault(null,fault); - } - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/UnknownProductFault.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/UnknownProductFault.java deleted file mode 100644 index da7ceb1975..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/UnknownProductFault.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws; - -import javax.xml.ws.WebFault; - -@WebFault(name = "UnknownProductFault") -public class UnknownProductFault extends Exception { - - private org.keycloak.example.ws.types.UnknownProductFault unknownProductFault; - - public UnknownProductFault() { - super(); - } - - public UnknownProductFault(String message) { - super(message); - } - - public UnknownProductFault(String message, Throwable cause) { - super(message, cause); - } - - public UnknownProductFault(String message, org.keycloak.example.ws.types.UnknownProductFault unknownProductFault) { - super(message); - this.unknownProductFault = unknownProductFault; - } - - public UnknownProductFault(String message, org.keycloak.example.ws.types.UnknownProductFault unknownProductFault, Throwable cause) { - super(message, cause); - this.unknownProductFault = unknownProductFault; - } - - public org.keycloak.example.ws.types.UnknownProductFault getFaultInfo() { - return this.unknownProductFault; - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProduct.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProduct.java deleted file mode 100644 index 6e4b1c8143..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProduct.java +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="productId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "productId" -}) -@XmlRootElement(name = "GetProduct") -public class GetProduct { - - @XmlElement(required = true) - protected String productId; - - /** - * Gets the value of the productId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProductId() { - return productId; - } - - /** - * Sets the value of the productId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProductId(String value) { - this.productId = value; - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java deleted file mode 100644 index a1220c3a69..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java +++ /dev/null @@ -1,109 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="productId" type="{http://www.w3.org/2001/XMLSchema}string"/>*
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "productId", - "name" -}) -@XmlRootElement(name = "GetProductResponse") -public class GetProductResponse { - - @XmlElement(required = true) - protected String productId; - @XmlElement(required = true) - protected String name; - - /** - * Gets the value of the productId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProductId() { - return productId; - } - - /** - * Sets the value of the productId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProductId(String value) { - this.productId = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java deleted file mode 100644 index eef95634f6..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java +++ /dev/null @@ -1,73 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.apache.servicemix.samples.wsdl_first.types package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.servicemix.samples.wsdl_first.types - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link GetProductResponse } - * - */ - public GetProductResponse createGetProductResponse() { - return new GetProductResponse(); - } - - /** - * Create an instance of {@link GetProduct } - * - */ - public GetProduct createGetProduct() { - return new GetProduct(); - } - - /** - * Create an instance of {@link UnknownProductFault } - * - */ - public UnknownProductFault createUnknownProductFault() { - return new UnknownProductFault(); - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java deleted file mode 100644 index 862239d4b0..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="productId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "productId" -}) -@XmlRootElement(name = "UnknownProductFault") -public class UnknownProductFault { - - @XmlElement(required = true) - protected String productId; - - /** - * Gets the value of the productId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProductId() { - return productId; - } - - /** - * Sets the value of the productId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProductId(String value) { - this.productId = value; - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/package-info.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/package-info.java deleted file mode 100644 index 4fd528b5de..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/java/org/keycloak/example/ws/types/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 8acae94de5..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json deleted file mode 100644 index e4caeb2c88..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "realm": "demo", - "resource": "custom-cxf-endpoint", - "bearer-only": "true", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external" -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/pom.xml deleted file mode 100755 index 67547eb429..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/pom.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-cxf-jaxws - bundle - CXF JAXWS Example - Secured in Karaf/Fuse - - - - - - javax.jws;resolution:=optional, - javax.wsdl, - javax.xml.bind;version="[2.2,3)", - javax.xml.bind.annotation;version="[2.2,3)", - javax.xml.namespace, - javax.xml.ws, - META-INF.cxf;version="[2.7,3.4)", - META-INF.cxf.osgi;version="[2.7,3.4)";resolution:=optional, - org.apache.cxf.bus;version="[2.7,3.4)", - org.apache.cxf.bus.spring;version="[2.7,3.4)", - org.apache.cxf.bus.resource;version="[2.7,3.4)", - org.apache.cxf.transport.http;version="[2.7,3.4)", - org.apache.cxf.*;version="[2.7,3.4)", - org.springframework.beans.factory.config, - org.eclipse.jetty.security;version="[8,10)", - org.eclipse.jetty.util.security;version="[8,10)", - org.keycloak.*;version="${fuse.adapter.version}" - - - org.keycloak.example.ws.* - - - - - - org.apache.geronimo.specs - geronimo-ws-metadata_2.0_spec - 1.1.2 - - - org.apache.geronimo.specs - geronimo-jaxws_2.2_spec - 1.0 - - - javax.xml.bind - jaxb-api - 2.2 - - - org.apache.cxf - cxf-rt-frontend-jaxws - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http - ${cxf.version} - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java deleted file mode 100644 index 90023bae34..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws; - -import org.keycloak.example.ws.types.ObjectFactory; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - -@WebService -@XmlSeeAlso({ObjectFactory.class}) -public interface Product { - - @RequestWrapper(localName = "GetProduct", className = "GetProduct") - @ResponseWrapper(localName = "GetProductResponse", className = "GetProductResponse") - @WebMethod(operationName = "GetProduct") - public void getProduct( - @WebParam(mode = WebParam.Mode.INOUT, name = "productId") - javax.xml.ws.Holder productId, - @WebParam(mode = WebParam.Mode.OUT, name = "name") - javax.xml.ws.Holder name - ) throws UnknownProductFault; -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/ProductImpl.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/ProductImpl.java deleted file mode 100644 index 8041135478..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/ProductImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws; - -import javax.jws.WebService; -import javax.xml.ws.Holder; - -@WebService(serviceName = "ProductService", endpointInterface = "org.keycloak.example.ws.Product") -public class ProductImpl implements Product { - - public void getProduct(Holder productId, Holder name) - throws UnknownProductFault - { - if (productId.value == null || productId.value.length() == 0) { - org.keycloak.example.ws.types.UnknownProductFault fault = new org.keycloak.example.ws.types.UnknownProductFault(); - fault.setProductId(productId.value); - throw new UnknownProductFault(null,fault); - } else if (productId.value.trim().equals("1")) { - name.value = "IPad"; - } else if (productId.value.trim().equals("2")) { - name.value = "IPhone"; - } else { - org.keycloak.example.ws.types.UnknownProductFault fault = new org.keycloak.example.ws.types.UnknownProductFault(); - fault.setProductId(productId.value); - throw new UnknownProductFault(null,fault); - } - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/UnknownProductFault.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/UnknownProductFault.java deleted file mode 100644 index da7ceb1975..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/UnknownProductFault.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws; - -import javax.xml.ws.WebFault; - -@WebFault(name = "UnknownProductFault") -public class UnknownProductFault extends Exception { - - private org.keycloak.example.ws.types.UnknownProductFault unknownProductFault; - - public UnknownProductFault() { - super(); - } - - public UnknownProductFault(String message) { - super(message); - } - - public UnknownProductFault(String message, Throwable cause) { - super(message, cause); - } - - public UnknownProductFault(String message, org.keycloak.example.ws.types.UnknownProductFault unknownProductFault) { - super(message); - this.unknownProductFault = unknownProductFault; - } - - public UnknownProductFault(String message, org.keycloak.example.ws.types.UnknownProductFault unknownProductFault, Throwable cause) { - super(message, cause); - this.unknownProductFault = unknownProductFault; - } - - public org.keycloak.example.ws.types.UnknownProductFault getFaultInfo() { - return this.unknownProductFault; - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProduct.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProduct.java deleted file mode 100644 index 6e4b1c8143..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProduct.java +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="productId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "productId" -}) -@XmlRootElement(name = "GetProduct") -public class GetProduct { - - @XmlElement(required = true) - protected String productId; - - /** - * Gets the value of the productId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProductId() { - return productId; - } - - /** - * Sets the value of the productId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProductId(String value) { - this.productId = value; - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java deleted file mode 100644 index a1220c3a69..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/GetProductResponse.java +++ /dev/null @@ -1,109 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="productId" type="{http://www.w3.org/2001/XMLSchema}string"/>*
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "productId", - "name" -}) -@XmlRootElement(name = "GetProductResponse") -public class GetProductResponse { - - @XmlElement(required = true) - protected String productId; - @XmlElement(required = true) - protected String name; - - /** - * Gets the value of the productId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProductId() { - return productId; - } - - /** - * Sets the value of the productId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProductId(String value) { - this.productId = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java deleted file mode 100644 index eef95634f6..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/ObjectFactory.java +++ /dev/null @@ -1,73 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.apache.servicemix.samples.wsdl_first.types package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.servicemix.samples.wsdl_first.types - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link GetProductResponse } - * - */ - public GetProductResponse createGetProductResponse() { - return new GetProductResponse(); - } - - /** - * Create an instance of {@link GetProduct } - * - */ - public GetProduct createGetProduct() { - return new GetProduct(); - } - - /** - * Create an instance of {@link UnknownProductFault } - * - */ - public UnknownProductFault createUnknownProductFault() { - return new UnknownProductFault(); - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java deleted file mode 100644 index 862239d4b0..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/UnknownProductFault.java +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="productId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "productId" -}) -@XmlRootElement(name = "UnknownProductFault") -public class UnknownProductFault { - - @XmlElement(required = true) - protected String productId; - - /** - * Gets the value of the productId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProductId() { - return productId; - } - - /** - * Sets the value of the productId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProductId(String value) { - this.productId = value; - } - -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/package-info.java b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/package-info.java deleted file mode 100644 index 4fd528b5de..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/types/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example.ws.types; diff --git a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml b/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml deleted file mode 100644 index 4f9af70ab9..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - user - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/demorealm.json b/testsuite/integration-arquillian/test-apps/fuse/demorealm.json deleted file mode 100644 index d63cb39663..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/demorealm.json +++ /dev/null @@ -1,321 +0,0 @@ -{ - "realm": "demo", - "enabled": true, - "accessTokenLifespan": 60, - "accessCodeLifespan": 60, - "accessCodeLifespanUserAction": 300, - "ssoSessionIdleTimeout": 600, - "ssoSessionMaxLifespan": 36000, - "sslRequired": "external", - "registrationAllowed": false, - "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=", - "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "requiredCredentials": [ "password" ], - "users" : [ - { - "username" : "bburke@redhat.com", - "enabled": true, - "email" : "bburke@redhat.com", - "firstName": "Bill", - "lastName": "Burke", - "credentials" : [ - { "type" : "password", - "value" : "password" } - ], - "realmRoles": [ "user", "ssh" ], - "clientRoles": { - "account": [ "manage-account" ] - } - }, - { - "username" : "stian", - "enabled": true, - "email" : "stian@redhat.com", - "firstName": "Stian", - "lastName": "Thorgersen", - "credentials" : [ - { "type" : "password", - "value" : "password" } - ], - "realmRoles": [ "user", "ssh" ], - "clientRoles": { - "account": [ "manage-account" ] - } - }, - { - "username" : "mposolda@redhat.com", - "enabled": true, - "email" : "mposolda@redhat.com", - "firstName": "Marek", - "lastName": "Posolda", - "credentials" : [ - { "type" : "password", - "value" : "password" } - ], - "realmRoles": [ "user", "ssh" ], - "clientRoles": { - "account": [ "manage-account" ] - } - }, - { - "username" : "admin", - "enabled": true, - "email" : "admin@admin.com", - "firstName": "Admin", - "lastName": "Burke", - "credentials" : [ - { "type" : "password", - "value" : "password" } - ], - "realmRoles": [ "user","admin", "ssh" ], - "clientRoles": { - "realm-management": [ "realm-admin" ], - "account": [ "manage-account" ] - } - }, - { - "username" : "jmxadmin", - "enabled": true, - "email" : "jmxadmin@admin.com", - "firstName": "JmxAdmin", - "lastName": "Burke", - "credentials" : [ - { "type" : "password", - "value" : "password" } - ], - "realmRoles": [ "user", "jmxAdmin", "ssh" ], - "clientRoles": { - "account": [ "manage-account" ], - "realm-management": [ "realm-admin" ] - } - }, - { - "username" : "john", - "firstName" : "John", - "lastName" : "Anthony", - "email" : "john@hawt.io", - "enabled" : true, - "credentials" : [ - { - "type" : "password", - "value" : "password" - } - ], - "realmRoles" : [ "viewer", "ssh" ], - "applicationRoles": { - "account" : [ "view-profile", "manage-account" ] - } - }, - { - "username" : "mary", - "firstName" : "Mary", - "lastName" : "Kelly", - "email" : "mary@hawt.io", - "enabled" : true, - "credentials" : [ - { - "type" : "password", - "value" : "password" - } - ], - "realmRoles" : [ "ssh" ], - "applicationRoles": { - "account" : [ "view-profile", "manage-account" ] - } - }, - { - "username" : "root", - "firstName" : "Root", - "lastName" : "Root", - "email" : "root@hawt.io", - "enabled" : true, - "credentials" : [ - { - "type" : "password", - "value" : "password" - } - ], - "realmRoles" : [ "jmxAdmin", "ssh" ], - "applicationRoles": { - "account" : [ "view-profile", "manage-account" ], - "realm-management" : [ "realm-admin" ] - } - } - ], - "roles" : { - "realm" : [ - { - "name": "user", - "description": "User privileges" - }, - { - "name": "admin", - "description": "Administrator privileges" - }, - { - "name": "manager" - }, - { - "name": "viewer" - }, - { - "name": "Operator" - }, - { - "name": "Maintainer" - }, - { - "name": "Deployer" - }, - { - "name": "Auditor" - }, - { - "name": "Administrator" - }, - { - "name": "SuperUser" - }, - { - "name": "ssh" - }, - { - "name": "jmxAdmin", - "description": "Admin role with all privileges to SSH and JMX access", - "composite": true, - "composites": { - "realm": [ "admin", "manager", "viewer", "Operator", "Maintainer", "Deployer", "Auditor", "Administrator", "SuperUser", "ssh" ] - } - } - ] - }, - "clients": [ - { - "clientId": "customer-portal", - "enabled": true, - "adminUrl": "http://localhost:8181/customer-portal", - "baseUrl": "http://localhost:8181/customer-portal", - "redirectUris": [ - "http://localhost:8181/customer-portal/*" - ], - "secret": "password", - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "product-portal", - "enabled": true, - "adminUrl": "http://localhost:8181/product-portal", - "baseUrl": "http://localhost:8181/product-portal", - "redirectUris": [ - "http://localhost:8181/product-portal/*" - ], - "secret": "password", - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "builtin-cxf-app", - "enabled": true, - "adminUrl": "http://localhost:8181/cxf", - "baseUrl": "http://localhost:8181/cxf", - "redirectUris": [ - "http://localhost:8181/cxf/*" - ], - "secret": "password", - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "custom-cxf-endpoint", - "enabled": true, - "adminUrl": "http://localhost:8282/PersonServiceCF", - "baseUrl": "http://localhost:8282/PersonServiceCF", - "bearerOnly": true, - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "admin-camel-endpoint", - "enabled": true, - "adminUrl": "http://localhost:8383/admin-camel-endpoint", - "baseUrl": "http://localhost:8383/admin-camel-endpoint", - "bearerOnly": true, - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "admin-camel-restdsl", - "enabled": true, - "adminUrl": "http://localhost:8484/restdsl", - "baseUrl": "http://localhost:8484/restdsl", - "bearerOnly": true, - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "ssh-jmx-admin-client", - "enabled": true, - "publicClient": false, - "standardFlowEnabled": false, - "directAccessGrantsEnabled": true, - "secret": "password", - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId": "external-config", - "enabled": true, - "adminUrl": "http://localhost:8181/external-config", - "baseUrl": "http://localhost:8181/external-config", - "redirectUris": [ - "http://localhost:8181/external-config", - "http://localhost:8181/external-config/*" - ], - "secret": "password", - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - }, - { - "clientId" : "hawtio-client", - "surrogateAuthRequired" : false, - "fullScopeAllowed" : false, - "enabled" : true, - "redirectUris" : [ "http://localhost:8080/hawtio/*", "http://localhost:8181/hawtio/*", "http://localhost:8081/hawtio/*" ], - "webOrigins" : [ "http://localhost:8080", "http://localhost:8181", "http://localhost:8081" ], - "bearerOnly" : false, - "publicClient" : true, - "protocol" : "openid-connect", - "attributes": { - "exclude.issuer.from.auth.response": "true" - } - } - - ], - "scopeMappings": [ - { - "client": "ssh-jmx-admin-client", - "roles": [ "admin", "jmxAdmin" ] - }, - { - "client": "hawtio-client", - "roles": [ "viewer", "jmxAdmin" ] - } - ], - "clientScopeMappings": { - "account": [ - { - "client": "hawtio-client", - "roles": [ "view-profile", "manage-account" ] - } - ] - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/external-config/external-config-keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/external-config/external-config-keycloak.json deleted file mode 100644 index 469da82a17..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/external-config/external-config-keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "external-config", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/external-config/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/external-config/pom.xml deleted file mode 100755 index ff8421e357..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/external-config/pom.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - 4.0.0 - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - Keycloak Examples - External Config - fuse-example-external-config - war - org.keycloak.testsuite - - Keycloak External Config Example - - - - - - - org.apache.http.auth.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.client.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.conn.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.cookie.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.auth.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.client.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.conn.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.cookie.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.impl.execchain.*;version=${apache.httpcomponents.fuse.version}, - org.apache.http.*;version=${apache.httpcomponents.httpcore.fuse.version}, - javax.servlet.*;version="[3.1,5)", - org.keycloak.adapters.jetty;version="${fuse.adapter.version}";resolution:=optional, - org.keycloak.adapters;version="${fuse.adapter.version}", - org.keycloak.constants;version="${fuse.adapter.version}", - org.keycloak.adapters.osgi;version="${fuse.adapter.version}", - org.keycloak.util;version="${fuse.adapter.version}", - org.keycloak.*;version="${fuse.adapter.version}", - *;resolution:=optional - - - org.keycloak.example.* - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - - - org.keycloak - keycloak-adapter-core - provided - - - org.keycloak - keycloak-adapter-spi - provided - - - - - org.keycloak - keycloak-core - provided - - - - external-config - - - org.apache.maven.plugins - maven-war-plugin - - - ${basedir}/target/classes/META-INF/MANIFEST.MF - - - - - org.apache.felix - maven-bundle-plugin - true - - - bundle-manifest - process-classes - - manifest - - - - - - war - - - /external-config - /external-config - WEB-INF/lib - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/java/org/keycloak/examples/ProtectedServlet.java b/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/java/org/keycloak/examples/ProtectedServlet.java deleted file mode 100755 index ec30cccb3b..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/java/org/keycloak/examples/ProtectedServlet.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.keycloak.examples;/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.keycloak.KeycloakPrincipal; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; - - -@WebServlet(urlPatterns = "/servlet") -public class ProtectedServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String realm = req.getPathInfo().split("/")[1]; - if (realm.contains("?")) { - realm = realm.split("\\?")[0]; - } - - if (req.getPathInfo().contains("logout")) { - req.logout(); - resp.sendRedirect(req.getContextPath() + "/" + realm); - return; - } - - KeycloakPrincipal principal = (KeycloakPrincipal) req.getUserPrincipal(); - - resp.setContentType("text/html"); - PrintWriter writer = resp.getWriter(); - - writer.write("Realm: "); - writer.write(principal.getKeycloakSecurityContext().getRealm()); - - writer.write("
User: "); - writer.write(principal.getKeycloakSecurityContext().getIdToken().getPreferredUsername()); - - writer.write(String.format("
Logout", realm)); - } - } diff --git a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/jetty-web.xml b/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/jetty-web.xml deleted file mode 100644 index 6b42d3f00c..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/web.xml b/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 43c63b2266..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - External Config Example - - - keycloak.config.resolver - org.keycloak.adapters.osgi.PathBasedKeycloakConfigResolver - - - - index.html - - - - - - REST endpoints - /* - - - user - - - - - KEYCLOAK - specified-in-keycloak-json - - - - admin - - - user - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/index.html b/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/index.html deleted file mode 100755 index 600c959181..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/external-config/src/main/webapp/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - External Config Example Karaf/Fuse - - -

External configuration worked.

- -

Log out

- - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/features/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/features/pom.xml deleted file mode 100755 index f5efd8bad5..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/features/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - org.keycloak.testsuite - fuse-example-keycloak-features - Keycloak Fuse Example - Features - - - - - - src/main/resources - true - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - generate-resources - - resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - target/classes/features.xml - xml - features - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/features/src/main/resources/features.xml b/testsuite/integration-arquillian/test-apps/fuse/features/src/main/resources/features.xml deleted file mode 100644 index 83e4651e65..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/features/src/main/resources/features.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - -
The Keycloak / Fuse 7.0 on Undertow example
- pax-web-http-undertow - war - camel - camel-undertow - cxf - keycloak - keycloak-pax-http-undertow - - mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.12.1 - mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.12.1 - mvn:org.keycloak.testsuite/fuse-example-camel-endpoint-fuse7-undertow/${project.version} - mvn:org.keycloak.testsuite/fuse-example-cxf-jaxrs-fuse7-undertow/${project.version} - mvn:org.keycloak.testsuite/fuse-example-cxf-jaxws-fuse7-undertow/${project.version} - mvn:org.keycloak.testsuite/fuse-example-customer-portal/${project.version}/war - mvn:org.keycloak.testsuite/fuse-example-external-config/${project.version}/war - mvn:org.keycloak.testsuite/fuse-example-product-portal-fuse7-undertow/${project.version} -
- - -
The Keycloak / Fuse 6.3 example
- war - camel - camel-jetty9 - cxf - keycloak - mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.12.1 - mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.12.1 - mvn:org.keycloak.testsuite/fuse-example-product-portal/${project.version} - mvn:org.keycloak.testsuite/fuse-example-customer-portal/${project.version}/war - mvn:org.keycloak.testsuite/fuse-example-external-config/${project.version}/war - mvn:org.keycloak.testsuite/fuse-example-camel-endpoint/${project.version} - mvn:org.keycloak.testsuite/fuse-example-cxf-jaxws/${project.version} - mvn:org.keycloak.testsuite/fuse-example-cxf-jaxrs/${project.version} -
- -
diff --git a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/README.md b/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/README.md deleted file mode 100644 index c819724c7a..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/README.md +++ /dev/null @@ -1,51 +0,0 @@ -How to secure Fuse admin services -================================= - -Fuse admin console authentication on JBoss Fuse 6.3.0 Rollup 1 or newer ---------------------------------- -Fuse admin console is Hawt.io. Follow the instructions in [Docs](https://keycloak.gitbooks.io/securing-client-applications-guide/content/v/latest/topics/oidc/java/fuse/hawtio.html) for details on how to integrate it. - -Example steps: - -1) Import `demo` realm as mentioned in [Base steps](../README.md#base-steps) . It contains `hawtio-client` and some example users. - -2) Copy files [keycloak-hawtio.json](keycloak-hawtio.json) and [keycloak-hawtio-client.json](keycloak-hawtio-client.json) to the `$FUSE_HOME/etc/` directory. - -3) Edit properties in `$FUSE_HOME/etc/system.properties` as described in the documentation pointed above. - -3) Run Fuse and install `keycloak` feature in the terminal as described in the documentation pointed above. - -4) Test. After going to `http://localhost:8181/hawtio` you can login as any of these users. Password of all the sample users is `password` : -* root - He has role `admin` . He can access to everything in Hawtio -* john - He has role `viewer` . He can access to man functionalities in Hawtio. -* mary - She is not able to successfully authenticate to Hawtio - - -SSH authentication with keycloak credentials on JBoss Fuse 6.3.0 Rollup 1 or newer ------------------------------------------------------------------------ - -Follow the instructions in [Docs](https://keycloak.gitbooks.io/securing-client-applications-guide/content/v/latest/topics/oidc/java/fuse/fuse-admin.html) for details - -Example steps for enable SSH authentication: - -1) Import `demo` realm as mentioned in [Base steps](../README.md#base-steps) . It contains `ssh-jmx-admin-client` and some example users. - -2) Then you need to update/specify this property in file `$FUSE_HOME/etc/org.apache.karaf.shell.cfg` as mentioned in the docs pointed above. - -3) Copy file from Keycloak fuse examples [keycloak-direct-access.json](keycloak-direct-access.json) to `$FUSE_HOME/etc/` directory. - -4) Start Fuse and install `keycloak` JAAS realm into Fuse as mentioned in the docs pointed above. - -5) Try to login into SSH as different users with the command shown in the docs pointed above. Password of all the sample users is `password` : -* root - He can run any command in Fuse Karaf SSH terminal -* john - He can run just read-only commands (eg. `features:list` ) but not write command (eg. `features:addurl` ). -* mary - She is not able to successfully authenticate to SSH - - -JMX authentication with keycloak credentials on JBoss Fuse 6.3.0 Rollup 1 or newer ------------------------------------------------------------------------ - -See [Docs](https://keycloak.gitbooks.io/securing-client-applications-guide/content/v/latest/topics/oidc/java/fuse/fuse-admin.html) for details - -You can use file [keycloak-direct-access.json](keycloak-direct-access.json) to be copied into `$FUSE_HOME/etc/` as mentioned above in the SSH section. You can -also test with same users. diff --git a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-direct-access.json b/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-direct-access.json deleted file mode 100644 index 2441134231..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-direct-access.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "ssh-jmx-admin-client", - "ssl-required" : "external", - "auth-server-url" : "http://localhost:8080/auth", - "credentials": { - "secret": "password" - } -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio-client.json b/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio-client.json deleted file mode 100644 index c28051d85a..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio-client.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "realm" : "demo", - "resource" : "hawtio-client", - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "public-client" : true -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio.json b/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio.json deleted file mode 100644 index b7f6b9ea90..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/fuse-admin/keycloak-hawtio.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm" : "demo", - "resource" : "jaas", - "bearer-only" : true, - "auth-server-url" : "http://localhost:8080/auth", - "ssl-required" : "external", - "use-resource-role-mappings": false, - "principal-attribute": "preferred_username" -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/pom.xml deleted file mode 100755 index ec776203ad..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - integration-arquillian-test-apps - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - Fuse Test Applications - - 4.0.0 - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - pom - - 2.21.2 - 18.0.12 - - - customer-app-fuse - cxf-jaxrs - cxf-jaxrs-fuse7-undertow - cxf-jaxws - cxf-jaxws-fuse7-undertow - product-app-fuse - product-app-fuse7-undertow - camel - camel-fuse7-undertow - features - external-config - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/pom.xml deleted file mode 100755 index 8e85c189e5..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-product-portal - bundle - Product Portal - Secured in Karaf/Fuse - - - - - - javax.xml.namespace, - org.eclipse.jetty.security;version="[8.1,10)", - org.eclipse.jetty.util.security;version="[8.1,10)", - org.apache.cxf.service.model;version="[2.7,3.4)", - org.apache.cxf.*;version="[2.7,3.4)", - org.keycloak.adapters.jetty;version="${fuse.adapter.version}", - org.keycloak.*;version="${fuse.adapter.version}", - *;resolution:=optional - - - org.keycloak.example.* - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - - - org.keycloak - keycloak-core - - - - - org.keycloak.testsuite - fuse-example-cxf-jaxws - ${project.version} - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java deleted file mode 100644 index eda8c1f2a4..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example; - -import org.apache.cxf.endpoint.Client; -import org.apache.cxf.frontend.ClientProxy; -import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; -import org.apache.cxf.message.Message; -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.common.util.KeycloakUriBuilder; -import org.keycloak.constants.ServiceUrlConstants; -import org.keycloak.example.ws.Product; -import org.keycloak.example.ws.UnknownProductFault; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.ws.Holder; -import javax.xml.ws.WebServiceException; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Servlet for receiving informations about products from backend JAXWS service - * - * @author Marek Posolda - */ -public class ProductPortalServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/html"); - - // Send jaxws request - try (PrintWriter out = resp.getWriter()) { - out.println("Product Portal Page"); - - String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth") - .path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH) - .queryParam("redirect_uri", "http://localhost:8181/product-portal") - .build("demo") - .toString(); - - String acctUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth") - .path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH) - .queryParam("referrer", "product-portal") - .build("demo") - .toString(); - - out.println("

Goto: customers | logout | manage acct

"); - out.println("Servlet User Principal " + req.getUserPrincipal() + " made this request."); - - String unsecuredWsClientResponse = sendWsReq(req, "1", false); - String securedWsClientResponse = sendWsReq(req, "1", true); - String securedWsClient2Response = sendWsReq(req, "2", true); - - out.println("

Product with ID 1 - unsecured request (it should end with failure): " + unsecuredWsClientResponse + "


"); - out.println("

Product with ID 1 - secured request: " + securedWsClientResponse + "


"); - out.println("

Product with ID 2 - secured request: " + securedWsClient2Response + "


"); - out.println(""); - out.flush(); - } - } - - private String sendWsReq(HttpServletRequest req, String productId, boolean secured) { - JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); - factory.setServiceClass(Product.class); - factory.setAddress("http://localhost:8282/ProductServiceCF"); - - Product simpleClient = (Product) factory.create(); - Holder _getProduct_productId = new Holder<>(productId); - Holder _getProduct_name = new Holder<>(); - - // Attach Authorization header - if (secured) { - Client clientProxy = ClientProxy.getClient(simpleClient); - - KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); - if (session == null) throw new RuntimeException("Keycloak Security Context is null."); - - Map> headers = new HashMap<>(); - headers.put("Authorization", Collections.singletonList("Bearer " + session.getTokenString())); - - clientProxy.getRequestContext().put(Message.PROTOCOL_HEADERS, headers); - } - - try { - simpleClient.getProduct(_getProduct_productId, _getProduct_name); - return String.format("Product received: id=%s, name=%s", _getProduct_productId.value, _getProduct_name.value); - } catch (UnknownProductFault upf) { - return "UnknownProductFault has occurred. Details: " + upf.toString(); - } catch (WebServiceException wse) { - String error = "Can't receive product. Reason: " + wse.getMessage(); - if (wse.getCause() != null) { - Throwable cause = wse.getCause(); - error = error + " Details: " + cause.getClass().getName() + ": " + cause.getMessage(); - } - return error; - } - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 8de70c38ef..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - user - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/jetty-web.xml b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/jetty-web.xml deleted file mode 100644 index 6b42d3f00c..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/keycloak.json deleted file mode 100644 index e90433ac51..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse/src/main/resources/WEB-INF/keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "product-portal", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/pom.xml b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/pom.xml deleted file mode 100755 index d35dfd83c2..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - integration-arquillian-test-apps-fuse-parent - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - - 4.0.0 - fuse-example-product-portal-fuse7-undertow - bundle - Product Portal - Secured in Karaf/Fuse 7 on Undertow - - - - - - javax.wsdl, - javax.xml.bind;version="[2.2,3)", - javax.xml.bind.annotation;version="[2.2,3)", - javax.xml.namespace, - javax.xml.ws, - META-INF.cxf;version="[2.7,3.4)", - org.apache.cxf.transport.http;version="[2.7,3.4)", - org.apache.cxf.*;version="[2.7,3.4)", - org.keycloak.*;version="${fuse.adapter.version}", - org.keycloak.adapters.authentication;version="${fuse.adapter.version}";resolution:=optional, - javax.servlet.*;version="[3.1,5)", - *;resolution:=optional - - - org.keycloak.example.* - - - - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - - - org.keycloak - keycloak-core - - - - - org.keycloak.testsuite - fuse-example-cxf-jaxws-fuse7-undertow - ${project.version} - - - - - install - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.name} - ${project.groupId}.${project.artifactId} - ${keycloak.osgi.import} - ${keycloak.osgi.private} - ${keycloak.osgi.export} - - - - - - - - diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/java/org/keycloak/example/ProductPortalServlet.java b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/java/org/keycloak/example/ProductPortalServlet.java deleted file mode 100644 index b3084a2c53..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/java/org/keycloak/example/ProductPortalServlet.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.example; - -import org.apache.cxf.endpoint.Client; -import org.apache.cxf.frontend.ClientProxy; -import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; -import org.apache.cxf.message.Message; -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.common.util.KeycloakUriBuilder; -import org.keycloak.constants.ServiceUrlConstants; -import org.keycloak.example.ws.Product; -import org.keycloak.example.ws.UnknownProductFault; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.ws.WebServiceException; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Servlet for receiving informations about products from backend JAXWS service - * - * @author Marek Posolda - */ -public class ProductPortalServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/html"); - - // Send jaxws request - PrintWriter out = resp.getWriter(); - out.println("Product Portal Page"); - - String logoutUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth").path(ServiceUrlConstants.TOKEN_SERVICE_LOGOUT_PATH) - .build("demo").toString(); - String acctUri = KeycloakUriBuilder.fromUri("http://localhost:8080/auth").path(ServiceUrlConstants.ACCOUNT_SERVICE_PATH) - .queryParam("referrer", "product-portal").build("demo").toString(); - - out.println("

Goto: customers | logout | manage acct

"); - out.println("Servlet User Principal " + req.getUserPrincipal() + " made this request."); - - String unsecuredWsClientResponse = sendWsReq(req, "1", false); - String securedWsClientResponse = sendWsReq(req, "1", true); - String securedWsClient2Response = sendWsReq(req, "2", true); - - out.println("

Product with ID 1 - unsecured request (it should end with failure): " + unsecuredWsClientResponse + "


"); - out.println("

Product with ID 1 - secured request: " + securedWsClientResponse + "


"); - out.println("

Product with ID 2 - secured request: " + securedWsClient2Response + "


"); - out.println(""); - out.flush(); - out.close(); - } - - private String sendWsReq(HttpServletRequest req, String productId, boolean secured) { - Product simpleClient = null; -// try { - JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); - factory.setServiceClass(Product.class); - factory.setAddress("http://localhost:8282/ProductServiceCF"); - - simpleClient = (Product)factory.create(); -/* } catch (Exception ex) { - ex.printStackTrace(); - String error = "Cannot create WS client: " + ex; - return error; - }*/ - java.lang.String _getProduct_productIdVal = productId; - javax.xml.ws.Holder _getProduct_productId = new javax.xml.ws.Holder(_getProduct_productIdVal); - javax.xml.ws.Holder _getProduct_name = new javax.xml.ws.Holder(); - - // Attach Authorization header - if (secured) { - Client clientProxy = ClientProxy.getClient(simpleClient); - - KeycloakSecurityContext session = (KeycloakSecurityContext) req.getAttribute(KeycloakSecurityContext.class.getName()); - Map> headers = new HashMap>(); - headers.put("Authorization", Arrays.asList("Bearer " + session.getTokenString())); - - clientProxy.getRequestContext().put(Message.PROTOCOL_HEADERS, headers); - } - - try { - simpleClient.getProduct(_getProduct_productId, _getProduct_name); - return String.format("Product received: id=%s, name=%s", _getProduct_productId.value, _getProduct_name.value); - } catch (UnknownProductFault upf) { - return "UnknownProductFault has occurred. Details: " + upf.toString(); - } catch (WebServiceException wse) { - String error = "Can't receive product. Reason: " + wse.getMessage(); - if (wse.getCause() != null) { - Throwable cause = wse.getCause(); - error = error + " Details: " + cause.getClass().getName() + ": " + cause.getMessage(); - } - return error; - } - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 8fc629fd28..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - user - - - - - - - - - - - - - - - - - - - - - - - - - /product-portal/* - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json deleted file mode 100644 index e90433ac51..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/WEB-INF/keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "product-portal", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} diff --git a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/keycloak.json b/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/keycloak.json deleted file mode 100644 index 0808feafef..0000000000 --- a/testsuite/integration-arquillian/test-apps/fuse/product-app-fuse7-undertow/src/main/resources/keycloak.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm": "demo", - "resource": "product-portal", - "auth-server-url": "http://localhost:8080/auth", - "ssl-required" : "external", - "credentials": { - "secret": "password" - } -} \ No newline at end of file diff --git a/testsuite/integration-arquillian/test-apps/pom.xml b/testsuite/integration-arquillian/test-apps/pom.xml index 47f2da30af..2729e6662c 100644 --- a/testsuite/integration-arquillian/test-apps/pom.xml +++ b/testsuite/integration-arquillian/test-apps/pom.xml @@ -23,6 +23,5 @@ servlets-jakarta app-profile-jee cors - fuse diff --git a/testsuite/integration-arquillian/test-apps/test-apps-dist/build.xml b/testsuite/integration-arquillian/test-apps/test-apps-dist/build.xml index a2e6b54940..569d743039 100755 --- a/testsuite/integration-arquillian/test-apps/test-apps-dist/build.xml +++ b/testsuite/integration-arquillian/test-apps/test-apps-dist/build.xml @@ -51,13 +51,5 @@ - - - - - - - - diff --git a/testsuite/integration-arquillian/tests/base/pom.xml b/testsuite/integration-arquillian/tests/base/pom.xml index 2b78802204..763dafea05 100644 --- a/testsuite/integration-arquillian/tests/base/pom.xml +++ b/testsuite/integration-arquillian/tests/base/pom.xml @@ -568,163 +568,6 @@ - - - app-server-fuse63 - - - app.server - fuse63 - - - - fuse63 - false - - - 0 - 8080 - 9990 - - 8181 - - admin - password - -agentlib:jdwp=transport=dt_socket,server=y,suspend=${app.server.debug.suspend},address=localhost:${app.server.debug.port} - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-fuse63 - ${project.version} - runtime - - - org.keycloak.testsuite - integration-arquillian-test-apps-fuse-parent - ${project.version} - runtime - pom - - - org.jboss.arquillian.container - arquillian-container-karaf-managed - - - - - - maven-enforcer-plugin - - enforce - - - - - When running fuse tests 'additional.fuse.repos' is expected to be set. - additional.fuse.repos - - - When running fuse tests 'fuse.adapter.version' is expected to be set. - fuse.adapter.version - - - - - - org.commonjava.maven.plugins - directory-maven-plugin - - - maven-surefire-plugin - - - ${app.server.management.user} - ${app.server.management.password} - ${app.server.karaf.jvm.debug.args} - - - - - - - - app-server-fuse7x - - - app.server - fuse7x - - - - fuse7x - false - - - 0 - 8080 - 9990 - - 8181 - - admin - password - -agentlib:jdwp=transport=dt_socket,server=y,suspend=${app.server.debug.suspend},address=localhost:${app.server.debug.port} - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-fuse7x - ${project.version} - runtime - - - org.keycloak.testsuite - integration-arquillian-test-apps-fuse-parent - ${project.version} - runtime - pom - - - org.jboss.arquillian.container - arquillian-container-karaf-managed - - - - - - maven-enforcer-plugin - - enforce - - - - - When running fuse tests 'additional.fuse.repos' is expected to be set. - additional.fuse.repos - - - - - - org.commonjava.maven.plugins - directory-maven-plugin - - - maven-surefire-plugin - - - ${app.server.management.user} - ${app.server.management.password} - ${app.server.karaf.jvm.debug.args} - - - - - - - - auth-servers-crossdc-undertow diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/Hawtio2Page.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/Hawtio2Page.java deleted file mode 100644 index 42e4ea42ae..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/Hawtio2Page.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.keycloak.testsuite.adapter.page; - -import org.keycloak.testsuite.page.AbstractPage; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import jakarta.ws.rs.core.UriBuilder; -import org.keycloak.testsuite.util.JavascriptBrowser; - -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; - -/** - * @author mhajas - */ -public class Hawtio2Page extends AbstractPage { - - public String getUrl() { - if (Boolean.parseBoolean(System.getProperty("app.server.ssl.required"))) { - return "https://localhost:" + System.getProperty("app.server.https.port", "8543") + "/hawtio"; - } - return "http://localhost:" + System.getProperty("app.server.http.port", "8180") + "/hawtio"; - } - - @Override - public UriBuilder createUriBuilder() { - return UriBuilder.fromUri(getUrl()); - } - - // First variant for Fuse 7.1, 7.2, the second variant for Fuse 7.3 - @FindBy(xpath = "//a[@id ='userDropdownMenu'] | //button[@id ='userDropdownMenu']") - @JavascriptBrowser - private WebElement dropDownMenu; - - // First variant for Fuse 7.1, 7.2, the second variant for Fuse 7.3 - @FindBy(xpath = "//a[@ng-click='userDetails.logout()'] | //a[@ng-focus='authService.logout()']") - @JavascriptBrowser - private WebElement logoutButton; - - public void logout() { - waitUntilElement(dropDownMenu).is().clickable(); - dropDownMenu.click(); - waitUntilElement(logoutButton).is().clickable(); - logoutButton.click(); - } -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/HawtioPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/HawtioPage.java deleted file mode 100644 index bdb338c40b..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/HawtioPage.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.keycloak.testsuite.adapter.page; - -import org.jboss.arquillian.graphene.wait.ElementBuilder; -import org.keycloak.testsuite.page.AbstractPage; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.FindBy; - -import jakarta.ws.rs.core.UriBuilder; -import org.keycloak.testsuite.util.JavascriptBrowser; - -import java.util.concurrent.TimeUnit; - -import static org.jboss.arquillian.graphene.Graphene.waitGui; -import static org.keycloak.testsuite.util.WaitUtils.pause; - -/** - * @author mhajas - */ -public class HawtioPage extends AbstractPage { - - public String getUrl() { - if (Boolean.parseBoolean(System.getProperty("app.server.ssl.required"))) { - return "https://localhost:" + System.getProperty("app.server.https.port", "8543") + "/hawtio"; - } - return "http://localhost:" + System.getProperty("app.server.http.port", "8180") + "/hawtio"; - } - - @Override - public UriBuilder createUriBuilder() { - return UriBuilder.fromUri(getUrl()); - } - - @FindBy(xpath = "//a[@class='dropdown-toggle' and @data-original-title='Preferences and log out']") - @JavascriptBrowser - private WebElement dropDownMenu; - - @FindBy(xpath = "//a[@ng-click='logout()']") - @JavascriptBrowser - private WebElement logoutButton; - - @FindBy(xpath = "//input[@type='submit' and @value='Yes']") - @JavascriptBrowser - private WebElement modal; - - public void logout(WebDriver jsDriver) { - log.debug("logging out"); - hawtioWaitUntil(dropDownMenu).is().clickable(); - dropDownMenu.click(); - - // There is a tooltip shown which prevents logout button from clicking - // So we need to move mouse away from dropDownMenu element - new Actions(jsDriver).moveToElement(logoutButton).perform(); - pause(100); // Wait for tooltip to fade out - - hawtioWaitUntil(logoutButton).is().clickable(); - logoutButton.click(); - hawtioWaitUntil(modal).is().clickable(); - modal.click(); - } - - public ElementBuilder hawtioWaitUntil(WebElement element) { - return waitGui().withTimeout(3, TimeUnit.MINUTES).until().element(element); - } - - public ElementBuilder hawtioWaitUntil(By element) { - return waitGui().withTimeout(3, TimeUnit.MINUTES).until().element(element); - } -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java deleted file mode 100644 index e82e4d9923..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.adapter.page.fuse; - -import org.keycloak.testsuite.adapter.page.AppServerContextRoot; - -import java.net.MalformedURLException; -import java.net.URL; -import org.keycloak.testsuite.util.DroneUtils; - -/** - * - * @author tkyjovsk - */ -public abstract class AbstractFuseExample extends AppServerContextRoot { - - public abstract String getContext(); - - private URL url; - - @Override - public URL getInjectedUrl() { - if (url == null) { - try { - url = new URL(super.getInjectedUrl().toExternalForm() + "/" + getContext()); - } catch (MalformedURLException ex) { - throw new IllegalStateException(ex); - } - } - return url; - } - - /* - * non-javadoc - * - * When run tests with phantomjs customer or prutuct portal page isn't properly - * loaded. This method reloads page in such case. - */ - @Override - public void navigateTo() { - super.navigateTo(); - - if (DroneUtils.getCurrentDriver().getPageSource().contains("")) { - log.debug("Page wasn't properly loaded - redirecting."); - super.navigateTo(); - } - } -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java deleted file mode 100644 index d39b6c28f9..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.adapter.page.fuse; - -/** - * - * @author tkyjovsk - */ -public class AdminInterface extends CustomerPortalFuseExample { - - @Override - public String getContext() { - return super.getContext() + "/customers/camel.jsp"; - } - -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerListing.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerListing.java deleted file mode 100644 index b495980989..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerListing.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.adapter.page.fuse; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -/** - * - * @author tkyjovsk - */ -public class CustomerListing extends CustomerPortalFuseExample { - - @Override - public String getContext() { - return super.getContext() + "/customers/cxf-rs.jsp"; - } - - @FindBy(linkText = "products") - protected WebElement productsLink; - @FindBy(linkText = "logout") - protected WebElement logOutLink; - @FindBy(linkText = "manage acct") - protected WebElement accountManagementLink; - - public void clickProducts() { - productsLink.click(); - } - - public void clickLogOut() { - logOutLink.click(); - } - - public void clickAccountManagement() { - accountManagementLink.click(); - } - -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerPortalFuseExample.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerPortalFuseExample.java deleted file mode 100644 index e18779785d..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/CustomerPortalFuseExample.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.adapter.page.fuse; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -/** - * - * @author tkyjovsk - */ -public class CustomerPortalFuseExample extends AbstractFuseExample { - - public static final String DEPLOYMENT_NAME = "customer-portal-fuse-example"; - public static final String DEPLOYMENT_CONTEXT = "customer-portal"; - - @Override - public String getContext() { - return DEPLOYMENT_CONTEXT; - } - - @FindBy(linkText = "Customer Listing - CXF RS endpoint") - protected WebElement customerListingLink; - - @FindBy(linkText = "Admin Interface - Apache Camel endpoint") - protected WebElement adminInterfaceLink; - - public void clickCustomerListingLink() { - customerListingLink.click(); - } - - public void clickAdminInterfaceLink() { - adminInterfaceLink.click(); - } - -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/ProductPortalFuseExample.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/ProductPortalFuseExample.java deleted file mode 100644 index 0c0ae7b60c..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/ProductPortalFuseExample.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.adapter.page.fuse; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -/** - * - * @author tkyjovsk - */ -public class ProductPortalFuseExample extends AbstractFuseExample { - - public static final String DEPLOYMENT_NAME = "product-portal-fuse-example"; - public static final String DEPLOYMENT_CONTEXT = "product-portal"; - - @Override - public String getContext() { - return DEPLOYMENT_CONTEXT; - } - - @FindBy(linkText = "products") - protected WebElement productsLink; - @FindBy(linkText = "logout") - protected WebElement logOutLink; - @FindBy(linkText = "manage acct") - protected WebElement accountManagementLink; - - @FindBy(xpath = "//p[contains(text(),'Product with ID 1 - unsecured request')]") - protected WebElement product1Unsecured; - @FindBy(xpath = "//p[contains(text(),'Product with ID 1 - secured request')]") - protected WebElement product1Secured; - @FindBy(xpath = "//p[contains(text(),'Product with ID 2 - secured request')]") - protected WebElement product2Secured; - - public String getProduct1UnsecuredText() { - return product1Unsecured.getText(); - } - - public String getProduct1SecuredText() { - return product1Secured.getText(); - } - - public String getProduct2SecuredText() { - return product2Secured.getText(); - } - - public void clickLogOutLink() { - logOutLink.click(); - } - -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java index 09fc34061b..e2565035fb 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java @@ -30,8 +30,6 @@ import org.jboss.logging.Logger; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.arquillian.annotation.AppServerContainers; import org.keycloak.testsuite.arquillian.containers.SelfManagedAppContainerLifecycle; -import org.keycloak.testsuite.utils.arquillian.ContainerConstants; -import org.keycloak.testsuite.utils.fuse.FuseUtils; import org.wildfly.extras.creaper.commands.web.AddConnector; import org.wildfly.extras.creaper.commands.web.AddConnectorSslConfig; import org.wildfly.extras.creaper.core.CommandFailedException; @@ -209,9 +207,6 @@ public class AppServerTestEnricher { log.info("Starting app server: " + testContext.getAppServerInfo().getQualifier()); controller.start(testContext.getAppServerInfo().getQualifier()); } - if (isFuseAppServer()) { - FuseUtils.setUpFuse(ContainerConstants.APP_SERVER_PREFIX + CURRENT_APP_SERVER); - } } } @@ -357,10 +352,6 @@ public class AppServerTestEnricher { return CURRENT_APP_SERVER.equals("wls"); } - public static boolean isFuseAppServer() { - return CURRENT_APP_SERVER.contains("fuse"); - } - public static boolean isRemoteAppServer() { return CURRENT_APP_SERVER.contains("remote"); } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java index 32ed7188cb..217c0a65e2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.arquillian; -import org.jboss.arquillian.container.osgi.OSGiApplicationArchiveProcessor; import org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider; import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; import org.jboss.arquillian.container.test.spi.client.deployment.DeploymentScenarioGenerator; @@ -42,7 +41,6 @@ import org.keycloak.testsuite.arquillian.provider.URLProvider; import org.keycloak.testsuite.drone.HtmlUnitScreenshots; import org.keycloak.testsuite.drone.KeycloakDronePostSetup; import org.keycloak.testsuite.drone.KeycloakWebDriverConfigurator; -import org.keycloak.testsuite.utils.arquillian.fuse.KeycloakOSGiApplicationArchiveProcessor; /** * @@ -79,7 +77,6 @@ public class KeycloakArquillianExtension implements LoadableExtension { builder .override(ResourceProvider.class, URLResourceProvider.class, URLProvider.class) .override(ResourceProvider.class, CustomizableURLResourceProvider.class, URLProvider.class) - .override(ApplicationArchiveProcessor.class, OSGiApplicationArchiveProcessor.class, KeycloakOSGiApplicationArchiveProcessor.class) .override(ResourceProvider.class, ContainerCustomizableURLResourceProvider.class, URLProvider.class); builder diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java deleted file mode 100644 index c1d6be7463..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.testsuite.adapter.example.fuse; - -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.graphene.page.Page; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; -import org.keycloak.protocol.oidc.OIDCLoginProtocolService; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest; -import org.keycloak.testsuite.adapter.page.Hawtio2Page; -import org.keycloak.testsuite.adapter.page.HawtioPage; -import org.keycloak.testsuite.adapter.page.fuse.AdminInterface; -import org.keycloak.testsuite.adapter.page.fuse.CustomerListing; -import org.keycloak.testsuite.adapter.page.fuse.CustomerPortalFuseExample; -import org.keycloak.testsuite.adapter.page.fuse.ProductPortalFuseExample; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.keycloak.testsuite.auth.page.AuthRealm; -import org.keycloak.testsuite.auth.page.login.OIDCLogin; -import org.keycloak.testsuite.pages.LogoutConfirmPage; -import org.keycloak.testsuite.util.DroneUtils; -import org.keycloak.testsuite.util.JavascriptBrowser; -import org.keycloak.testsuite.util.WaitUtils; -import org.keycloak.testsuite.utils.arquillian.ContainerConstants; -import org.keycloak.testsuite.utils.fuse.FuseUtils.Result; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -import javax.management.InstanceNotFoundException; -import javax.management.MBeanException; -import javax.management.MBeanServerConnection; -import javax.management.ObjectName; -import javax.management.ReflectionException; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertTrue; -import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; -import static org.keycloak.testsuite.utils.fuse.FuseUtils.assertCommand; -import static org.keycloak.testsuite.utils.fuse.FuseUtils.getCommandOutput; -import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm; - -@AppServerContainer(ContainerConstants.APP_SERVER_FUSE63) -@AppServerContainer(ContainerConstants.APP_SERVER_FUSE7X) -public class FuseAdapterTest extends AbstractExampleAdapterTest { - - - @Drone - @JavascriptBrowser - protected WebDriver jsDriver; - - @Page - @JavascriptBrowser - private HawtioPage hawtioPage; - @Page - @JavascriptBrowser - private Hawtio2Page hawtio2Page; - @Page - @JavascriptBrowser - private OIDCLogin testRealmLoginPageFuse; - @Page - @JavascriptBrowser - private AuthRealm loginPageFuse; - @Page - @JavascriptBrowser - protected CustomerPortalFuseExample customerPortal; - @Page - @JavascriptBrowser - protected CustomerListing customerListing; - @Page - @JavascriptBrowser - protected AdminInterface adminInterface; - @Page - @JavascriptBrowser - protected ProductPortalFuseExample productPortal; - - @Page - @JavascriptBrowser - protected LogoutConfirmPage logoutConfirmPage; - - @Override - public void addAdapterTestRealms(List testRealms) { - RealmRepresentation fuseRealm = loadRealm(new File(TEST_APPS_HOME_DIR + "/fuse/demorealm.json")); - testRealms.add(fuseRealm); - } - - @Override - public void setDefaultPageUriParameters() { - super.setDefaultPageUriParameters(); - testRealmLoginPageFuse.setAuthRealm(DEMO); - testRealmPage.setAuthRealm(DEMO); - testRealmLoginPage.setAuthRealm(DEMO); - loginPageFuse.setAuthRealm(DEMO); - } - - @Before - public void addJsDriver() { - DroneUtils.addWebDriver(jsDriver); - } - - @Override - public boolean isImportAfterEachMethod() { - return false; - } - - @Test - @AppServerContainer(value = ContainerConstants.APP_SERVER_FUSE7X, skip = true) - public void hawtio1LoginTest() throws Exception { - hawtioPage.navigateTo(); - WaitUtils.waitForPageToLoad(); - assertCurrentUrlStartsWith(loginPageFuse); - testRealmLoginPageFuse.form().login("user", "invalid-password"); - assertCurrentUrlStartsWith(loginPageFuse); - - testRealmLoginPageFuse.form().login("invalid-user", "password"); - assertCurrentUrlStartsWith(loginPageFuse); - - testRealmLoginPageFuse.form().login("root", "password"); - assertCurrentUrlStartsWith(hawtioPage.toString()); - - String logoutUri = OIDCLoginProtocolService.logoutUrl(authServerPage.createUriBuilder()) - .build("demo").toString(); - DroneUtils.getCurrentDriver().navigate().to(logoutUri); - WaitUtils.waitForPageToLoad(); - logoutConfirmPage.confirmLogout(); - - hawtioPage.navigateTo(); - WaitUtils.waitForPageToLoad(); - log.debug("logging in as mary"); - testRealmLoginPageFuse.form().login("mary", "password"); - log.debug("Previous WARN waitForPageToLoad time exceeded! is expected"); - assertThat(DroneUtils.getCurrentDriver().getCurrentUrl(), not(containsString("welcome"))); - } - - @Test - @Ignore - @AppServerContainer(value = ContainerConstants.APP_SERVER_FUSE63, skip = true) - public void hawtio2LoginTest() throws Exception { - - Assume.assumeTrue("This test doesn't work with phantomjs", !"phantomjs".equals(System.getProperty("js.browser"))); - - hawtio2Page.navigateTo(); - WaitUtils.waitForPageToLoad(); - - assertCurrentUrlStartsWith(loginPageFuse); - testRealmLoginPageFuse.form().login("user", "invalid-password"); - assertCurrentUrlStartsWith(loginPageFuse); - - testRealmLoginPageFuse.form().login("invalid-user", "password"); - assertCurrentUrlStartsWith(loginPageFuse); - - log.debug("logging in as root"); - testRealmLoginPageFuse.form().login("root", "password"); - assertCurrentUrlStartsWith(hawtio2Page.toString()); - - assertHawtio2Page("camel", true); - assertHawtio2Page("jmx", true); - assertHawtio2Page("osgi", true); - assertHawtio2Page("logs", true); - - hawtio2Page.logout(); - WaitUtils.waitForPageToLoad(); - - assertCurrentUrlStartsWith(testRealmLoginPageFuse); - - hawtio2Page.navigateTo(); - WaitUtils.waitForPageToLoad(); - - log.debug("logging in as mary"); - testRealmLoginPageFuse.form().login("mary", "password"); - log.debug("Current URL: " + DroneUtils.getCurrentDriver().getCurrentUrl()); - assertCurrentUrlStartsWith(hawtio2Page.toString()); - - assertHawtio2Page("camel", false); - assertHawtio2Page("jmx", false); - assertHawtio2Page("osgi", false); - assertHawtio2Page("logs", false); - } - - private void assertHawtio2Page(String urlFragment, boolean expectedSuccess) { - DroneUtils.getCurrentDriver().navigate().to(hawtio2Page.getUrl() + "/" + urlFragment); - WaitUtils.waitForPageToLoad(); - WaitUtils.waitUntilElement(By.xpath("//img[@alt='Red Hat Fuse Management Console'] | //img[@ng-src='img/fuse-logo.svg']")).is().present(); - if (expectedSuccess) { - assertCurrentUrlStartsWith(hawtio2Page.getUrl() + "/" + urlFragment); - } else { - assertCurrentUrlStartsWith(hawtio2Page.getUrl() + "/jvm"); - } - } - - @Test - @AppServerContainer(value = ContainerConstants.APP_SERVER_FUSE7X, skip = true) - public void sshLoginTestFuse6() throws Exception { - assertCommand("mary", "password", "shell:date", Result.NO_CREDENTIALS); - assertCommand("john", "password", "shell:info", Result.NO_CREDENTIALS); - assertCommand("john", "password", "shell:date", Result.OK); - assertCommand("root", "password", "shell:info", Result.OK); - } - - @Test - @AppServerContainer(value = ContainerConstants.APP_SERVER_FUSE63, skip = true) - public void sshLoginTestFuse7() throws Exception { - assertCommand("mary", "password", "shell:date", Result.NOT_FOUND); - assertCommand("john", "password", "shell:info", Result.OK); - assertCommand("john", "password", "shell:date", Result.OK); - assertRoles("root", - "ssh", - "jmxAdmin", - "admin", - "manager", - "viewer", - "Administrator", - "Auditor", - "Deployer", - "Maintainer", - "Operator", - "SuperUser" - ); - } - - private void assertRoles(String username, String... expectedRoles) throws Exception { - final String commandOutput = getCommandOutput(username, "password", "jaas:whoami -r --no-format"); - final List parsedOutput = Arrays.asList(commandOutput.split("\\n+")); - assertThat(parsedOutput, containsInAnyOrder(expectedRoles)); - } - - @Test - public void jmxLoginTest() throws Exception { - ObjectName mbean = new ObjectName("org.apache.karaf:type=config,name=root"); - log.debug("jmxLoginTest - testing: invalid credentials"); - try (JMXConnector jmxConnector = getJMXConnector(10, TimeUnit.SECONDS, "mary", "password1")) { - jmxConnector.getMBeanServerConnection(); - Assert.fail(); - } catch (TimeoutException expected) { - assertThat(expected.getCause().toString(), containsString("java.lang.SecurityException: Authentication failed")); - } - log.debug("jmxLoginTest - testing: no role"); - try (JMXConnector jmxConnector = getJMXConnector("mary", "password")) { - MBeanServerConnection connection = jmxConnector.getMBeanServerConnection(); - assertJmxInvoke(false, connection, mbean, "listProperties", new Object [] {""}, new String [] {String.class.getName()}); - assertJmxInvoke(false, connection, mbean, "setProperty", new Object [] {"", "x", "y"}, new String [] {String.class.getName(), String.class.getName(), String.class.getName()}); - } - log.debug("jmxLoginTest - testing: read only role"); - try (JMXConnector jmxConnector = getJMXConnector("john", "password")) { - MBeanServerConnection connection = jmxConnector.getMBeanServerConnection(); - assertJmxInvoke(true, connection, mbean, "listProperties", new Object [] {""}, new String [] {String.class.getName()}); - assertJmxInvoke(false, connection, mbean, "setProperty", new Object [] {"", "x", "y"}, new String [] {String.class.getName(), String.class.getName(), String.class.getName()}); - } - log.debug("jmxLoginTest - testing: read write role"); - try (JMXConnector jmxConnector = getJMXConnector("root", "password")) { - MBeanServerConnection connection = jmxConnector.getMBeanServerConnection(); - assertJmxInvoke(true, connection, mbean, "listProperties", new Object [] {""}, new String [] {String.class.getName()}); - assertJmxInvoke(true, connection, mbean, "setProperty", new Object [] {"", "x", "y"}, new String [] {String.class.getName(), String.class.getName(), String.class.getName()}); - } - } - - private Object assertJmxInvoke(boolean expectSuccess, MBeanServerConnection connection, ObjectName mbean, String method, - Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException { - try { - Object result = connection.invoke(mbean, method, params, signature); - assertTrue(expectSuccess); - return result; - } catch (SecurityException se) { - assertTrue(!expectSuccess); - return null; - } - } - - private JMXConnector getJMXConnector(String username, String password) throws Exception { - return getJMXConnector(2, TimeUnit.MINUTES, username, password); - } - - private JMXConnector getJMXConnector(long timeout, TimeUnit unit, String username, String password) throws Exception { - Exception lastException = null; - long timeoutMillis = System.currentTimeMillis() + unit.toMillis(timeout); - while (System.currentTimeMillis() < timeoutMillis) { - try { - Map env = Collections.singletonMap(JMXConnector.CREDENTIALS, new String[] { username, password }); - return JMXConnectorFactory.connect(new JMXServiceURL(getJmxServiceUrl()), env); - } catch (Exception ex) { - lastException = ex; - Thread.sleep(500); - log.debug("Loop: Getting MBean Server Connection: last caught exception: " + lastException.getClass().getName()); - } - } - log.error("Failed to get MBean Server Connection within " + timeout + " " + unit.toString()); - TimeoutException timeoutException = new TimeoutException(); - timeoutException.initCause(lastException); - throw timeoutException; - } - - private String getJmxServiceUrl() throws Exception { - return "service:jmx:rmi://localhost:44444/jndi/rmi://localhost:1099/karaf-root"; - } - - @Test - public void testCustomerListingAndAccountManagement() { - customerPortal.navigateTo(); - assertCurrentUrlStartsWith(customerPortal); - - customerPortal.clickCustomerListingLink(); - assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); - - testRealmLoginPageFuse.form().login("bburke@redhat.com", "password"); - assertCurrentUrlStartsWith(customerListing); - - assertThat(DroneUtils.getCurrentDriver().getPageSource(), allOf( - containsString("Username: bburke@redhat.com"), - containsString("Bill Burke") - )); - - // account mgmt - customerListing.clickAccountManagement(); - - DroneUtils.getCurrentDriver().navigate().back(); - customerListing.clickLogOut(); - - logoutConfirmPage.confirmLogout(); - - customerPortal.navigateTo();//needed for phantomjs - WaitUtils.waitForPageToLoad(); - customerPortal.clickCustomerListingLink(); - WaitUtils.waitForPageToLoad(); - // assert user not logged in - assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); - } - - @Test - public void testAdminInterface() { - customerPortal.navigateTo(); - assertCurrentUrlStartsWith(customerPortal); - - customerPortal.clickAdminInterfaceLink(); - WaitUtils.waitForPageToLoad(); - assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); - - testRealmLoginPageFuse.form().login("admin", "password"); - assertCurrentUrlStartsWith(adminInterface); - assertThat(DroneUtils.getCurrentDriver().getPageSource(), containsString("Hello admin!")); - assertThat(DroneUtils.getCurrentDriver().getPageSource(), containsString("This second sentence is returned from a Camel RestDSL endpoint")); - - customerListing.navigateTo(); - WaitUtils.waitForPageToLoad(); - customerListing.clickLogOut(); - logoutConfirmPage.confirmLogout(); - WaitUtils.waitForPageToLoad(); - - WaitUtils.pause(2500); - customerPortal.navigateTo();//needed for phantomjs - WaitUtils.waitForPageToLoad(); - customerPortal.clickAdminInterfaceLink(); - WaitUtils.waitForPageToLoad(); - assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); - - testRealmLoginPageFuse.form().login("bburke@redhat.com", "password"); - assertCurrentUrlStartsWith(adminInterface); - assertThat(DroneUtils.getCurrentDriver().getPageSource(), containsString("Status code is 403")); - } - - @Test - @AppServerContainer(value = ContainerConstants.APP_SERVER_FUSE63, skip = true) - public void testProductPortal() { - productPortal.navigateTo(); - WaitUtils.waitForPageToLoad(); - - assertCurrentUrlStartsWithLoginUrlOf(testRealmPage); - - testRealmLoginPageFuse.form().login("bburke@redhat.com", "password"); - assertCurrentUrlStartsWith(productPortal); - - assertThat(productPortal.getProduct1UnsecuredText(), containsString("401: Unauthorized")); - assertThat(productPortal.getProduct1SecuredText(), containsString("Product received: id=1")); - assertThat(productPortal.getProduct2SecuredText(), containsString("Product received: id=2")); - - productPortal.clickLogOutLink(); - logoutConfirmPage.confirmLogout(); - WaitUtils.waitForPageToLoad(); - assertCurrentUrlStartsWith(testRealmPage); - } -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/common/xslt/arquillian.xsl b/testsuite/integration-arquillian/tests/other/adapters/karaf/common/xslt/arquillian.xsl deleted file mode 100644 index e1df46cde1..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/common/xslt/arquillian.xsl +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - true - - org.keycloak.testsuite.arquillian.karaf.CustomKarafContainer - false - ${app.server.home} - ${app.server.java.home} - - ${app.server.karaf.jvm.debug.args} - ${adapter.test.props} - - service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf-root - ${app.server.management.user} - ${app.server.management.password} - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/pom.xml deleted file mode 100644 index 165ab3386b..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 4.0.0 - - - org.keycloak.testsuite - integration-arquillian-tests-adapters-karaf - 999.0.0-SNAPSHOT - - - integration-arquillian-tests-adapters-fuse61 - - Adapter Tests - Karaf - JBoss Fuse 6.1 - - - fuse61 - - admin - admin - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/src/test/java/org/keycloak/testsuite/adapter/example/Fuse61ExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/src/test/java/org/keycloak/testsuite/adapter/example/Fuse61ExampleAdapterTest.java deleted file mode 100644 index 122693fa33..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse61/src/test/java/org/keycloak/testsuite/adapter/example/Fuse61ExampleAdapterTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.keycloak.testsuite.adapter.example; - -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; - -/** - * - * @author tkyjovsk - */ -@AppServerContainer("app-server-fuse61") -public class Fuse61ExampleAdapterTest extends AbstractFuseExampleAdapterTest { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/pom.xml deleted file mode 100644 index 012da49743..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 4.0.0 - - - org.keycloak.testsuite - integration-arquillian-tests-adapters-karaf - 999.0.0-SNAPSHOT - - - integration-arquillian-tests-adapters-fuse62 - - Adapter Tests - Karaf - JBoss Fuse 6.2 - - - fuse62 - - admin - admin - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/src/test/java/org/keycloak/testsuite/adapter/example/Fuse62ExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/src/test/java/org/keycloak/testsuite/adapter/example/Fuse62ExampleAdapterTest.java deleted file mode 100644 index 1a6e3048b5..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/fuse62/src/test/java/org/keycloak/testsuite/adapter/example/Fuse62ExampleAdapterTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.testsuite.adapter.example; - -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; - -/** - * - * @author tkyjovsk - */ -@AppServerContainer("app-server-fuse62") -public class Fuse62ExampleAdapterTest extends AbstractFuseExampleAdapterTest { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/pom.xml deleted file mode 100644 index e4eb4dc312..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 4.0.0 - - - org.keycloak.testsuite - integration-arquillian-tests-adapters-karaf - 999.0.0-SNAPSHOT - - - integration-arquillian-tests-adapters-karaf3 - - Adapter Tests - Karaf - Karaf 3 - - - karaf3 - - karaf - karaf - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/src/test/java/org/keycloak/testsuite/adapter/example/Karaf3ExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/src/test/java/org/keycloak/testsuite/adapter/example/Karaf3ExampleAdapterTest.java deleted file mode 100644 index ce0059e477..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/karaf3/src/test/java/org/keycloak/testsuite/adapter/example/Karaf3ExampleAdapterTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.keycloak.testsuite.adapter.example; - -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; - -/** - * - * @author tkyjovsk - */ -@AppServerContainer("app-server-karaf3") -public class Karaf3ExampleAdapterTest extends AbstractFuseExampleAdapterTest { - -} diff --git a/testsuite/integration-arquillian/tests/other/adapters/karaf/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/karaf/pom.xml deleted file mode 100644 index c11a2e159a..0000000000 --- a/testsuite/integration-arquillian/tests/other/adapters/karaf/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 4.0.0 - - - org.keycloak.testsuite - integration-arquillian-tests-adapters - 999.0.0-SNAPSHOT - - - integration-arquillian-tests-adapters-karaf - - pom - - Adapter Tests - Karaf - - - ${project.parent.basedir}/common - - - 0 - 8080 - 9990 - - 8181 - - -agentlib:jdwp=transport=dt_socket,server=y,suspend=${app.server.debug.suspend},address=${app.server.host}:${app.server.debug.port} - - - - - app-server-karaf3 - - karaf3 - - - - app-server-fuse61 - - fuse61 - - - - app-server-fuse62 - - fuse62 - - - - - diff --git a/testsuite/integration-arquillian/tests/other/adapters/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/pom.xml index f64034d586..cfec81446a 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/pom.xml +++ b/testsuite/integration-arquillian/tests/other/adapters/pom.xml @@ -99,7 +99,6 @@ jboss - karaf was wls @@ -215,8 +214,7 @@ ${app.server.startup.timeout} ${app.server.memory.settings} ${app.server.jboss.jvm.debug.args} - ${app.server.karaf.jvm.debug.args} - + ${app.server.reverse-proxy.port.offset} ${app.server.1.port.offset} diff --git a/testsuite/integration-arquillian/tests/pom.xml b/testsuite/integration-arquillian/tests/pom.xml index 2b1ac304bd..bd63122c7d 100644 --- a/testsuite/integration-arquillian/tests/pom.xml +++ b/testsuite/integration-arquillian/tests/pom.xml @@ -1854,13 +1854,6 @@ zip - - - org.osgi - org.osgi.enterprise - provided - - org.eclipse.microprofile.metrics diff --git a/testsuite/integration-arquillian/util/pom.xml b/testsuite/integration-arquillian/util/pom.xml index 91a3f227ef..0ff73d861d 100644 --- a/testsuite/integration-arquillian/util/pom.xml +++ b/testsuite/integration-arquillian/util/pom.xml @@ -47,22 +47,6 @@ org.jboss.shrinkwrap.resolver shrinkwrap-resolver-api-maven - - - org.jboss.arquillian.container - arquillian-container-karaf-managed - - - org.slf4j - slf4j-log4j12 - - - - - org.osgi - org.osgi.enterprise - provided - org.apache.maven.resolver @@ -108,23 +92,4 @@ jakarta.servlet-api - - - - - jboss-public-repository-group - JBoss Public Repository Group - https://repository.jboss.org/nexus/content/groups/public/ - default - - true - never - - - true - never - - - diff --git a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/ContainerConstants.java b/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/ContainerConstants.java index d9a60665d4..775b0f4a4a 100644 --- a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/ContainerConstants.java +++ b/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/ContainerConstants.java @@ -28,6 +28,4 @@ public interface ContainerConstants { String APP_SERVER_EAP_CLUSTER = APP_SERVER_EAP + "-ha-node-1;" + APP_SERVER_EAP + "-ha-node-2"; String APP_SERVER_EAP8 = APP_SERVER_PREFIX + "eap8"; - String APP_SERVER_FUSE63 = APP_SERVER_PREFIX + "fuse63"; - String APP_SERVER_FUSE7X = APP_SERVER_PREFIX + "fuse7x"; } diff --git a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/CustomFuseContainer.java b/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/CustomFuseContainer.java deleted file mode 100644 index 27e0c3a7f2..0000000000 --- a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/CustomFuseContainer.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.keycloak.testsuite.utils.arquillian.fuse; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import javax.management.MBeanServerConnection; -import javax.management.ObjectName; - -import com.google.common.base.Strings; -import org.jboss.arquillian.container.osgi.jmx.JMXDeployableContainer; -import org.jboss.arquillian.container.osgi.jmx.ObjectNameFactory; -import org.jboss.arquillian.container.osgi.karaf.managed.KarafManagedContainerConfiguration; -import org.jboss.arquillian.container.spi.client.container.LifecycleException; -import org.jboss.logging.Logger; -import org.osgi.jmx.framework.BundleStateMBean; -import org.osgi.jmx.framework.FrameworkMBean; -import org.osgi.jmx.framework.ServiceStateMBean; - -/** - * KarafManagedDeployableContainer - * - * @author thomas.diesler@jboss.com - */ -public class CustomFuseContainer extends JMXDeployableContainer { - - private static final Logger log = Logger.getLogger(CustomFuseContainer.class); - - private KarafManagedContainerConfiguration config; - private Process process; - - private static final String fuseAdapterVersion = System.getProperty("fuse.adapter.version"); - - @Override - public Class getConfigurationClass() { - @SuppressWarnings("unchecked") - Class clazz = (Class) KarafManagedContainerConfiguration.class; - return clazz; - } - - @Override - public void setup(T config) { - super.setup(config); - this.config = config; - } - - @Override - public void start() throws LifecycleException { - - // Try to connect to an already running server - MBeanServerConnection mbeanServer = null; - try { - mbeanServer = getMBeanServerConnection(500, TimeUnit.MILLISECONDS); - } catch (TimeoutException ignore) { - } - - if (mbeanServer != null && !config.isAllowConnectingToRunningServer()) { - throw new LifecycleException( - "The server is already running! Managed containers does not support connecting to running server instances due to the " + - "possible harmful effect of connecting to the wrong server. Please stop server before running or change to another type of container.\n" + - "To disable this check and allow Arquillian to connect to a running server, set allowConnectingToRunningServer to true in the container configuration"); - } - - // Start the Karaf process - if (mbeanServer == null) { - String karafHome = config.getKarafHome(); - if (karafHome == null) - throw new IllegalStateException("karafHome cannot be null"); - - File karafHomeDir = new File(karafHome).getAbsoluteFile(); - if (!karafHomeDir.isDirectory()) - throw new IllegalStateException("Not a valid Karaf home dir: " + karafHomeDir); - - String java = System.getProperty("app.server.java.home") + File.separator + "bin" + File.separator + "java"; - if (Strings.isNullOrEmpty(java)) { - java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; - } - log.infof("Using java: %s", java); - - List cmd = new ArrayList<>(); - cmd.add(java); - - // JavaVM args - String javaArgs = config.getJavaVmArguments(); - if (!javaArgs.contains("-Xmx")) { - javaArgs = KarafManagedContainerConfiguration.DEFAULT_JAVAVM_ARGUMENTS + " " + javaArgs; - } - cmd.addAll(Arrays.asList(javaArgs.split("\\s"))); - - // Karaf properties - cmd.add("-Dkaraf.home=" + karafHomeDir); - cmd.add("-Dkaraf.base=" + karafHomeDir); - cmd.add("-Dkaraf.etc=" + karafHomeDir + "/etc"); - cmd.add("-Dkaraf.data=" + karafHomeDir + "/data"); - cmd.add("-Dkaraf.instances=" + karafHomeDir + "/instances"); - cmd.add("-Dkaraf.restart.jvm.supported=true"); - cmd.add("-Dkaraf.startLocalConsole=false"); - cmd.add("-Dkaraf.startRemoteShell=true"); - cmd.add("-Dfuse.adapter.version=" + fuseAdapterVersion); - - // Java properties - cmd.add("-Djava.io.tmpdir=" + new File(karafHomeDir, "data/tmp")); - cmd.add("-Djava.util.logging.config.file=" + new File(karafHomeDir, "etc/java.util.logging.properties")); - cmd.add("-Djava.endorsed.dirs=" + new File(karafHomeDir, "lib/endorsed")); - - // Classpath - StringBuilder classPath = new StringBuilder(); - boolean fuse7 = new File(karafHomeDir, "lib/boot/").exists(); - if (fuse7) { - log.info("Adding karaf4 libraries to classpath."); - String[] libDirs = { "lib/boot/", "lib/ext/" }; - for (String libDir : libDirs) { - File karafLibBootDir = new File(karafHomeDir, libDir); - String[] libs = karafLibBootDir.list((File dir, String name) -> name.endsWith(".jar")); - for (String lib : libs) { - String separator = classPath.length() > 0 ? File.pathSeparator : ""; - classPath.append(separator).append(new File(karafLibBootDir, lib)); - } - } - - } else { //fuse6 - log.info("Adding karaf3 libraries to classpath."); - File karafLibDir = new File(karafHomeDir, "lib"); - String[] libs = karafLibDir.list((File dir, String name) -> name.startsWith("karaf")); - for (String lib : libs) { - String separator = classPath.length() > 0 ? File.pathSeparator : ""; - classPath.append(separator).append(new File(karafHomeDir, "lib/" + lib)); - } - } - cmd.add("-classpath"); - cmd.add(classPath.toString()); - - // Main class - cmd.add("org.apache.karaf.main.Main"); - - // Output the startup command - StringBuffer cmdstr = new StringBuffer(); - for (String tok : cmd) { - cmdstr.append(tok).append(" "); - } - log.debugv("Starting Karaf with: {0}", cmdstr); - - try { - ProcessBuilder processBuilder = new ProcessBuilder(cmd); - processBuilder.directory(karafHomeDir); - processBuilder.redirectErrorStream(true); - process = processBuilder.start(); - new Thread(new ConsoleConsumer()).start(); - } catch (IOException ex) { - throw new LifecycleException("Cannot start managed Karaf container", ex); - } - - // Get the MBeanServerConnection - try { - log.debug("Geting the MBeanServerConnection"); - mbeanServer = getMBeanServerConnection(120, TimeUnit.SECONDS); - } catch (TimeoutException ex) { - destroyKarafProcess(); - throw new LifecycleException("Cannot obtain MBean server connection", ex); - } - } - - mbeanServerInstance.set(mbeanServer); - - try { - // Get the FrameworkMBean - ObjectName oname = ObjectNameFactory.create("osgi.core:type=framework,*"); - frameworkMBean = getMBeanProxy(mbeanServer, oname, FrameworkMBean.class, 30, TimeUnit.SECONDS); - - // Get the BundleStateMBean - oname = ObjectNameFactory.create("osgi.core:type=bundleState,*"); - bundleStateMBean = getMBeanProxy(mbeanServer, oname, BundleStateMBean.class, 30, TimeUnit.SECONDS); - - // Get the BundleStateMBean - oname = ObjectNameFactory.create("osgi.core:type=serviceState,*"); - serviceStateMBean = getMBeanProxy(mbeanServer, oname, ServiceStateMBean.class, 30, TimeUnit.SECONDS); - - // Install the arquillian bundle to become active - installArquillianBundle(); - - // Await the arquillian bundle to become active - awaitArquillianBundleActive(30, TimeUnit.SECONDS); - - // Await the beginning start level - Integer beginningStartLevel = config.getKarafBeginningStartLevel(); - if (beginningStartLevel != null) - awaitBeginningStartLevel(beginningStartLevel, 30, TimeUnit.SECONDS); - - // Await bootsrap complete services - awaitBootstrapCompleteServices(); - - } catch (RuntimeException rte) { - destroyKarafProcess(); - throw rte; - } catch (IOException | InterruptedException | TimeoutException | LifecycleException ex) { - destroyKarafProcess(); - throw new LifecycleException("Cannot start Karaf container", ex); - } - } - - @Override - public void stop() throws LifecycleException { - try { - super.stop(); - } catch (LifecycleException ex) { - log.info("Couldn't uninstall arquillian bundle. This should be non-blocking issue, proceeding with destroying karaf process."); - } - - destroyKarafProcess(); - } - - private void destroyKarafProcess() throws LifecycleException { - if (process != null) { - process.destroy(); - try { - process.waitFor(); - } catch (InterruptedException e) { - throw new LifecycleException("Cannot start Karaf container", e); - } - } - } - - /** - * Runnable that consumes the output of the process. If nothing consumes the output the AS will hang on some platforms - * - * @author Stuart Douglas - */ - private class ConsoleConsumer implements Runnable { - - @Override - public void run() { - final InputStream stream = process.getInputStream(); - final boolean writeOutput = config.isOutputToConsole(); - try { - byte[] buf = new byte[32]; - int num; - // Do not try reading a line cos it considers '\r' end of line - while ((num = stream.read(buf)) != -1) { - if (writeOutput) - System.out.write(buf, 0, num); - } - } catch (IOException ignored) { - } - } - } - - -} diff --git a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/KeycloakOSGiApplicationArchiveProcessor.java b/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/KeycloakOSGiApplicationArchiveProcessor.java deleted file mode 100644 index 3be51adb5a..0000000000 --- a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/arquillian/fuse/KeycloakOSGiApplicationArchiveProcessor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite.utils.arquillian.fuse; - -import org.jboss.arquillian.container.osgi.OSGiApplicationArchiveProcessor; -import org.jboss.arquillian.test.spi.TestClass; -import org.jboss.logging.Logger; -import org.jboss.shrinkwrap.api.Archive; - -/** - * @author Marek Posolda - */ -public class KeycloakOSGiApplicationArchiveProcessor extends OSGiApplicationArchiveProcessor { - - private static final Logger log = Logger.getLogger(KeycloakOSGiApplicationArchiveProcessor.class); - - // We want to ignore OSGI for exampleAdapter tests - @Override - public void process(Archive appArchive, TestClass testClass) { - Class clazz = testClass.getJavaClass(); - boolean isExampleAdapterTest = isExampleAdapterTest(clazz); - - if (isExampleAdapterTest) { - log.infof("Ignore OSGiApplicationArchiveProcessor for test %s", clazz.getName()); - } else { - super.process(appArchive, testClass); - } - } - - public static boolean isExampleAdapterTest(Class clazz) { - Class parent = clazz; - while (true) { - parent = parent.getSuperclass(); - if (parent == null) { - return false; - } else if (parent.getName().equals("org.keycloak.testsuite.adapter.AbstractExampleAdapterTest")) { - return true; - } - } - } -} diff --git a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/fuse/FuseUtils.java b/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/fuse/FuseUtils.java deleted file mode 100644 index 814bd81389..0000000000 --- a/testsuite/integration-arquillian/util/src/main/java/org/keycloak/testsuite/utils/fuse/FuseUtils.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.testsuite.utils.fuse; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Set; -import org.apache.sshd.client.SshClient; -import org.apache.sshd.client.channel.ChannelExec; -import org.apache.sshd.client.channel.ClientChannelEvent; -import org.apache.sshd.client.future.ConnectFuture; -import org.apache.sshd.client.session.ClientSession; -import org.apache.sshd.common.NamedFactory; -import org.apache.sshd.common.signature.Signature; -import org.apache.sshd.common.signature.BuiltinSignatures; - -import org.hamcrest.Matcher; -import org.jboss.arquillian.core.spi.Validate; -import org.jboss.logging.Logger; -import org.junit.Assert; -import org.keycloak.testsuite.utils.arquillian.ContainerConstants; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.anyOf; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.emptyString; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; - -public class FuseUtils { - - private static final Logger log = Logger.getLogger(FuseUtils.class); - private static boolean initiated = false; - - private static final String managementUser = System.getProperty("app.server.management.user", "admin"); - private static final String managementPassword = System.getProperty("app.server.management.password", "password"); - private static final String additionalFuseRepos = System.getProperty("additional.fuse.repos"); - private static final String userHome = System.getProperty("user.home"); - private static final String fuseAdapterVersion = System.getProperty("fuse.adapter.version"); - private static final String projectVersion = System.getProperty("project.version"); - private static final String mvnRepoLocal; - private static final String mvnLocalSettings; - - public enum Result { OK, NOT_FOUND, NO_CREDENTIALS, NO_ROLES, EMPTY }; - - static { - Validate.notNullOrEmpty(managementUser, "app.server.management.user is not set."); - Validate.notNullOrEmpty(managementPassword, "app.server.management.password is not set."); - Validate.notNullOrEmpty(additionalFuseRepos, "additional.fuse.repos is not set."); - - mvnRepoLocal = System.getProperty("maven.repo.local", userHome + "/.m2/repository"); - mvnLocalSettings = System.getProperty("maven.local.settings", userHome + "/.m2/settings.xml"); - } - - public static void setUpFuse(String appServer) throws IOException { - if (!initiated) { - switch (appServer) { - case ContainerConstants.APP_SERVER_FUSE7X : - setUpFuse7(); - break; - case ContainerConstants.APP_SERVER_FUSE63 : - setUpFuse6(); - break; - default: - throw new UnsupportedOperationException(appServer + " is not supported!"); - } - initiated = true; - } - } - - private static void setUpFuse7() throws IOException { - log.debug("Going to set up fuse server"); - - assertCommand(managementUser, managementPassword, - "config:edit org.ops4j.pax.url.mvn; " + - "config:property-set org.ops4j.pax.url.mvn.localRepository " + mvnRepoLocal + "; " + - "config:property-set org.ops4j.pax.url.mvn.settings " + mvnLocalSettings + "; " + - "config:property-append org.ops4j.pax.url.mvn.repositories " + additionalFuseRepos + "; " + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "config:edit jmx.acl.org.apache.karaf.security.jmx; " + - "config:property-append list* viewer; " + - "config:property-append set* jmxAdmin; " + - "config:property-append * jmxAdmin,admin; " + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "config:edit org.apache.karaf.management; " + - "config:property-set jmxRealm keycloak;" + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "feature:repo-add mvn:org.keycloak/keycloak-osgi-features/" + fuseAdapterVersion + "/xml/features; " + - "feature:repo-add mvn:org.keycloak.testsuite/fuse-example-keycloak-features/" + projectVersion + "/xml/features; " + - "feature:install pax-web-http-undertow; " + - "feature:install keycloak-pax-http-undertow; " + - "feature:install keycloak-fuse-7.0-example", - Result.OK); - - assertCommand(managementUser, managementPassword, - "config:edit --factory --alias cxf org.ops4j.pax.web.context; " + - "config:property-set bundle.symbolicName org.apache.cxf.cxf-rt-transports-http; " + - "config:property-set context.id default; " + - "config:property-set context.param.keycloak.config.resolver org.keycloak.adapters.osgi.HierarchicalPathBasedKeycloakConfigResolver; " + - "config:property-set login.config.authMethod KEYCLOAK; " + - "config:property-set security.cxf.url /cxf/customerservice/*; " + - "config:property-set security.cxf.roles \"admin, user\"; " + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "system:property -p hawtio.keycloakEnabled true; " + - "system:property -p hawtio.realm keycloak; " + - "system:property -p hawtio.keycloakClientConfig ${karaf.etc}/keycloak-hawtio-client.json; " + - "system:property -p hawtio.keycloakServerConfig ${karaf.etc}/keycloak-bearer.json; " + - "system:property -p hawtio.roles admin,manager,viewer,ssh; " + - "system:property -p hawtio.rolePrincipalClasses org.apache.karaf.jaas.boot.principal.RolePrincipal;", - Result.EMPTY); - - // KEYCLOAK-17873 For older version of Fuse - final boolean isOSGiBundleAvailable = checkCommand(managementUser, managementPassword, "bundle:id io.hawt.hawtio-osgi", Result.OK); - assertCommand(managementUser, managementPassword, isOSGiBundleAvailable ? "restart io.hawt.hawtio-osgi" : "restart io.hawt.hawtio-war", Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "config:edit org.apache.karaf.shell; " + - "config:property-set sshRealm keycloak; " + - "config:update", - Result.EMPTY); - - log.debug("Fuse server should be ready"); - } - - private static void setUpFuse6() throws IOException { - log.debug("Going to set up fuse server"); - - assertCommand(managementUser, managementPassword, - "config:edit org.ops4j.pax.url.mvn; " + - "config:propset org.ops4j.pax.url.mvn.localRepository " + mvnRepoLocal + "; " + - "config:propset org.ops4j.pax.url.mvn.settings " + mvnLocalSettings + "; " + - "config:propappend org.ops4j.pax.url.mvn.repositories " + additionalFuseRepos + "; " + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "config:edit jmx.acl.org.apache.karaf.security.jmx; " + - "config:propappend list* viewer; " + - "config:propappend set* jmxAdmin; " + - "config:propappend * jmxAdmin,admin; " + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "config:edit org.apache.karaf.management; " + - "config:propset jmxRealm keycloak;" + - "config:update", - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "features:addurl mvn:org.keycloak/keycloak-osgi-features/" + fuseAdapterVersion + "/xml/features; " + - "features:addurl mvn:org.keycloak.testsuite/fuse-example-keycloak-features/" + projectVersion + "/xml/features; " + - "features:install keycloak-fuse-6.3-example", - Result.OK); - - String appServerHome = System.getProperty("app.server.home"); - Validate.notNullOrEmpty(appServerHome, "app.server.home is not set."); - assertCommand(managementUser, managementPassword, - "system-property -p hawtio.roles admin,user; " + - "system-property -p hawtio.keycloakEnabled true; " + - "system-property -p hawtio.realm keycloak; " + - "system-property -p hawtio.keycloakClientConfig file://" + appServerHome + "/etc/keycloak-hawtio-client.json; " + - "system-property -p hawtio.rolePrincipalClasses org.apache.karaf.jaas.boot.principal.RolePrincipal; ", - Result.EMPTY); - - String output = getCommandOutput(managementUser, managementPassword, "osgi:list | grep hawtio | grep web;"); - assertThat(output, containsString("hawtio")); - String id = output.substring(output.indexOf("[") + 1, output.indexOf("]")).trim(); - log.debug("osgi hawtio-web id: " + id); - assertCommand(managementUser, managementPassword, - "osgi:restart " + id, - Result.EMPTY); - - assertCommand(managementUser, managementPassword, - "config:edit org.apache.karaf.shell; " + - "config:propset sshRealm keycloak; " + - "config:update", - Result.EMPTY); - - log.debug("Fuse server should be ready"); - } - - public static boolean checkCommand(String user, String password, String command, Result result) throws IOException { - String output = getCommandOutput(user, password, command); - - log.debug("Check command: " + command + ", user: " + user + ", password: " + password + ", output: " + output); - return resultToMatcher(result).matches(output); - } - - public static String assertCommand(String user, String password, String command, Result result) throws IOException { - String output = getCommandOutput(user, password, command); - - log.debug("Assert command: " + command + ", user: " + user + ", password: " + password + ", output: " + output); - assertThat(output, resultToMatcher(result)); - return output; - } - - public static String getCommandOutput(String user, String password, String command) throws IOException { - if (!command.endsWith("\n")) - command += "\n"; - - try (ClientSession session = openSshChannel(user, password); - ChannelExec channel = session.createExecChannel(command); - ByteArrayOutputStream out = new ByteArrayOutputStream()) { - channel.setOut(out); - channel.setErr(out); - channel.open(); - channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED, ClientChannelEvent.EOF), 0); - - return out.toString(); - } - } - - private static ClientSession openSshChannel(String username, String password) throws IOException { - SshClient client = SshClient.setUpDefaultClient(); - List> signatureFactories = client.getSignatureFactories(); - List signatures = new ArrayList<>(); - signatures.add(BuiltinSignatures.dsa); - signatureFactories.addAll(NamedFactory.setUpBuiltinFactories(false, signatures)); - - client.setSignatureFactories(signatureFactories); - client.start(); - ConnectFuture future = client.connect(username, "localhost", 8101); - future.await(); - ClientSession session = future.getSession(); - - Set ret = EnumSet.of(ClientSession.ClientSessionEvent.WAIT_AUTH); - while (ret.contains(ClientSession.ClientSessionEvent.WAIT_AUTH)) { - session.addPasswordIdentity(password); - session.auth().verify(); - ret = session.waitFor(EnumSet.of(ClientSession.ClientSessionEvent.WAIT_AUTH, ClientSession.ClientSessionEvent.CLOSED, ClientSession.ClientSessionEvent.AUTHED), 0); - } - if (ret.contains(ClientSession.ClientSessionEvent.CLOSED)) { - throw new RuntimeException("Could not open SSH channel"); - } - - return session; - } - - private static Matcher resultToMatcher(Result result) { - switch (result) { - case EMPTY: - return is(emptyString()); - case OK: - return not(anyOf( - containsString("Insufficient credentials"), - containsString("Command not found"), - containsString("Error executing command"), - containsString("Authentication failed")) - ); - case NOT_FOUND: - return containsString("Command not found"); - case NO_CREDENTIALS: - return containsString("Insufficient credentials"); - case NO_ROLES: - return containsString("Current user has no associated roles"); - default: - Assert.fail("Unexpected enum value: " + result); - return containsString("Unexpected enum value: " + result); - } - } -}