From ecab54eec81fbead1e1048d2b134b99bb48b6618 Mon Sep 17 00:00:00 2001 From: Alwin Joseph <44426046+alwin-joseph@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:01:52 +0530 Subject: [PATCH] Jakarta Transactions TCK refactoring for EE Platform TCK (#1470) * Initial changes to generate jta test files, fixing compilation * archive fixes * jta transactional and txpropagationtest tests in runnable form * add execution of javatest, revert wrong file change * 74/195 javatests passing with GF, all tests runnable * 100/195 tests passing * use glassfish.postBootCommands and simplify runner * ee/transactional tests fixed * hardcode db user/pwd in descriptor - fix 12 txpropagationtest tests --- glassfish-runner/jta-platform-tck/j2ee.pass | 17 + .../jta-platform-tck/javajoe.pass | 16 + glassfish-runner/jta-platform-tck/pom.xml | 469 +++++++ .../jta-platform-tck/sql/derby/derby.ddl.sql | 176 +++ .../jta-platform-tck/sql/derby/derby.dml.sql | 769 +++++++++++ .../core/tck/GlassfishLoadableExtension.java | 30 + .../tck/GlassfishTestArchiveProcessor.java | 149 +++ ...boss.arquillian.core.spi.LoadableExtension | 1 + .../test/resources/appclient-arquillian.xml | 36 + .../src/test/resources/arquillian.xml | 29 + jta/pom.xml | 78 +- .../jta/ee/common/InitFailedException.java | 13 + .../jta/ee/common/InvalidStatusException.java | 12 + .../sun/ts/tests/jta/ee/common/Transact.java | 26 - .../jta/ee/common/TransactionStatus.java | 9 + .../transactional/ClientEjblitejsfTest.java | 1129 +++++++++++++++++ .../transactional/ClientEjblitejspTest.java | 641 ++++++++++ .../ClientEjbliteservlet2Test.java | 639 ++++++++++ .../ClientEjbliteservletTest.java | 633 +++++++++ .../jta/ee/transactional/EJBLiteJSPTag.java | 128 ++ .../transactional/EJBLiteServlet2Filter.java | 63 + .../transactional/EJBLiteServletVehicle.java | 96 ++ .../ee/transactional/HttpServletDelegate.java | 48 + .../{JsfClient.java => JsfClient.java.txt} | 4 +- .../ee/txpropagationtest/ClientEjbTest.java | 243 ++++ .../ee/txpropagationtest/ClientJspTest.java | 216 ++++ .../txpropagationtest/ClientServletTest.java | 209 +++ .../jta/ee/txpropagationtest/TxBeanHome.java | 31 + .../begin/UserBeginClient.java | 2 + .../begin/UserBeginClientEjbTest.java | 189 +++ .../begin/UserBeginClientJspTest.java | 138 ++ .../begin/UserBeginClientServletTest.java | 135 ++ .../commit/UserCommitClientEjbTest.java | 210 +++ .../commit/UserCommitClientJspTest.java | 161 +++ .../commit/UserCommitClientServletTest.java | 156 +++ .../getstatus/UserGetStatusClientEjbTest.java | 211 +++ .../getstatus/UserGetStatusClientJspTest.java | 181 +++ .../UserGetStatusClientServletTest.java | 175 +++ .../rollback/UserRollbackClientEjbTest.java | 210 +++ .../rollback/UserRollbackClientJspTest.java | 180 +++ .../UserRollbackClientServletTest.java | 175 +++ .../UserSetRollbackOnlyClientEjbTest.java | 203 +++ .../UserSetRollbackOnlyClientJspTest.java | 172 +++ .../UserSetRollbackOnlyClientServletTest.java | 168 +++ .../setrollbackonly/jsp_vehicle_web.xml | 36 - .../setrollbackonly/servlet_vehicle_web.xml | 39 - ...serSetTransactionTimeoutClientEjbTest.java | 188 +++ ...serSetTransactionTimeoutClientJspTest.java | 159 +++ ...etTransactionTimeoutClientServletTest.java | 154 +++ .../settransactiontimeout/jsp_vehicle_web.xml | 36 - .../servlet_vehicle_web.xml | 39 - .../ee/txpropagationtest/ejb_vehicle_ejb.xml | 0 .../ee/txpropagationtest/jsp_vehicle_web.xml | 2 +- ...ta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml | 0 .../jta_ee_txpropagate1_ejb.xml | 0 ...ta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml | 4 +- .../jta_ee_txpropagate2_ejb.xml | 0 ...ta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml | 4 +- .../jta_ee_txpropagate3_ejb.xml | 0 ...icle_client.jar.sun-application-client.xml | 0 .../jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 .../jta_jsp_vehicle_web.war.sun-web.xml | 4 +- .../jta_servlet_vehicle_web.war.sun-web.xml | 4 +- .../txpropagationtest/servlet_vehicle_web.xml | 2 +- .../begin/appclient_vehicle_client.xml | 0 ...icle_client.jar.sun-application-client.xml | 0 .../begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 .../begin_jsp_vehicle_web.war.sun-web.xml | 0 .../begin_servlet_vehicle_web.war.sun-web.xml | 0 .../usertransaction/begin/ejb_vehicle_ejb.xml | 0 .../begin}/jsp_vehicle_web.xml | 2 +- .../begin/servlet_vehicle_web.xml | 2 +- .../commit/appclient_vehicle_client.xml | 0 ...icle_client.jar.sun-application-client.xml | 0 ...commit_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 .../commit_jsp_vehicle_web.war.sun-web.xml | 0 ...commit_servlet_vehicle_web.war.sun-web.xml | 0 .../commit/ejb_vehicle_ejb.xml | 0 .../commit}/jsp_vehicle_web.xml | 2 +- .../commit}/servlet_vehicle_web.xml | 2 +- .../getstatus/appclient_vehicle_client.xml | 0 .../getstatus/ejb_vehicle_ejb.xml | 0 ...icle_client.jar.sun-application-client.xml | 0 ...status_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 .../getstatus_jsp_vehicle_web.war.sun-web.xml | 0 ...status_servlet_vehicle_web.war.sun-web.xml | 0 .../getstatus}/jsp_vehicle_web.xml | 2 +- .../getstatus}/servlet_vehicle_web.xml | 2 +- .../rollback/appclient_vehicle_client.xml | 0 .../rollback/ejb_vehicle_ejb.xml | 0 .../rollback}/jsp_vehicle_web.xml | 2 +- ...icle_client.jar.sun-application-client.xml | 0 ...llback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 .../rollback_jsp_vehicle_web.war.sun-web.xml | 0 ...llback_servlet_vehicle_web.war.sun-web.xml | 0 .../rollback}/servlet_vehicle_web.xml | 2 +- .../appclient_vehicle_client.xml | 0 .../setrollbackonly/ejb_vehicle_ejb.xml | 0 .../setrollbackonly/jsp_vehicle_web.xml | 36 + .../setrollbackonly/servlet_vehicle_web.xml | 39 + ...icle_client.jar.sun-application-client.xml | 0 ...ckonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 ...llbackonly_jsp_vehicle_web.war.sun-web.xml | 0 ...ckonly_servlet_vehicle_web.war.sun-web.xml | 0 .../appclient_vehicle_client.xml | 0 .../settransactiontimeout/ejb_vehicle_ejb.xml | 0 .../settransactiontimeout/jsp_vehicle_web.xml | 36 + .../servlet_vehicle_web.xml | 39 + ...icle_client.jar.sun-application-client.xml | 0 ...imeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 0 ...iontimeout_jsp_vehicle_web.war.sun-web.xml | 0 ...imeout_servlet_vehicle_web.war.sun-web.xml | 0 ...icle_client.jar.sun-application-client.xml | 26 + .../vehicle/ejb/ejb_vehicle_client.xml | 28 + .../ejb/ejb_vehicle_ejb.jar.sun-ejb-jar.xml | 49 + .../resources/vehicle/ejb/ejb_vehicle_ejb.xml | 44 + .../resources/vehicle/ejblitejsf/beans.xml | 22 + .../ejblitejsf/ejblitejsf_vehicle.xhtml | 25 + .../ejblitejsf/ejblitejsf_vehicle_web.xml | 31 + .../vehicle/ejblitejsf/faces-config.xml | 25 + .../vehicle/ejblitejsp/EJBLiteJSPTag.java.txt | 128 ++ .../resources/vehicle/ejblitejsp/beans.xml | 22 + .../vehicle/ejblitejsp/ejblitejsp.tld | 45 + .../vehicle/ejblitejsp/ejblitejsp_vehicle.jsp | 30 + .../EJBLiteServletVehicle.java.txt | 96 ++ .../HttpServletDelegate.java.txt | 48 + .../vehicle/ejbliteservlet/beans.xml | 22 + .../ejbliteservlet_vehicle_web.xml | 29 + .../EJBLiteServlet2Filter.java.txt | 63 + .../vehicle/ejbliteservlet2/beans.xml | 22 + .../ejbliteservlet2_vehicle.jsp | 24 + .../ejbliteservlet2_vehicle_web.xml | 37 + .../vehicle/jsp/contentRoot/client.html | 30 + .../vehicle/jsp/contentRoot/jsp_vehicle.jsp | 117 ++ 134 files changed, 10166 insertions(+), 210 deletions(-) create mode 100644 glassfish-runner/jta-platform-tck/j2ee.pass create mode 100644 glassfish-runner/jta-platform-tck/javajoe.pass create mode 100644 glassfish-runner/jta-platform-tck/pom.xml create mode 100644 glassfish-runner/jta-platform-tck/sql/derby/derby.ddl.sql create mode 100644 glassfish-runner/jta-platform-tck/sql/derby/derby.dml.sql create mode 100644 glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishLoadableExtension.java create mode 100644 glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishTestArchiveProcessor.java create mode 100644 glassfish-runner/jta-platform-tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension create mode 100644 glassfish-runner/jta-platform-tck/src/test/resources/appclient-arquillian.xml create mode 100644 glassfish-runner/jta-platform-tck/src/test/resources/arquillian.xml create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/common/InitFailedException.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/common/InvalidStatusException.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/common/TransactionStatus.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejsfTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservlet2Test.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservletTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteJSPTag.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServlet2Filter.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServletVehicle.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/HttpServletDelegate.java rename jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/{JsfClient.java => JsfClient.java.txt} (99%) create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientServletTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/TxBeanHome.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientServletTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientServletTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientServletTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientServletTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientServletTest.java delete mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml delete mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientEjbTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientJspTest.java create mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientServletTest.java delete mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml delete mode 100644 jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/ejb_vehicle_ejb.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml (97%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml (95%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml (95%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml (97%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/appclient_vehicle_client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_jsp_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_servlet_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/ejb_vehicle_ejb.xml (100%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/getstatus => resources/com/sun/ts/tests/jta/ee/usertransaction/begin}/jsp_vehicle_web.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/commit/appclient_vehicle_client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_jsp_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_servlet_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/commit/ejb_vehicle_ejb.xml (100%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/rollback => resources/com/sun/ts/tests/jta/ee/usertransaction/commit}/jsp_vehicle_web.xml (96%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/getstatus => resources/com/sun/ts/tests/jta/ee/usertransaction/commit}/servlet_vehicle_web.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/getstatus/appclient_vehicle_client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/getstatus/ejb_vehicle_ejb.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_jsp_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_servlet_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/begin => resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus}/jsp_vehicle_web.xml (96%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/rollback => resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus}/servlet_vehicle_web.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/rollback/appclient_vehicle_client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/rollback/ejb_vehicle_ejb.xml (100%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/commit => resources/com/sun/ts/tests/jta/ee/usertransaction/rollback}/jsp_vehicle_web.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_jsp_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_servlet_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java/com/sun/ts/tests/jta/ee/usertransaction/commit => resources/com/sun/ts/tests/jta/ee/usertransaction/rollback}/servlet_vehicle_web.xml (96%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/appclient_vehicle_client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/ejb_vehicle_ejb.xml (100%) create mode 100644 jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml create mode 100644 jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_jsp_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_servlet_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/appclient_vehicle_client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/ejb_vehicle_ejb.xml (100%) create mode 100644 jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml create mode 100644 jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_client.jar.sun-application-client.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_jsp_vehicle_web.war.sun-web.xml (100%) rename jta/src/main/{java => resources}/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_servlet_vehicle_web.war.sun-web.xml (100%) create mode 100644 jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml create mode 100644 jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.xml create mode 100644 jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.jar.sun-ejb-jar.xml create mode 100644 jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.xml create mode 100644 jta/src/main/resources/vehicle/ejblitejsf/beans.xml create mode 100644 jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle.xhtml create mode 100644 jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle_web.xml create mode 100644 jta/src/main/resources/vehicle/ejblitejsf/faces-config.xml create mode 100644 jta/src/main/resources/vehicle/ejblitejsp/EJBLiteJSPTag.java.txt create mode 100644 jta/src/main/resources/vehicle/ejblitejsp/beans.xml create mode 100644 jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp.tld create mode 100644 jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp_vehicle.jsp create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet/EJBLiteServletVehicle.java.txt create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet/HttpServletDelegate.java.txt create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet/beans.xml create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet/ejbliteservlet_vehicle_web.xml create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet2/EJBLiteServlet2Filter.java.txt create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet2/beans.xml create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle.jsp create mode 100644 jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle_web.xml create mode 100644 jta/src/main/resources/vehicle/jsp/contentRoot/client.html create mode 100644 jta/src/main/resources/vehicle/jsp/contentRoot/jsp_vehicle.jsp diff --git a/glassfish-runner/jta-platform-tck/j2ee.pass b/glassfish-runner/jta-platform-tck/j2ee.pass new file mode 100644 index 0000000000..dccc3037eb --- /dev/null +++ b/glassfish-runner/jta-platform-tck/j2ee.pass @@ -0,0 +1,17 @@ + +# +# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# +AS_ADMIN_USERPASSWORD=j2ee diff --git a/glassfish-runner/jta-platform-tck/javajoe.pass b/glassfish-runner/jta-platform-tck/javajoe.pass new file mode 100644 index 0000000000..d69a7520e5 --- /dev/null +++ b/glassfish-runner/jta-platform-tck/javajoe.pass @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# +AS_ADMIN_USERPASSWORD=javajoe diff --git a/glassfish-runner/jta-platform-tck/pom.xml b/glassfish-runner/jta-platform-tck/pom.xml new file mode 100644 index 0000000000..8e3b2be82a --- /dev/null +++ b/glassfish-runner/jta-platform-tck/pom.xml @@ -0,0 +1,469 @@ + + + + 4.0.0 + + + org.glassfish + standalone-tck + 11.0.0-SNAPSHOT + ../pom.xml + + jakarta + glassfish.jta-platform-tck + 11.0.0-SNAPSHOT + jar + + + admin + 1.9.1.Final + ${derby.poolName} + ${derby.dataSource} + ; + db1 + db1OnlyUsedIfDriverManagerIsYes + ${derby.home}/lib/derbyclient.jar${pathsep}${derby.home}/lib/derbyshared.jar${pathsep}${derby.home}/lib/derbytools.jar + ../../lib/dbprocedures.jar${pathsep}${derby.home}/lib/derbynet.jar${pathsep}${derby.home}/lib/derbyshared.jar${pathsep}${derby.home}/lib/derbytools.jar + org.apache.derby.jdbc.ClientDataSource + derbyDB + derby/derby.dml.sql + org.apache.derby.jdbc.ClientDriver + ${project.build.directory}/${glassfish.toplevel.dir}/javadb + cts1 + cts-derby-pool + 1527 + DatabaseName\=\"${derby.dbName}\":user\=${derby.user}:password\=${derby.passwd}:serverName\=${derby.server}:portNumber=${derby.port} + localhost + 5 + ${derby.home}/databases + jdbc:derby://${derby.server}:${derby.port}/${derby.dbName};create=true + cts1 + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + ctstable2 + + 8.0.0-JDK17-M7 + ${project.build.directory}/${glassfish.toplevel.dir} + + + glassfish8 + 11.0.0-M2 + ${glassfish.home}/javadb/lib + ${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbyclient.jar:${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbyshared.jar:${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbytools.jar + derby + org.apache.derby.jdbc.ClientDriver + ${javadb.lib}/derbyclient.jar:${javadb.lib}/derbyshared.jar:${javadb.lib}/derbytools.jar + 64 + cts1 + 32 + jdbc:derby://localhost:1527/derbyDB;create=true + cts1 + jdbc/DB1 + 5.10.2 + cts1 + cts1 + : + ${derby.properties} + ${derby.poolName} + ctstable1 + javax.sql.DataSource + ./sql + jta-tck + 11.0.0-SNAPSHOT + /jakartaeetck + cts1 + cts1 + 11.0.0-SNAPSHOT + 1.0.0-M15 + + + + + + org.junit + junit-bom + ${junit.jupiter.version} + pom + import + + + org.jboss.arquillian + arquillian-bom + 1.9.1.Final + pom + import + + + + + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + + + org.junit.vintage + junit-vintage-engine + ${junit.jupiter.version} + test + + + jakarta.tck + ${tck.artifactId} + ${tck.version} + + + jakarta.platform + jakarta.jakartaee-api + ${jakarta.platform.version} + provided + + + org.jboss.arquillian.container + arquillian-container-test-spi + ${arquillian.junit} + + + org.glassfish.main.common + simple-glassfish-api + ${glassfish.container.version} + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + ${arquillian.junit} + + + org.jboss.arquillian.junit + arquillian-junit-core + ${arquillian.junit} + + + org.jboss.arquillian.junit5 + arquillian-junit5-core + ${arquillian.junit} + + + org.omnifaces.arquillian + arquillian-glassfish-server-managed + 1.4 + test + + + jakarta.tck.arquillian + arquillian-protocol-appclient + ${version.jakarta.tck.arquillian} + + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-api + 3.2.0 + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + 3.2.0 + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-api-maven + 3.2.0 + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-spi-maven + 3.2.0 + + + + jakarta.tck.arquillian + arquillian-protocol-javatest + ${version.jakarta.tck.arquillian} + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-api + + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-api-maven + + + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-spi-maven + + + + + + jakarta.tck.arquillian + arquillian-protocol-common + ${version.jakarta.tck.arquillian} + + + jakarta.tck.arquillian + arquillian-protocol-lib + ${version.jakarta.tck.arquillian} + + + jakarta.tck.arquillian + tck-porting-lib + ${version.jakarta.tck.arquillian} + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.2.0 + + + 001-unpack + + unpack + + generate-resources + + + + org.glassfish.main.distributions + ${glassfish-artifact-id} + ${glassfish.container.version} + zip + false + ${project.build.directory} + + + + + + + + maven-antrun-plugin + 3.0.0 + + + 002-asadmin-permission + + run + + generate-resources + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + 003-copy-protocol-lib + + copy + + generate-resources + + + + jakarta.tck.arquillian + arquillian-protocol-lib + ${version.jakarta.tck.arquillian} + jar + true + ${project.build.directory}/protocol + protocol.jar + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + 004-StartDatabase + + exec + + process-resources + + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin + ${derby.basedir} + + start-database + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + 005-initdb + + run + + pre-integration-test + + + + + + + + + + + + + + + maven-failsafe-plugin + 3.5.0 + + false + + + + jta-tests-appclient + + integration-test + verify + + + + tck-appclient + + com/sun/ts/tests/jta/ee/transactional/*Ejb*.java + com/sun/ts/tests/jta/ee/txpropagationtest/*Ejb*.java + com/sun/ts/tests/jta/ee/usertransaction/**/*EjbTest*.java + + jakarta.tck:${tck.artifactId} + + ${project.build.directory}/${glassfish.toplevel.dir} + ${project.build.directory}/${glassfish.toplevel.dir} + set server-config.network-config.protocols.protocol.http-listener-1.http.trace-enabled=true + create-file-user --groups guest --passwordfile ${project.basedir}/javajoe.pass javajoe + create-file-user --groups staff:mgr --passwordfile ${project.basedir}/j2ee.pass j2ee + create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property DatabaseName=derbyDB:serverName=localhost:portNumber=1527:user=cts1:password=cts1:connectionAttributes="create=true" --steadypoolsize 32 --maxpoolsize 64 cts-derby-pool + create-jdbc-resource --connectionpoolid cts-derby-pool jdbc/DB1 + list-jdbc-connection-pools + list-jdbc-resources + list-file-users + true + true + true + /tmp + appclient-arquillian.xml + + + ${project.build.directory}/${glassfish.toplevel.dir} + + + + + jta-tests-javatest + + integration-test + verify + + + + ${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbytools.jar + ${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbyclient.jar + ${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derby.jar + ${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/glassfish-naming.jar + + + com/sun/ts/tests/jta/ee/transactional/ClientEjblitejspTest*.java + com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservletTest*.java + com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservlet2Test*.java + com/sun/ts/tests/jta/ee/transactional/ClientEjblitejsfTest*.java + com/sun/ts/tests/jta/ee/txpropagationtest/ClientServletTest*.java + com/sun/ts/tests/jta/ee/txpropagationtest/ClientJspTest*.java + com/sun/ts/tests/jta/ee/usertransaction/**/*JspTest*.java + com/sun/ts/tests/jta/ee/usertransaction/**/*ServletTest*.java + + + tck-javatest + jakarta.tck:${tck.artifactId} + + ${project.build.directory}/${glassfish.toplevel.dir} + ${project.build.directory}/${glassfish.toplevel.dir} + set server-config.network-config.protocols.protocol.http-listener-1.http.trace-enabled=true + create-file-user --groups guest --passwordfile ${project.basedir}/javajoe.pass javajoe + create-file-user --groups staff:mgr --passwordfile ${project.basedir}/j2ee.pass j2ee + create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property DatabaseName=derbyDB:serverName=localhost:portNumber=1527:user=cts1:password=cts1:connectionAttributes="create=true" --steadypoolsize 32 --maxpoolsize 64 cts-derby-pool + create-jdbc-resource --connectionpoolid cts-derby-pool jdbc/DB1 + list-jdbc-connection-pools + list-jdbc-resources + list-file-users + true + true + true + /tmp + arquillian.xml + + + ${project.build.directory}/${glassfish.toplevel.dir} + + + + + + + + + + + full + + true + + + glassfish + + + + web + + web + + + + diff --git a/glassfish-runner/jta-platform-tck/sql/derby/derby.ddl.sql b/glassfish-runner/jta-platform-tck/sql/derby/derby.ddl.sql new file mode 100644 index 0000000000..b2bd297182 --- /dev/null +++ b/glassfish-runner/jta-platform-tck/sql/derby/derby.ddl.sql @@ -0,0 +1,176 @@ +drop table ctstable2 ; +drop table ctstable1 ; +create table ctstable1 (TYPE_ID int NOT NULL, TYPE_DESC varchar(32), primary key(TYPE_ID)) ; +create table ctstable2 (KEY_ID int NOT NULL, COF_NAME varchar(32), PRICE float, TYPE_ID int, primary key(KEY_ID), foreign key(TYPE_ID) references ctstable1) ; + +drop table concurrencetable ; +create table concurrencetable (TYPE_ID int NOT NULL, TYPE_DESC varchar(32), primary key(TYPE_ID)) ; + +drop table Numeric_Tab ; +create table Numeric_Tab (MAX_VAL NUMERIC(30,15), MIN_VAL NUMERIC(30,15), NULL_VAL NUMERIC(30,15)) ; + +drop table Decimal_Tab ; + create table Decimal_Tab (MAX_VAL DECIMAL(30,15),MIN_VAL DECIMAL(30,15), NULL_VAL DECIMAL(30,15)) ; + +drop table Double_Tab ; +create table Double_Tab (MAX_VAL DOUBLE PRECISION, MIN_VAL DOUBLE PRECISION, NULL_VAL DOUBLE PRECISION) ; + +drop table Float_Tab ; +create table Float_Tab (MAX_VAL FLOAT, MIN_VAL FLOAT, NULL_VAL FLOAT) ; + +drop table Real_Tab ; +create table Real_Tab (MAX_VAL REAL, MIN_VAL REAL,NULL_VAL REAL) ; + +drop table Bit_Tab ; +create table Bit_Tab (MAX_VAL BOOLEAN, MIN_VAL BOOLEAN, NULL_VAL SMALLINT) ; + +drop table Smallint_Tab ; +create table Smallint_Tab (MAX_VAL SMALLINT, MIN_VAL SMALLINT, NULL_VAL SMALLINT) ; + +drop table Tinyint_Tab ; +create table Tinyint_Tab (MAX_VAL SMALLINT, MIN_VAL SMALLINT, NULL_VAL SMALLINT) ; + +drop table Integer_Tab ; +create table Integer_Tab (MAX_VAL INTEGER, MIN_VAL INTEGER, NULL_VAL INTEGER) ; + +drop table Bigint_Tab ; +create table Bigint_Tab (MAX_VAL BIGINT, MIN_VAL BIGINT, NULL_VAL BIGINT) ; + +drop table Char_Tab ; +create table Char_Tab (COFFEE_NAME CHAR(30), NULL_VAL CHAR(30)) ; + +drop table Varchar_Tab ; +create table Varchar_Tab (COFFEE_NAME VARCHAR(30), NULL_VAL VARCHAR(30)) ; + +drop table Longvarchar_Tab ; +create table Longvarchar_Tab (COFFEE_NAME LONG VARCHAR) ; + +drop table Longvarcharnull_Tab ; +create table Longvarcharnull_Tab (NULL_VAL LONG VARCHAR) ; + +drop table Date_Tab ; +create table Date_Tab (MFG_DATE DATE, NULL_VAL DATE) ; + +drop table Time_Tab ; +create table Time_Tab (BRK_TIME TIME, NULL_VAL TIME) ; + +drop table Timestamp_Tab ; +create table Timestamp_Tab (IN_TIME TIMESTAMP, NULL_VAL TIMESTAMP) ; + +drop table Binary_Tab ; +create table Binary_Tab (BINARY_VAL VARCHAR(24) FOR BIT DATA) ; + +drop table Varbinary_Tab ; +create table Varbinary_Tab (VARBINARY_VAL VARCHAR(255) FOR BIT DATA) ; + +drop table Longvarbinary_Tab ; +create table Longvarbinary_Tab (LONGVARBINARY_VAL VARCHAR(255) FOR BIT DATA) ; + +drop table ctstable3 ; +create table ctstable3(STRING1 VARCHAR(20), STRING2 VARCHAR(20), STRING3 VARCHAR(20), NUMCOL INTEGER, FLOATCOL FLOAT, DATECOL DATE, TIMECOL TIME, TSCOL1 TIMESTAMP, TSCOL2 TIMESTAMP) ; + +drop table ctstable4 ; +create table ctstable4(STRING4 VARCHAR(20), NUMCOL NUMERIC) ; + + +drop table TxBean_Tab1 ; +create table TxBean_Tab1 (KEY_ID int, TABONE_NAME varchar(32), PRICE float) ; + +drop table TxBean_Tab2 ; +create table TxBean_Tab2 (KEY_ID int, TABTWO_NAME varchar(32), PRICE float) ; + ; +drop table TxEBean_Tab ; +create table TxEBean_Tab (KEY_ID INTEGER NOT NULL, BRAND_NAME VARCHAR(32), PRICE FLOAT, primary key(KEY_ID)) ; + +drop table Integration_Tab ; +create table Integration_Tab (ACCOUNT INTEGER NOT NULL, BALANCE FLOAT, primary key(ACCOUNT)) ; + +drop table BB_Tab ; +create table BB_Tab (KEY_ID INTEGER NOT NULL, BRAND_NAME varchar(32), PRICE float, primary key(KEY_ID)) ; + +drop table JTA_Tab1 ; +create table JTA_Tab1 (KEY_ID int, COF_NAME varchar(32), PRICE float) ; + +drop table JTA_Tab2 ; +create table JTA_Tab2 (KEY_ID int, CHOC_NAME varchar(32), PRICE float) ; + +drop table Deploy_Tab1 ; +create table Deploy_Tab1 (KEY_ID INTEGER NOT NULL, BRAND_NAME varchar(32), PRICE float, primary key(KEY_ID)) ; + +drop table Deploy_Tab2 ; +create table Deploy_Tab2 (KEY_ID VARCHAR(100) NOT NULL, BRAND_NAME varchar(32), PRICE float, primary key(KEY_ID)) ; + +drop table Deploy_Tab3 ; +create table Deploy_Tab3 (KEY_ID BIGINT NOT NULL, BRAND_NAME varchar(32), PRICE float, primary key(KEY_ID)) ; + +drop table Deploy_Tab4 ; +create table Deploy_Tab4 (KEY_ID FLOAT NOT NULL, BRAND_NAME varchar(32), PRICE float, primary key(KEY_ID)) ; + +drop table Deploy_Tab5 ; +create table Deploy_Tab5 (KEY_ID1 int NOT NULL, KEY_ID2 varchar(100) NOT NULL, KEY_ID3 float NOT NULL, BRAND_NAME varchar(32), PRICE float, primary key(KEY_ID1, KEY_ID2, KEY_ID3)) ; + +drop table Xa_Tab1 ; +create table Xa_Tab1 (col1 int NOT NULL, col2 varchar(32), col3 varchar(32), primary key(col1)) ; + +drop table Xa_Tab2 ; +create table Xa_Tab2 (col1 int NOT NULL, col2 varchar(32), col3 varchar(32), primary key(col1)) ; + +drop table SEC_Tab1 ; +create table SEC_Tab1 (KEY_ID INTEGER NOT NULL, PRICE float, BRAND varchar(32), primary key(KEY_ID)) ; + +drop table Connector_Tab ; +create table Connector_Tab (KEY_ID int, PRODUCT_NAME varchar(32), PRICE float) ; + +drop table Coffee_Table ; +create table Coffee_Table (KEY_ID INTEGER NOT NULL, BRAND_NAME varchar(32) NOT NULL, PRICE float NOT NULL, primary key(KEY_ID)) ; + +drop table Coffee_StringPK_Table ; +create table Coffee_StringPK_Table (KEY_ID VARCHAR(100) NOT NULL, BRAND_NAME varchar(32) NOT NULL, PRICE float NOT NULL, primary key(KEY_ID)) ; + +drop table Coffee_LongPK_Table ; +create table Coffee_LongPK_Table (KEY_ID BIGINT NOT NULL, BRAND_NAME varchar(32) NOT NULL, PRICE float NOT NULL, primary key(KEY_ID)) ; + +drop table Coffee_FloatPK_Table ; +create table Coffee_FloatPK_Table (KEY_ID FLOAT NOT NULL, BRAND_NAME varchar(32) NOT NULL, PRICE float NOT NULL, primary key(KEY_ID)) ; + +drop table Coffee_CompoundPK_Table ; +create table Coffee_CompoundPK_Table (KEY_ID1 int NOT NULL, KEY_ID2 varchar(100) NOT NULL, KEY_ID3 float NOT NULL, BRAND_NAME varchar(32) NOT NULL, PRICE float NOT NULL, primary key(KEY_ID1, KEY_ID2, KEY_ID3)) ; + +DROP TABLE COFFEEEJBLITE; +CREATE TABLE COFFEEEJBLITE (ID INT NOT NULL, BRANDNAME VARCHAR(25), PRICE REAL, CONSTRAINT PK_COFFEEEJBLITE PRIMARY KEY (ID)); + + +DROP TABLE EJB_AUTOCLOSE_TAB ; +CREATE TABLE EJB_AUTOCLOSE_TAB (NAME VARCHAR(25) NOT NULL, MESSAGE VARCHAR(25) NOT NULL); + + +DROP TABLE caller ; +DROP TABLE caller_groups ; + +CREATE TABLE caller(name VARCHAR(64) PRIMARY KEY, password VARCHAR(1024)) ; +CREATE TABLE caller_groups(caller_name VARCHAR(64), group_name VARCHAR(64)) ; + +INSERT INTO caller VALUES('tom', 'secret1') ; +INSERT INTO caller VALUES('emma', 'secret2') ; +INSERT INTO caller VALUES('bob', 'secret3') ; + +INSERT INTO caller_groups VALUES('tom', 'Administrator') ; +INSERT INTO caller_groups VALUES('tom', 'Manager') ; + +INSERT INTO caller_groups VALUES('emma', 'Administrator') ; +INSERT INTO caller_groups VALUES('emma', 'Employee') ; + +INSERT INTO caller_groups VALUES('bob', 'Administrator') ; + + INSERT INTO caller VALUES('tom_hash512_saltsize16', 'PBKDF2WithHmacSHA512:1024:DbjXqT9p8VhJ7OtU6DrqDw==:p/qihG8IZKkz03JzKd6XXA==') ; + INSERT INTO caller VALUES('tom_hash256_saltsize32', 'PBKDF2WithHmacSHA256:2048:suVayUIJMQMc6wCgckvAIgKRlo1UkxyFXhXbTxX6C7s=:cvdHkBXVUCN2WL3LRAYodeCdNZxEM4RLlNCCYP68Kmg=') ; + INSERT INTO caller VALUES('tom_hash512_saltsize32', 'PBKDF2WithHmacSHA512:2048:dPTjUfiklfyg2bas/KOQKqEfdtoXK8YvbBscIxA8tNg=:ixBg0wr3ySBI86y8HP7+Yw==') ; + + INSERT INTO caller_groups VALUES('tom_hash512_saltsize16', 'Administrator') ; + INSERT INTO caller_groups VALUES('tom_hash512_saltsize16', 'Manager') ; + + INSERT INTO caller_groups VALUES('tom_hash256_saltsize32', 'Administrator') ; + INSERT INTO caller_groups VALUES('tom_hash256_saltsize32', 'Manager') ; + + INSERT INTO caller_groups VALUES('tom_hash512_saltsize32', 'Administrator') ; + INSERT INTO caller_groups VALUES('tom_hash512_saltsize32', 'Manager') ; diff --git a/glassfish-runner/jta-platform-tck/sql/derby/derby.dml.sql b/glassfish-runner/jta-platform-tck/sql/derby/derby.dml.sql new file mode 100644 index 0000000000..06684fc071 --- /dev/null +++ b/glassfish-runner/jta-platform-tck/sql/derby/derby.dml.sql @@ -0,0 +1,769 @@ +#------------------------------------------------- +#All sql DML statements used in the test cases against derby +#------------------------------------------------- + + + +Dbschema_Tab1_Insert=insert into ctstable2 values(?, ?, ?, ?) +Dbschema_Tab2_Insert=insert into ctstable1 values(?, ?) + +Dbschema_Tab1_Delete=delete from ctstable2 +Dbschema_Tab2_Delete=delete from ctstable1 + +Dbschema_Concur_Insert=insert into concurrencetable values(?, ?) +Dbschema_Concur_Delete=delete from concurrencetable + +#****************************************************************** +# SQL Statements for creating procedures in side the test. +#****************************************************************** + +UpdCoffee_Proc=create method alias UpdCoffee_Proc for com.sun.ts.lib.tests.jdbc.CS_Procs.UpdCoffee_Proc + +#****************************************************************** +# SQL Statements for deleting tables for appropriate JDBC Datatypes +#****************************************************************** + +Numeric_Tab_Delete=delete from Numeric_Tab + +Decimal_Tab_Delete=delete from Decimal_Tab + +Double_Tab_Delete=delete from Double_Tab + +Float_Tab_Delete=delete from Float_Tab + +Real_Tab_Delete=delete from Real_Tab + +Bit_Tab_Delete=delete from Bit_Tab + +Smallint_Tab_Delete=delete from Smallint_Tab + +Tinyint_Tab_Delete=delete from Tinyint_Tab + +Integer_Tab_Delete=delete from Integer_Tab + +Bigint_Tab_Delete=delete from Bigint_Tab + +Char_Tab_Delete=delete from Char_Tab + +Varchar_Tab_Delete=delete from Varchar_Tab + +Longvarchar_Tab_Delete=delete from Longvarchar_Tab + +Longvarcharnull_Tab_Delete=delete from Longvarcharnull_Tab + +Date_Tab_Delete=delete from Date_Tab + +Time_Tab_Delete=delete from Time_Tab + +Timestamp_Tab_Delete=delete from Timestamp_Tab + +Binary_Tab_Delete=delete from Binary_Tab + +Varbinary_Tab_Delete=delete from Varbinary_Tab + +Longvarbinary_Tab_Delete=delete from Longvarbinary_Tab + + + +#**************************************************** +# SQL Statements for inserting values into the tables +#**************************************************** + +Numeric_Tab_Insert=insert into Numeric_Tab values(9999999999,0.000000000000001, null) + +Decimal_Tab_Insert= insert into Decimal_Tab values(9999999999,0.000000000000001, null) + +#Double_Tab_Insert=insert into Double_Tab values(1.7976931348623157E308,4.9E-324,null) +Double_Tab_Insert=insert into Double_Tab values(1.0E125,1.0E-130,null) + +Float_Tab_Insert=insert into Float_Tab values(3.4028235E37,1.4E-45,null) + +Real_Tab_Insert= insert into Real_Tab values(3.402E38,1.4E-37, null) + +Bit_Tab_Insert=insert into Bit_Tab values(true,false,null) + +Smallint_Tab_Insert= insert into Smallint_Tab values(32767,-32768,null) + +Tinyint_Tab_Insert=insert into Tinyint_Tab values(127,0,null) + +Integer_Tab_Insert=insert into Integer_Tab values(2147483647,-2147483648,null) + +Bigint_Tab_Insert= insert into Bigint_Tab values(9223372036854775807,-9223372036854775808,null) + +Char_Tab_Insert= insert into Char_Tab values('Test Coffee', null) + +Varchar_Tab_Insert= insert into Varchar_Tab values('Test Coffee',null) + +Longvarchar_Tab_Insert= insert into Longvarchar_Tab values('Test Coffee') + +Longvarcharnull_Tab_Insert= insert into Longvarcharnull_Tab values(null) + +Date_Tab_Insert=insert into Date_Tab values({d '1999-05-05'}, null) + +Time_Tab_Insert= insert into Time_Tab values({t '12:59:59'}, null) + +Timestamp_Tab_Insert= insert into Timestamp_Tab values({ts '1999-12-31 12:59:59'}, null) + +Binary_Tab_Insert= insert into Binary_Tab values(null) + +Varbinary_Tab_Insert= insert into Varbinary_Tab values(null) + +Longvarbinary_Tab_Insert= insert into Longvarbinary_Tab values(null) + +Boolean_Tab_Insert = insert into Boolean_Tab values(true,false,null) + + +#***************************************************** +# SQL Statements for retrieving values from the tables +#***************************************************** + +SelCoffeeAll=SELECT COF_NAME, PRICE FROM ctstable2 +SelCoffeeNull=select * from ctstable2 where TYPE_ID=0 + +Numeric_Query_Max=Select MAX_VAL from Numeric_Tab +Numeric_Query_Min=Select MIN_VAL from Numeric_Tab +Numeric_Query_Null=Select NULL_VAL from Numeric_Tab + +Decimal_Query_Max=Select MAX_VAL from Decimal_Tab +Decimal_Query_Min=Select MIN_VAL from Decimal_Tab +Decimal_Query_Null=Select NULL_VAL from Decimal_Tab + +Double_Query_Max=Select MAX_VAL from Double_Tab +Double_Query_Min=Select MIN_VAL from Double_Tab +Double_Query_Null=Select NULL_VAL from Double_Tab + +Float_Query_Max=Select MAX_VAL from Float_Tab +Float_Query_Min=Select MIN_VAL from Float_Tab +Float_Query_Null=Select NULL_VAL from Float_Tab + +Real_Query_Max=Select MAX_VAL from Real_Tab +Real_Query_Min=Select MIN_VAL from Real_Tab +Real_Query_Null=Select NULL_VAL from Real_Tab + +Bit_Query_Max=Select MAX_VAL from Bit_Tab +Bit_Query_Min=Select MIN_VAL from Bit_Tab +Bit_Query_Null=Select NULL_VAL from Bit_Tab + +Smallint_Query_Max=Select MAX_VAL from Smallint_Tab +Smallint_Query_Min=Select MIN_VAL from Smallint_Tab +Smallint_Query_Null=Select NULL_VAL from Smallint_Tab + +Tinyint_Query_Max=Select MAX_VAL from Tinyint_Tab +Tinyint_Query_Min=Select MIN_VAL from Tinyint_Tab +Tinyint_Query_Null=Select NULL_VAL from Tinyint_Tab + +Integer_Query_Max=Select MAX_VAL from Integer_Tab +Integer_Query_Min=Select MIN_VAL from Integer_Tab +Integer_Query_Null=Select NULL_VAL from Integer_Tab + +Bigint_Query_Max=Select MAX_VAL from Bigint_Tab +Bigint_Query_Min=Select MIN_VAL from Bigint_Tab +Bigint_Query_Null=Select NULL_VAL from Bigint_Tab + +Char_Query_Name=Select COFFEE_NAME from Char_Tab +Char_Query_Null=Select NULL_VAL from Char_Tab + +Varchar_Query_Name=Select COFFEE_NAME from Varchar_Tab +Varchar_Query_Null=Select NULL_VAL from Varchar_Tab + +Longvarchar_Query_Name=Select COFFEE_NAME from Longvarchar_Tab +Longvarchar_Query_Null=Select NULL_VAL from Longvarcharnull_Tab + +Date_Query_Mfg=Select MFG_DATE from Date_Tab +Date_Query_Null=Select NULL_VAL from Date_Tab + +Time_Query_Brk=Select BRK_TIME from Time_Tab +Time_Query_Null=Select NULL_VAL from Time_Tab + +Timestamp_Query_In=Select IN_TIME from Timestamp_Tab +Timestamp_Query_Null=Select NULL_VAL from Timestamp_Tab + +Binary_Query_Val=Select BINARY_VAL from Binary_Tab +Varbinary_Query_Val=Select VARBINARY_VAL from Varbinary_Tab +Longvarbinary_Query_Val=Select LONGVARBINARY_VAL from Longvarbinary_Tab + + + + + +#*************************************** +# SQL Statements for updating the tables +#*************************************** + +Numeric_Tab_Max_Update=update Numeric_Tab set MAX_VAL=? +Numeric_Tab_Min_Update=update Numeric_Tab set MIN_VAL=? +Numeric_Tab_Null_Update=update Numeric_Tab set NULL_VAL=? + +Decimal_Tab_Max_Update=update Decimal_Tab set MAX_VAL=? +Decimal_Tab_Min_Update=update Decimal_Tab set MIN_VAL=? +Decimal_Tab_Null_Update=update Decimal_Tab set NULL_VAL=? + +Double_Tab_Max_Update=update Double_Tab set MAX_VAL=? +Double_Tab_Min_Update=update Double_Tab set MIN_VAL=? +Double_Tab_Null_Update=update Double_Tab set NULL_VAL=? + +Float_Tab_Max_Update=update Float_Tab set MAX_VAL=? +Float_Tab_Min_Update=update Float_Tab set MIN_VAL=? +Float_Tab_Null_Update=update Float_Tab set NULL_VAL=? + +Real_Tab_Max_Update=update Real_Tab set MAX_VAL=? +Real_Tab_Min_Update=update Real_Tab set MIN_VAL=? +Real_Tab_Null_Update=update Real_Tab set NULL_VAL=? + +Bit_Tab_Max_Update=update Bit_Tab set MAX_VAL=? +Bit_Tab_Min_Update=update Bit_Tab set MIN_VAL=? +Bit_Tab_Null_Update=update Bit_Tab set NULL_VAL=? + +Smallint_Tab_Max_Update=update Smallint_Tab set MAX_VAL=? +Smallint_Tab_Min_Update=update Smallint_Tab set MIN_VAL=? +Smallint_Tab_Null_Update=update Smallint_Tab set NULL_VAL=? + +Tinyint_Tab_Max_Update=update Tinyint_Tab set MAX_VAL=? +Tinyint_Tab_Min_Update=update Tinyint_Tab set MIN_VAL=? +Tinyint_Tab_Null_Update=update Tinyint_Tab set NULL_VAL=? + +Integer_Tab_Max_Update=update Integer_Tab set MAX_VAL=? +Integer_Tab_Min_Update=update Integer_Tab set MIN_VAL=? +Integer_Tab_Null_Update=update Integer_Tab set NULL_VAL=? + +Bigint_Tab_Max_Update=update Bigint_Tab set MAX_VAL=? +Bigint_Tab_Min_Update=update Bigint_Tab set MIN_VAL=? +Bigint_Tab_Null_Update=update Bigint_Tab set NULL_VAL=? + +Char_Tab_Name_Update=update Char_Tab set COFFEE_NAME=? +Char_Tab_Null_Update=update Char_Tab set NULL_VAL=? + +Varchar_Tab_Name_Update=update Varchar_Tab set COFFEE_NAME=? +Varchar_Tab_Null_Update=update Varchar_Tab set NULL_VAL=? + +Longvarchar_Tab_Name_Update=update Longvarchar_Tab set COFFEE_NAME=? +Longvarchar_Tab_Null_Update=update Longvarcharnull_Tab set NULL_VAL=? + +Date_Tab_Mfgdate_Update=update Date_Tab set MFG_DATE=? +Date_Tab_Null_Update=update Date_Tab set NULL_VAL=? + +Time_Tab_Brktime_Update=update Time_Tab set BRK_TIME=? +Time_Tab_Null_Update=update Time_Tab set NULL_VAL=? + +Timestamp_Tab_Intime_Update=update Timestamp_Tab set IN_TIME=? +Timestamp_Tab_Null_Update=update Timestamp_Tab set NULL_VAL=? + +Binary_Tab_Val_Update=update Binary_Tab set BINARY_VAL=? +Varbinary_Tab_Val_Update=update Varbinary_Tab set VARBINARY_VAL=? +Longvarbinary_Tab_Val_Update=update Longvarbinary_Tab set LONGVARBINARY_VAL=? + +CoffeeTab_Query=select COF_NAME,PRICE from ctstable2 where TYPE_ID=? +CoffeeTab_Delete=delete from ctstable2 where KEY_ID=? + +CoffeeTab_Select=select PRICE from ctstable2 where KEY_ID=? +CoffeeTab_Update=update ctstable2 set PRICE=PRICE*20 where TYPE_ID=? + +Ins_Coffee_Tab=insert into ctstable2 values (9,'COFFEE-9',9.0,5) +Del_Coffee_Tab=delete from ctstable2 where KEY_ID=9 +Upd_Coffee_Tab=update ctstable2 set PRICE=PRICE*20 where TYPE_ID=1 +Sel_Coffee_Tab=select PRICE from ctstable2 where KEY_ID>4 + +#********************************************************************************** +# is used in ResultSet. To update with BIT value. +#********************************************************************************** +Update_decimal_tab=update Decimal_Tab set MAX_VAL=1.0, MIN_VAL=0.0, NULL_VAL=null +Update_numeric_tab=update Numeric_Tab set MAX_VAL=1.0, MIN_VAL=0.0, NULL_VAL=null +Update_char_tab1=update Char_Tab set COFFEE_NAME=1, NULL_VAL=null +Update_char_tab2=update Char_Tab set COFFEE_NAME=0, NULL_VAL=null +Update_varchar_tab1=update Varchar_Tab set COFFEE_NAME=1, NULL_VAL=null +Update_varchar_tab2=update Varchar_Tab set COFFEE_NAME=0, NULL_VAL=null + +#********************************************************************************** +# is used in BatchUpdate Tests. +#********************************************************************************** +BatchUpdate_Query=select count(*) from ctstable2 where TYPE_ID=? +BatchUpdate_Delete=delete from ctstable2 +BatchInsert_String=insert into ctstable2 values(?,?,?,?) + +#********************************************************************************** +# is used in BatchUpdate exception +#********************************************************************************** +Coffee_InsTab=insert into ctstable2 values (9,'COFFEE-9',9.0,5) +Coffee_DelTab=delete from ctstable2 where KEY_ID=2 +Coffee_UpdTab=update ctstable2 set PRICE=PRICE*20 where TYPE_ID=1 +Coffee_SelTab=select PRICE from ctstable2 where KEY_ID>4 +Coffee_Inscount_Query=select count(*) from ctstable2 where KEY_ID=9 +Coffee_Delcount_Query=select count(*) from ctstable2 where KEY_ID=2 +Coffee_Updcount_Query=select count(*) from ctstable2 where TYPE_ID=1 +CoffeeTab_Continue1=update ctstable2 set KEY_ID=?, COF_NAME=? where COF_NAME=? +CoffeeTab_ContinueSelect1=Select count(*) from ctstable2 where COF_NAME in ('Continue-1') +CoffeeTab_Continue2=update ctstable2 set KEY_ID=1,COF_NAME = 'Continue-1' where COF_NAME='COFFEE-1' +CoffeeTab_Continue3=update ctstable2 set KEY_ID=1 ,COF_NAME = 'Invalid' where COF_NAME='COFFEE-3' +CoffeeTab_Continue4=update ctstable2 set KEY_ID=2,COF_NAME = 'Continue-3' where COF_NAME='COFFEE-2' +Coffee_Proc1=create procedure Coffee_Proc1(keyid in Numeric) as begin update ctstable2 set KEY_ID=keyid,COF_NAME = 'Continue-1' where KEY_ID=1;end; +Coffee_Proc1_Delete=Drop procedure Coffee_Proc1 +#********************************************************************************** +# is used in DataTruncation exception +#********************************************************************************** +DTrunc_Ins_Coffee=insert into ctstable2 values (10,'kumarjadjsjdhsjhdjsjdajhdjasdsdsdsd',21.00,1) + +#********************************************************************************** +# is used in SQLException +#********************************************************************************** +Error_Query=select * from + +#********************************************************************************** +# Constructor arguments for exceptions +#********************************************************************************** +Reason_BatUpdExec=Message +SQLState_BatUpdExec=S100 +VendorCode_BatUpdExec=10 +IntialValue_BatUpdExec={1,1,1} +Index_DataTrunc=1 +Param_DataTrunc=true +Read_DataTrunc=true +DataSize_DataTrunc=100 +TranSize_DataTrunc=50 + +#********************************************************************************** +# is used to print a message to the current logging writer +#********************************************************************************** +JDBCLogstream_Message=Hello World + + +#********************************************************************************** +#The following pair of values are related and so must be changed simultaneously +#The first one is a reference value and the second one is a equivalent in millisecond after epoch +#********************************************************************************** +DateTime_Str_Val1=1970-01-02 00:00:00.001 +DateTime_Long_Val1=86400001 + +#********************************************************************************** +#The following pair of values are related and so must be changed simultaneously +#The first one is a reference value and the second one is a equivalent in millisecond after epoch +#********************************************************************************** +DateTime_Str_Val2=1969-12-30 23:59:59.999 +DateTime_Long_Val2=-86400001 + +#********************************************************************************** +#value in millisecond for testing after() and before() in Timestamp +#********************************************************************************** +Ref_Milli_Val = 86400000 + +#********************************************************************************** +#Value in nanoseconds for testing time values +#********************************************************************************** +Ref_Nano_Val = 999999999 + + +#********************************************************************************** +#Value in nanoseconds and must be equivalent equivalent to multiples of milliseconds +#********************************************************************************** +Ref_Nano_Val2 = 1000000 + +Trial_String=TrialSetting +Escape_Seq_Query=select count(*) from ctstable2 where cof_name like '\%-%' { escape '\\' } +Escape_Seq_ChkQuery=select count(*) from ctstable2 +Max_Set_Val=10 + + +#********************************************************************************** +#The SQL Statements which are used to test the Scalar functions using escape syntax +#********************************************************************************** +Concat_Fn_Query=SELECT {FN CONCAT(STRING1,STRING2)} FROM ctstable3 +Ascii_Fn_Query=SELECT {FN ASCII(STRING1)} FROM ctstable3 +Insert_Fn_Query=SELECT {FN INSERT(STRING1,2,4,STRING2)} FROM ctstable3 +Lcase_Fn_Query=SELECT {FN LCASE(STRING1)} FROM ctstable3 +Left_Fn_Query=SELECT {FN LEFT(STRING1,2)} FROM ctstable3 +Length_Fn_Query=SELECT {FN LENGTH(STRING1)} FROM ctstable3 +Locate_Fn_Query=SELECT {FN LOCATE(STRING1,STRING2)} FROM ctstable3 +Ltrim_Fn_Query=SELECT {FN LTRIM(STRING2)} FROM ctstable3 +Repeat_Fn_Query=SELECT {FN REPEAT(STRING1,3)} FROM ctstable3 +Right_Fn_Query=SELECT {FN RIGHT(STRING1,3)} FROM ctstable3 +Rtrim_Fn_Query=SELECT {FN RTRIM(STRING2)} FROM ctstable3 +Soundex_Fn_Query=SELECT {FN SOUNDEX(STRING1)} FROM ctstable3 +Space_Fn_Query=SELECT {FN SPACE(5)} FROM ctstable3 +Substring_Fn_Query=SELECT {FN SUBSTR(STRING2,2,3)} FROM ctstable3 +Ucase_Fn_Query=SELECT {FN UCASE(STRING1)} FROM ctstable3 +Char_Fn_Query=SELECT {FN CHAR(NUMCOL)} FROM ctstable3 +Replace_Fn_Query=SELECT {FN REPLACE(STRING2,STRING1,STRING3)} FROM ctstable3 +User_Fn_Query=SELECT {FN USER()} FROM ctstable3 +Ifnull_Fn_Query=SELECT {FN IFNULL(STRING1,100)} FROM ctstable3 +Sin_Fn_Query=SELECT {FN SIN(0)} FROM ctstable3 +Abs_Fn_Query=SELECT {FN ABS(NUMCOL)} FROM ctstable3 +Power_Fn_Query=SELECT {FN POWER(NUMCOL,2)} FROM ctstable3 +Round_Fn_Query=SELECT {FN ROUND(FLOATCOL,2)} FROM ctstable3 +Sign_Fn_Query=SELECT {FN SIGN(NUMCOL)} FROM ctstable3 +Sqrt_Fn_Query=SELECT {FN SQRT(FLOATCOL)} FROM ctstable3 +Truncate_Fn_Query=SELECT {FN TRUNCATE(FLOATCOL,1)} FROM ctstable3 +Mod_Fn_Query=SELECT {FN MOD(NUMCOL,7)} FROM ctstable3 +Floor_Fn_Query=SELECT {FN FLOOR(FLOATCOL)} FROM ctstable3 +Ceiling_Fn_Query=SELECT {FN CEILING(NUMCOL)} FROM ctstable3 +Log10_Fn_Query=SELECT {FN LOG10(NUMCOL)} FROM ctstable3 +Log_Fn_Query=SELECT {FN LOG(NUMCOL)} FROM ctstable3 +Exp_Fn_Query=SELECT {FN EXP(FLOATCOL)} FROM ctstable3 +Cos_Fn_Query=SELECT {FN COS(FLOATCOL)} FROM ctstable3 +Tan_Fn_Query=SELECT {FN TAN(FLOATCOL)} FROM ctstable3 +Cot_Fn_Query=SELECT {FN COT(FLOATCOL)} FROM ctstable3 +Curdate_Fn_Query=SELECT {FN CURDATE()} FROM ctstable3 +Dayname_Fn_Query=SELECT {FN DAYNAME(DATECOL)} FROM ctstable3 +Dayofmonth_Fn_Query=SELECT {FN DAYOFMONTH(DATECOL)} FROM ctstable3 +Dayofweek_Fn_Query=SELECT {FN DAYOFWEEK(DATECOL)} FROM ctstable3 +Dayofyear_Fn_Query=SELECT {FN DAYOFYEAR(DATECOL)} FROM ctstable3 +Week_Fn_Query=SELECT {FN WEEK(DATECOL)} FROM ctstable3 +Month_Fn_Query=SELECT {FN MONTH(DATECOL)} FROM ctstable3 +Year_Fn_Query=SELECT {FN YEAR(DATECOL)} FROM ctstable3 +Monthname_Fn_Query=SELECT {FN MONTHNAME(DATECOL)} FROM ctstable3 +Quarter_Fn_Query=SELECT {FN QUARTER(DATECOL)} FROM ctstable3 +Now_Fn_Query=SELECT {FN NOW()} FROM ctstable3 +Hour_Fn_Query=SELECT {FN HOUR(TIMECOL)} FROM ctstable3 +Minute_Fn_Query=SELECT {FN MINUTE(TIMECOL)} FROM ctstable3 +Second_Fn_Query=SELECT {FN SECOND(TIMECOL)} FROM ctstable3 +Database_Fn_Query=SELECT {FN DATABASE()} FROM ctstable3 +Acos_Fn_Query=SELECT {FN ACOS(FLOATCOL)} FROM ctstable3 +Asin_Fn_Query=SELECT {FN ASIN(FLOATCOL)} FROM ctstable3 +Atan_Fn_Query=SELECT {FN ATAN(FLOATCOL)} FROM ctstable3 +Atan2_Fn_Query=SELECT {FN ATAN2(FLOATCOL,FLOATCOL)} FROM ctstable3 +Degrees_Fn_Query=SELECT {FN DEGREES(NUMCOL)} FROM ctstable3 +Radians_Fn_Query=SELECT {FN RADIANS(NUMCOL)} FROM ctstable3 +Pi_Fn_Query=SELECT {FN PI()} FROM ctstable3 +Rand_Fn_Query=SELECT {FN RAND(NUMCOL)} FROM ctstable3 +Difference_Fn_Query=SELECT {FN DIFFERENCE(STRING1,STRING2)} FROM ctstable3 +Locate_Fn_Query=SELECT {FN LOCATE(STRING1,STRING2,2)} FROM ctstable3 +Timestampaddfrac_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_FRAC_SECOND,2,TSCOL1)} FROM ctstable3 +Timestampaddsecond_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_SECOND,2,TSCOL1)} FROM ctstable3 +Timestampaddminute_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_MINUTE,2,TSCOL1)} FROM ctstable3 +Timestampaddhour_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_HOUR,2,TSCOL1)} FROM ctstable3 +Timestampaddday_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_DAY,2,TSCOL1)} FROM ctstable3 +Timestampaddweek_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_WEEK,2,TSCOL1)} FROM ctstable3 +Timestampaddmonth_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_MONTH,2,TSCOL1)} FROM ctstable3 +Timestampaddquarter_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_QUARTER,2,TSCOL1)} FROM ctstable3 +Timestampaddyear_Fn_Query=SELECT {FN TIMESTAMPADD(SQL_TSI_YEAR,2,TSCOL1)} FROM ctstable3 +Timestampdifffrac_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_FRAC_SECOND,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffsecond_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_SECOND,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffminute_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_MINUTE,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffhour_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_HOUR,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffday_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_DAY,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffweek_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_WEEK,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffmonth_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_MONTH,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffquarter_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_QUARTER,TSCOL1,TSCOL2)} FROM ctstable3 +Timestampdiffyear_Fn_Query=SELECT {FN TIMESTAMPDIFF(SQL_TSI_YEAR,TSCOL1,TSCOL2)} FROM ctstable3 + + +#***************************************************************************** +#The SQL Statements which are used to test the Outer Joins using escape syntax +#***************************************************************************** +Left_Oj_Query=SELECT * FROM {OJ ctstable3 LEFT OUTER JOIN ctstable4 ON ctstable3.NUMCOL=ctstable4.NUMCOL} +Right_Oj_Query=SELECT * FROM {OJ ctstable3 RIGHT OUTER JOIN ctstable4 ON ctstable3.NUMCOL=ctstable4.NUMCOL} +Full_Oj_Query=SELECT * FROM {OJ ctstable3 FULL OUTER JOIN ctstable4 ON ctstable3.NUMCOL=ctstable4.NUMCOL} + + +#***************************************************************************** +#The SQL Statements for creating, inserting and dropping the tables which are +#used in testing the scalar functions and outer joins using escape syntax +#***************************************************************************** + +Fnschema_Tab1_Insert=INSERT INTO ctstable3 VALUES ('Java',' HotJava ','JAVA',100,0.5,{d '1993-07-13'},{t '10:30:55'},{ts '1996-05-10 10:07:04'},{ts '1996-05-10 10:07:05'}) +Fnschema_Tab2_Insert=INSERT INTO ctstable4 VALUES ('STRING3',100) + +Fnschema_Tab1_Delete=delete from ctstable3 +Fnschema_Tab2_Delete=delete from ctstable4 + +#***************************************************************************** +#The SQL Statements which are used in TxBean (Session bean) +#***************************************************************************** +TxBean_insert1=insert into TxBean_Tab1 values(?, ?, ?) +TxBean_insert2=insert into TxBean_Tab2 values(?, ?, ?) + +TxBean_delete1=delete from TxBean_Tab1 where KEY_ID = ? +TxBean_delete2=delete from TxBean_Tab2 where KEY_ID = ? + +TxBean_update1=update TxBean_Tab1 set TABONE_NAME = ? where KEY_ID = ? +TxBean_update2=update TxBean_Tab2 set TABTWO_NAME = ? where KEY_ID = ? +TxBean_update3=update TxBean_Tab1 set PRICE = ? where KEY_ID = ? +TxBean_update4=update TxBean_Tab2 set PRICE = ? where KEY_ID = ? + +TxBean_query1=select * from TxBean_Tab1 +TxBean_query2=select * from TxBean_Tab2 +TxBean_query3=select KEY_ID, TABONE_NAME, PRICE from TxBean_Tab1 where KEY_ID = ? +TxBean_query4=select KEY_ID, TABTWO_NAME, PRICE from TxBean_Tab2 where KEY_ID = ? + + +TxBean_Tab1_Delete=delete from TxBean_Tab1 +TxBean_Tab2_Delete=delete from TxBean_Tab2 + +#***************************************************************************** +#The SQL Statements which are used in TxEBean (Entity bean) +#***************************************************************************** +TxEBean_updateString1=insert into TxEBean_Tab values(?, ?, ?) +TxEBean_updateString2=delete from TxEBean_Tab where KEY_ID = ? +TxEBean_updateString3=update TxEBean_Tab set BRAND_NAME = ?, PRICE = ? where KEY_ID = ? + +TxEBean_selectString1=select KEY_ID from TxEBean_Tab where KEY_ID = ? +TxEBean_selectString2=select KEY_ID from TxEBean_Tab where BRAND_NAME = ? +TxEBean_selectString3=select KEY_ID from TxEBean_Tab where PRICE = ? +TxEBean_selectString4=select KEY_ID, BRAND_NAME, PRICE from TxEBean_Tab where KEY_ID = ? +TxEBean_selectString5=select BRAND_NAME from TxEBean_Tab where KEY_ID = ? +TxEBean_selectString6=select PRICE from TxEBean_Tab where KEY_ID = ? + +TxEBean_queryStr1=select KEY_ID from TxEBean_Tab where KEY_ID = ? + +TxEBean_Delete=delete from TxEBean_Tab + +#***************************************************************************** +#The SQL Statements which are used in the integration/session and +#integration/entity tests +#***************************************************************************** +Integration_Tab_Delete=delete from Integration_Tab +Integration_Insert=insert into Integration_Tab values(?, ?) +Integration_Insert1=insert into Integration_Tab values(1000, 50000.0) +Integration_Insert2=insert into Integration_Tab values(1075, 10490.75) +Integration_Insert3=insert into Integration_Tab values(40, 200.50) +Integration_Insert4=insert into Integration_Tab values(30564, 25000.0) +Integration_Insert5=insert into Integration_Tab values(387, 1000000.0) +Integration_Select_Account=select * from Integration_Tab WHERE ACCOUNT = ? +Integration_Select_All=select * from Integration_Tab +Integration_Update_Account=update Integration_Tab set BALANCE = ? where ACCOUNT = ? +Integration_Delete_Account=delete from Integration_Tab where ACCOUNT = ? + +#***************************************************************************** +#The SQL Statements which are used in the integration/sec tests +#***************************************************************************** +Integration_Sec_Tab_Delete=delete from Integration_Sec_Tab +Integration_Sec_Tab_Insert=insert into Integration_Sec_Tab values(?, ?, ?) +Integration_Sec_Tab_Delete1=delete from Integration_Sec_Tab WHERE LOG_NO=? +Integration_Sec_Tab_Delete2=delete FROM Integration_Sec_Tab where LOG_NO=? and not ( LINE_NO = ? ) +Integration_Sec_Tab_Update=update Integration_Sec_Tab set MESSAGE= ? where LOG_NO = ? and LINE_NO = ? +Integration_Sec_Tab_Select1=select MESSAGE, LINE_NO from Integration_Sec_Tab where LOG_NO = ? and not( LINE_NO= ? ) order by LINE_NO +Integration_Sec_Tab_Select2=select MESSAGE FROM Integration_Sec_Tab where LOG_NO = ? and LINE_NO = ? +Integration_Sec_Tab_Select3=select MAX(LOG_NO) FROM Integration_Sec_Tab +Integration_Sec_Tab_Select4=select LOG_NO from Integration_Sec_Tab where MESSAGE = ? and LINE_NO = ? +Integration_Sec_Tab_Select5=select LINE_NO from Integration_Sec_Tab where LOG_NO = ? and LINE_NO= ? + + +#***************************************************************************** +#The SQL Statements which are used in DBSupport used by ejb/ee/bb tests +#***************************************************************************** +BB_Tab_Delete=delete from BB_Tab +BB_Insert1=insert into BB_Tab values(?, ?, ?) +BB_Select1=select KEY_ID from BB_Tab where KEY_ID = ? +BB_Select2=select KEY_ID from BB_Tab where BRAND_NAME = ? +BB_Select3=select KEY_ID from BB_Tab where PRICE = ? +BB_Select4=select KEY_ID from BB_Tab where PRICE >= ? and PRICE <= ? +BB_Select5=select KEY_ID from BB_Tab where KEY_ID >= ? and KEY_ID <= ? +BB_Select6=select PRICE from BB_Tab where KEY_ID = ? +BB_Update1=update BB_Tab set PRICE = ? where KEY_ID = ? +BB_Delete1=delete from BB_Tab where KEY_ID = ? + +#***************************************************************************** +#The SQL Statements which are used in DAO by ejb/ee/bb tests +#***************************************************************************** +COFFEE_BB_Tab_Delete=delete from BB_Tab +COFFEE_BB_Insert1=insert into BB_Tab values(?, ?, ?) +COFFEE_BB_Select1=select KEY_ID from BB_Tab where KEY_ID = ? +COFFEE_BB_Select2=select KEY_ID from BB_Tab where BRAND_NAME = ? +COFFEE_BB_Select3=select KEY_ID from BB_Tab where PRICE = ? +COFFEE_BB_Select4=select KEY_ID from BB_Tab where PRICE >= ? and PRICE <= ? +COFFEE_BB_Select5=select KEY_ID from BB_Tab where KEY_ID >= ? and KEY_ID <= ? +COFFEE_BB_Select6=select PRICE from BB_Tab where KEY_ID = ? +COFFEE_BB_Update1=update BB_Tab set PRICE = ? where KEY_ID = ? +COFFEE_BB_Delete1=delete from BB_Tab where KEY_ID = ? + +#***************************************************************************** +#The SQL Statements which are used in DBSupport in jta/ee/txpropagationtest +#***************************************************************************** +JTA_Tab1_Delete=delete from JTA_Tab1 +JTA_Tab2_Delete=delete from JTA_Tab2 + +JTA_Tab1_Insert=insert into JTA_Tab1 values(?, ?, ?) +JTA_Tab2_Insert=insert into JTA_Tab2 values(?, ?, ?) + +JTA_Delete1=delete from JTA_Tab1 where KEY_ID = ? +JTA_Delete2=delete from JTA_Tab2 where KEY_ID = ? + +JTA_Tab1_Update1=update JTA_Tab1 set COF_NAME = ? where KEY_ID = ? +JTA_Tab2_Update1=update JTA_Tab2 set CHOC_NAME = ? where KEY_ID = ? + +JTA_Tab1_Update2=update JTA_Tab1 set PRICE = ? where KEY_ID = ? +JTA_Tab2_Update2=update JTA_Tab2 set PRICE = ? where KEY_ID = ? + +JTA_Tab1_Select=select * from JTA_Tab1 +JTA_Tab2_Select=select * from JTA_Tab2 + +JTA_Tab1_Select1=select KEY_ID, COF_NAME, PRICE FROM JTA_Tab1 where KEY_ID = ? +JTA_Tab2_Select1=select KEY_ID, CHOC_NAME, PRICE FROM JTA_Tab2 where KEY_ID = ? + + +#***************************************************************************** +# SQL Statements used by deployment tests +# +# See /tests/assembly/util/dbsupport for more details +# +#***************************************************************************** + +# +# BMP table with Integer Primary Key +# +DEPLOY_intPKTable_Insert=insert into Deploy_Tab1 values(?, ?, ?) +DEPLOY_intPKTable_Select_PK=select KEY_ID from Deploy_Tab1 where KEY_ID = ? +DEPLOY_intPKTable_Select_Price=select PRICE from Deploy_Tab1 where KEY_ID = ? +DEPLOY_intPKTable_Update=update Deploy_Tab1 set PRICE = ? where KEY_ID = ? +DEPLOY_intPKTable_Delete=delete from Deploy_Tab1 where KEY_ID = ? +DEPLOY_intPKTable_Cleanup=delete from Deploy_Tab1 + +# +# BMP table with String Primary Key +# +DEPLOY_strPKTable_Insert=insert into Deploy_Tab2 values(?, ?, ?) +DEPLOY_strPKTable_Select_PK=select KEY_ID from Deploy_Tab2 where KEY_ID = ? +DEPLOY_strPKTable_Select_Price=select PRICE from Deploy_Tab2 where KEY_ID = ? +DEPLOY_strPKTable_Update=update Deploy_Tab2 set PRICE = ? where KEY_ID = ? +DEPLOY_strPKTable_Delete=delete from Deploy_Tab2 where KEY_ID = ? +DEPLOY_strPKTable_Cleanup=delete from Deploy_Tab2 + +# +# BMP table with Long Primary Key +# +DEPLOY_longPKTable_Insert=insert into Deploy_Tab3 values(?, ?, ?) +DEPLOY_longPKTable_Select_PK=select KEY_ID from Deploy_Tab3 where KEY_ID = ? +DEPLOY_longPKTable_Select_Price=select PRICE from Deploy_Tab3 where KEY_ID = ? +DEPLOY_longPKTable_Update=update Deploy_Tab3 set PRICE = ? where KEY_ID = ? +DEPLOY_longPKTable_Delete=delete from Deploy_Tab3 where KEY_ID = ? +DEPLOY_longPKTable_Cleanup=delete from Deploy_Tab3 + +# +# BMP table with Float Primary Key +# +DEPLOY_floatPKTable_Insert=insert into Deploy_Tab4 values(?, ?, ?) +DEPLOY_floatPKTable_Select_PK=select KEY_ID from Deploy_Tab4 where KEY_ID = ? +DEPLOY_floatPKTable_Select_Price=select PRICE from Deploy_Tab4 where KEY_ID = ? +DEPLOY_floatPKTable_Update=update Deploy_Tab4 set PRICE = ? where KEY_ID = ? +DEPLOY_floatPKTable_Delete=delete from Deploy_Tab4 where KEY_ID = ? +DEPLOY_floatPKTable_Cleanup=delete from Deploy_Tab4 + +# +# BMP table with Compound Primary Key +# +DEPLOY_compoundPKTable_Insert=insert into Deploy_Tab5 values(?, ?, ?, ?, ?) +DEPLOY_compoundPKTable_Select_PK=select KEY_ID1, KEY_ID2, KEY_ID3 from Deploy_Tab5 where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +DEPLOY_compoundPKTable_Select_Price=select PRICE from Deploy_Tab5 where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +DEPLOY_compoundPKTable_Update=update Deploy_Tab5 set PRICE = ? where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +DEPLOY_compoundPKTable_Delete=delete from Deploy_Tab5 where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +DEPLOY_compoundPKTable_Cleanup=delete from Deploy_Tab5 + +#***************************************************************************** +#The SQL Statements which are used in DBSupport2 used by secpropagation tests +#***************************************************************************** +SEC_Insert1=insert into SEC_Tab1 values(?, ?, ?) +SEC_Select1=select KEY_ID from SEC_Tab1 where KEY_ID = ? +SEC_Select2=select KEY_ID from SEC_Tab1 where BRAND = ? +SEC_Select3=select KEY_ID from SEC_Tab1 where PRICE = ? +SEC_Select4=select KEY_ID from SEC_Tab1 where PRICE >= ? and PRICE <= ? +SEC_Select5=select KEY_ID from SEC_Tab1 where KEY_ID >= ? and KEY_ID <= ? +SEC_Select6=select PRICE from SEC_Tab1 where KEY_ID = ? +SEC_Update1=update SEC_Tab1 set PRICE = ? where KEY_ID = ? +SEC_Delete1=delete from SEC_Tab1 where KEY_ID = ? +SEC_Tab1_Delete=delete from SEC_Tab1 + +#***************************************************************************** +# Connector tests in src/tests/connector +#***************************************************************************** +ConnectorTable_Insert=insert into Connector_Tab values(?, ?, ?) +ConnectorTable_Delete=delete from Connector_Tab + +#***************************************************************************** +# insert values EIS +#***************************************************************************** +TSEIS_insert_init=1 +TSEIS_insert1=2 +TSEIS_insert2=3 + +#***************************************************************************** +#The SQL Statements which are used in xa multires tests +#***************************************************************************** + +Xa_Tab1_Select=select * from Xa_Tab1 + +# insert values +Xa_Tab1_Insert=insert into Xa_Tab1 values(?, ?, ?) + +# delete using id +Xa_Tab1_Delete1=delete from Xa_Tab1 where col1 = ? + +Xa_Tab1_Delete=delete from Xa_Tab1 +Xa_Tab2_Delete=delete from Xa_Tab2 + +#initial insert +Xa_Tab1_insert_init=insert into Xa_Tab1 values (1, 'Table1 Line one ', '1.0' ) +Xa_Tab2_insert_init=insert into Xa_Tab2 values (1, 'Table2 Line one ', '2.0' ) + +#subsequent insert +Xa_Tab1_insert1=insert into Xa_Tab1 values (2, 'Table1 Line two ', '11.0' ) +Xa_Tab1_insert2=insert into Xa_Tab1 values (3, 'Table1 Line three ','111.0' ) + +Xa_Tab2_insert1=insert into Xa_Tab2 values (2, 'Table2 Line two ', '22.0' ) +Xa_Tab2_insert2=insert into Xa_Tab2 values (3, 'Table2 Line three ', '222.0' ) + +#get results + +Xa_Tab1_query=select col1 from Xa_Tab1 order by col1 +Xa_Tab2_query=select col1 from Xa_Tab2 order by col1 + + + +#***************************************************************************** +# Coffee DAO SQL statements +#***************************************************************************** + +# +# Standard Coffee DAO +# +COFFEE_insert=insert into Coffee_Table values(?, ?, ?) +COFFEE_select=select BRAND_NAME, PRICE from Coffee_Table where KEY_ID = ? +COFFEE_select_pk_by_name=select KEY_ID from Coffee_Table where BRAND_NAME = ? +COFFEE_select_pk_by_price=select KEY_ID from Coffee_Table where PRICE = ? +COFFEE_select_pk_by_price_range=select KEY_ID from Coffee_Table where PRICE >= ? and PRICE <= ? +COFFEE_select_pk_by_pk_range=select KEY_ID from Coffee_Table where KEY_ID >= ? and KEY_ID <= ? +COFFEE_select_price=select PRICE from Coffee_Table where KEY_ID = ? +COFFEE_update=update Coffee_Table set BRAND_NAME = ?, PRICE = ? where KEY_ID = ? +COFFEE_update_price=update Coffee_Table set PRICE = ? where KEY_ID = ? +COFFEE_delete=delete from Coffee_Table where KEY_ID = ? +COFFEE_delete_all=delete from Coffee_Table + + +# +# Coffee DAO variant with String Primary Key +# +COFFEE_STRING_PK_insert=insert into Coffee_StringPK_Table values(?, ?, ?) +COFFEE_STRING_PK_select=select KEY_ID from Coffee_StringPK_Table where KEY_ID = ? +COFFEE_STRING_PK_select_price=select PRICE from Coffee_StringPK_Table where KEY_ID = ? +COFFEE_STRING_PK_update_price=update Coffee_StringPK_Table set PRICE = ? where KEY_ID = ? +COFFEE_STRING_PK_delete=delete from Coffee_StringPK_Table where KEY_ID = ? +COFFEE_STRING_PK_delete_all=delete from Coffee_StringPK_Table + +# +# Coffee DAO variant with Long Primary Key +# +COFFEE_LONG_PK_insert=insert into Coffee_LongPK_Table values(?, ?, ?) +COFFEE_LONG_PK_select=select KEY_ID from Coffee_LongPK_Table where KEY_ID = ? +COFFEE_LONG_PK_select_price=select PRICE from Coffee_LongPK_Table where KEY_ID = ? +COFFEE_LONG_PK_update_price=update Coffee_LongPK_Table set PRICE = ? where KEY_ID = ? +COFFEE_LONG_PK_delete=delete from Coffee_LongPK_Table where KEY_ID = ? +COFFEE_LONG_PK_delete_all=delete from Coffee_LongPK_Table + +# +# Coffee DAO variant with Float Primary Key +# +COFFEE_FLOAT_PK_insert=insert into Coffee_FloatPK_Table values(?, ?, ?) +COFFEE_FLOAT_PK_select=select KEY_ID from Coffee_FloatPK_Table where KEY_ID = ? +COFFEE_FLOAT_PK_select_price=select PRICE from Coffee_FloatPK_Table where KEY_ID = ? +COFFEE_FLOAT_PK_update_price=update Coffee_FloatPK_Table set PRICE = ? where KEY_ID = ? +COFFEE_FLOAT_PK_delete=delete from Coffee_FloatPK_Table where KEY_ID = ? +COFFEE_FLOAT_PK_delete_all=delete from Coffee_FloatPK_Table + +# +# Coffee DAO variant with Compound Primary Key +# +COFFEE_COMPOUND_PK_insert=insert into Coffee_CompoundPK_Table values(?, ?, ?, ?, ?) +COFFEE_COMPOUND_PK_select=select KEY_ID1, KEY_ID2, KEY_ID3 from Coffee_CompoundPK_Table where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +COFFEE_COMPOUND_PK_select_price=select PRICE from Coffee_CompoundPK_Table where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +COFFEE_COMPOUND_PK_update_price=update Coffee_CompoundPK_Table set PRICE = ? where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +COFFEE_COMPOUND_PK_delete=delete from Coffee_CompoundPK_Table where KEY_ID1 = ? and KEY_ID2 = ? and KEY_ID3 = ? +COFFEE_COMPOUND_PK_delete_all=delete from Coffee_CompoundPK_Table + + diff --git a/glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishLoadableExtension.java b/glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishLoadableExtension.java new file mode 100644 index 0000000000..21c10c8358 --- /dev/null +++ b/glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishLoadableExtension.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.transactions.core.tck; + +import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; +import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; +import org.jboss.arquillian.core.spi.LoadableExtension; + +public class GlassfishLoadableExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder extensionBuilder) { + extensionBuilder.service(ResourceProvider.class, GlassfishTestArchiveProcessor.class); + extensionBuilder.observer(GlassfishTestArchiveProcessor.class); + + } +} diff --git a/glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishTestArchiveProcessor.java b/glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishTestArchiveProcessor.java new file mode 100644 index 0000000000..7cad005c89 --- /dev/null +++ b/glassfish-runner/jta-platform-tck/src/main/java/org/glassfish/transactions/core/tck/GlassfishTestArchiveProcessor.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.transactions.core.tck; + +import org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor; +import org.jboss.arquillian.config.descriptor.api.ExtensionDef; +import org.jboss.arquillian.core.api.annotation.Observes; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.container.ManifestContainer; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import tck.arquillian.porting.lib.spi.AbstractTestArchiveProcessor; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.logging.Logger; + +public class GlassfishTestArchiveProcessor extends AbstractTestArchiveProcessor { + + static Logger log = Logger.getLogger(GlassfishTestArchiveProcessor.class.getName()); + static HashSet sunXmlFiles = new HashSet(); + static { + sunXmlFiles.add("META-INF/sun-application-client.xml"); + sunXmlFiles.add("META-INF/sun-application.xml"); + sunXmlFiles.add("META-INF/sun-ra.xml"); + sunXmlFiles.add("WEB-INF/sun-web.xml"); + sunXmlFiles.add("META-INF/sun-ejb-jar.xml"); + } + + private Path descriptorDirRoot; + + /** + * Called on completion of the Arquillian configuration. + */ + public void initalize(@Observes ArquillianDescriptor descriptor) { + // Must call to setup the ResourceProvider + super.initalize(descriptor); + + + // Get the descriptor path + ExtensionDef descriptorsDef = descriptor.extension("glassfish-descriptors"); + String descriptorDir = descriptorsDef.getExtensionProperties().get("descriptorDir"); + if(descriptorDir == null) { + String msg = "Specify the descriptorDir property in arquillian.xml as extension:\n"+ + "\n" + + " path-to-descriptors-dir\n" + + ""; + throw new IllegalStateException(msg); + } + this.descriptorDirRoot = Paths.get(descriptorDir); + if(!Files.exists(this.descriptorDirRoot)) { + throw new RuntimeException("Descriptor directory does not exist: " + this.descriptorDirRoot); + } + } + + @Override + public void processClientArchive(JavaArchive clientArchive, Class testClass, URL sunXmlURL) { + String name = clientArchive.getName(); + addDescriptors(name, clientArchive, testClass); + } + + @Override + public void processWebArchive(WebArchive webArchive, Class testClass, URL sunXmlURL) { + String name = webArchive.getName(); + addDescriptors(name, webArchive, testClass); + } + + @Override + public void processRarArchive(JavaArchive warArchive, Class testClass, URL sunXmlURL) { + + } + + @Override + public void processParArchive(JavaArchive javaArchive, Class aClass, URL url) { + + } + + @Override + public void processEarArchive(EnterpriseArchive earArchive, Class testClass, URL sunXmlURL) { + String name = earArchive.getName(); + addDescriptors(name, earArchive, testClass); + } + + @Override + public void processEjbArchive(JavaArchive ejbArchive, Class testClass, URL sunXmlURL) { + String name = ejbArchive.getName(); + addDescriptors(name, ejbArchive, testClass); + } + + protected void addDescriptors(String archiveName, ManifestContainer archive, Class testClass) { + String pkgName = testClass.getPackageName(); + Path pkgPath = Paths.get(pkgName.replace(".", "/")); + Path descriptorDir = descriptorDirRoot.resolve(pkgPath); + List files = findGlassfishDescriptors(descriptorDir); + for (File f : files) { + String name = f.getName(); + if(!name.startsWith(archiveName)) { + continue; + } + try { + URL url = f.toURL(); + // stateful_migration_threetwo_annotated.ear.jboss-deployment-structure.xml -> jboss-deployment-structure.xml + String descriptorName = name.replace(archiveName+".", ""); + if(archive instanceof WebArchive webArchive) { + webArchive.addAsWebInfResource(url, descriptorName); + } else { + archive.addAsManifestResource(url, descriptorName); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + } + + protected List findGlassfishDescriptors(Path pkgPath) { + try { + List files = Files.walk(pkgPath, 1) + .map(Path::toFile) + .filter(File::isFile) + .toList(); + return files; + } catch (Exception e) { + } + return Collections.emptyList(); + } +} diff --git a/glassfish-runner/jta-platform-tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/glassfish-runner/jta-platform-tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 0000000000..a3e9fc312a --- /dev/null +++ b/glassfish-runner/jta-platform-tck/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1 @@ +org.glassfish.transactions.core.tck.GlassfishLoadableExtension \ No newline at end of file diff --git a/glassfish-runner/jta-platform-tck/src/test/resources/appclient-arquillian.xml b/glassfish-runner/jta-platform-tck/src/test/resources/appclient-arquillian.xml new file mode 100644 index 0000000000..2f4d5a265f --- /dev/null +++ b/glassfish-runner/jta-platform-tck/src/test/resources/appclient-arquillian.xml @@ -0,0 +1,36 @@ + + + + + target/deployments + + + + ${ts.home}/dist/ + + + + + + target/glassfish8 + + + true + true + target/appclient + + + + CLASSPATH=${project.build.directory}/appclient/javatest.jar:${project.build.directory}/appclient/libutil.jar:${project.build.directory}/appclient/libcommon.jar + ${project.basedir} + ${ts.home}/tmp + ${ts.home}/bin/ts.jte + true + 20000 + + + + + \ No newline at end of file diff --git a/glassfish-runner/jta-platform-tck/src/test/resources/arquillian.xml b/glassfish-runner/jta-platform-tck/src/test/resources/arquillian.xml new file mode 100644 index 0000000000..ac726a0e1b --- /dev/null +++ b/glassfish-runner/jta-platform-tck/src/test/resources/arquillian.xml @@ -0,0 +1,29 @@ + + + + + target/ + + + + ${ts.home}/dist/ + + + + + + target/glassfish8 + + + true + /tmp + ${ts.home}/bin/ts.jte + sql/derby/derby.dml.sql + + + + + + \ No newline at end of file diff --git a/jta/pom.xml b/jta/pom.xml index d1cad91381..a124ef7d85 100644 --- a/jta/pom.xml +++ b/jta/pom.xml @@ -26,12 +26,31 @@ 11.0.0-SNAPSHOT - jta + jta-tck jar jta jta + + 1.9.1.Final + 11.0.0-M2 + 5.10.2 + 1.0.0-M16 + + + + + + org.junit + junit-bom + ${junit.jupiter.version} + pom + import + + + + ${project.groupId} @@ -65,21 +84,52 @@ jakarta.enterprise jakarta.enterprise.cdi-api + + jakarta.tck.arquillian + arquillian-protocol-appclient + ${version.jakarta.tck.arquillian} + + + jakarta.tck.arquillian + arquillian-protocol-common + ${version.jakarta.tck.arquillian} + + + jakarta.tck.arquillian + arquillian-protocol-javatest + ${version.jakarta.tck.arquillian} + + + jakarta.tck.arquillian + arquillian-protocol-lib + ${version.jakarta.tck.arquillian} + + + jakarta.tck.arquillian + tck-porting-lib + ${version.jakarta.tck.arquillian} + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + + + org.jboss.arquillian.junit + arquillian-junit-core + ${arquillian.junit} + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + + + org.jboss.arquillian.junit5 + arquillian-junit5-core + - - - - - src/main/java - - **/*.xml - - - **/build.xml - - - + diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/common/InitFailedException.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/InitFailedException.java new file mode 100644 index 0000000000..4130ae0ea4 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/InitFailedException.java @@ -0,0 +1,13 @@ +package com.sun.ts.tests.jta.ee.common; + +public class InitFailedException extends Exception { + + InitFailedException() { + super(); + } + + InitFailedException(String msg) { + super(msg); + } + }// End of InitFailedException + diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/common/InvalidStatusException.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/InvalidStatusException.java new file mode 100644 index 0000000000..d5841f0b23 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/InvalidStatusException.java @@ -0,0 +1,12 @@ +package com.sun.ts.tests.jta.ee.common; + +public class InvalidStatusException extends Exception { + InvalidStatusException() { + super(); + } + + InvalidStatusException(String msg) { + super(msg); + } + }// End of InvalidStatusException + diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/common/Transact.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/Transact.java index bf14fa6259..9e8c6fa71d 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/common/Transact.java +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/Transact.java @@ -25,12 +25,6 @@ import com.sun.ts.lib.util.TSNamingContext; import com.sun.ts.lib.util.TestUtil; -interface TransactionStatus { - public static final String[] transStatusArray = { "STATUS_ACTIVE", - "STATUS_MARKED_ROLLBACK", "STATUS_PREPARED", "STATUS_COMMITED", - "STATUS_ROLLBACK", "STATUS_UNKNOWN", "STATUS_NO_TRANSACTION", - "STATUS_PREPARING", "STATUS_COMMITTING", "STATUS_ROLLING_BACK" }; -}// End of TransactionStatus public class Transact extends ServiceEETest implements TransactionStatus { public static TSNamingContext nctx = null; @@ -75,23 +69,3 @@ public static void free() { } }// End of Transact -class InvalidStatusException extends Exception { - InvalidStatusException() { - super(); - } - - InvalidStatusException(String msg) { - super(msg); - } -}// End of InvalidStatusException - -class InitFailedException extends Exception { - - InitFailedException() { - super(); - } - - InitFailedException(String msg) { - super(msg); - } -}// End of InitFailedException diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/common/TransactionStatus.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/TransactionStatus.java new file mode 100644 index 0000000000..368df25e52 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/common/TransactionStatus.java @@ -0,0 +1,9 @@ +package com.sun.ts.tests.jta.ee.common; + +public interface TransactionStatus { + public static final String[] transStatusArray = { "STATUS_ACTIVE", + "STATUS_MARKED_ROLLBACK", "STATUS_PREPARED", "STATUS_COMMITED", + "STATUS_ROLLBACK", "STATUS_UNKNOWN", "STATUS_NO_TRANSACTION", + "STATUS_PREPARING", "STATUS_COMMITTING", "STATUS_ROLLING_BACK" }; + +} diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejsfTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejsfTest.java new file mode 100644 index 0000000000..adfcf9a83b --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejsfTest.java @@ -0,0 +1,1129 @@ +package com.sun.ts.tests.jta.ee.transactional; + +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; + +import com.sun.ts.tests.ejb30.common.lite.EJBLiteJsfClientBase; +import jakarta.annotation.Resource; +import jakarta.enterprise.context.ContextNotActiveException; +import jakarta.inject.Inject; +import jakarta.interceptor.Interceptor; +import jakarta.transaction.InvalidTransactionException; +import jakarta.transaction.Status; +import jakarta.transaction.SystemException; +import jakarta.transaction.TransactionRequiredException; +import jakarta.transaction.TransactionalException; +import jakarta.transaction.UserTransaction; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") +@jakarta.inject.Named("client") +@jakarta.enterprise.context.RequestScoped +public class ClientEjblitejsfTest extends EJBLiteJsfClientBase implements Serializable { + + static final String VEHICLE_ARCHIVE = "transactional_ejblitejsf_vehicle"; + + private static final Logger logger = System.getLogger(ClientEjblitejsfTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + private static final long serialVersionUID = 1L; + private static StringBuilder callRecords = new StringBuilder(); + + @Inject + @OneManagedQualifier + OneManagedBean one; + + @Inject + TransactionScopedBean tscopedBean; + + @Resource(lookup = "java:comp/UserTransaction") + private UserTransaction ut; + + public static void main(String[] args) { + ClientEjblitejsfTest theTests = new ClientEjblitejsfTest(); + com.sun.ts.lib.harness.Status s = theTests.run(args, System.out, System.err); + s.exit(); + } + + @Inject + @TwoManagedQualifier + TwoManagedBean two; + + /** + EE10 Deployment Descriptors: + transactional_ejblitejsf_vehicle_web: WEB-INF/beans.xml,WEB-INF/faces-config.xml,WEB-INF/web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/common/vehicle/ejblitejsf/ejblitejsf_vehicle_web.xml + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static WebArchive createDeploymentVehicle() { + // public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + + // War + // the war with the correct archive name + WebArchive transactional_ejblitejsf_vehicle_web = ShrinkWrap.create(WebArchive.class, "transactional_ejblitejsf_vehicle_web.war"); + // The class files + transactional_ejblitejsf_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.EJBLiteClientIF.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.ReasonableStatus.class, + com.sun.ts.tests.ejb30.common.helper.Helper.class, + com.sun.ts.tests.ejb30.common.lite.NumberEnum.class, + com.sun.ts.tests.ejb30.common.lite.EJBLiteJsfClientBase.class, + com.sun.ts.tests.ejb30.common.lite.NumberIF.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedBean.class, + com.sun.ts.tests.jta.ee.transactional.CTSRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.TransactionScopedBean.class, + com.sun.ts.tests.jta.ee.transactional.Helper.class, + com.sun.ts.tests.jta.ee.transactional.CTSDontRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedBean.class, + HttpServletDelegate.class, + ClientEjblitejsfTest.class + ); + // The web.xml descriptor + URL warResURL = ClientEjblitejsfTest.class.getResource("/vehicle/ejblitejsf/ejblitejsf_vehicle_web.xml"); + if(warResURL != null) { + transactional_ejblitejsf_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // The sun-web.xml descriptor + warResURL = ClientEjblitejsfTest.class.getResource("/vehicle/ejblitejsf/faces-config.xml"); + if(warResURL != null) { + transactional_ejblitejsf_vehicle_web.addAsWebInfResource(warResURL, "faces-config.xml"); + } + + warResURL = ClientEjblitejsfTest.class.getResource("/vehicle/ejblitejsf/beans.xml"); + if(warResURL != null) { + transactional_ejblitejsf_vehicle_web.addAsWebInfResource(warResURL, "beans.xml"); + } + + // Web content + warResURL = ClientEjblitejsfTest.class.getResource("/vehicle/ejblitejsf/ejblitejsf_vehicle.xhtml"); + transactional_ejblitejsf_vehicle_web.addAsWebResource(warResURL, "/ejblitejsf_vehicle.xhtml"); + + return transactional_ejblitejsf_vehicle_web; + } + + /* + * @testName: txTypeRequired_withoutTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeRequired_withoutTransaction() throws Exception { + + Helper.assertEquals("\n", "txTypeRequired called successfully", + one.txTypeRequired(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("txTypeRequired called successfully", + one.txTypeRequired())); + + } + + /* + * @testName: txTypeRequired_withTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeRequired_withTransaction() throws Exception { + try { + ut.begin(); + Helper.assertEquals(null, "txTypeRequired called successfully", + one.txTypeRequired(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("txTypeRequired called successfully", + one.txTypeRequired())); + ut.commit(); + } catch (Exception e) { + Helper.getLogger().log(Level.INFO, null, e); + throw new Exception("txTypeRequired_withTransaction failed"); + } + } + + /* + * @testName: txTypeRequired_IllegalStateException + * + * @test_Strategy: If an attempt is made to call any method of the + * UserTransaction interface from within a bean or method annotated with + * + * @Transactional and a Transactional.TxType other than NOT_SUPPORTED or + * NEVER, an IllegalStateException must be thrown. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeRequired_IllegalStateException() throws Exception { + + Helper.assertEquals(null, "IllegalStateException", + one.txTypeRequiredIllegalStateException(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("IllegalStateException", + one.txTypeRequiredIllegalStateException())); + + } + + /* + * @testName: txTypeRequiresNew + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeRequiresNew() throws Exception { + + Helper.assertEquals(null, "txTypeRequiresNew called successfully", + one.txTypeRequiresNew(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("txTypeRequiresNew called successfully", + one.txTypeRequiresNew())); + + } + + /* + * @testName: txTypeRequiresNew_withTransaction + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeRequiresNew_withTransaction() throws Exception { + try { + ut.begin(); + Helper.assertEquals(null, "txTypeRequiresNew called successfully", + one.txTypeRequiresNew(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("txTypeRequiresNew called successfully", + one.txTypeRequiresNew())); + ut.commit(); + } catch (Exception e) { + Helper.getLogger().log(Level.INFO, null, e); + throw new Exception("txTypeRequiresNew_withTransaction failed"); + } + } + + /* + * @testName: txTypeMandatory_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeMandatory_withoutTransaction() throws Exception { + String result = "TransactionalException not received"; + + try { + Helper.getLogger().info( + "Invoking OneManagedBean.txTypeManadatory() without a transaction Context"); + one.txTypeMandatory(); + } catch (TransactionalException te) { + if (te.getCause() instanceof TransactionRequiredException) { + result = "Received expected TransactionalException with nested TransactionRequiredException"; + } else { + throw new Exception( + "Received TransactionalException without nested TransactionRequiredExecption"); + } + + } catch (Exception e) { + e.printStackTrace(); + result = "Received unexcepted Exception :" + e.getMessage(); + } + + if (result.equals( + "Received expected TransactionalException with nested TransactionRequiredException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason( + "Received expected TransactionalException with nested TransactionRequiredException"); + } else { + throw new Exception(result); + } + + } + + /* + * @testName: txTypeMandatory_withTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeMandatory_withTransaction() throws Exception { + try { + ut.begin(); + Helper.assertEquals(null, "txTypeMandatory called successfully", + one.txTypeMandatory(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("txTypeMandatory called successfully", + one.txTypeMandatory())); + ut.commit(); + } catch (Exception e) { + Helper.getLogger().log(Level.INFO, null, e); + throw new Exception("txTypeRequiresNew_withTransaction failed"); + } + } + + /* + * @testName: txTypeSupports_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeSupports_withoutTransaction() throws Exception { + + Helper.assertEquals(null, "txTypeSupports run without active transaction", + one.txTypeSupportsWithoutTransaction(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason( + Helper.compareResult("txTypeSupports run without active transaction", + one.txTypeSupportsWithoutTransaction())); + + } + + /* + * @testName: txTypeSupports_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeSupports_withTransaction() throws Exception { + try { + ut.begin(); + Helper.assertEquals(null, "txTypeSupports called successfully", + one.txTypeSupports(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult("txTypeSupports called successfully", + one.txTypeSupports())); + ut.commit(); + } catch (Exception e) { + Helper.getLogger().log(Level.INFO, null, e); + throw new Exception("txTypeSupports failed"); + } + } + + /* + * @testName: txTypeNotSupported_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeNotSupported_withoutTransaction() throws Exception { + + Helper.assertEquals(null, + "txTypeNotSupported run without active transaction", + one.txTypeNotSupported(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult( + "txTypeNotSupported run without active transaction", + one.txTypeNotSupported())); + + } + + /* + * @testName: txTypeNotSupported_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeNotSupported_withTransaction() throws Exception { + try { + ut.begin(); + Helper.assertEquals(null, + "txTypeNotSupported run without active transaction", + one.txTypeNotSupported(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult( + "txTypeNotSupported run without active transaction", + one.txTypeNotSupported())); + ut.commit(); + } catch (Exception e) { + Helper.getLogger().log(Level.INFO, null, e); + throw new Exception("txTypeSupports failed"); + } + } + + /* + * @testName: txTypeNever_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeNever_withoutTransaction() throws Exception { + Helper.assertEquals(null, "txTypeNever run without active transaction", + one.txTypeNever(), callRecords); + // Helper.getLogger().info(callRecords.toString()); + appendReason(Helper.compareResult( + "txTypeNever run without active transaction", one.txTypeNever())); + + } + + /* + * @testName: txTypeNever_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @TargetVehicle("ejblitejsf") + public void txTypeNever_withTransaction() throws Exception { + String result = "Expected TransactionalException not received"; + + try { + Helper.getLogger().info( + "Invoking OneManagedBean.txTypeNever() with a transaction Context"); + ut.begin(); + one.txTypeNever(); + ut.commit(); + } catch (TransactionalException te) { + + if (te.getCause() instanceof InvalidTransactionException) { + result = "Received expected TransactionalException with nested InvalidTransactionException"; + } else { + throw new Exception( + "Received expected TransactionalException without nested InvalidTransactionException"); + } + + } catch (Exception e) { + e.printStackTrace(); + result = "Received unexcepted Exception :" + e.getMessage(); + } + + if (result.equals( + "Received expected TransactionalException with nested InvalidTransactionException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason( + "Received expected TransactionalException with nested InvalidTransactionException"); + } else { + throw new Exception(result); + } + } + + /* + * @testName: rollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @TargetVehicle("ejblitejsf") + public void rollbackOnException() throws Exception { + String result = "failed to set STATUS_MARKED_ROLLBACK on CTSRollbackException"; + int status; + + try { + ut.begin(); + if (ut.getStatus() == Status.STATUS_ACTIVE) { + Helper.getLogger() + .info("Current Transaction Status is = " + ut.getStatus()); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_ACTIVE = " + + Status.STATUS_ACTIVE); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_NO_TRANSACTION = " + + Status.STATUS_NO_TRANSACTION); + Helper.getLogger().info( + "Transaction Status value for Status.STATUS_MARKED_ROLLBACK = " + + Status.STATUS_MARKED_ROLLBACK); + Helper.getLogger().info("Calling one.rollbackOnException()"); + one.rollbackOnException(); + } + + } catch (CTSRollbackException ce) { + Helper.getLogger().info("Received Expected CTSRollbackException"); + try { + + if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { + result = "Transaction STATUS_MARKED_ROLLBACK on CTSRollbackException"; + } else { + result = "Transaction Status is set to : " + ut.getStatus(); + + } + } catch (SystemException se) { + result = "failed to get transaction status"; + } + + } catch (Exception e) { + result = "Received unexpected exception :" + e.getClass(); + } + + if (result + .equals("Transaction STATUS_MARKED_ROLLBACK on CTSRollbackException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + appendReason(result); + throw new Exception(result); + } + + } + + /* + * @testName: rollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void rollbackOnExceptionTwo() throws Exception { + String result = "failed to set STATUS_MARKED_ROLLBACK on CTSRollbackException"; + int status; + + try { + ut.begin(); + if (ut.getStatus() == Status.STATUS_ACTIVE) { + Helper.getLogger() + .info("Current Transaction Status is = " + ut.getStatus()); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_ACTIVE = " + + Status.STATUS_ACTIVE); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_NO_TRANSACTION = " + + Status.STATUS_NO_TRANSACTION); + Helper.getLogger().info( + "Transaction Status value for Status.STATUS_MARKED_ROLLBACK = " + + Status.STATUS_MARKED_ROLLBACK); + Helper.getLogger().info("Calling one.rollbackOnException()"); + two.rollbackOnException(); + } + + } catch (CTSRollbackException ce) { + Helper.getLogger().info("Received Expected CTSRollbackException"); + try { + + if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { + result = "Transaction STATUS_MARKED_ROLLBACK on CTSRollbackException"; + } else { + result = "Transaction Status is set to : " + ut.getStatus(); + + } + } catch (SystemException se) { + result = "failed to get transaction status"; + } + + } catch (Exception e) { + result = "Received unexpected exception :" + e.getClass(); + } + + if (result + .equals("Transaction STATUS_MARKED_ROLLBACK on CTSRollbackException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + appendReason(result); + throw new Exception(result); + } + + } + + /* + * @testName: dontRollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @TargetVehicle("ejblitejsf") + public void dontRollbackOnException() throws Exception { + String result = ""; + int status; + + try { + ut.begin(); + if (ut.getStatus() == Status.STATUS_ACTIVE) { + Helper.getLogger() + .info("Current Transaction Status is = " + ut.getStatus()); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_ACTIVE = " + + Status.STATUS_ACTIVE); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_NO_TRANSACTION = " + + Status.STATUS_NO_TRANSACTION); + Helper.getLogger().info( + "Transaction Status value for Status.STATUS_MARKED_ROLLBACK = " + + Status.STATUS_MARKED_ROLLBACK); + Helper.getLogger().info("Calling one.dontRollbackOnException()"); + one.dontRollbackOnException(); + } + + } catch (CTSDontRollbackException ce) { + Helper.getLogger().info("Received Expected CTSDontRollbackException"); + try { + + if (ut.getStatus() == Status.STATUS_ACTIVE) { + result = "Transaction Status not changed on CTSDontRollbackException"; + } else { + result = "Transaction Status is set to : " + ut.getStatus(); + + } + } catch (SystemException se) { + result = "failed to get transaction status"; + } + + } catch (Exception e) { + result = "Received unexpected exception :" + e.getClass(); + e.printStackTrace(); + } + + if (result + .equals("Transaction Status not changed on CTSDontRollbackException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + appendReason(result); + throw new Exception(result); + } + + } + + /* + * @testName: dontRollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void dontRollbackOnExceptionTwo() throws Exception { + String result = ""; + int status; + + try { + ut.begin(); + if (ut.getStatus() == Status.STATUS_ACTIVE) { + Helper.getLogger() + .info("Current Transaction Status is = " + ut.getStatus()); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_ACTIVE = " + + Status.STATUS_ACTIVE); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_NO_TRANSACTION = " + + Status.STATUS_NO_TRANSACTION); + Helper.getLogger().info( + "Transaction Status value for Status.STATUS_MARKED_ROLLBACK = " + + Status.STATUS_MARKED_ROLLBACK); + Helper.getLogger().info("Calling two.dontRollbackOnException()"); + two.dontRollbackOnException(); + } + + } catch (CTSDontRollbackException ce) { + Helper.getLogger().info("Received Expected CTSDontRollbackException"); + try { + + if (ut.getStatus() == Status.STATUS_ACTIVE) { + result = "Transaction Status not changed on CTSDontRollbackException"; + } else { + result = "Transaction Status is set to : " + ut.getStatus(); + + } + } catch (SystemException se) { + result = "failed to get transaction status"; + } + + } catch (Exception e) { + result = "Received unexpected exception :" + e.getClass(); + e.printStackTrace(); + } + + if (result + .equals("Transaction Status not changed on CTSDontRollbackException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + appendReason(result); + throw new Exception(result); + } + + } + + /* + * @testName: rollbackAndDontRollback + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + */ + @Test + @TargetVehicle("ejblitejsf") + public void rollbackAndDontRollback() throws Exception { + String result = ""; + int status; + + try { + ut.begin(); + if (ut.getStatus() == Status.STATUS_ACTIVE) { + Helper.getLogger() + .info("Current Transaction Status is = " + ut.getStatus()); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_ACTIVE = " + + Status.STATUS_ACTIVE); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_NO_TRANSACTION = " + + Status.STATUS_NO_TRANSACTION); + Helper.getLogger().info( + "Transaction Status value for Status.STATUS_MARKED_ROLLBACK = " + + Status.STATUS_MARKED_ROLLBACK); + Helper.getLogger().info("Calling one.rollbackAndDontRollback()"); + one.rollbackAndDontRollback(); + } + + } catch (CTSRollbackException ce) { + Helper.getLogger().info("Received Expected CTSRollbackException"); + try { + + if (ut.getStatus() == Status.STATUS_ACTIVE) { + result = "Transaction Status not changed on CTSRollbackException"; + } else { + result = "Transaction Status is set to : " + ut.getStatus(); + + } + } catch (SystemException se) { + result = "failed to get transaction status"; + } + + } catch (Exception e) { + result = "Received unexpected exception :" + e.getClass(); + } + + if (result + .equals("Transaction Status not changed on CTSRollbackException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + appendReason(result); + throw new Exception(result); + } + + } + + /* + * @testName: rollbackAndDontRollbackTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void rollbackAndDontRollbackTwo() throws Exception { + String result = ""; + int status; + + try { + ut.begin(); + if (ut.getStatus() == Status.STATUS_ACTIVE) { + Helper.getLogger() + .info("Current Transaction Status is = " + ut.getStatus()); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_ACTIVE = " + + Status.STATUS_ACTIVE); + Helper.getLogger() + .info("Transaction Status value for Status.STATUS_NO_TRANSACTION = " + + Status.STATUS_NO_TRANSACTION); + Helper.getLogger().info( + "Transaction Status value for Status.STATUS_MARKED_ROLLBACK = " + + Status.STATUS_MARKED_ROLLBACK); + Helper.getLogger().info("Calling two.rollbackAndDontRollback()"); + two.rollbackAndDontRollback(); + } + + } catch (CTSRollbackException ce) { + Helper.getLogger().info("Received Expected CTSRollbackException"); + try { + + if (ut.getStatus() == Status.STATUS_ACTIVE) { + result = "Transaction Status not changed on CTSRollbackException"; + } else { + result = "Transaction Status is set to : " + ut.getStatus(); + + } + } catch (SystemException se) { + result = "failed to get transaction status"; + } + + } catch (Exception e) { + result = "Received unexpected exception :" + e.getClass(); + } + + if (result + .equals("Transaction Status not changed on CTSRollbackException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + appendReason(result); + throw new Exception(result); + } + + } + + /* + * @testName: transactionScopedBean_withoutTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void transactionScopedBean_withoutTransaction() throws Exception { + + String result = "ContextNotActiveException not received"; + + try { + Helper.getLogger().info( + "Invoking TransactionScopedBean.test() without a transaction Context"); + tscopedBean.test(); + } catch (ContextNotActiveException te) { + result = "Received expected ContextNotActiveException"; + + } catch (Exception e) { + result = "Received unexcepted Exception :" + e.getClass(); + e.printStackTrace(); + } + + if (result.equals("Received expected ContextNotActiveException")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + throw new Exception(result); + } + } + + /* + * @testName: transactionScopedBean_withTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + */ + @Test + @TargetVehicle("ejblitejsf") + public void transactionScopedBean_withTransaction() throws Exception { + + String result = ""; + + try { + ut.begin(); + Helper.getLogger().info( + "Invoking TransactionScopedBean.test() with a transaction Context"); + result = tscopedBean.test(); + ut.commit(); + } catch (Exception e) { + result = "Received unexcepted Exception :" + e.getClass(); + e.printStackTrace(); + } + + if (result + .equals("TransactionScopedBean.test called with active transaction")) { + Helper.getLogger().log(Level.INFO, result); + appendReason(result); + } else { + throw new Exception(result); + } + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequired + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void getInterceptorPriorityForTxTypeRequired() throws Exception { + String methodName = "txTypeRequired"; + List priorityList = one.getPriority(methodName); + verifyInterceptorPriority(priorityList, "TxType.REQUIRED"); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequiresNew + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void getInterceptorPriorityForTxTypeRequiresNew() throws Exception { + String methodName = "txTypeRequiresNew"; + List priorityList = one.getPriority(methodName); + verifyInterceptorPriority(priorityList, "TxType.REQUIRES_NEW"); + } + + /* + * @testName: getInterceptorPriorityForTxTypeMandatory + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void getInterceptorPriorityForTxTypeMandatory() throws Exception { + String methodName = "txTypeMandatory"; + List priorityList = one.getPriority(methodName); + verifyInterceptorPriority(priorityList, "TxType.MANDATORY"); + } + + /* + * @testName: getInterceptorPriorityForTxTypeSupports + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void getInterceptorPriorityForTxTypeSupports() throws Exception { + String methodName = "txTypeSupports"; + List priorityList = one.getPriority(methodName); + verifyInterceptorPriority(priorityList, "TxType.SUPPORTS"); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNotSupported + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void getInterceptorPriorityForTxTypeNotSupported() throws Exception { + String methodName = "txTypeNotSupported"; + List priorityList = one.getPriority(methodName); + verifyInterceptorPriority(priorityList, "TxType.NOT_SUPPORTED"); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNever + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @TargetVehicle("ejblitejsf") + public void getInterceptorPriorityForTxTypeNever() throws Exception { + String methodName = "txTypeNever"; + List priorityList = one.getPriority(methodName); + verifyInterceptorPriority(priorityList, "TxType.NEVER"); + + } + + private void verifyInterceptorPriority(List priorityList, + String txType) throws Exception { + String result = null; + if (priorityList.contains(Interceptor.Priority.PLATFORM_BEFORE + 200)) { + Helper.getLogger().log(Level.INFO, "Transactional Interceptor for " + + txType + " has right interceptor priority"); + result = "Transactional Interceptor for " + txType + + " has right interceptor priority"; + } else { + throw new Exception("Transactional Interceptor for " + txType + + " has incorrect interceptor priority : " + + Arrays.toString(priorityList.toArray()) + " Excpected value is :" + + Interceptor.Priority.PLATFORM_BEFORE + 200); + } + + if (result != null) + appendReason(result); + + } + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejspTest.java new file mode 100644 index 0000000000..2e295dc764 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjblitejspTest.java @@ -0,0 +1,641 @@ +package com.sun.ts.tests.jta.ee.transactional; + +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; + +import com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase; + +import jakarta.annotation.Resource; +import jakarta.enterprise.context.ContextNotActiveException; +import jakarta.inject.Inject; +import jakarta.interceptor.Interceptor; +import jakarta.transaction.InvalidTransactionException; +import jakarta.transaction.Status; +import jakarta.transaction.SystemException; +import jakarta.transaction.TransactionRequiredException; +import jakarta.transaction.TransactionalException; +import jakarta.transaction.UserTransaction; + +import java.lang.System.Logger; + + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") +public class ClientEjblitejspTest extends com.sun.ts.tests.jta.ee.transactional.Client { + static final String VEHICLE_ARCHIVE = "transactional_ejblitejsp_vehicle"; + + private static final Logger logger = System.getLogger(ClientEjblitejspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static WebArchive createDeploymentVehicle() { + // War + // the war with the correct archive name + WebArchive transactional_ejblitejsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "transactional_ejblitejsp_vehicle_web.war"); + // The class files + transactional_ejblitejsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.EJBLiteClientIF.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.ReasonableStatus.class, + com.sun.ts.tests.ejb30.common.lite.NumberEnum.class, + com.sun.ts.tests.ejb30.common.helper.Helper.class, + com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.class, + com.sun.ts.tests.ejb30.common.lite.NumberIF.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedBean.class, + com.sun.ts.tests.jta.ee.transactional.CTSRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.TransactionScopedBean.class, + com.sun.ts.tests.jta.ee.transactional.Helper.class, + com.sun.ts.tests.jta.ee.transactional.CTSDontRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.EJBLiteJSPTag.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedBean.class, + HttpServletDelegate.class, + com.sun.ts.tests.jta.ee.transactional.Client.class, + ClientEjblitejspTest.class + ); + // The web.xml descriptor + URL warResURL = ClientEjblitejspTest.class.getResource("/vehicle/ejblitejsp/ejblitejsp_vehicle.jsp"); + if(warResURL != null) { + transactional_ejblitejsp_vehicle_web.addAsWebResource(warResURL, "ejblitejsp_vehicle.jsp"); + } + + warResURL = ClientEjblitejspTest.class.getResource("/vehicle/ejblitejsp/ejblitejsp.tld"); + if(warResURL != null) { + transactional_ejblitejsp_vehicle_web.addAsWebInfResource(warResURL, "tlds/ejblitejsp.tld"); + } + + warResURL = ClientEjblitejspTest.class.getResource("/vehicle/ejblitejsp/beans.xml"); + if(warResURL != null) { + transactional_ejblitejsp_vehicle_web.addAsWebInfResource(warResURL, "beans.xml"); + } + + return transactional_ejblitejsp_vehicle_web; + } + + + /* + * @testName: txTypeRequired_withoutTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeRequired_withoutTransaction() throws Exception { + super.txTypeRequired_withoutTransaction(); + } + + /* + * @testName: txTypeRequired_withTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeRequired_withTransaction() throws Exception { + super.txTypeRequired_withTransaction(); + } + + /* + * @testName: txTypeRequired_IllegalStateException + * + * @test_Strategy: If an attempt is made to call any method of the + * UserTransaction interface from within a bean or method annotated with + * + * @Transactional and a Transactional.TxType other than NOT_SUPPORTED or + * NEVER, an IllegalStateException must be thrown. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeRequired_IllegalStateException() throws Exception { + super.txTypeRequired_IllegalStateException(); + } + + /* + * @testName: txTypeRequiresNew + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeRequiresNew() throws Exception { + super.txTypeRequiresNew(); + + } + + /* + * @testName: txTypeRequiresNew_withTransaction + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeRequiresNew_withTransaction() throws Exception { + super.txTypeRequiresNew_withTransaction(); + } + + /* + * @testName: txTypeMandatory_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeMandatory_withoutTransaction() throws Exception { + super.txTypeMandatory_withoutTransaction(); + + } + + /* + * @testName: txTypeMandatory_withTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeMandatory_withTransaction() throws Exception { + super.txTypeMandatory_withTransaction(); + } + + /* + * @testName: txTypeSupports_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeSupports_withoutTransaction() throws Exception { + super.txTypeSupports_withoutTransaction(); + } + + /* + * @testName: txTypeSupports_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeSupports_withTransaction() throws Exception { + super.txTypeSupports_withTransaction(); + } + + /* + * @testName: txTypeNotSupported_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeNotSupported_withoutTransaction() throws Exception { + super.txTypeNotSupported_withoutTransaction(); + } + + /* + * @testName: txTypeNotSupported_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeNotSupported_withTransaction() throws Exception { + super.txTypeNotSupported_withTransaction(); + } + + /* + * @testName: txTypeNever_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeNever_withoutTransaction() throws Exception { + super.txTypeNever_withoutTransaction(); + } + + /* + * @testName: txTypeNever_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void txTypeNever_withTransaction() throws Exception { + super.txTypeNever_withTransaction(); + } + + /* + * @testName: rollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void rollbackOnException() throws Exception { + super.rollbackOnException(); + + } + + /* + * @testName: rollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void rollbackOnExceptionTwo() throws Exception { + super.rollbackOnExceptionTwo(); + + } + + /* + * @testName: dontRollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void dontRollbackOnException() throws Exception { + super.dontRollbackOnException(); + + } + + /* + * @testName: dontRollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void dontRollbackOnExceptionTwo() throws Exception { + super.dontRollbackOnExceptionTwo(); + + } + + /* + * @testName: rollbackAndDontRollback + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void rollbackAndDontRollback() throws Exception { + super.rollbackAndDontRollback(); + + } + + /* + * @testName: rollbackAndDontRollbackTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void rollbackAndDontRollbackTwo() throws Exception { + super.rollbackAndDontRollbackTwo(); + + } + + /* + * @testName: transactionScopedBean_withoutTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void transactionScopedBean_withoutTransaction() throws Exception { + super.transactionScopedBean_withoutTransaction(); + } + + /* + * @testName: transactionScopedBean_withTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void transactionScopedBean_withTransaction() throws Exception { + super.transactionScopedBean_withTransaction(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequired + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void getInterceptorPriorityForTxTypeRequired() throws Exception { + super.getInterceptorPriorityForTxTypeRequired(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequiresNew + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void getInterceptorPriorityForTxTypeRequiresNew() throws Exception { + super.getInterceptorPriorityForTxTypeRequiresNew(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeMandatory + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void getInterceptorPriorityForTxTypeMandatory() throws Exception { + super.getInterceptorPriorityForTxTypeMandatory(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeSupports + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void getInterceptorPriorityForTxTypeSupports() throws Exception { + super.getInterceptorPriorityForTxTypeSupports(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNotSupported + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void getInterceptorPriorityForTxTypeNotSupported() throws Exception { + super.getInterceptorPriorityForTxTypeNotSupported(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNever + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejblitejsp") + public void getInterceptorPriorityForTxTypeNever() throws Exception { + super.getInterceptorPriorityForTxTypeNever(); + + } + + private void verifyInterceptorPriority(List priorityList, + String txType) throws Exception { + String result = null; + if (priorityList.contains(Interceptor.Priority.PLATFORM_BEFORE + 200)) { + Helper.getLogger().log(Level.INFO, "Transactional Interceptor for " + + txType + " has right interceptor priority"); + result = "Transactional Interceptor for " + txType + + " has right interceptor priority"; + } else { + throw new Exception("Transactional Interceptor for " + txType + + " has incorrect interceptor priority : " + + Arrays.toString(priorityList.toArray()) + " Excpected value is :" + + Interceptor.Priority.PLATFORM_BEFORE + 200); + } + + if (result != null) + appendReason(result); + + } + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservlet2Test.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservlet2Test.java new file mode 100644 index 0000000000..e31f6d3c04 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservlet2Test.java @@ -0,0 +1,639 @@ +package com.sun.ts.tests.jta.ee.transactional; + +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; + +import com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase; + +import jakarta.annotation.Resource; +import jakarta.enterprise.context.ContextNotActiveException; +import jakarta.inject.Inject; +import jakarta.interceptor.Interceptor; +import jakarta.transaction.InvalidTransactionException; +import jakarta.transaction.Status; +import jakarta.transaction.SystemException; +import jakarta.transaction.TransactionRequiredException; +import jakarta.transaction.TransactionalException; +import jakarta.transaction.UserTransaction; + +import java.lang.System.Logger; + + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") +public class ClientEjbliteservlet2Test extends com.sun.ts.tests.jta.ee.transactional.Client { + static final String VEHICLE_ARCHIVE = "transactional_ejbliteservlet2_vehicle"; + + private static final Logger logger = System.getLogger(ClientEjbliteservlet2Test.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static WebArchive createDeploymentVehicle() { + // War + // the war with the correct archive name + WebArchive transactional_ejbliteservlet2_vehicle_web = ShrinkWrap.create(WebArchive.class, "transactional_ejbliteservlet2_vehicle_web.war"); + transactional_ejbliteservlet2_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.EJBLiteClientIF.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.ReasonableStatus.class, + com.sun.ts.tests.ejb30.common.lite.NumberEnum.class, + com.sun.ts.tests.ejb30.common.helper.Helper.class, + com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.class, + com.sun.ts.tests.ejb30.common.lite.NumberIF.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedBean.class, + com.sun.ts.tests.jta.ee.transactional.CTSRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.TransactionScopedBean.class, + com.sun.ts.tests.jta.ee.transactional.Helper.class, + com.sun.ts.tests.jta.ee.transactional.CTSDontRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedBean.class, + com.sun.ts.tests.jta.ee.transactional.EJBLiteServlet2Filter.class, + com.sun.ts.tests.jta.ee.transactional.HttpServletDelegate.class, + com.sun.ts.tests.jta.ee.transactional.Client.class, + ClientEjbliteservlet2Test.class + ); + // The web.xml descriptor + URL warResURL = ClientEjbliteservlet2Test.class.getResource("/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle_web.xml"); + if(warResURL != null) { + transactional_ejbliteservlet2_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + + warResURL = ClientEjbliteservlet2Test.class.getResource("/vehicle/ejbliteservlet2/beans.xml"); + if(warResURL != null) { + transactional_ejbliteservlet2_vehicle_web.addAsWebInfResource(warResURL, "beans.xml"); + } + + warResURL = ClientEjbliteservlet2Test.class.getResource("/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle.jsp"); + if(warResURL != null) { + transactional_ejbliteservlet2_vehicle_web.addAsWebResource(warResURL, "/ejbliteservlet2_vehicle.jsp"); + } + + return transactional_ejbliteservlet2_vehicle_web; + } + + + /* + * @testName: txTypeRequired_withoutTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeRequired_withoutTransaction() throws Exception { + super.txTypeRequired_withoutTransaction(); + } + + /* + * @testName: txTypeRequired_withTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeRequired_withTransaction() throws Exception { + super.txTypeRequired_withTransaction(); + } + + /* + * @testName: txTypeRequired_IllegalStateException + * + * @test_Strategy: If an attempt is made to call any method of the + * UserTransaction interface from within a bean or method annotated with + * + * @Transactional and a Transactional.TxType other than NOT_SUPPORTED or + * NEVER, an IllegalStateException must be thrown. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeRequired_IllegalStateException() throws Exception { + super.txTypeRequired_IllegalStateException(); + } + + /* + * @testName: txTypeRequiresNew + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeRequiresNew() throws Exception { + super.txTypeRequiresNew(); + + } + + /* + * @testName: txTypeRequiresNew_withTransaction + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeRequiresNew_withTransaction() throws Exception { + super.txTypeRequiresNew_withTransaction(); + } + + /* + * @testName: txTypeMandatory_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeMandatory_withoutTransaction() throws Exception { + super.txTypeMandatory_withoutTransaction(); + } + + /* + * @testName: txTypeMandatory_withTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeMandatory_withTransaction() throws Exception { + super.txTypeMandatory_withTransaction(); + } + + /* + * @testName: txTypeSupports_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeSupports_withoutTransaction() throws Exception { + super.txTypeSupports_withoutTransaction(); + } + + /* + * @testName: txTypeSupports_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeSupports_withTransaction() throws Exception { + super.txTypeSupports_withTransaction(); + } + + /* + * @testName: txTypeNotSupported_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeNotSupported_withoutTransaction() throws Exception { + super.txTypeNotSupported_withoutTransaction(); + + } + + /* + * @testName: txTypeNotSupported_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeNotSupported_withTransaction() throws Exception { + super.txTypeNotSupported_withTransaction(); + } + + /* + * @testName: txTypeNever_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeNever_withoutTransaction() throws Exception { + super.txTypeNever_withoutTransaction(); + } + + /* + * @testName: txTypeNever_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void txTypeNever_withTransaction() throws Exception { + super.txTypeNever_withTransaction(); + } + + /* + * @testName: rollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void rollbackOnException() throws Exception { + super.rollbackOnException(); + + } + + /* + * @testName: rollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void rollbackOnExceptionTwo() throws Exception { + super.rollbackOnExceptionTwo(); + + } + + /* + * @testName: dontRollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void dontRollbackOnException() throws Exception { + super.dontRollbackOnException(); + } + + /* + * @testName: dontRollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void dontRollbackOnExceptionTwo() throws Exception { + super.dontRollbackOnExceptionTwo(); + + } + + /* + * @testName: rollbackAndDontRollback + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void rollbackAndDontRollback() throws Exception { + super.rollbackAndDontRollback(); + + } + + /* + * @testName: rollbackAndDontRollbackTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void rollbackAndDontRollbackTwo() throws Exception { + super.rollbackAndDontRollbackTwo(); + + } + + /* + * @testName: transactionScopedBean_withoutTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void transactionScopedBean_withoutTransaction() throws Exception { + super.transactionScopedBean_withoutTransaction(); + } + + /* + * @testName: transactionScopedBean_withTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void transactionScopedBean_withTransaction() throws Exception { + super.transactionScopedBean_withTransaction(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequired + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void getInterceptorPriorityForTxTypeRequired() throws Exception { + super.getInterceptorPriorityForTxTypeRequired(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequiresNew + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void getInterceptorPriorityForTxTypeRequiresNew() throws Exception { + super.getInterceptorPriorityForTxTypeRequiresNew(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeMandatory + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void getInterceptorPriorityForTxTypeMandatory() throws Exception { + super.getInterceptorPriorityForTxTypeMandatory(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeSupports + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void getInterceptorPriorityForTxTypeSupports() throws Exception { + super.getInterceptorPriorityForTxTypeSupports(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNotSupported + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void getInterceptorPriorityForTxTypeNotSupported() throws Exception { + super.getInterceptorPriorityForTxTypeNotSupported(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNever + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet2") + public void getInterceptorPriorityForTxTypeNever() throws Exception { + super.getInterceptorPriorityForTxTypeNever(); + + } + + private void verifyInterceptorPriority(List priorityList, + String txType) throws Exception { + String result = null; + if (priorityList.contains(Interceptor.Priority.PLATFORM_BEFORE + 200)) { + Helper.getLogger().log(Level.INFO, "Transactional Interceptor for " + + txType + " has right interceptor priority"); + result = "Transactional Interceptor for " + txType + + " has right interceptor priority"; + } else { + throw new Exception("Transactional Interceptor for " + txType + + " has incorrect interceptor priority : " + + Arrays.toString(priorityList.toArray()) + " Excpected value is :" + + Interceptor.Priority.PLATFORM_BEFORE + 200); + } + + if (result != null) + appendReason(result); + + } + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservletTest.java new file mode 100644 index 0000000000..d6039a672e --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/ClientEjbliteservletTest.java @@ -0,0 +1,633 @@ +package com.sun.ts.tests.jta.ee.transactional; + +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; + +import com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase; + +import jakarta.annotation.Resource; +import jakarta.enterprise.context.ContextNotActiveException; +import jakarta.inject.Inject; +import jakarta.interceptor.Interceptor; +import jakarta.transaction.InvalidTransactionException; +import jakarta.transaction.Status; +import jakarta.transaction.SystemException; +import jakarta.transaction.TransactionRequiredException; +import jakarta.transaction.TransactionalException; +import jakarta.transaction.UserTransaction; + +import java.lang.System.Logger; + + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") +public class ClientEjbliteservletTest extends com.sun.ts.tests.jta.ee.transactional.Client { + static final String VEHICLE_ARCHIVE = "transactional_ejbliteservlet_vehicle"; + + private static final Logger logger = System.getLogger(ClientEjbliteservletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static WebArchive createDeploymentVehicle() { + // War + // the war with the correct archive name + WebArchive transactional_ejbliteservlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "transactional_ejbliteservlet_vehicle_web.war"); + // The class files + transactional_ejbliteservlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.EJBLiteClientIF.class, + com.sun.ts.tests.common.vehicle.ejbliteshare.ReasonableStatus.class, + com.sun.ts.tests.ejb30.common.lite.NumberEnum.class, + com.sun.ts.tests.ejb30.common.helper.Helper.class, + com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.class, + com.sun.ts.tests.ejb30.common.lite.NumberIF.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedQualifier.class, + com.sun.ts.tests.jta.ee.transactional.TwoManagedBean.class, + com.sun.ts.tests.jta.ee.transactional.CTSRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.TransactionScopedBean.class, + com.sun.ts.tests.jta.ee.transactional.Helper.class, + com.sun.ts.tests.jta.ee.transactional.CTSDontRollbackException.class, + com.sun.ts.tests.jta.ee.transactional.OneManagedBean.class, + com.sun.ts.tests.jta.ee.transactional.EJBLiteServletVehicle.class, + com.sun.ts.tests.jta.ee.transactional.HttpServletDelegate.class, + com.sun.ts.tests.jta.ee.transactional.Client.class, + ClientEjbliteservletTest.class + ); + // The web.xml descriptor + URL warResURL = ClientEjbliteservletTest.class.getResource("/vehicle/ejbliteservlet/ejbliteservlet_vehicle_web.xml"); + if(warResURL != null) { + transactional_ejbliteservlet_vehicle_web.setWebXML(warResURL); + } + + warResURL = ClientEjbliteservletTest.class.getResource("/vehicle/ejbliteservlet/beans.xml"); + if(warResURL != null) { + transactional_ejbliteservlet_vehicle_web.addAsWebInfResource(warResURL, "beans.xml"); + } + + return transactional_ejbliteservlet_vehicle_web; + } + + + /* + * @testName: txTypeRequired_withoutTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeRequired_withoutTransaction() throws Exception { + super.txTypeRequired_withoutTransaction(); + } + + /* + * @testName: txTypeRequired_withTransaction + * + * @test_Strategy: TxType.REQUIRED: If called outside a transaction context, + * the interceptor must begin a new JTA transaction, the managed bean method + * execution must then continue inside this transaction context, and the + * transaction must be completed by the interceptor. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeRequired_withTransaction() throws Exception { + super.txTypeRequired_withTransaction(); + } + + /* + * @testName: txTypeRequired_IllegalStateException + * + * @test_Strategy: If an attempt is made to call any method of the + * UserTransaction interface from within a bean or method annotated with + * + * @Transactional and a Transactional.TxType other than NOT_SUPPORTED or + * NEVER, an IllegalStateException must be thrown. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeRequired_IllegalStateException() throws Exception { + super.txTypeRequired_IllegalStateException(); + } + + /* + * @testName: txTypeRequiresNew + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeRequiresNew() throws Exception { + super.txTypeRequiresNew(); + } + + /* + * @testName: txTypeRequiresNew_withTransaction + * + * @test_Strategy: If called outside a transaction context, the interceptor + * must begin a new JTA transaction, the managed bean method execution must + * then continue inside this transaction context, and the transaction must be + * completed by the interceptor. + * + * If called inside a transaction context, the current transaction context + * must be suspended, a new JTA transaction will begin, the managed bean + * method execution must then continue inside this transaction context, the + * transaction must be completed, and the previously suspended transaction + * must be resumed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeRequiresNew_withTransaction() throws Exception { + super.txTypeRequiresNew_withTransaction(); + } + + /* + * @testName: txTypeMandatory_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeMandatory_withoutTransaction() throws Exception { + super.txTypeMandatory_withoutTransaction(); + + } + + /* + * @testName: txTypeMandatory_withTransaction + * + * @test_Strategy: If called outside a transaction context, a + * TransactionalException with a nested TransactionRequiredException must be + * thrown. + * + * If called inside a transaction context, managed bean method execution will + * then continue under that context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeMandatory_withTransaction() throws Exception { + super.txTypeMandatory_withTransaction(); + } + + /* + * @testName: txTypeSupports_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeSupports_withoutTransaction() throws Exception { + super.txTypeSupports_withoutTransaction(); + } + + /* + * @testName: txTypeSupports_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the managed bean method execution + * must then continue inside this transaction context. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeSupports_withTransaction() throws Exception { + super.txTypeSupports_withTransaction(); + } + + /* + * @testName: txTypeNotSupported_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeNotSupported_withoutTransaction() throws Exception { + super.txTypeNotSupported_withoutTransaction(); + + } + + /* + * @testName: txTypeNotSupported_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, the current transaction context + * must be suspended, the managed bean method execution must then continue + * outside a transaction context, and the previously suspended transaction + * must be resumed by the interceptor that suspended it after the method + * execution has completed. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeNotSupported_withTransaction() throws Exception { + super.txTypeNotSupported_withTransaction(); + } + + /* + * @testName: txTypeNever_withoutTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeNever_withoutTransaction() throws Exception { + super.txTypeNever_withoutTransaction(); + } + + /* + * @testName: txTypeNever_withTransaction + * + * @test_Strategy: If called outside a transaction context, managed bean + * method execution must then continue outside a transaction context. + * + * If called inside a transaction context, a TransactionalException with a + * nested InvalidTransactionException must be thrown + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void txTypeNever_withTransaction() throws Exception { + super.txTypeNever_withTransaction(); + } + + /* + * @testName: rollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void rollbackOnException() throws Exception { + super.rollbackOnException(); + + } + + /* + * @testName: rollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void rollbackOnExceptionTwo() throws Exception { + super.rollbackOnExceptionTwo(); + + } + + /* + * @testName: dontRollbackOnException + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void dontRollbackOnException() throws Exception { + super.dontRollbackOnException(); + } + + /* + * @testName: dontRollbackOnExceptionTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void dontRollbackOnExceptionTwo() throws Exception { + super.dontRollbackOnExceptionTwo(); + + } + + /* + * @testName: rollbackAndDontRollback + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void rollbackAndDontRollback() throws Exception { + super.rollbackAndDontRollback(); + + } + + /* + * @testName: rollbackAndDontRollbackTwo + * + * @test_Strategy: The rollbackOn element can be set to indicate exceptions + * that must cause the interceptor to mark the transaction for rollback. + * + * Conversely, the dontRollbackOn element can be set to indicate exceptions + * that must not cause the interceptor to mark the transaction for rollback. + * + * When a class is specified for either of these elements, the designated + * behavior applies to subclasses of that class as well. If both elements are + * specified, dontRollbackOn takes precedence. + * + * Note: This test verifies the behavior in SubClass + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void rollbackAndDontRollbackTwo() throws Exception { + super.rollbackAndDontRollbackTwo(); + + } + + /* + * @testName: transactionScopedBean_withoutTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void transactionScopedBean_withoutTransaction() throws Exception { + super.transactionScopedBean_withoutTransaction(); + } + + /* + * @testName: transactionScopedBean_withTransaction + * + * @test_Strategy: + * + * The jakarta.transaction.TransactionScoped annotation provides the ability to + * specify a standard CDI scope to define bean instances whose lifecycle is + * scoped to the currently active JTA transaction. + * + * The transaction scope is active when the return from a call to + * UserTransaction.getStatus or TransactionManager.getStatus is one of the + * following states: Status.STATUS_ACTIVE Status.STATUS_MARKED_ROLLBACK + * Status.STATUS_PREPARED Status.STATUS_UNKNOWN Status.STATUS_PREPARING + * Status.STATUS_COMMITTING Status.STATUS_ROLLING_BACK + * + * A jakarta.enterprise.context.ContextNotActiveException must be thrown if a + * bean with this annotation is used when the transaction context is not + * active. + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void transactionScopedBean_withTransaction() throws Exception { + super.transactionScopedBean_withTransaction(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequired + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void getInterceptorPriorityForTxTypeRequired() throws Exception { + super.getInterceptorPriorityForTxTypeRequired(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeRequiresNew + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void getInterceptorPriorityForTxTypeRequiresNew() throws Exception { + super.getInterceptorPriorityForTxTypeRequiresNew(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeMandatory + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void getInterceptorPriorityForTxTypeMandatory() throws Exception { + super.getInterceptorPriorityForTxTypeMandatory(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeSupports + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void getInterceptorPriorityForTxTypeSupports() throws Exception { + super.getInterceptorPriorityForTxTypeSupports(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNotSupported + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void getInterceptorPriorityForTxTypeNotSupported() throws Exception { + super.getInterceptorPriorityForTxTypeNotSupported(); + } + + /* + * @testName: getInterceptorPriorityForTxTypeNever + * + * @test_Strategy: The Transactional interceptors must have a priority of + * Interceptor.Priority.PLATFORM_BEFORE+200 + * + */ + @Test + @Override + @TargetVehicle("ejbliteservlet") + public void getInterceptorPriorityForTxTypeNever() throws Exception { + super.getInterceptorPriorityForTxTypeNever(); + } + + private void verifyInterceptorPriority(List priorityList, + String txType) throws Exception { + String result = null; + if (priorityList.contains(Interceptor.Priority.PLATFORM_BEFORE + 200)) { + Helper.getLogger().log(Level.INFO, "Transactional Interceptor for " + + txType + " has right interceptor priority"); + result = "Transactional Interceptor for " + txType + + " has right interceptor priority"; + } else { + throw new Exception("Transactional Interceptor for " + txType + + " has incorrect interceptor priority : " + + Arrays.toString(priorityList.toArray()) + " Excpected value is :" + + Interceptor.Priority.PLATFORM_BEFORE + 200); + } + + if (result != null) + appendReason(result); + + } + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteJSPTag.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteJSPTag.java new file mode 100644 index 0000000000..c97afe9503 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteJSPTag.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package com.sun.ts.tests.jta.ee.transactional; + +import jakarta.servlet.jsp.JspContext; +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.tagext.JspFragment; +import jakarta.servlet.jsp.tagext.JspTag; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.tagext.SimpleTag; +import java.io.IOException; + +public class EJBLiteJSPTag extends ClientEjblitejspTest implements SimpleTag { + /** Reference to the enclosing tag. */ + private JspTag parentTag; + + /** The JSP context for the upcoming tag invocation. */ + private JspContext jspContext; + + /** The body of the tag. */ + private JspFragment jspBody; + + /** + * Called by the container to invoke this tag. + * The implementation of this method is provided by the tag library developer, + * and handles all tag processing, body iteration, etc. + */ + public void doTag() throws JspException { + JspWriter out = getJspContext().getOut(); + setModuleName( + ((PageContext) getJspContext()).getServletContext().getContextPath() ); + String sta = getStatus(); //to trigger the test run + getJspContext().setAttribute("statusAndReason", sta + " " + getReason()); + JspFragment f = getJspBody(); + if (f != null) { + try { + f.invoke(out); + } catch (IOException e) { + throw new JspException(e); + } + } + } + + /** + * Sets the parent of this tag, for collaboration purposes. + *

+ * The container invokes this method only if this tag invocation is + * nested within another tag invocation. + * + * @param parent the tag that encloses this tag + */ + public void setParent(JspTag parent) { + this.parentTag = parent; + } + + /** + * Returns the parent of this tag, for collaboration purposes. + * + * @return the parent of this tag + */ + public JspTag getParent() { + return this.parentTag; + } + + /** + * Stores the provided JSP context in the private jspContext field. + * Subclasses can access the JspContext via + * getJspContext(). + * + * @param pc the page context for this invocation + * @see SimpleTag#setJspContext + */ + public void setJspContext(JspContext pc) { + this.jspContext = pc; + } + + /** + * Returns the page context passed in by the container via + * setJspContext. + * + * @return the page context for this invocation + */ + protected JspContext getJspContext() { + return this.jspContext; + } + + /** + * Stores the provided JspFragment. + * + * @param jspBody The fragment encapsulating the body of this tag. + * If the action element is empty in the page, this method is + * not called at all. + * @see SimpleTag#setJspBody + */ + public void setJspBody(JspFragment jspBody) { + this.jspBody = jspBody; + } + + /** + * Returns the body passed in by the container via setJspBody. + * + * @return the fragment encapsulating the body of this tag, or + * null if the action element is empty in the page. + */ + protected JspFragment getJspBody() { + return this.jspBody; + } + +} diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServlet2Filter.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServlet2Filter.java new file mode 100644 index 0000000000..6ac6f76493 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServlet2Filter.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package com.sun.ts.tests.jta.ee.transactional; + +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.ServletResponse; +import java.util.logging.Logger; +import java.util.logging.Level; + +public class EJBLiteServlet2Filter extends Client implements Filter { + private static Logger logger = Logger.getLogger(EJBLiteServlet2Filter.class.getName()); + private FilterConfig filterConfig; + + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) + throws IOException, ServletException { + response.setContentType("text/plain"); + setInjectionSupported(true); + String tn = request.getParameter("testName"); + if(logger.isLoggable(Level.FINE)) { + logger.fine("doFilter testName=" + tn); + } + setTestName(tn); + setModuleName( ((HttpServletRequest) request).getContextPath() ); + String sta = getStatus(); //to trigger the test run + PrintWriter pw = response.getWriter(); + pw.println(sta + " " + getReason()); + cleanup(); //need to reset all fields since filter instances are shared + //skip the rest of the chain + } + + public void destroy() { + } + + public void init(FilterConfig filterConfig) { + this.filterConfig = filterConfig; + } +} diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServletVehicle.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServletVehicle.java new file mode 100644 index 0000000000..63006f46e7 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/EJBLiteServletVehicle.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package com.sun.ts.tests.jta.ee.transactional; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Enumeration; +import java.util.Iterator; +import jakarta.servlet.Servlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import java.util.logging.Logger; +import java.util.logging.Level; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +public class EJBLiteServletVehicle extends Client + implements Servlet, ServletConfig { + + private static Logger logger = Logger.getLogger(EJBLiteServletVehicle.class.getName()); + + private HttpServletDelegate delegate = new HttpServletDelegate(); + + public void init(ServletConfig config) throws ServletException { + delegate.init(config); + } + + public ServletConfig getServletConfig() { + return delegate.getServletConfig(); + } + + public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { + delegate.service(request, response); + + setInjectionSupported(true); + String tn = request.getParameter("testName"); + logger.fine("EJBLiteServletVehicle processing request testName=" + tn); + setTestName(tn); + setModuleName(getServletContext().getContextPath()); + String sta = getStatus(); //to trigger the test run + + PrintWriter pw = response.getWriter(); + pw.println(sta + " " + getReason()); + cleanup(); //need to reset all fields since servlet instances are shared + + } + + public String getServletInfo() { + return delegate.getServletInfo(); + } + + public void destroy() { + delegate.destroy(); + delegate = null; + } + + public String getServletName() { + return delegate.getServletName(); + } + + public ServletContext getServletContext() { + return delegate.getServletContext(); + } + + public String getInitParameter(String arg0) { + return delegate.getInitParameter(arg0); + } + + public Enumeration getInitParameterNames() { + return delegate.getInitParameterNames(); + } + + +} diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/HttpServletDelegate.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/HttpServletDelegate.java new file mode 100644 index 0000000000..7d4020b302 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/HttpServletDelegate.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + + package com.sun.ts.tests.jta.ee.transactional; + +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import java.util.logging.Logger; +import java.util.logging.Level; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +public class HttpServletDelegate extends HttpServlet { + + private static Logger logger = Logger.getLogger(HttpServletDelegate.class.getName()); + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + private void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/plain"); + } + } diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/JsfClient.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/JsfClient.java.txt similarity index 99% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/JsfClient.java rename to jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/JsfClient.java.txt index ac22a262c9..d34375ac4a 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/JsfClient.java +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/transactional/JsfClient.java.txt @@ -35,8 +35,8 @@ @jakarta.inject.Named("client") @jakarta.enterprise.context.RequestScoped -public class JsfClient extends EJBLiteJsfClientBase implements Serializable { - private static final long serialVersionUID = 1L; +public class JsfClient extends EJBLiteJsfClientBase { + private static StringBuilder callRecords = new StringBuilder(); @Inject diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientEjbTest.java new file mode 100644 index 0000000000..f18b40cf1c --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientEjbTest.java @@ -0,0 +1,243 @@ +package com.sun.ts.tests.jta.ee.txpropagationtest; + +import com.sun.ts.tests.jta.ee.txpropagationtest.Client; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("tck-appclient") + +public class ClientEjbTest extends com.sun.ts.tests.jta.ee.txpropagationtest.Client { + static final String VEHICLE_ARCHIVE = "jta_ejb_vehicle"; + + private static String packagePath = ClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(ClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + jta_ee_txpropagate1_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ee_txpropagate2_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ee_txpropagate3_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ejb_vehicle: + jta_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + jta_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_jsp_vehicle: + jta_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + jta_servlet_vehicle: + jta_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/txpropagationtest/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive jta_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "jta_ejb_vehicle_client.jar"); + // The class files + jta_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class + ); + // The application-client.xml descriptor + //TODO : replace display-name as jta_ejb_vehicle_client + URL resURL = ClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + + if(resURL != null) { + jta_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + resURL = ClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml"); + if(resURL != null) { + jta_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + jta_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + ClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(jta_ejb_vehicle_client, ClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive jta_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "jta_ejb_vehicle_ejb.jar"); + // The class files + jta_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanEJB.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.txpropagationtest.Client.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class, + ClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = ClientEjbTest.class.getClassLoader().getResource(packagePath+"/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + jta_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = ClientEjbTest.class.getClassLoader().getResource(packagePath+"/jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + jta_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(jta_ejb_vehicle_ejb, ClientEjbTest.class, ejbResURL); + + + JavaArchive jta_ee_txpropagate1_ejb = ShrinkWrap.create(JavaArchive.class, "jta_ee_txpropagate1_ejb.jar"); + // The class files + jta_ee_txpropagate1_ejb.addClasses( + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanEJB.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanHome.class + ); + // The ejb-jar.xml descriptor + ejbResURL = ClientEjbTest.class.getClassLoader().getResource(packagePath+"/jta_ee_txpropagate1_ejb.xml"); + if(ejbResURL != null) { + jta_ee_txpropagate1_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = ClientEjbTest.class.getClassLoader().getResource(packagePath+"/jta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + jta_ee_txpropagate1_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(jta_ee_txpropagate1_ejb, ClientEjbTest.class, ejbResURL); + + + // Ear + EnterpriseArchive jta_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "jta_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + jta_ejb_vehicle_ear.addAsModule(jta_ee_txpropagate1_ejb); + // jta_ejb_vehicle_ear.addAsModule(jta_ee_txpropagate2_ejb); + // jta_ejb_vehicle_ear.addAsModule(jta_ee_txpropagate3_ejb); + jta_ejb_vehicle_ear.addAsModule(jta_ejb_vehicle_ejb); + jta_ejb_vehicle_ear.addAsModule(jta_ejb_vehicle_client); + + + + // // The application.xml descriptor + // URL earResURL = Client.class.getResource("/com/sun/ts/tests/jta/ee/txpropagationtest/"); + // if(earResURL != null) { + // jta_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // The sun-application.xml descriptor + URL earResURL = Client.class.getClassLoader().getResource(packagePath+"/jta_ejb_vehicle_client.jar.sun-application-client.xml"); + if(earResURL != null) { + jta_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + } + archiveProcessor.processEarArchive(jta_ejb_vehicle_ear, Client.class, earResURL); + + return jta_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void test1() throws java.lang.Exception { + super.test1(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void test2() throws java.lang.Exception { + super.test2(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void test3() throws java.lang.Exception { + super.test3(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void test4() throws java.lang.Exception { + super.test4(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void test5() throws java.lang.Exception { + super.test5(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void test6() throws java.lang.Exception { + super.test6(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientJspTest.java new file mode 100644 index 0000000000..d4511b415f --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientJspTest.java @@ -0,0 +1,216 @@ +package com.sun.ts.tests.jta.ee.txpropagationtest; + +import com.sun.ts.tests.jta.ee.txpropagationtest.Client; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("tck-javatest") + +public class ClientJspTest extends com.sun.ts.tests.jta.ee.txpropagationtest.Client { + static final String VEHICLE_ARCHIVE = "jta_jsp_vehicle"; + + private static String packagePath = ClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(ClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + jta_ee_txpropagate1_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ee_txpropagate2_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ee_txpropagate3_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ejb_vehicle: + jta_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + jta_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_jsp_vehicle: + jta_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + jta_servlet_vehicle: + jta_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Ejb: + + /com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml + /com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml + War: + + /com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive jta_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "jta_jsp_vehicle_web.war"); + // The class files + jta_jsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanEJB.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.txpropagationtest.Client.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanHome.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class, + ClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = ClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + jta_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + + // Web content + warResURL = ClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + jta_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = ClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + jta_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + warResURL = ClientJspTest.class.getClassLoader().getResource(packagePath+"/jta_jsp_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + jta_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + + // archiveProcessor.processWebArchive(jta_jsp_vehicle_web, ClientJspTest.class, warResURL); + + // Ejb + // the jar with the correct archive name + JavaArchive jta_ee_txpropagate3_ejb = ShrinkWrap.create(JavaArchive.class, "jta_ee_txpropagate3_ejb.jar"); + // The class files + jta_ee_txpropagate3_ejb.addClasses( + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanEJB.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanHome.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = ClientJspTest.class.getClassLoader().getResource(packagePath+"/jta_ee_txpropagate3_ejb.xml"); + if(ejbResURL != null) { + jta_ee_txpropagate3_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = ClientJspTest.class.getClassLoader().getResource(packagePath+"/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + jta_ee_txpropagate3_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + // archiveProcessor.processEjbArchive(jta_ee_txpropagate3_ejb, ClientJspTest.class, ejbResURL); + + // Ear + EnterpriseArchive jta_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "jta_jsp_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + // jta_jsp_vehicle_ear.addAsModule(jta_ee_txpropagate1_ejb); + // jta_jsp_vehicle_ear.addAsModule(jta_ee_txpropagate2_ejb); + jta_jsp_vehicle_ear.addAsModule(jta_ee_txpropagate3_ejb); + jta_jsp_vehicle_ear.addAsModule(jta_jsp_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = Client.class.getResource("/com/sun/ts/tests/jta/ee/txpropagationtest/"); + // if(earResURL != null) { + // jta_jsp_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = Client.class.getResource("/com/sun/ts/tests/jta/ee/txpropagationtest/.ear.sun-application.xml"); + // if(earResURL != null) { + // jta_jsp_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(jta_jsp_vehicle_ear, Client.class, earResURL); + return jta_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void test1() throws java.lang.Exception { + super.test1(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void test2() throws java.lang.Exception { + super.test2(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void test3() throws java.lang.Exception { + super.test3(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void test4() throws java.lang.Exception { + super.test4(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void test5() throws java.lang.Exception { + super.test5(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void test6() throws java.lang.Exception { + super.test6(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientServletTest.java new file mode 100644 index 0000000000..f64e063635 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ClientServletTest.java @@ -0,0 +1,209 @@ +package com.sun.ts.tests.jta.ee.txpropagationtest; + +import com.sun.ts.tests.jta.ee.txpropagationtest.Client; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("tck-javatest") + +public class ClientServletTest extends com.sun.ts.tests.jta.ee.txpropagationtest.Client { + static final String VEHICLE_ARCHIVE = "jta_servlet_vehicle"; + + private static String packagePath = ClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(ClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + jta_ee_txpropagate1_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ee_txpropagate2_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ee_txpropagate3_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_ejb_vehicle: + jta_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + jta_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + jta_jsp_vehicle: + jta_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + jta_servlet_vehicle: + jta_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Ejb: + + /com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml + /com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml + War: + + /com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive jta_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "jta_servlet_vehicle_web.war"); + // The class files + jta_servlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanEJB.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.txpropagationtest.Client.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanHome.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class, + ClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = ClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + jta_servlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // The sun-web.xml descriptor + warResURL = ClientServletTest.class.getClassLoader().getResource(packagePath+"/jta_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + jta_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + // archiveProcessor.processWebArchive(jta_servlet_vehicle_web, ClientServletTest.class, warResURL); + + // Ejb + // the jar with the correct archive name + JavaArchive jta_ee_txpropagate2_ejb = ShrinkWrap.create(JavaArchive.class, "jta_ee_txpropagate2_ejb.jar"); + // The class files + jta_ee_txpropagate2_ejb.addClasses( + com.sun.ts.tests.jta.ee.txpropagationtest.TxBean.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanEJB.class, + com.sun.ts.tests.jta.ee.txpropagationtest.TxBeanHome.class, + com.sun.ts.tests.jta.ee.txpropagationtest.DBSupport.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = ClientServletTest.class.getClassLoader().getResource(packagePath+"/jta_ee_txpropagate2_ejb.xml"); + if(ejbResURL != null) { + jta_ee_txpropagate2_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = ClientServletTest.class.getClassLoader().getResource(packagePath+"/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + jta_ee_txpropagate2_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + // archiveProcessor.processEjbArchive(jta_ee_txpropagate2_ejb, ClientServletTest.class, ejbResURL); + + // Ear + EnterpriseArchive jta_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "jta_servlet_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + // jta_servlet_vehicle_ear.addAsModule(jta_ee_txpropagate1_ejb); + jta_servlet_vehicle_ear.addAsModule(jta_ee_txpropagate2_ejb); + // jta_servlet_vehicle_ear.addAsModule(jta_ee_txpropagate3_ejb); + jta_servlet_vehicle_ear.addAsModule(jta_servlet_vehicle_web); + + + // // The application.xml descriptor + // URL earResURL = Client.class.getResource("/com/sun/ts/tests/jta/ee/txpropagationtest/"); + // if(earResURL != null) { + // jta_servlet_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = Client.class.getResource("/com/sun/ts/tests/jta/ee/txpropagationtest/.ear.sun-application.xml"); + // if(earResURL != null) { + // jta_servlet_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(jta_servlet_vehicle_ear, Client.class, earResURL); + return jta_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void test1() throws java.lang.Exception { + super.test1(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void test2() throws java.lang.Exception { + super.test2(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void test3() throws java.lang.Exception { + super.test3(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void test4() throws java.lang.Exception { + super.test4(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void test5() throws java.lang.Exception { + super.test5(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void test6() throws java.lang.Exception { + super.test6(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/TxBeanHome.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/TxBeanHome.java new file mode 100644 index 0000000000..f80db86de3 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/TxBeanHome.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package com.sun.ts.tests.jta.ee.txpropagationtest; + +import java.rmi.RemoteException; +import java.util.Properties; + +import jakarta.ejb.CreateException; +import jakarta.ejb.EJBHome; + +public interface TxBeanHome extends EJBHome { + public TxBean create(Properties p) throws RemoteException, CreateException; +} diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClient.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClient.java index d08584e6cd..03588dbefe 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClient.java +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClient.java @@ -45,6 +45,8 @@ public class UserBeginClient extends ServiceEETest implements Serializable { private static final String testName = "jta.ee.usertransaction.begin"; + private static String packagePath = UserBeginClientJspTest.class.getPackageName().replace(".", "/"); + private UserTransaction userTransaction = null; public void setup(String[] args, Properties p) throws Exception { diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientEjbTest.java new file mode 100644 index 0000000000..bdf8a59346 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientEjbTest.java @@ -0,0 +1,189 @@ +package com.sun.ts.tests.jta.ee.usertransaction.begin; + +import com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-appclient") + +public class UserBeginClientEjbTest extends com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient { + static final String VEHICLE_ARCHIVE = "begin_ejb_vehicle"; + + private static String packagePath = UserBeginClientEjbTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserBeginClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + begin_ejb_vehicle: + begin_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + begin_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + begin_jsp_vehicle: + begin_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + begin_servlet_vehicle: + begin_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/usertransaction/begin/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive begin_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "begin_ejb_vehicle_client.jar"); + // The class files + begin_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserBeginClientEjbTest.class + ); + // The application-client.xml descriptor + //TODO : replace display-name begin_ejb_vehicle_client + URL resURL = UserBeginClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + if(resURL != null) { + begin_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + resURL = UserBeginClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml"); + if(resURL != null) { + begin_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + begin_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + UserBeginClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(begin_ejb_vehicle_client, UserBeginClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive begin_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "begin_ejb_vehicle_ejb.jar"); + // The class files + begin_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserBeginClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = UserBeginClient.class.getClassLoader().getResource(packagePath+"/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + begin_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = UserBeginClient.class.getClassLoader().getResource(packagePath+"/begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + begin_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(begin_ejb_vehicle_ejb, UserBeginClient.class, ejbResURL); + + // Ear + EnterpriseArchive begin_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "begin_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + begin_ejb_vehicle_ear.addAsModule(begin_ejb_vehicle_ejb); + begin_ejb_vehicle_ear.addAsModule(begin_ejb_vehicle_client); + + + // The application.xml descriptor + URL earResURL = UserBeginClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/begin/"); + if(earResURL != null) { + begin_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + } + // The sun-application.xml descriptor + earResURL = UserBeginClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_client.jar.sun-application-client.xml"); + if(earResURL != null) { + begin_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + } + archiveProcessor.processEarArchive(begin_ejb_vehicle_ear, UserBeginClient.class, earResURL); + + return begin_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserBegin001() throws java.lang.Exception { + super.testUserBegin001(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserBegin002() throws java.lang.Exception { + super.testUserBegin002(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientJspTest.java new file mode 100644 index 0000000000..1269e3ed35 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientJspTest.java @@ -0,0 +1,138 @@ +package com.sun.ts.tests.jta.ee.usertransaction.begin; + +import com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserBeginClientJspTest extends com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient { + static final String VEHICLE_ARCHIVE = "begin_jsp_vehicle"; + + private static String packagePath = UserBeginClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserBeginClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + begin_ejb_vehicle: + begin_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + begin_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + begin_jsp_vehicle: + begin_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + begin_servlet_vehicle: + begin_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive begin_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "begin_jsp_vehicle_web.war"); + // The class files + begin_jsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + UserBeginClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = UserBeginClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + begin_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // Web content + warResURL = UserBeginClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + begin_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = UserBeginClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + begin_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + // warResURL = UserBeginClientJspTest.class.getClassLoader().getResource(packagePath+"/begin_jsp_vehicle_web.war.sun-web.xml"); + // if(warResURL != null) { + // begin_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + // } + + + // archiveProcessor.processWebArchive(begin_jsp_vehicle_web, UserBeginClientJspTest.class, warResURL); + + // Ear + EnterpriseArchive begin_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "begin_jsp_vehicle.ear"); + begin_jsp_vehicle_ear.addAsModule(begin_jsp_vehicle_web); + return begin_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserBegin001() throws java.lang.Exception { + super.testUserBegin001(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserBegin002() throws java.lang.Exception { + super.testUserBegin002(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientServletTest.java new file mode 100644 index 0000000000..5dc77be1d7 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/UserBeginClientServletTest.java @@ -0,0 +1,135 @@ +package com.sun.ts.tests.jta.ee.usertransaction.begin; + +import com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserBeginClientServletTest extends com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient { + static final String VEHICLE_ARCHIVE = "begin_servlet_vehicle"; + + private static String packagePath = UserBeginClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserBeginClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + begin_ejb_vehicle: + begin_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + begin_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + begin_jsp_vehicle: + begin_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + begin_servlet_vehicle: + begin_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive begin_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "begin_servlet_vehicle_web.war"); + // The class files + begin_servlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.begin.UserBeginClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserBeginClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = UserBeginClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + begin_servlet_vehicle_web.setWebXML(warResURL); + } + // The sun-web.xml descriptor + warResURL = UserBeginClientServletTest.class.getClassLoader().getResource(packagePath+"/begin_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + begin_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + archiveProcessor.processWebArchive(begin_servlet_vehicle_web, UserBeginClientServletTest.class, warResURL); + + // Ear + EnterpriseArchive begin_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "begin_servlet_vehicle.ear"); + begin_servlet_vehicle_ear.addAsModule(begin_servlet_vehicle_web); + return begin_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserBegin001() throws java.lang.Exception { + super.testUserBegin001(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserBegin002() throws java.lang.Exception { + super.testUserBegin002(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientEjbTest.java new file mode 100644 index 0000000000..f19d6d4b4e --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientEjbTest.java @@ -0,0 +1,210 @@ +package com.sun.ts.tests.jta.ee.usertransaction.commit; + +import com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-appclient") + +public class UserCommitClientEjbTest extends com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient { + static final String VEHICLE_ARCHIVE = "commit_ejb_vehicle"; + + private static String packagePath = UserCommitClientEjbTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserCommitClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + commit_ejb_vehicle: + commit_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + commit_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + commit_jsp_vehicle: + commit_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + commit_servlet_vehicle: + commit_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/usertransaction/commit/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive commit_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "commit_ejb_vehicle_client.jar"); + // The class files + commit_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserCommitClientEjbTest.class + ); + // The application-client.xml descriptor + // TODO replace display-name + URL resURL = UserCommitClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + if(resURL != null) { + commit_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + resURL = UserCommitClientEjbTest.class.getResource("//com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml"); + if(resURL != null) { + commit_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + commit_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + UserCommitClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(commit_ejb_vehicle_client, UserCommitClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive commit_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "commit_ejb_vehicle_ejb.jar"); + // The class files + commit_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserCommitClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = UserCommitClientEjbTest.class.getResource("/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + commit_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = UserCommitClientEjbTest.class.getResource("/ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + commit_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(commit_ejb_vehicle_ejb, UserCommitClientEjbTest.class, ejbResURL); + + // Ear + EnterpriseArchive commit_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "commit_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + commit_ejb_vehicle_ear.addAsModule(commit_ejb_vehicle_ejb); + commit_ejb_vehicle_ear.addAsModule(commit_ejb_vehicle_client); + + + + // // The application.xml descriptor + // URL earResURL = UserCommitClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/commit/"); + // if(earResURL != null) { + // commit_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // The sun-application.xml descriptor + URL earResURL = UserCommitClientEjbTest.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_client.jar.sun-application-client.xml"); + if(earResURL != null) { + commit_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + } + archiveProcessor.processEarArchive(commit_ejb_vehicle_ear, UserCommitClientEjbTest.class, earResURL); + return commit_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserCommit001() throws java.lang.Exception { + super.testUserCommit001(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserCommit002() throws java.lang.Exception { + super.testUserCommit002(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserCommit003() throws java.lang.Exception { + super.testUserCommit003(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserCommit004() throws java.lang.Exception { + super.testUserCommit004(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserCommit005() throws java.lang.Exception { + super.testUserCommit005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientJspTest.java new file mode 100644 index 0000000000..2b1bf52669 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientJspTest.java @@ -0,0 +1,161 @@ +package com.sun.ts.tests.jta.ee.usertransaction.commit; + +import com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserCommitClientJspTest extends com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient { + static final String VEHICLE_ARCHIVE = "commit_jsp_vehicle"; + + private static String packagePath = UserCommitClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserCommitClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + commit_ejb_vehicle: + commit_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + commit_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + commit_jsp_vehicle: + commit_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + commit_servlet_vehicle: + commit_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive commit_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "commit_jsp_vehicle_web.war"); + // The class files + commit_jsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserCommitClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = UserCommitClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + commit_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // Web content + warResURL = UserCommitClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + commit_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = UserCommitClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + commit_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + warResURL = UserCommitClientJspTest.class.getClassLoader().getResource(packagePath+"/commit_jsp_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + commit_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + + archiveProcessor.processWebArchive(commit_jsp_vehicle_web, UserCommitClientJspTest.class, warResURL); + + // Ear + EnterpriseArchive commit_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "commit_jsp_vehicle.ear"); + commit_jsp_vehicle_ear.addAsModule(commit_jsp_vehicle_web); + return commit_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserCommit001() throws java.lang.Exception { + super.testUserCommit001(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserCommit002() throws java.lang.Exception { + super.testUserCommit002(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserCommit003() throws java.lang.Exception { + super.testUserCommit003(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserCommit004() throws java.lang.Exception { + super.testUserCommit004(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserCommit005() throws java.lang.Exception { + super.testUserCommit005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientServletTest.java new file mode 100644 index 0000000000..58f71922d3 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/UserCommitClientServletTest.java @@ -0,0 +1,156 @@ +package com.sun.ts.tests.jta.ee.usertransaction.commit; + +import com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserCommitClientServletTest extends com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient { + static final String VEHICLE_ARCHIVE = "commit_servlet_vehicle"; + + private static String packagePath = UserCommitClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserCommitClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + commit_ejb_vehicle: + commit_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + commit_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + commit_jsp_vehicle: + commit_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + commit_servlet_vehicle: + commit_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive commit_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "commit_servlet_vehicle_web.war"); + // The class files + commit_servlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.commit.UserCommitClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserCommitClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = UserCommitClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + commit_servlet_vehicle_web.setWebXML(warResURL); + } + // The sun-web.xml descriptor + warResURL = UserCommitClientServletTest.class.getClassLoader().getResource(packagePath+"/commit_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + commit_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + archiveProcessor.processWebArchive(commit_servlet_vehicle_web, UserCommitClientServletTest.class, warResURL); + + // Ear + EnterpriseArchive commit_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "commit_servlet_vehicle.ear"); + commit_servlet_vehicle_ear.addAsModule(commit_servlet_vehicle_web); + return commit_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserCommit001() throws java.lang.Exception { + super.testUserCommit001(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserCommit002() throws java.lang.Exception { + super.testUserCommit002(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserCommit003() throws java.lang.Exception { + super.testUserCommit003(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserCommit004() throws java.lang.Exception { + super.testUserCommit004(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserCommit005() throws java.lang.Exception { + super.testUserCommit005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientEjbTest.java new file mode 100644 index 0000000000..788c68544e --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientEjbTest.java @@ -0,0 +1,211 @@ +package com.sun.ts.tests.jta.ee.usertransaction.getstatus; + +import com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-appclient") + +public class UserGetStatusClientEjbTest extends com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient { + static final String VEHICLE_ARCHIVE = "getstatus_ejb_vehicle"; + + private static String packagePath = UserGetStatusClientEjbTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserGetStatusClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + getstatus_ejb_vehicle: + getstatus_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + getstatus_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + getstatus_jsp_vehicle: + getstatus_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + getstatus_servlet_vehicle: + getstatus_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/usertransaction/getstatus/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive getstatus_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "getstatus_ejb_vehicle_client.jar"); + // The class files + getstatus_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient.class, + UserGetStatusClientEjbTest.class + ); + // The application-client.xml descriptor + // TODO: replace display-name + URL resURL = UserGetStatusClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + if(resURL != null) { + getstatus_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + // resURL = UserGetStatusClient.class.getResource("/getstatus_jsp_vehicle_web.war.sun-web.xml"); + // if(resURL != null) { + // getstatus_ejb_vehicle_client.addAsManifestResource(resURL, "sun-web.xml"); + // } + getstatus_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + UserGetStatusClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(getstatus_ejb_vehicle_client, UserGetStatusClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive getstatus_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "getstatus_ejb_vehicle_ejb.jar"); + // The class files + getstatus_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClientEjbTest.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserGetStatusClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = UserGetStatusClientEjbTest.class.getResource("/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + getstatus_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = UserGetStatusClientEjbTest.class.getResource("/getstatus_ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + getstatus_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(getstatus_ejb_vehicle_ejb, UserGetStatusClientEjbTest.class, ejbResURL); + + // Ear + EnterpriseArchive getstatus_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "getstatus_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + getstatus_ejb_vehicle_ear.addAsModule(getstatus_ejb_vehicle_ejb); + getstatus_ejb_vehicle_ear.addAsModule(getstatus_ejb_vehicle_client); + + + + // // The application.xml descriptor + // URL earResURL = UserGetStatusClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/getstatus/"); + // if(earResURL != null) { + // getstatus_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserGetStatusClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/getstatus/.ear.sun-application.xml"); + // if(earResURL != null) { + // getstatus_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(getstatus_ejb_vehicle_ear, UserGetStatusClient.class, earResURL); + return getstatus_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserGetStatus001() throws java.lang.Exception { + super.testUserGetStatus001(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserGetStatus002() throws java.lang.Exception { + super.testUserGetStatus002(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserGetStatus003() throws java.lang.Exception { + super.testUserGetStatus003(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserGetStatus004() throws java.lang.Exception { + super.testUserGetStatus004(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserGetStatus005() throws java.lang.Exception { + super.testUserGetStatus005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientJspTest.java new file mode 100644 index 0000000000..0c5a94186b --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientJspTest.java @@ -0,0 +1,181 @@ +package com.sun.ts.tests.jta.ee.usertransaction.getstatus; + +import com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserGetStatusClientJspTest extends com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient { + static final String VEHICLE_ARCHIVE = "getstatus_jsp_vehicle"; + + private static String packagePath = UserGetStatusClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserGetStatusClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + getstatus_ejb_vehicle: + getstatus_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + getstatus_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + getstatus_jsp_vehicle: + getstatus_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + getstatus_servlet_vehicle: + getstatus_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive getstatus_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "getstatus_jsp_vehicle_web.war"); + // The class files + getstatus_jsp_vehicle_web.addClasses( + com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserGetStatusClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = UserGetStatusClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + getstatus_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + + // Web content + warResURL = UserGetStatusClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + getstatus_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = UserGetStatusClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + getstatus_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + warResURL = UserGetStatusClientJspTest.class.getClassLoader().getResource(packagePath+"/getstatus_jsp_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + getstatus_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + archiveProcessor.processWebArchive(getstatus_jsp_vehicle_web, UserGetStatusClientJspTest.class, warResURL); + + + // Ear + EnterpriseArchive getstatus_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "getstatus_jsp_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + getstatus_jsp_vehicle_ear.addAsModule(getstatus_jsp_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserGetStatusClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/getstatus/"); + // if(earResURL != null) { + // getstatus_jsp_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserGetStatusClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/getstatus/.ear.sun-application.xml"); + // if(earResURL != null) { + // getstatus_jsp_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(getstatus_jsp_vehicle_ear, UserGetStatusClient.class, earResURL); + + return getstatus_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserGetStatus001() throws java.lang.Exception { + super.testUserGetStatus001(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserGetStatus002() throws java.lang.Exception { + super.testUserGetStatus002(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserGetStatus003() throws java.lang.Exception { + super.testUserGetStatus003(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserGetStatus004() throws java.lang.Exception { + super.testUserGetStatus004(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserGetStatus005() throws java.lang.Exception { + super.testUserGetStatus005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientServletTest.java new file mode 100644 index 0000000000..5ad825ae7c --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/UserGetStatusClientServletTest.java @@ -0,0 +1,175 @@ +package com.sun.ts.tests.jta.ee.usertransaction.getstatus; + +import com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserGetStatusClientServletTest extends com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient { + static final String VEHICLE_ARCHIVE = "getstatus_servlet_vehicle"; + + private static String packagePath = UserGetStatusClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserGetStatusClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + getstatus_ejb_vehicle: + getstatus_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + getstatus_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + getstatus_jsp_vehicle: + getstatus_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + getstatus_servlet_vehicle: + getstatus_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive getstatus_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "getstatus_servlet_vehicle_web.war"); + // The class files + getstatus_servlet_vehicle_web.addClasses( + com.sun.ts.tests.jta.ee.usertransaction.getstatus.UserGetStatusClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserGetStatusClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = UserGetStatusClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + getstatus_servlet_vehicle_web.setWebXML(warResURL); + } + // The sun-web.xml descriptor + warResURL = UserGetStatusClientServletTest.class.getClassLoader().getResource(packagePath+"/getstatus_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + getstatus_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + archiveProcessor.processWebArchive(getstatus_servlet_vehicle_web, UserGetStatusClientServletTest.class, warResURL); + + // Ear + EnterpriseArchive getstatus_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "getstatus_servlet_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + getstatus_servlet_vehicle_ear.addAsModule(getstatus_servlet_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserGetStatusClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/getstatus/"); + // if(earResURL != null) { + // getstatus_servlet_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserGetStatusClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/getstatus/.ear.sun-application.xml"); + // if(earResURL != null) { + // getstatus_servlet_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(getstatus_servlet_vehicle_ear, UserGetStatusClient.class, earResURL); + + return getstatus_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserGetStatus001() throws java.lang.Exception { + super.testUserGetStatus001(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserGetStatus002() throws java.lang.Exception { + super.testUserGetStatus002(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserGetStatus003() throws java.lang.Exception { + super.testUserGetStatus003(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserGetStatus004() throws java.lang.Exception { + super.testUserGetStatus004(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserGetStatus005() throws java.lang.Exception { + super.testUserGetStatus005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientEjbTest.java new file mode 100644 index 0000000000..0687cad06c --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientEjbTest.java @@ -0,0 +1,210 @@ +package com.sun.ts.tests.jta.ee.usertransaction.rollback; + +import com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-appclient") + +public class UserRollbackClientEjbTest extends com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient { + static final String VEHICLE_ARCHIVE = "rollback_ejb_vehicle"; + + private static String packagePath = UserRollbackClientEjbTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserRollbackClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + rollback_ejb_vehicle: + rollback_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + rollback_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + rollback_jsp_vehicle: + rollback_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + rollback_servlet_vehicle: + rollback_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/usertransaction/rollback/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive rollback_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "rollback_ejb_vehicle_client.jar"); + // The class files + rollback_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserRollbackClientEjbTest.class + ); + // The application-client.xml descriptor + //TODO :replace display-name + URL resURL = UserRollbackClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + if(resURL != null) { + rollback_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + // resURL = UserRollbackClient.class.getResource("//com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml"); + // if(resURL != null) { + // rollback_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + // } + rollback_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + UserRollbackClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(rollback_ejb_vehicle_client, UserRollbackClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive rollback_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "rollback_ejb_vehicle_ejb.jar"); + // The class files + rollback_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserRollbackClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = UserRollbackClientEjbTest.class.getResource("/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + rollback_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = UserRollbackClientEjbTest.class.getResource("/rollback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + rollback_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(rollback_ejb_vehicle_ejb, UserRollbackClientEjbTest.class, ejbResURL); + + // Ear + EnterpriseArchive rollback_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "rollback_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + rollback_ejb_vehicle_ear.addAsModule(rollback_ejb_vehicle_ejb); + rollback_ejb_vehicle_ear.addAsModule(rollback_ejb_vehicle_client); + + + + // // The application.xml descriptor + // URL earResURL = UserRollbackClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/rollback/"); + // if(earResURL != null) { + // rollback_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // The sun-application.xml descriptor + URL earResURL = UserRollbackClientEjbTest.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_client.jar.sun-application-client"); + if(earResURL != null) { + rollback_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + } + archiveProcessor.processEarArchive(rollback_ejb_vehicle_ear, UserRollbackClientEjbTest.class, earResURL); + return rollback_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserRollback001() throws java.lang.Exception { + super.testUserRollback001(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserRollback002() throws java.lang.Exception { + super.testUserRollback002(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserRollback003() throws java.lang.Exception { + super.testUserRollback003(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserRollback004() throws java.lang.Exception { + super.testUserRollback004(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserRollback005() throws java.lang.Exception { + super.testUserRollback005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientJspTest.java new file mode 100644 index 0000000000..8eeb97ac3f --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientJspTest.java @@ -0,0 +1,180 @@ +package com.sun.ts.tests.jta.ee.usertransaction.rollback; + +import com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserRollbackClientJspTest extends com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient { + static final String VEHICLE_ARCHIVE = "rollback_jsp_vehicle"; + + private static String packagePath = UserRollbackClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserRollbackClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + rollback_ejb_vehicle: + rollback_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + rollback_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + rollback_jsp_vehicle: + rollback_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + rollback_servlet_vehicle: + rollback_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive rollback_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "rollback_jsp_vehicle_web.war"); + // The class files + rollback_jsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserRollbackClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = UserRollbackClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + rollback_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // Web content + warResURL = UserRollbackClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + rollback_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = UserRollbackClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + rollback_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + warResURL = UserRollbackClientJspTest.class.getClassLoader().getResource(packagePath+"/rollback_jsp_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + rollback_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + archiveProcessor.processWebArchive(rollback_jsp_vehicle_web, UserRollbackClientJspTest.class, warResURL); + + + // Ear + EnterpriseArchive rollback_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "rollback_jsp_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + rollback_jsp_vehicle_ear.addAsModule(rollback_jsp_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserRollbackClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/rollback/"); + // if(earResURL != null) { + // rollback_jsp_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserRollbackClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/rollback/.ear.sun-application.xml"); + // if(earResURL != null) { + // rollback_jsp_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(rollback_jsp_vehicle_ear, UserRollbackClient.class, earResURL); + + return rollback_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserRollback001() throws java.lang.Exception { + super.testUserRollback001(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserRollback002() throws java.lang.Exception { + super.testUserRollback002(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserRollback003() throws java.lang.Exception { + super.testUserRollback003(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserRollback004() throws java.lang.Exception { + super.testUserRollback004(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserRollback005() throws java.lang.Exception { + super.testUserRollback005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientServletTest.java new file mode 100644 index 0000000000..66eeef34bf --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/UserRollbackClientServletTest.java @@ -0,0 +1,175 @@ +package com.sun.ts.tests.jta.ee.usertransaction.rollback; + +import com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserRollbackClientServletTest extends com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient { + static final String VEHICLE_ARCHIVE = "rollback_servlet_vehicle"; + + private static String packagePath = UserRollbackClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserRollbackClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + rollback_ejb_vehicle: + rollback_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + rollback_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + rollback_jsp_vehicle: + rollback_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + rollback_servlet_vehicle: + rollback_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive rollback_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "rollback_servlet_vehicle_web.war"); + // The class files + rollback_servlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.usertransaction.rollback.UserRollbackClient.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserRollbackClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = UserRollbackClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + rollback_servlet_vehicle_web.setWebXML(warResURL); + } + // The sun-web.xml descriptor + warResURL = UserRollbackClientServletTest.class.getClassLoader().getResource(packagePath+"/rollback_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + rollback_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + archiveProcessor.processWebArchive(rollback_servlet_vehicle_web, UserRollbackClientServletTest.class, warResURL); + + // Ear + EnterpriseArchive rollback_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "rollback_servlet_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + rollback_servlet_vehicle_ear.addAsModule(rollback_servlet_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserRollbackClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/rollback/"); + // if(earResURL != null) { + // rollback_servlet_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserRollbackClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/rollback/.ear.sun-application.xml"); + // if(earResURL != null) { + // rollback_servlet_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(rollback_servlet_vehicle_ear, UserRollbackClient.class, earResURL); + + return rollback_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserRollback001() throws java.lang.Exception { + super.testUserRollback001(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserRollback002() throws java.lang.Exception { + super.testUserRollback002(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserRollback003() throws java.lang.Exception { + super.testUserRollback003(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserRollback004() throws java.lang.Exception { + super.testUserRollback004(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserRollback005() throws java.lang.Exception { + super.testUserRollback005(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientEjbTest.java new file mode 100644 index 0000000000..713d1e1b34 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientEjbTest.java @@ -0,0 +1,203 @@ +package com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly; + +import com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-appclient") + +public class UserSetRollbackOnlyClientEjbTest extends com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient { + static final String VEHICLE_ARCHIVE = "setrollbackonly_ejb_vehicle"; + + private static String packagePath = UserSetRollbackOnlyClientEjbTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserSetRollbackOnlyClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + setrollbackonly_ejb_vehicle: + setrollbackonly_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + setrollbackonly_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + setrollbackonly_jsp_vehicle: + setrollbackonly_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + setrollbackonly_servlet_vehicle: + setrollbackonly_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive setrollbackonly_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "setrollbackonly_ejb_vehicle_client.jar"); + // The class files + setrollbackonly_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetRollbackOnlyClientEjbTest.class + ); + // The application-client.xml descriptor + // TODO: replace display-name + URL resURL = UserSetRollbackOnlyClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + if(resURL != null) { + setrollbackonly_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + // resURL = UserSetRollbackOnlyClient.class.getResource("//com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml"); + // if(resURL != null) { + // setrollbackonly_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + // } + setrollbackonly_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + UserSetRollbackOnlyClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(setrollbackonly_ejb_vehicle_client, UserSetRollbackOnlyClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive setrollbackonly_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "setrollbackonly_ejb_vehicle_ejb.jar"); + // The class files + setrollbackonly_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetRollbackOnlyClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = UserSetRollbackOnlyClientEjbTest.class.getResource("/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + setrollbackonly_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = UserSetRollbackOnlyClientEjbTest.class.getResource("/setrollbackonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + setrollbackonly_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(setrollbackonly_ejb_vehicle_ejb, UserSetRollbackOnlyClientEjbTest.class, ejbResURL); + + // Ear + EnterpriseArchive setrollbackonly_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "setrollbackonly_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + setrollbackonly_ejb_vehicle_ear.addAsModule(setrollbackonly_ejb_vehicle_ejb); + setrollbackonly_ejb_vehicle_ear.addAsModule(setrollbackonly_ejb_vehicle_client); + + + + // // The application.xml descriptor + // URL earResURL = UserSetRollbackOnlyClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/"); + // if(earResURL != null) { + // setrollbackonly_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // The sun-application.xml descriptor + URL earResURL = UserSetRollbackOnlyClientEjbTest.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_client.jar.sun-application-client.xml"); + if(earResURL != null) { + setrollbackonly_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + } + archiveProcessor.processEarArchive(setrollbackonly_ejb_vehicle_ear, UserSetRollbackOnlyClientEjbTest.class, earResURL); + return setrollbackonly_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserSetRollbackOnly001() throws java.lang.Exception { + super.testUserSetRollbackOnly001(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserSetRollbackOnly002() throws java.lang.Exception { + super.testUserSetRollbackOnly002(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserSetRollbackOnly003() throws java.lang.Exception { + super.testUserSetRollbackOnly003(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserSetRollbackOnly004() throws java.lang.Exception { + super.testUserSetRollbackOnly004(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientJspTest.java new file mode 100644 index 0000000000..1c90c0fa47 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientJspTest.java @@ -0,0 +1,172 @@ +package com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly; + +import com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserSetRollbackOnlyClientJspTest extends com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient { + static final String VEHICLE_ARCHIVE = "setrollbackonly_jsp_vehicle"; + + private static String packagePath = UserSetRollbackOnlyClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserSetRollbackOnlyClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + setrollbackonly_ejb_vehicle: + setrollbackonly_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + setrollbackonly_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + setrollbackonly_jsp_vehicle: + setrollbackonly_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + setrollbackonly_servlet_vehicle: + setrollbackonly_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive setrollbackonly_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "setrollbackonly_jsp_vehicle_web.war"); + // The class files + setrollbackonly_jsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetRollbackOnlyClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = UserSetRollbackOnlyClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + setrollbackonly_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // Web content + warResURL = UserSetRollbackOnlyClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + setrollbackonly_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = UserSetRollbackOnlyClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + setrollbackonly_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + warResURL = UserSetRollbackOnlyClientJspTest.class.getClassLoader().getResource(packagePath+"/setrollbackonly_jsp_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + setrollbackonly_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + archiveProcessor.processWebArchive(setrollbackonly_jsp_vehicle_web, UserSetRollbackOnlyClientJspTest.class, warResURL); + + // Ear + EnterpriseArchive setrollbackonly_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "setrollbackonly_jsp_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + setrollbackonly_jsp_vehicle_ear.addAsModule(setrollbackonly_jsp_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserSetRollbackOnlyClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/"); + // if(earResURL != null) { + // setrollbackonly_jsp_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserSetRollbackOnlyClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/.ear.sun-application.xml"); + // if(earResURL != null) { + // setrollbackonly_jsp_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(setrollbackonly_jsp_vehicle_ear, UserSetRollbackOnlyClient.class, earResURL); + + return setrollbackonly_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserSetRollbackOnly001() throws java.lang.Exception { + super.testUserSetRollbackOnly001(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserSetRollbackOnly002() throws java.lang.Exception { + super.testUserSetRollbackOnly002(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserSetRollbackOnly003() throws java.lang.Exception { + super.testUserSetRollbackOnly003(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserSetRollbackOnly004() throws java.lang.Exception { + super.testUserSetRollbackOnly004(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientServletTest.java new file mode 100644 index 0000000000..e517cc2fea --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/UserSetRollbackOnlyClientServletTest.java @@ -0,0 +1,168 @@ +package com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly; + +import com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserSetRollbackOnlyClientServletTest extends com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient { + static final String VEHICLE_ARCHIVE = "setrollbackonly_servlet_vehicle"; + + private static String packagePath = UserSetRollbackOnlyClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserSetRollbackOnlyClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + setrollbackonly_ejb_vehicle: + setrollbackonly_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + setrollbackonly_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + setrollbackonly_jsp_vehicle: + setrollbackonly_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + setrollbackonly_servlet_vehicle: + setrollbackonly_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive setrollbackonly_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "setrollbackonly_servlet_vehicle_web.war"); + // The class files + setrollbackonly_servlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.jta.ee.usertransaction.setrollbackonly.UserSetRollbackOnlyClient.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetRollbackOnlyClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = UserSetRollbackOnlyClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + setrollbackonly_servlet_vehicle_web.setWebXML(warResURL); + } + // The sun-web.xml descriptor + warResURL = UserSetRollbackOnlyClientServletTest.class.getClassLoader().getResource(packagePath+"/setrollbackonly_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + setrollbackonly_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + archiveProcessor.processWebArchive(setrollbackonly_servlet_vehicle_web, UserSetRollbackOnlyClientServletTest.class, warResURL); + + // Ear + EnterpriseArchive setrollbackonly_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "setrollbackonly_servlet_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + setrollbackonly_servlet_vehicle_ear.addAsModule(setrollbackonly_servlet_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserSetRollbackOnlyClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/"); + // if(earResURL != null) { + // setrollbackonly_servlet_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserSetRollbackOnlyClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/.ear.sun-application.xml"); + // if(earResURL != null) { + // setrollbackonly_servlet_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(setrollbackonly_servlet_vehicle_ear, UserSetRollbackOnlyClient.class, earResURL); + + return setrollbackonly_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserSetRollbackOnly001() throws java.lang.Exception { + super.testUserSetRollbackOnly001(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserSetRollbackOnly002() throws java.lang.Exception { + super.testUserSetRollbackOnly002(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserSetRollbackOnly003() throws java.lang.Exception { + super.testUserSetRollbackOnly003(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserSetRollbackOnly004() throws java.lang.Exception { + super.testUserSetRollbackOnly004(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml deleted file mode 100644 index af54232b7e..0000000000 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - jsp_vehicle - - jsp_vehicle - /jsp_vehicle.jsp - 0 - - - 54 - - - jdbc/DB1 - javax.sql.DataSource - Container - Shareable - - diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml deleted file mode 100644 index e6178bc18a..0000000000 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - servlet_vehicle - - Servlet_VehicleLogicalName - com.sun.ts.tests.common.vehicle.servlet.ServletVehicle - - - Servlet_VehicleLogicalName - /servlet_vehicle - - - 54 - - - jdbc/DB1 - javax.sql.DataSource - Container - Shareable - - diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientEjbTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientEjbTest.java new file mode 100644 index 0000000000..154d00a1f5 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientEjbTest.java @@ -0,0 +1,188 @@ +package com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout; + +import com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-appclient") + +public class UserSetTransactionTimeoutClientEjbTest extends com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient { + static final String VEHICLE_ARCHIVE = "settransactiontimeout_ejb_vehicle"; + + private static String packagePath = UserSetTransactionTimeoutClientEjbTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserSetTransactionTimeoutClientEjbTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + settransactiontimeout_ejb_vehicle: + settransactiontimeout_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + settransactiontimeout_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + settransactiontimeout_jsp_vehicle: + settransactiontimeout_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + settransactiontimeout_servlet_vehicle: + settransactiontimeout_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + Client: + + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.xml + Ejb: + + /com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/ejb_vehicle_ejb.xml + /com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_ejb.xml + Ear: + + */ + @TargetsContainer("tck-appclient") + @OverProtocol("appclient") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // Client + // the jar with the correct archive name + JavaArchive settransactiontimeout_ejb_vehicle_client = ShrinkWrap.create(JavaArchive.class, "settransactiontimeout_ejb_vehicle_client.jar"); + // The class files + settransactiontimeout_ejb_vehicle_client.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRunner.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class + ); + // The application-client.xml descriptor + // TODO change client name + URL resURL = UserSetTransactionTimeoutClientEjbTest.class.getResource("/vehicle/ejb/ejb_vehicle_client.xml"); + if(resURL != null) { + settransactiontimeout_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + } + // // The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension? + // resURL = UserSetTransactionTimeoutClient.class.getResource("//com/sun/ts/tests/common/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml"); + // if(resURL != null) { + // settransactiontimeout_ejb_vehicle_client.addAsManifestResource(resURL, "application-client.xml"); + // } + settransactiontimeout_ejb_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + UserSetTransactionTimeoutClientEjbTest.class.getName() + "\n"), "MANIFEST.MF"); + archiveProcessor.processClientArchive(settransactiontimeout_ejb_vehicle_client, UserSetTransactionTimeoutClientEjbTest.class, resURL); + + + // Ejb + // the jar with the correct archive name + JavaArchive settransactiontimeout_ejb_vehicle_ejb = ShrinkWrap.create(JavaArchive.class, "settransactiontimeout_ejb_vehicle_ejb.jar"); + // The class files + settransactiontimeout_ejb_vehicle_ejb.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetTransactionTimeoutClientEjbTest.class + ); + // The ejb-jar.xml descriptor + URL ejbResURL = UserSetTransactionTimeoutClientEjbTest.class.getResource("/ejb_vehicle_ejb.xml"); + if(ejbResURL != null) { + settransactiontimeout_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "ejb-jar.xml"); + } + // The sun-ejb-jar.xml file + ejbResURL = UserSetTransactionTimeoutClientEjbTest.class.getResource("/settransactiontimeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml"); + if(ejbResURL != null) { + settransactiontimeout_ejb_vehicle_ejb.addAsManifestResource(ejbResURL, "sun-ejb-jar.xml"); + } + archiveProcessor.processEjbArchive(settransactiontimeout_ejb_vehicle_ejb, UserSetTransactionTimeoutClientEjbTest.class, ejbResURL); + + // Ear + EnterpriseArchive settransactiontimeout_ejb_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "settransactiontimeout_ejb_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + settransactiontimeout_ejb_vehicle_ear.addAsModule(settransactiontimeout_ejb_vehicle_ejb); + settransactiontimeout_ejb_vehicle_ear.addAsModule(settransactiontimeout_ejb_vehicle_client); + + + // // The application.xml descriptor + // URL earResURL = UserSetTransactionTimeoutClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/"); + // if(earResURL != null) { + // settransactiontimeout_ejb_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // The sun-application.xml descriptor + URL earResURL = UserSetTransactionTimeoutClientEjbTest.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_client.jar.sun-application-client.xml"); + if(earResURL != null) { + settransactiontimeout_ejb_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + } + archiveProcessor.processEarArchive(settransactiontimeout_ejb_vehicle_ear, UserSetTransactionTimeoutClientEjbTest.class, earResURL); + + return settransactiontimeout_ejb_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserSetTransactionTimeout001() throws java.lang.Exception { + super.testUserSetTransactionTimeout001(); + } + + @Test + @Override + @TargetVehicle("ejb") + public void testUserSetTransactionTimeout002() throws java.lang.Exception { + super.testUserSetTransactionTimeout002(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientJspTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientJspTest.java new file mode 100644 index 0000000000..ffb3e56b38 --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientJspTest.java @@ -0,0 +1,159 @@ +package com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout; + +import com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserSetTransactionTimeoutClientJspTest extends com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient { + static final String VEHICLE_ARCHIVE = "settransactiontimeout_jsp_vehicle"; + + private static String packagePath = UserSetTransactionTimeoutClientJspTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserSetTransactionTimeoutClientJspTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + settransactiontimeout_ejb_vehicle: + settransactiontimeout_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + settransactiontimeout_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + settransactiontimeout_jsp_vehicle: + settransactiontimeout_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + settransactiontimeout_servlet_vehicle: + settransactiontimeout_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/jsp/jsp_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive settransactiontimeout_jsp_vehicle_web = ShrinkWrap.create(WebArchive.class, "settransactiontimeout_jsp_vehicle_web.war"); + // The class files + settransactiontimeout_jsp_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetTransactionTimeoutClientJspTest.class + ); + // The web.xml descriptor + URL warResURL = UserSetTransactionTimeoutClientJspTest.class.getClassLoader().getResource(packagePath+"/jsp_vehicle_web.xml"); + if(warResURL != null) { + settransactiontimeout_jsp_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); + } + // Web content + warResURL = UserSetTransactionTimeoutClientJspTest.class.getResource("/vehicle/jsp/contentRoot/client.html"); + settransactiontimeout_jsp_vehicle_web.addAsWebResource(warResURL, "/client.html"); + warResURL = UserSetTransactionTimeoutClientJspTest.class.getResource("/vehicle/jsp/contentRoot/jsp_vehicle.jsp"); + settransactiontimeout_jsp_vehicle_web.addAsWebResource(warResURL, "/jsp_vehicle.jsp"); + + // The sun-web.xml descriptor + warResURL = UserSetTransactionTimeoutClientJspTest.class.getClassLoader().getResource(packagePath+"/settransactiontimeout_jsp_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + settransactiontimeout_jsp_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + + archiveProcessor.processWebArchive(settransactiontimeout_jsp_vehicle_web, UserSetTransactionTimeoutClientJspTest.class, warResURL); + + // Ear + EnterpriseArchive settransactiontimeout_jsp_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "settransactiontimeout_jsp_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + settransactiontimeout_jsp_vehicle_ear.addAsModule(settransactiontimeout_jsp_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserSetTransactionTimeoutClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/"); + // if(earResURL != null) { + // settransactiontimeout_jsp_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserSetTransactionTimeoutClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/.ear.sun-application.xml"); + // if(earResURL != null) { + // settransactiontimeout_jsp_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(settransactiontimeout_jsp_vehicle_ear, UserSetTransactionTimeoutClient.class, earResURL); + + return settransactiontimeout_jsp_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserSetTransactionTimeout001() throws java.lang.Exception { + super.testUserSetTransactionTimeout001(); + } + + @Test + @Override + @TargetVehicle("jsp") + public void testUserSetTransactionTimeout002() throws java.lang.Exception { + super.testUserSetTransactionTimeout002(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientServletTest.java b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientServletTest.java new file mode 100644 index 0000000000..f0b1cbaebd --- /dev/null +++ b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/UserSetTransactionTimeoutClientServletTest.java @@ -0,0 +1,154 @@ +package com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout; + +import com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient; +import java.net.URL; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.container.test.api.OverProtocol; +import org.jboss.arquillian.container.test.api.TargetsContainer; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; +import tck.arquillian.porting.lib.spi.TestArchiveProcessor; +import tck.arquillian.protocol.common.TargetVehicle; + +import java.lang.System.Logger; + +@ExtendWith(ArquillianExtension.class) +@Tag("jta") +@Tag("platform") +@Tag("web") +@Tag("tck-javatest") + +public class UserSetTransactionTimeoutClientServletTest extends com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient { + static final String VEHICLE_ARCHIVE = "settransactiontimeout_servlet_vehicle"; + + private static String packagePath = UserSetTransactionTimeoutClientServletTest.class.getPackageName().replace(".", "/"); + + private static final Logger logger = System.getLogger(UserSetTransactionTimeoutClientServletTest.class.getName()); + + @BeforeEach + void logStartTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "STARTING TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + void logFinishTest(TestInfo testInfo) { + logger.log(Logger.Level.INFO, "FINISHED TEST : " + testInfo.getDisplayName()); + } + + @AfterEach + public void cleanup() { + logger.log(Logger.Level.INFO, "cleanup ok"); + } + + /** + EE10 Deployment Descriptors: + settransactiontimeout_ejb_vehicle: + settransactiontimeout_ejb_vehicle_client: META-INF/application-client.xml,jar.sun-application-client.xml + settransactiontimeout_ejb_vehicle_ejb: META-INF/ejb-jar.xml,jar.sun-ejb-jar.xml + settransactiontimeout_jsp_vehicle: + settransactiontimeout_jsp_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + settransactiontimeout_servlet_vehicle: + settransactiontimeout_servlet_vehicle_web: WEB-INF/web.xml,war.sun-web.xml + + Found Descriptors: + War: + + /com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml + /com/sun/ts/tests/common/vehicle/servlet/servlet_vehicle_web.xml + Ear: + + */ + @TargetsContainer("tck-javatest") + @OverProtocol("javatest") + @Deployment(name = VEHICLE_ARCHIVE, order = 2) + public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + // War + // the war with the correct archive name + WebArchive settransactiontimeout_servlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "settransactiontimeout_servlet_vehicle_web.war"); + // The class files + settransactiontimeout_servlet_vehicle_web.addClasses( + com.sun.ts.tests.common.vehicle.VehicleRunnerFactory.class, + com.sun.ts.lib.harness.EETest.Fault.class, + com.sun.ts.tests.jta.ee.common.Transact.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.usertransaction.settransactiontimeout.UserSetTransactionTimeoutClient.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.tests.common.vehicle.VehicleRunnable.class, + com.sun.ts.tests.jta.ee.common.InvalidStatusException.class, + com.sun.ts.tests.jta.ee.common.InitFailedException.class, + com.sun.ts.lib.harness.EETest.class, + com.sun.ts.lib.harness.ServiceEETest.class, + com.sun.ts.tests.jta.ee.common.TransactionStatus.class, + com.sun.ts.lib.harness.EETest.SetupException.class, + com.sun.ts.tests.common.vehicle.VehicleClient.class, + UserSetTransactionTimeoutClientServletTest.class + ); + // The web.xml descriptor + URL warResURL = UserSetTransactionTimeoutClientServletTest.class.getClassLoader().getResource(packagePath+"/servlet_vehicle_web.xml"); + if(warResURL != null) { + settransactiontimeout_servlet_vehicle_web.setWebXML(warResURL); + } + // The sun-web.xml descriptor + warResURL = UserSetTransactionTimeoutClientServletTest.class.getClassLoader().getResource(packagePath+"/settransactiontimeout_servlet_vehicle_web.war.sun-web.xml"); + if(warResURL != null) { + settransactiontimeout_servlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); + } + // Web content + archiveProcessor.processWebArchive(settransactiontimeout_servlet_vehicle_web, UserSetTransactionTimeoutClientServletTest.class, warResURL); + + // Ear + EnterpriseArchive settransactiontimeout_servlet_vehicle_ear = ShrinkWrap.create(EnterpriseArchive.class, "settransactiontimeout_servlet_vehicle.ear"); + + // Any libraries added to the ear + + // The component jars built by the package target + settransactiontimeout_servlet_vehicle_ear.addAsModule(settransactiontimeout_servlet_vehicle_web); + + + + // // The application.xml descriptor + // URL earResURL = UserSetTransactionTimeoutClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/"); + // if(earResURL != null) { + // settransactiontimeout_servlet_vehicle_ear.addAsManifestResource(earResURL, "application.xml"); + // } + // // The sun-application.xml descriptor + // earResURL = UserSetTransactionTimeoutClient.class.getResource("/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/.ear.sun-application.xml"); + // if(earResURL != null) { + // settransactiontimeout_servlet_vehicle_ear.addAsManifestResource(earResURL, "sun-application.xml"); + // } + // archiveProcessor.processEarArchive(settransactiontimeout_servlet_vehicle_ear, UserSetTransactionTimeoutClient.class, earResURL); + + return settransactiontimeout_servlet_vehicle_ear; + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserSetTransactionTimeout001() throws java.lang.Exception { + super.testUserSetTransactionTimeout001(); + } + + @Test + @Override + @TargetVehicle("servlet") + public void testUserSetTransactionTimeout002() throws java.lang.Exception { + super.testUserSetTransactionTimeout002(); + } + + +} \ No newline at end of file diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml deleted file mode 100644 index af54232b7e..0000000000 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - jsp_vehicle - - jsp_vehicle - /jsp_vehicle.jsp - 0 - - - 54 - - - jdbc/DB1 - javax.sql.DataSource - Container - Shareable - - diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml b/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml deleted file mode 100644 index e6178bc18a..0000000000 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - servlet_vehicle - - Servlet_VehicleLogicalName - com.sun.ts.tests.common.vehicle.servlet.ServletVehicle - - - Servlet_VehicleLogicalName - /servlet_vehicle - - - 54 - - - jdbc/DB1 - javax.sql.DataSource - Container - Shareable - - diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/ejb_vehicle_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml similarity index 97% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml index 73341d1759..5743a8047b 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jsp_vehicle_web.xml @@ -18,7 +18,7 @@ --> - jsp_vehicle + txpropagationtest_jsp_vehicle jsp_vehicle /jsp_vehicle.jsp diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate1_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml index 5cd15de582..1f15833687 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.jar.sun-ejb-jar.xml @@ -28,8 +28,8 @@ jdbc/DB1 jdbc/DB1 - user1 - password1 + cts1 + cts1 false diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate2_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml index 31580dd16a..27297f4df3 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.jar.sun-ejb-jar.xml @@ -28,8 +28,8 @@ jdbc/DB1 jdbc/DB1 - user1 - password1 + cts1 + cts1 false diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ee_txpropagate3_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml similarity index 95% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml index ed8a2d5d04..1dc2b4abe4 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_jsp_vehicle_web.war.sun-web.xml @@ -27,8 +27,8 @@ jdbc/DB1 jdbc/DB1 - user1 - password1 + cts1 + cts1 diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml similarity index 95% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml index 3a2c21f800..b81ab67514 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/jta_servlet_vehicle_web.war.sun-web.xml @@ -27,8 +27,8 @@ jdbc/DB1 jdbc/DB1 - user1 - password1 + cts1 + cts1 diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml similarity index 97% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml index 626466c5c0..512ea988e7 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/txpropagationtest/servlet_vehicle_web.xml @@ -18,7 +18,7 @@ --> - servlet_vehicle + txpropagationtest_servlet_vehicle Servlet_VehicleLogicalName com.sun.ts.tests.common.vehicle.servlet.ServletVehicle diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/appclient_vehicle_client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/appclient_vehicle_client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/appclient_vehicle_client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/appclient_vehicle_client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_jsp_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_jsp_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_servlet_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/begin_servlet_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/ejb_vehicle_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml index af54232b7e..165f9aaa5e 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml @@ -18,7 +18,7 @@ --> - jsp_vehicle + begin_jsp_vehicle jsp_vehicle /jsp_vehicle.jsp diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml index e6178bc18a..72589156e0 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/begin/servlet_vehicle_web.xml @@ -18,7 +18,7 @@ --> - servlet_vehicle + begin_servlet_vehicle Servlet_VehicleLogicalName com.sun.ts.tests.common.vehicle.servlet.ServletVehicle diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/appclient_vehicle_client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/appclient_vehicle_client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/appclient_vehicle_client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/appclient_vehicle_client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_jsp_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_jsp_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_servlet_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/commit_servlet_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/ejb_vehicle_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml index af54232b7e..727d696ed4 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml @@ -18,7 +18,7 @@ --> - jsp_vehicle + commit_jsp_vehicle jsp_vehicle /jsp_vehicle.jsp diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml index e6178bc18a..59939e89ad 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml @@ -18,7 +18,7 @@ --> - servlet_vehicle + commit_servlet_vehicle Servlet_VehicleLogicalName com.sun.ts.tests.common.vehicle.servlet.ServletVehicle diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/appclient_vehicle_client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/appclient_vehicle_client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/appclient_vehicle_client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/appclient_vehicle_client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/ejb_vehicle_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_jsp_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_jsp_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_servlet_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/getstatus_servlet_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml index af54232b7e..820b75975b 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/begin/jsp_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/jsp_vehicle_web.xml @@ -18,7 +18,7 @@ --> - jsp_vehicle + getstatus_jsp_vehicle jsp_vehicle /jsp_vehicle.jsp diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml index e6178bc18a..f27ab61ec8 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/getstatus/servlet_vehicle_web.xml @@ -18,7 +18,7 @@ --> - servlet_vehicle + getstatus_servlet_vehicle Servlet_VehicleLogicalName com.sun.ts.tests.common.vehicle.servlet.ServletVehicle diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/appclient_vehicle_client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/appclient_vehicle_client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/appclient_vehicle_client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/appclient_vehicle_client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/ejb_vehicle_ejb.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml index af54232b7e..69de9f6a2c 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/jsp_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/jsp_vehicle_web.xml @@ -18,7 +18,7 @@ --> - jsp_vehicle + rollback_jsp_vehicle jsp_vehicle /jsp_vehicle.jsp diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_jsp_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_jsp_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_servlet_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/rollback_servlet_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml similarity index 96% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml index e6178bc18a..ecacfd9d24 100644 --- a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/commit/servlet_vehicle_web.xml +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/rollback/servlet_vehicle_web.xml @@ -18,7 +18,7 @@ --> - servlet_vehicle + rollback_servlet_vehicle Servlet_VehicleLogicalName com.sun.ts.tests.common.vehicle.servlet.ServletVehicle diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/appclient_vehicle_client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/appclient_vehicle_client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/appclient_vehicle_client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/appclient_vehicle_client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/ejb_vehicle_ejb.xml diff --git a/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml new file mode 100644 index 0000000000..fb5231e841 --- /dev/null +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/jsp_vehicle_web.xml @@ -0,0 +1,36 @@ + + + + + setrollbackonly_jsp_vehicle + + jsp_vehicle + /jsp_vehicle.jsp + 0 + + + 54 + + + jdbc/DB1 + javax.sql.DataSource + Container + Shareable + + diff --git a/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml new file mode 100644 index 0000000000..bfa2471f94 --- /dev/null +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/servlet_vehicle_web.xml @@ -0,0 +1,39 @@ + + + + + setrollbackonly_servlet_vehicle + + Servlet_VehicleLogicalName + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle + + + Servlet_VehicleLogicalName + /servlet_vehicle + + + 54 + + + jdbc/DB1 + javax.sql.DataSource + Container + Shareable + + diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_jsp_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_jsp_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_servlet_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/setrollbackonly/setrollbackonly_servlet_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/appclient_vehicle_client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/appclient_vehicle_client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/appclient_vehicle_client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/appclient_vehicle_client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/ejb_vehicle_ejb.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/ejb_vehicle_ejb.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/ejb_vehicle_ejb.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/ejb_vehicle_ejb.xml diff --git a/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml new file mode 100644 index 0000000000..d0c57baa30 --- /dev/null +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/jsp_vehicle_web.xml @@ -0,0 +1,36 @@ + + + + + settransactiontimeout_jsp_vehicle + + jsp_vehicle + /jsp_vehicle.jsp + 0 + + + 54 + + + jdbc/DB1 + javax.sql.DataSource + Container + Shareable + + diff --git a/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml new file mode 100644 index 0000000000..2f36ccd6be --- /dev/null +++ b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/servlet_vehicle_web.xml @@ -0,0 +1,39 @@ + + + + + settransactiontimeout_servlet_vehicle + + Servlet_VehicleLogicalName + com.sun.ts.tests.common.vehicle.servlet.ServletVehicle + + + Servlet_VehicleLogicalName + /servlet_vehicle + + + 54 + + + jdbc/DB1 + javax.sql.DataSource + Container + Shareable + + diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_client.jar.sun-application-client.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_client.jar.sun-application-client.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_client.jar.sun-application-client.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_ejb_vehicle_ejb.jar.sun-ejb-jar.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_jsp_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_jsp_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_jsp_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_jsp_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_servlet_vehicle_web.war.sun-web.xml b/jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_servlet_vehicle_web.war.sun-web.xml similarity index 100% rename from jta/src/main/java/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_servlet_vehicle_web.war.sun-web.xml rename to jta/src/main/resources/com/sun/ts/tests/jta/ee/usertransaction/settransactiontimeout/settransactiontimeout_servlet_vehicle_web.war.sun-web.xml diff --git a/jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml new file mode 100644 index 0000000000..5a60880143 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.jar.sun-application-client.xml @@ -0,0 +1,26 @@ + + + + + + + ejb/EJBVehicle + com_sun_ts_tests_common_vehicle_ejb_EJBVehicle + + diff --git a/jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.xml b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.xml new file mode 100644 index 0000000000..e548026fae --- /dev/null +++ b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_client.xml @@ -0,0 +1,28 @@ + + + + + TS ejbvehicle client + ejb_vehicle_client + + ejb/EJBVehicle + Session + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote + + diff --git a/jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.jar.sun-ejb-jar.xml b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.jar.sun-ejb-jar.xml new file mode 100644 index 0000000000..21dd1cab5a --- /dev/null +++ b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.jar.sun-ejb-jar.xml @@ -0,0 +1,49 @@ + + + + + + + 0 + + com_sun_ts_tests_common_vehicle_ejb_EJBVehicle + com_sun_ts_tests_common_vehicle_ejb_EJBVehicle + false + + + supported + supported + supported + supported + + + username_password + default + false + + + supported + + + false + -1 + + + + diff --git a/jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.xml b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.xml new file mode 100644 index 0000000000..09ad3eae1e --- /dev/null +++ b/jta/src/main/resources/vehicle/ejb/ejb_vehicle_ejb.xml @@ -0,0 +1,44 @@ + + + + + Ejb1 + + + com_sun_ts_tests_common_vehicle_ejb_EJBVehicle + com.sun.ts.tests.common.vehicle.ejb.EJBVehicleRemote + com.sun.ts.tests.common.vehicle.ejb.EJBVehicle + Stateful + Container + + + + + + + + + com_sun_ts_tests_common_vehicle_ejb_EJBVehicle + Remote + runTest + + Required + + + diff --git a/jta/src/main/resources/vehicle/ejblitejsf/beans.xml b/jta/src/main/resources/vehicle/ejblitejsf/beans.xml new file mode 100644 index 0000000000..3e07dee756 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsf/beans.xml @@ -0,0 +1,22 @@ + + + + diff --git a/jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle.xhtml b/jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle.xhtml new file mode 100644 index 0000000000..3579776664 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle.xhtml @@ -0,0 +1,25 @@ + + + + + #{param['testName']}_from_ejblitejsf + + #{client.status} #{client.reason} + + diff --git a/jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle_web.xml b/jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle_web.xml new file mode 100644 index 0000000000..cb9e27c689 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsf/ejblitejsf_vehicle_web.xml @@ -0,0 +1,31 @@ + + + + + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + diff --git a/jta/src/main/resources/vehicle/ejblitejsf/faces-config.xml b/jta/src/main/resources/vehicle/ejblitejsf/faces-config.xml new file mode 100644 index 0000000000..e62777280e --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsf/faces-config.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/jta/src/main/resources/vehicle/ejblitejsp/EJBLiteJSPTag.java.txt b/jta/src/main/resources/vehicle/ejblitejsp/EJBLiteJSPTag.java.txt new file mode 100644 index 0000000000..870098c2e6 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsp/EJBLiteJSPTag.java.txt @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package @package@; + +import jakarta.servlet.jsp.JspContext; +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.tagext.JspFragment; +import jakarta.servlet.jsp.tagext.JspTag; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.tagext.SimpleTag; +import java.io.IOException; + +public class EJBLiteJSPTag extends Client implements SimpleTag { + /** Reference to the enclosing tag. */ + private JspTag parentTag; + + /** The JSP context for the upcoming tag invocation. */ + private JspContext jspContext; + + /** The body of the tag. */ + private JspFragment jspBody; + + /** + * Called by the container to invoke this tag. + * The implementation of this method is provided by the tag library developer, + * and handles all tag processing, body iteration, etc. + */ + public void doTag() throws JspException { + JspWriter out = getJspContext().getOut(); + setModuleName( + ((PageContext) getJspContext()).getServletContext().getContextPath() ); + String sta = getStatus(); //to trigger the test run + getJspContext().setAttribute("statusAndReason", sta + " " + getReason()); + JspFragment f = getJspBody(); + if (f != null) { + try { + f.invoke(out); + } catch (IOException e) { + throw new JspException(e); + } + } + } + + /** + * Sets the parent of this tag, for collaboration purposes. + *

+ * The container invokes this method only if this tag invocation is + * nested within another tag invocation. + * + * @param parent the tag that encloses this tag + */ + public void setParent(JspTag parent) { + this.parentTag = parent; + } + + /** + * Returns the parent of this tag, for collaboration purposes. + * + * @return the parent of this tag + */ + public JspTag getParent() { + return this.parentTag; + } + + /** + * Stores the provided JSP context in the private jspContext field. + * Subclasses can access the JspContext via + * getJspContext(). + * + * @param pc the page context for this invocation + * @see SimpleTag#setJspContext + */ + public void setJspContext(JspContext pc) { + this.jspContext = pc; + } + + /** + * Returns the page context passed in by the container via + * setJspContext. + * + * @return the page context for this invocation + */ + protected JspContext getJspContext() { + return this.jspContext; + } + + /** + * Stores the provided JspFragment. + * + * @param jspBody The fragment encapsulating the body of this tag. + * If the action element is empty in the page, this method is + * not called at all. + * @see SimpleTag#setJspBody + */ + public void setJspBody(JspFragment jspBody) { + this.jspBody = jspBody; + } + + /** + * Returns the body passed in by the container via setJspBody. + * + * @return the fragment encapsulating the body of this tag, or + * null if the action element is empty in the page. + */ + protected JspFragment getJspBody() { + return this.jspBody; + } + +} diff --git a/jta/src/main/resources/vehicle/ejblitejsp/beans.xml b/jta/src/main/resources/vehicle/ejblitejsp/beans.xml new file mode 100644 index 0000000000..3e07dee756 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsp/beans.xml @@ -0,0 +1,22 @@ + + + + diff --git a/jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp.tld b/jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp.tld new file mode 100644 index 0000000000..b34e4806f7 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp.tld @@ -0,0 +1,45 @@ + + + + + 1.0 + ejblitejsp + /WEB-INF/tlds/ejblitejsp + + EJBLiteJSPTag + com.sun.ts.tests.jta.ee.transactional.EJBLiteJSPTag + scriptless + + to display return value of getReason() + statusAndReason + + + testName + true + true + java.lang.String + + + injectionSupported + true + true + java.lang.Boolean + + + diff --git a/jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp_vehicle.jsp b/jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp_vehicle.jsp new file mode 100644 index 0000000000..b99df69627 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejblitejsp/ejblitejsp_vehicle.jsp @@ -0,0 +1,30 @@ +<%-- + + Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + +--%> + +<%@page contentType="text/html"%> +<%@taglib prefix="ejblitejsp" uri="/WEB-INF/tlds/ejblitejsp.tld"%> +<%@taglib prefix="c" uri="jakarta.tags.core"%> + + + ${param['testName']}_from_ejblitejsp + + + + + + diff --git a/jta/src/main/resources/vehicle/ejbliteservlet/EJBLiteServletVehicle.java.txt b/jta/src/main/resources/vehicle/ejbliteservlet/EJBLiteServletVehicle.java.txt new file mode 100644 index 0000000000..72e78bc162 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet/EJBLiteServletVehicle.java.txt @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package @package@; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Enumeration; +import java.util.Iterator; +import jakarta.servlet.Servlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import java.util.logging.Logger; +import java.util.logging.Level; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +public class EJBLiteServletVehicle extends Client + implements Servlet, ServletConfig { + + private static Logger logger = Logger.getLogger(EJBLiteServletVehicle.class.getName()); + + private HttpServletDelegate delegate = new HttpServletDelegate(); + + public void init(ServletConfig config) throws ServletException { + delegate.init(config); + } + + public ServletConfig getServletConfig() { + return delegate.getServletConfig(); + } + + public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { + delegate.service(request, response); + + setInjectionSupported(true); + String tn = request.getParameter("testName"); + logger.fine("EJBLiteServletVehicle processing request testName=" + tn); + setTestName(tn); + setModuleName(getServletContext().getContextPath()); + String sta = getStatus(); //to trigger the test run + + PrintWriter pw = response.getWriter(); + pw.println(sta + " " + getReason()); + cleanup(); //need to reset all fields since servlet instances are shared + + } + + public String getServletInfo() { + return delegate.getServletInfo(); + } + + public void destroy() { + delegate.destroy(); + delegate = null; + } + + public String getServletName() { + return delegate.getServletName(); + } + + public ServletContext getServletContext() { + return delegate.getServletContext(); + } + + public String getInitParameter(String arg0) { + return delegate.getInitParameter(arg0); + } + + public Enumeration getInitParameterNames() { + return delegate.getInitParameterNames(); + } + + +} diff --git a/jta/src/main/resources/vehicle/ejbliteservlet/HttpServletDelegate.java.txt b/jta/src/main/resources/vehicle/ejbliteservlet/HttpServletDelegate.java.txt new file mode 100644 index 0000000000..1ffa9276d4 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet/HttpServletDelegate.java.txt @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + + package @package@; + +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.ServletException; +import java.util.logging.Logger; +import java.util.logging.Level; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +public class HttpServletDelegate extends HttpServlet { + + private static Logger logger = Logger.getLogger(HttpServletDelegate.class.getName()); + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + private void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/plain"); + } + } diff --git a/jta/src/main/resources/vehicle/ejbliteservlet/beans.xml b/jta/src/main/resources/vehicle/ejbliteservlet/beans.xml new file mode 100644 index 0000000000..3e07dee756 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet/beans.xml @@ -0,0 +1,22 @@ + + + + diff --git a/jta/src/main/resources/vehicle/ejbliteservlet/ejbliteservlet_vehicle_web.xml b/jta/src/main/resources/vehicle/ejbliteservlet/ejbliteservlet_vehicle_web.xml new file mode 100644 index 0000000000..06e9e7adcf --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet/ejbliteservlet_vehicle_web.xml @@ -0,0 +1,29 @@ + + + + + + EJBLiteServletVehicle + com.sun.ts.tests.jta.ee.transactional.EJBLiteServletVehicle + + + EJBLiteServletVehicle + /ejbliteservlet_vehicle.jsp + + diff --git a/jta/src/main/resources/vehicle/ejbliteservlet2/EJBLiteServlet2Filter.java.txt b/jta/src/main/resources/vehicle/ejbliteservlet2/EJBLiteServlet2Filter.java.txt new file mode 100644 index 0000000000..2e4213ff97 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet2/EJBLiteServlet2Filter.java.txt @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/* + * $Id$ + */ + +package @package@; + +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.ServletResponse; +import java.util.logging.Logger; +import java.util.logging.Level; + +public class EJBLiteServlet2Filter extends Client implements Filter { + private static Logger logger = Logger.getLogger(EJBLiteServlet2Filter.class.getName()); + private FilterConfig filterConfig; + + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) + throws IOException, ServletException { + response.setContentType("text/plain"); + setInjectionSupported(true); + String tn = request.getParameter("testName"); + if(logger.isLoggable(Level.FINE)) { + logger.fine("doFilter testName=" + tn); + } + setTestName(tn); + setModuleName( ((HttpServletRequest) request).getContextPath() ); + String sta = getStatus(); //to trigger the test run + PrintWriter pw = response.getWriter(); + pw.println(sta + " " + getReason()); + cleanup(); //need to reset all fields since filter instances are shared + //skip the rest of the chain + } + + public void destroy() { + } + + public void init(FilterConfig filterConfig) { + this.filterConfig = filterConfig; + } +} diff --git a/jta/src/main/resources/vehicle/ejbliteservlet2/beans.xml b/jta/src/main/resources/vehicle/ejbliteservlet2/beans.xml new file mode 100644 index 0000000000..3e07dee756 --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet2/beans.xml @@ -0,0 +1,22 @@ + + + + diff --git a/jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle.jsp b/jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle.jsp new file mode 100644 index 0000000000..585090e38d --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle.jsp @@ -0,0 +1,24 @@ +<%-- + + Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + +--%> + +<%@page contentType="text/html"%> + + + ${param['testName']}_from_ejbliteservlet2 + Intercepted by filter + diff --git a/jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle_web.xml b/jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle_web.xml new file mode 100644 index 0000000000..cc28daebeb --- /dev/null +++ b/jta/src/main/resources/vehicle/ejbliteservlet2/ejbliteservlet2_vehicle_web.xml @@ -0,0 +1,37 @@ + + + + + + EJBLiteServlet2Filter + com.sun.ts.tests.jta.ee.transactional.EJBLiteServlet2Filter + + + EJBLiteServlet2Filter + ejbliteservlet2_vehicle.jsp + + + ejbliteservlet2_vehicle.jsp + /ejbliteservlet2_vehicle.jsp + + + ejbliteservlet2_vehicle.jsp + /ejbliteservlet2_vehicle.jsp + + diff --git a/jta/src/main/resources/vehicle/jsp/contentRoot/client.html b/jta/src/main/resources/vehicle/jsp/contentRoot/client.html new file mode 100644 index 0000000000..fe2a10403c --- /dev/null +++ b/jta/src/main/resources/vehicle/jsp/contentRoot/client.html @@ -0,0 +1,30 @@ + + + + + + Invoke the generic Jsp for testing purposes + + +

Invoke the generic Jsp for testing purposes

+ + + Invoke the jsp here! + + diff --git a/jta/src/main/resources/vehicle/jsp/contentRoot/jsp_vehicle.jsp b/jta/src/main/resources/vehicle/jsp/contentRoot/jsp_vehicle.jsp new file mode 100644 index 0000000000..12ad682705 --- /dev/null +++ b/jta/src/main/resources/vehicle/jsp/contentRoot/jsp_vehicle.jsp @@ -0,0 +1,117 @@ +<%-- + + Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + +--%> + +<%@ page language="java" %> +<%@ page import="javax.naming.*" %> +<%@ page import="java.rmi.RemoteException" %> +<%@ page import="java.util.*" %> +<%@ page import="java.io.*" %> +<%@ page import="com.sun.ts.lib.util.*" %> +<%@ page import="com.sun.ts.lib.harness.*" %> +<%@ page import="com.sun.ts.lib.harness.Status" %> +<%@ page session="false" %> + +<%! Properties properties = null; + String[] arguments = null; + EETest testObj = null; + Properties stp=new Properties(); + StringBuffer propsData = new StringBuffer(); + +%> + +<%! private RemoteStatus runTest() throws RemoteException { + RemoteStatus sTestStatus = new RemoteStatus(Status.passed("")); + try + { + //call EETest impl's run method + sTestStatus = new RemoteStatus(testObj.run(arguments, properties)); + if(sTestStatus.getType() == Status.PASSED) + TestUtil.logMsg("Test running in jsp vehicle passed"); + else + TestUtil.logMsg("Test running in jsp vehicle failed"); + } + catch(Throwable e) + { + TestUtil.logErr("Test running in jsp vehicle failed", e); + sTestStatus = + new RemoteStatus(Status.failed("Test running in jsp vehicle failed")); + } + return sTestStatus; + } + +%> + +<% + try { + //get the inputstream and read any objects passed from the + //client, e.g. properties, args, etc. + //wrap the Inputstream in an ObjectInputstream and read + //the properties and args. + TestUtil.logTrace("JSPVehicle - In doJSPGet"); + ObjectInputStream objInStream = + new ObjectInputStream(new BufferedInputStream(request.getInputStream())); + TestUtil.logTrace("JSPVehicle - got InputStream"); + properties = (Properties)objInStream.readObject(); + TestUtil.logTrace("JSP Vehicle -read properties!!!"); + TestUtil.logTrace("JSP Vehicle - list the props "); + TestUtil.list(properties); + + //create an instance of the test client and run here + Class c = + Class.forName(properties.getProperty("test_classname")); + testObj = (EETest) c.newInstance(); + + arguments = (String[])objInStream.readObject(); + //arguments = new String[1]; + //arguments[0] = ""; + TestUtil.logTrace("JSPVehicle - read Objects"); + try + { + TestUtil.init(properties); + TestUtil.logTrace("Remote logging set for JSP Vehicle"); + TestUtil.logTrace("JSPVehicle - Here are the props"); + //TestUtil.list(properties); + } + catch (Exception e) + { + throw new ServletException("unable to initialize remote logging"); + } + //now run the test and return the result + RemoteStatus finalStatus = runTest(); + // Create properties object + stp.setProperty("type", String.valueOf(finalStatus.toStatus().getType())); + stp.setProperty("reason", finalStatus.toStatus().getReason()); + java.util.Enumeration key = stp.keys(); + String name; + while (key.hasMoreElements()) + { + name = (String)key.nextElement(); + propsData.append(name+"="+stp.getProperty(name)+"\n"); + } + + } + catch(Exception e2) + { + System.out.println(e2.getMessage()); + TestUtil.logTrace(e2.getMessage()); + e2.printStackTrace(); + throw new ServletException("test failed to run within the Servlet Vehicle"); + } +%> + +<%= propsData.toString() %>