From bdf0c40835a935fe1cb29562fd37c5925c845130 Mon Sep 17 00:00:00 2001 From: Panagiotis Sotiropoulos Date: Thu, 24 Aug 2017 15:31:14 +0200 Subject: [PATCH] [EAT] : Adding a testcase in EAT for JBEAP-12052. --- .../CacheTypeValidationTestCase.java | 52 +++ .../testcases/jdkAll/Eap70x/security/pom.xml | 1 + .../test/config/standaloneEap7/standalone.xml | 406 ++++++++++++++++++ .../security/test-configurations/pom.xml | 2 +- .../security/test2-configurations/pom.xml | 96 +++++ .../test2-configurations/startServer.sh | 1 + .../test/config/standaloneEap7/standalone.xml | 403 +++++++++++++++++ .../Eap70x/web/test-configurations/pom.xml | 29 +- 8 files changed, 988 insertions(+), 2 deletions(-) create mode 100644 modules/src/main/java/org/jboss/additional/testsuite/jdkall/present/security/validations/CacheTypeValidationTestCase.java create mode 100644 modules/testcases/jdkAll/Eap70x/security/src/test/config/standaloneEap7/standalone.xml create mode 100644 modules/testcases/jdkAll/Eap70x/security/test2-configurations/pom.xml create mode 100755 modules/testcases/jdkAll/Eap70x/security/test2-configurations/startServer.sh create mode 100644 modules/testcases/jdkAll/Eap70x/web/src/test/config/standaloneEap7/standalone.xml diff --git a/modules/src/main/java/org/jboss/additional/testsuite/jdkall/present/security/validations/CacheTypeValidationTestCase.java b/modules/src/main/java/org/jboss/additional/testsuite/jdkall/present/security/validations/CacheTypeValidationTestCase.java new file mode 100644 index 0000000000..0977cab4f3 --- /dev/null +++ b/modules/src/main/java/org/jboss/additional/testsuite/jdkall/present/security/validations/CacheTypeValidationTestCase.java @@ -0,0 +1,52 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.additional.testsuite.jdkall.present.security.validations; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import org.jboss.eap.additional.testsuite.annotations.EapAdditionalTestsuite; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +//@apAdditionalTestsuite({"modules/testcases/jdkAll/Eap70x/security/src/main/java"}) +public class CacheTypeValidationTestCase { + @Test + public void testCacheTypeValidation() throws Exception { + ProcessBuilder pb = new ProcessBuilder("./startServer.sh").redirectErrorStream(true); + pb.redirectError(new File("output.txt")); + pb.start(); + + Thread.sleep(5000); + + InputStream in = new FileInputStream(new File("output.txt")); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + if ((line = reader.readLine()) == null) { + assertTrue("The server should not start successfully.",false); + } + reader.close(); + } +} diff --git a/modules/testcases/jdkAll/Eap70x/security/pom.xml b/modules/testcases/jdkAll/Eap70x/security/pom.xml index 523c752f65..be7f582383 100644 --- a/modules/testcases/jdkAll/Eap70x/security/pom.xml +++ b/modules/testcases/jdkAll/Eap70x/security/pom.xml @@ -21,6 +21,7 @@ test-configurations + test2-configurations diff --git a/modules/testcases/jdkAll/Eap70x/security/src/test/config/standaloneEap7/standalone.xml b/modules/testcases/jdkAll/Eap70x/security/src/test/config/standaloneEap7/standalone.xml new file mode 100644 index 0000000000..c7991af63c --- /dev/null +++ b/modules/testcases/jdkAll/Eap70x/security/src/test/config/standaloneEap7/standalone.xml @@ -0,0 +1,406 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + + org.h2.jdbcx.JdbcDataSource + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${jboss.bind.address:127.0.0.1} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/testcases/jdkAll/Eap70x/security/test-configurations/pom.xml b/modules/testcases/jdkAll/Eap70x/security/test-configurations/pom.xml index e17ff5ab35..80ebd7b794 100644 --- a/modules/testcases/jdkAll/Eap70x/security/test-configurations/pom.xml +++ b/modules/testcases/jdkAll/Eap70x/security/test-configurations/pom.xml @@ -60,7 +60,7 @@ - org/jboss/additional/testsuite/jdkall/present/security/**/*TestCase.java + org/jboss/additional/testsuite/jdkall/present/security/roleToRolesMapping/*TestCase.java diff --git a/modules/testcases/jdkAll/Eap70x/security/test2-configurations/pom.xml b/modules/testcases/jdkAll/Eap70x/security/test2-configurations/pom.xml new file mode 100644 index 0000000000..3276374244 --- /dev/null +++ b/modules/testcases/jdkAll/Eap70x/security/test2-configurations/pom.xml @@ -0,0 +1,96 @@ + + + 4.0.0 + + + + + org.jboss + eap70x-additional-testsuite-security + 1.0.2.Final + + + eap70x-additional-testsuite-security-configuration-2 + eap70x additional testsuite: security : configuration-2 + + + ../src/test/config/standaloneEap7/standalone.xml + ${basedir}/../../../../.. + eap7 + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + ${testLogToFile} + false + + + + ${jboss.modules.dir}/src/config/arqEap7 + + + + + + + default-test + test + + test + + + + + org/jboss/additional/testsuite/jdkall/present/security/validations/*TestCase.java + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + build-basic-config + process-test-resources + + run + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/testcases/jdkAll/Eap70x/security/test2-configurations/startServer.sh b/modules/testcases/jdkAll/Eap70x/security/test2-configurations/startServer.sh new file mode 100755 index 0000000000..3d22c23e0f --- /dev/null +++ b/modules/testcases/jdkAll/Eap70x/security/test2-configurations/startServer.sh @@ -0,0 +1 @@ +./../../../../../servers/eap7/build/target/jbossas/bin/standalone.sh > output.txt diff --git a/modules/testcases/jdkAll/Eap70x/web/src/test/config/standaloneEap7/standalone.xml b/modules/testcases/jdkAll/Eap70x/web/src/test/config/standaloneEap7/standalone.xml new file mode 100644 index 0000000000..8fc0c91e25 --- /dev/null +++ b/modules/testcases/jdkAll/Eap70x/web/src/test/config/standaloneEap7/standalone.xml @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + + org.h2.jdbcx.JdbcDataSource + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${jboss.bind.address:127.0.0.1} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/testcases/jdkAll/Eap70x/web/test-configurations/pom.xml b/modules/testcases/jdkAll/Eap70x/web/test-configurations/pom.xml index f96d7e6648..7a34a9efbb 100644 --- a/modules/testcases/jdkAll/Eap70x/web/test-configurations/pom.xml +++ b/modules/testcases/jdkAll/Eap70x/web/test-configurations/pom.xml @@ -18,8 +18,9 @@ eap70x additional testsuite: web : configuration - ../src/test/config/standaloneWildfly/standalone.xml + ../src/test/config/standaloneEap7/standalone.xml ${basedir}/../../../../.. + eap7 @@ -65,6 +66,32 @@ + + + org.apache.maven.plugins + maven-antrun-plugin + + + build-basic-config + process-test-resources + + run + + + + + + + + + + + + + + + +