[jboss-svn-commits] JBL Code SVN: r37727 - in labs/jbosstm/trunk/XTS/localjunit: WS-T and 19 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Nov 21 07:26:57 EST 2011
Author: zhfeng
Date: 2011-11-21 07:26:56 -0500 (Mon, 21 Nov 2011)
New Revision: 37727
Added:
labs/jbosstm/trunk/XTS/localjunit/WS-T/
labs/jbosstm/trunk/XTS/localjunit/WS-T/pom.xml
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestAbortedVoteParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestPreparedVoteParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestReadOnlyVoteParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestTransactionRolledBackExceptionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestInitialisation.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBAPMParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBusinessActivityTerminator.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionCompletionCoordinatorParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBAPMParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBusinessActivityTerminator.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionCompletionCoordinatorParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionBusinessActivityTerminator.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionCompletionCoordinatorParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionBusinessActivityTerminator.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionCompletionCoordinatorParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUtil.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestWrongStateExceptionBAPMParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionParticipantTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionCoordinatorProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionInitiatorCallback.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionCoordinatorProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionParticipantProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionCoordinatorProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionParticipantProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantProcessor.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestSuite.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTestCase.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/WarDeployment.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionParticipantTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTest.java
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/arquillian.xml
labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/web.xml
Log:
JBTM-954 update to convert ws-t11 unit tests
Property changes on: labs/jbosstm/trunk/XTS/localjunit/WS-T
___________________________________________________________________
Added: svn:ignore
+ target
.project
.classpath
.settings
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/pom.xml
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/pom.xml (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/pom.xml 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated by the @authors tag. All rights reserved. See the copyright.txt in the distribution
+ for a full listing of individual contributors. This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the GNU Lesser
+ General Public License, v. 2.1. This program is distributed in the hope that it will be useful, but WITHOUT A WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License, v.2.1 along with this distribution; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <groupId>org.jboss.narayana.xts</groupId>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>localjunit-ws-t11-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>ws-t11 unit tests</name>
+ <description>ws-t11 unit tests</description>
+ <version>5.0.0.M2-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.narayana.xts</groupId>
+ <artifactId>jbossxts</artifactId>
+ <version>5.0.0.M2-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <version>1.0.0.CR5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <profiles>
+ <profile>
+ <!-- The default profile skips all tests, though you can tune it
+ to run just unit tests based on a custom pattern -->
+ <!-- Seperate profiles are provided for running all tests, including
+ Arquillian tests that execute in the specified container -->
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.7.2</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ <version>7.0.2.Final</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestAbortedVoteParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestAbortedVoteParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestAbortedVoteParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestAbortedVoteParticipant.java,v 1.1.2.1 2005/11/22 10:37:41 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.Aborted;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestAbortedVoteParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Aborted();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $Id: TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:51 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant implements BusinessAgreementWithCoordinatorCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ throw new FaultedException();
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ }
+
+ public void complete () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $Id: TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:52 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant implements BusinessAgreementWithParticipantCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ throw new FaultedException();
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $Id: TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:52 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant implements BusinessAgreementWithCoordinatorCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ }
+
+ public void compensate () throws WrongStateException, SystemException
+ {
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ }
+
+ public void complete () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:52 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant implements BusinessAgreementWithParticipantCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestNoExceptionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestNoExceptionParticipant.java,v 1.1.2.1 2005/11/22 10:37:38 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestNoExceptionParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ }
+
+ public void error()
+ throws SystemException
+ {
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestPreparedVoteParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestPreparedVoteParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestPreparedVoteParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestPreparedVoteParticipant.java,v 1.1.2.1 2005/11/22 10:37:37 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestPreparedVoteParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestReadOnlyVoteParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestReadOnlyVoteParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestReadOnlyVoteParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestReadOnlyVoteParticipant.java,v 1.1.2.1 2005/11/22 10:37:39 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.ReadOnly;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestReadOnlyVoteParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new ReadOnly();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $IdD$
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant implements BusinessAgreementWithCoordinatorCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void complete () throws WrongStateException, SystemException
+ {
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void unknown () throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error () throws SystemException
+ {
+ throw new SystemException();
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:53 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant implements BusinessAgreementWithParticipantCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void unknown () throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error () throws SystemException
+ {
+ throw new SystemException();
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestSystemExceptionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestSystemExceptionParticipant.java,v 1.1.2.1 2005/11/22 10:37:39 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestSystemExceptionParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestTransactionRolledBackExceptionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestTransactionRolledBackExceptionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestTransactionRolledBackExceptionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestTransactionRolledBackExceptionParticipant.java,v 1.1.2.1 2005/11/22 10:37:40 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestTransactionRolledBackExceptionParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ throw new TransactionRolledBackException();
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $Id: TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:53 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant implements BusinessAgreementWithCoordinatorCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void complete () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant.java,v 1.1.2.1 2004/05/26 10:04:54 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.Status;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant implements BusinessAgreementWithParticipantCompletionParticipant
+{
+
+ public void close () throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public String status () throws SystemException
+ {
+ return Status.STATUS_ACTIVE;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst/tests/common/TestWrongStateExceptionParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TestWrongStateExceptionParticipant.java,v 1.1.2.1 2005/11/22 10:37:38 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+public class TestWrongStateExceptionParticipant implements Participant
+{
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void commitOnePhase()
+ throws TransactionRolledBackException, WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestInitialisation.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestInitialisation.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,311 @@
+package com.arjuna.wst11.tests;
+
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContextEvent;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices11.ServiceRegistry;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+
+import com.arjuna.webservices11.wsat.ParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+
+import com.arjuna.wst11.messaging.engines.ParticipantEngine;
+import com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine;
+import com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine;
+
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.wst11.BusinessActivityTerminator;
+
+
+import com.arjuna.wst.tests.common.TestAbortedVoteParticipant;
+import com.arjuna.wst.tests.common.TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestNoExceptionParticipant;
+import com.arjuna.wst.tests.common.TestPreparedVoteParticipant;
+import com.arjuna.wst.tests.common.TestReadOnlyVoteParticipant;
+import com.arjuna.wst.tests.common.TestTransactionRolledBackExceptionParticipant;
+import com.arjuna.wst.tests.common.TestWrongStateExceptionParticipant;
+import com.arjuna.wst.tests.common.TestSystemExceptionParticipant;
+
+import com.arjuna.wst.tests.common.TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant;
+
+import com.arjuna.wst.tests.common.TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+//import com.arjuna.wst.tests.common.*;
+
+/**
+ * listener class to set up WSTX 1.1 tests
+ */
+
+public class TestInitialisation implements ServletContextListener
+{
+ private final CompletionCoordinatorParticipant testNoExceptionCompletionCoordinatorParticipant = new TestNoExceptionCompletionCoordinatorParticipant(getCoordinatorCompletionParticipantEndpoint(TestUtil.NOEXCEPTION_TRANSACTION_IDENTIFIER));
+ private final CompletionCoordinatorParticipant testTransactionRolledExceptionCompletionCoordinatorParticipant = new TestTransactionRolledBackExceptionCompletionCoordinatorParticipant(getCoordinatorCompletionParticipantEndpoint(TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_TRANSACTION_IDENTIFIER));
+ private final CompletionCoordinatorParticipant testUnknownTransactionExceptionCompletionCoordinatorParticipant = new TestUnknownTransactionExceptionCompletionCoordinatorParticipant(getCoordinatorCompletionParticipantEndpoint(TestUtil.UNKNOWNTRANSACTIONEXCEPTION_TRANSACTION_IDENTIFIER));
+ private final CompletionCoordinatorParticipant testSystemExceptionCompletionCoordinatorParticipant = new TestSystemExceptionCompletionCoordinatorParticipant(getCoordinatorCompletionParticipantEndpoint(TestUtil.SYSTEMEXCEPTION_TRANSACTION_IDENTIFIER));
+
+ private final Participant testPreparedVoteParticipant = new TestPreparedVoteParticipant();
+ private final Participant testAbortedVoteParticipant = new TestAbortedVoteParticipant();
+ private final Participant testReadOnlyParticipant = new TestReadOnlyVoteParticipant();
+ private final Participant testNoExceptionParticipant = new TestNoExceptionParticipant();
+ private final Participant testTransactionRolledBackExceptionParticipant = new TestTransactionRolledBackExceptionParticipant();
+ private final Participant testWrongStateExceptionParticipant = new TestWrongStateExceptionParticipant();
+ private final Participant testSystemExceptionParticipant = new TestSystemExceptionParticipant();
+
+ private ParticipantInboundEvents testPreparedVoteParticipantEngine;
+ private ParticipantInboundEvents testAbortedVoteParticipantEngine;
+ private ParticipantInboundEvents testReadOnlyParticipantEngine;
+ private ParticipantInboundEvents testNoExceptionParticipantEngine;
+ private ParticipantInboundEvents testTransactionRolledBackExceptionParticipantEngine;
+ private ParticipantInboundEvents testWrongStateExceptionParticipantEngine;
+ private ParticipantInboundEvents testSystemExceptionParticipantEngine;
+
+ private final BusinessAgreementWithParticipantCompletionParticipant testSystemExceptionBusinessAgreementWithParticipantCompletionParticipant = new TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant();
+ private final BusinessAgreementWithParticipantCompletionParticipant testWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant = new TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant();
+ private final BusinessAgreementWithParticipantCompletionParticipant testNoExceptionBusinessAgreementWithParticipantCompletionParticipant = new TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant();
+ private final BusinessAgreementWithParticipantCompletionParticipant testFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant = new TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant();
+
+ private ParticipantCompletionParticipantInboundEvents testSystemExceptionBusinessAgreementWithParticipantCompletionParticipantEngine;
+ private ParticipantCompletionParticipantInboundEvents testWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipantEngine;
+ private ParticipantCompletionParticipantInboundEvents testNoExceptionBusinessAgreementWithParticipantCompletionParticipantEngine;
+ private ParticipantCompletionParticipantInboundEvents testFaultedExceptionBusinessAgreementWithParticipantCompletionParticipantEngine;
+
+ private final BusinessAgreementWithCoordinatorCompletionParticipant testSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant = new TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant();
+ private final BusinessAgreementWithCoordinatorCompletionParticipant testWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant = new TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant();
+ private final BusinessAgreementWithCoordinatorCompletionParticipant testNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant = new TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant();
+ private final BusinessAgreementWithCoordinatorCompletionParticipant testFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant = new TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant();
+
+ private CoordinatorCompletionParticipantInboundEvents testSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine;
+ private CoordinatorCompletionParticipantInboundEvents testWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine;
+ private CoordinatorCompletionParticipantInboundEvents testNoExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine;
+ private CoordinatorCompletionParticipantInboundEvents testFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine;
+
+ private final BAParticipantManager testNoExceptionBAPMParticipant = new TestNoExceptionBAPMParticipant();
+ private final BAParticipantManager testWrongStateExceptionBAPMParticipant = new TestWrongStateExceptionBAPMParticipant();
+ private final BAParticipantManager testSystemExceptionBAPMParticipant = new TestSystemExceptionBAPMParticipant();
+
+ private final BusinessActivityTerminator testNoExceptionBusinessActivityTerminator = new TestNoExceptionBusinessActivityTerminator(getTerminationParticipantEndpoint(TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER));
+ private final BusinessActivityTerminator testUnknownTransactionExceptionBusinessActivityTerminator = new TestUnknownTransactionExceptionBusinessActivityTerminator(getTerminationParticipantEndpoint(TestUtil.UNKNOWNTRANSACTIONEXCEPTION_TRANSACTION_IDENTIFIER));
+ private final BusinessActivityTerminator testTransactionRolledBackExceptionBusinessActivityTerminator = new TestTransactionRolledBackExceptionBusinessActivityTerminator(getTerminationParticipantEndpoint(TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_PARTICIPANT_IDENTIFIER));
+ private final BusinessActivityTerminator testSystemExceptionBusinessActivityTerminator = new TestSystemExceptionBusinessActivityTerminator(getTerminationParticipantEndpoint(TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER));
+ /**
+ * * Notification that the web application initialization
+ * * process is starting.
+ * * All ServletContextListeners are notified of context
+ * * initialization before any filter or servlet in the web
+ * * application is initialized.
+ */
+
+public void contextInitialized(ServletContextEvent sce) {
+ final CompletionCoordinatorProcessor completionCoordinatorProcessor = CompletionCoordinatorProcessor.getProcessor() ;
+ completionCoordinatorProcessor.activateParticipant(testNoExceptionCompletionCoordinatorParticipant, TestUtil.NOEXCEPTION_TRANSACTION_IDENTIFIER);
+ completionCoordinatorProcessor.activateParticipant(testTransactionRolledExceptionCompletionCoordinatorParticipant, TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_TRANSACTION_IDENTIFIER);
+ completionCoordinatorProcessor.activateParticipant(testUnknownTransactionExceptionCompletionCoordinatorParticipant, TestUtil.UNKNOWNTRANSACTIONEXCEPTION_TRANSACTION_IDENTIFIER);
+ completionCoordinatorProcessor.activateParticipant(testSystemExceptionCompletionCoordinatorParticipant, TestUtil.SYSTEMEXCEPTION_TRANSACTION_IDENTIFIER);
+
+ final ParticipantProcessor participantProcessor = ParticipantProcessor.getProcessor() ;
+
+ testPreparedVoteParticipantEngine = new ParticipantEngine(testPreparedVoteParticipant, TestUtil.PREPAREDVOTE_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.PREPAREDVOTE_PARTICIPANT_IDENTIFIER));
+ testAbortedVoteParticipantEngine = new ParticipantEngine(testAbortedVoteParticipant, TestUtil.ABORTEDVOTE_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.ABORTEDVOTE_PARTICIPANT_IDENTIFIER));
+ testReadOnlyParticipantEngine = new ParticipantEngine(testReadOnlyParticipant, TestUtil.READONLYVOTE_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.READONLYVOTE_PARTICIPANT_IDENTIFIER));
+ testNoExceptionParticipantEngine = new ParticipantEngine(testNoExceptionParticipant, TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER));
+ testTransactionRolledBackExceptionParticipantEngine = new ParticipantEngine(testTransactionRolledBackExceptionParticipant, TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_PARTICIPANT_IDENTIFIER));
+ testWrongStateExceptionParticipantEngine = new ParticipantEngine(testWrongStateExceptionParticipant, TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER));
+ testSystemExceptionParticipantEngine = new ParticipantEngine(testSystemExceptionParticipant, TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorEndpoint(TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER));
+
+ participantProcessor.activateParticipant(testPreparedVoteParticipantEngine, TestUtil.PREPAREDVOTE_PARTICIPANT_IDENTIFIER);
+ participantProcessor.activateParticipant(testAbortedVoteParticipantEngine, TestUtil.ABORTEDVOTE_PARTICIPANT_IDENTIFIER);
+ participantProcessor.activateParticipant(testReadOnlyParticipantEngine, TestUtil.READONLYVOTE_PARTICIPANT_IDENTIFIER);
+ participantProcessor.activateParticipant(testNoExceptionParticipantEngine, TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER);
+ participantProcessor.activateParticipant(testTransactionRolledBackExceptionParticipantEngine, TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_PARTICIPANT_IDENTIFIER);
+ participantProcessor.activateParticipant(testWrongStateExceptionParticipantEngine, TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER);
+ participantProcessor.activateParticipant(testSystemExceptionParticipantEngine, TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER);
+
+ final ParticipantCompletionParticipantProcessor participantCompletionParticipantProcessor = ParticipantCompletionParticipantProcessor.getProcessor() ;
+
+ testSystemExceptionBusinessAgreementWithParticipantCompletionParticipantEngine = new ParticipantCompletionParticipantEngine(TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER, getParticipantCompletionCoordinatorEndpoint(TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER), testSystemExceptionBusinessAgreementWithParticipantCompletionParticipant);
+ testWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipantEngine = new ParticipantCompletionParticipantEngine(TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER, getParticipantCompletionCoordinatorEndpoint(TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER), testWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant);
+ testNoExceptionBusinessAgreementWithParticipantCompletionParticipantEngine = new ParticipantCompletionParticipantEngine(TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER, getParticipantCompletionCoordinatorEndpoint(TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER), testNoExceptionBusinessAgreementWithParticipantCompletionParticipant);
+ testFaultedExceptionBusinessAgreementWithParticipantCompletionParticipantEngine = new ParticipantCompletionParticipantEngine(TestUtil.FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER, getParticipantCompletionCoordinatorEndpoint(TestUtil.FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER), testFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant);
+
+ participantCompletionParticipantProcessor.activateParticipant(testSystemExceptionBusinessAgreementWithParticipantCompletionParticipantEngine, TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER);
+ participantCompletionParticipantProcessor.activateParticipant(testWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipantEngine, TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER);
+ participantCompletionParticipantProcessor.activateParticipant(testNoExceptionBusinessAgreementWithParticipantCompletionParticipantEngine, TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER);
+ participantCompletionParticipantProcessor.activateParticipant(testFaultedExceptionBusinessAgreementWithParticipantCompletionParticipantEngine, TestUtil.FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER);
+
+ final CoordinatorCompletionParticipantProcessor coordinatorCompletionParticipantProcessor = CoordinatorCompletionParticipantProcessor.getProcessor() ;
+
+ testSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine = new CoordinatorCompletionParticipantEngine(TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorCompletionCoordinatorEndpoint(TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER), testSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant);
+ testWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine = new CoordinatorCompletionParticipantEngine(TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorCompletionCoordinatorEndpoint(TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER), testWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant);
+ testNoExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine = new CoordinatorCompletionParticipantEngine(TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorCompletionCoordinatorEndpoint(TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER), testNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant);
+ testFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine = new CoordinatorCompletionParticipantEngine(TestUtil.FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER, getCoordinatorCompletionCoordinatorEndpoint(TestUtil.FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER), testFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant);
+
+
+ coordinatorCompletionParticipantProcessor.activateParticipant(testSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine, TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER);
+ coordinatorCompletionParticipantProcessor.activateParticipant(testWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine, TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER);
+ coordinatorCompletionParticipantProcessor.activateParticipant(testNoExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine, TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER);
+ coordinatorCompletionParticipantProcessor.activateParticipant(testFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine, TestUtil.FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER);
+
+ // final ParticipantManagerParticipantProcessor participantManagerParticipantProcessor = ParticipantManagerParticipantProcessor.getParticipant() ;
+ // participantManagerParticipantProcessor.activateParticipant(testNoExceptionBAPMParticipant, TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER);
+ // participantManagerParticipantProcessor.activateParticipant(testWrongStateExceptionBAPMParticipant, TestUtil.WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER);
+ // participantManagerParticipantProcessor.activateParticipant(testSystemExceptionBAPMParticipant, TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER);
+
+ final TerminationCoordinatorProcessor terminatorParticipantProcessor = TerminationCoordinatorProcessor.getProcessor() ;
+ terminatorParticipantProcessor.activateParticipant(testNoExceptionBusinessActivityTerminator, TestUtil.NOEXCEPTION_PARTICIPANT_IDENTIFIER);
+ terminatorParticipantProcessor.activateParticipant(testTransactionRolledBackExceptionBusinessActivityTerminator, TestUtil.TRANSACTIONROLLEDBACKEXCEPTION_TRANSACTION_IDENTIFIER);
+ terminatorParticipantProcessor.activateParticipant(testUnknownTransactionExceptionBusinessActivityTerminator, TestUtil.UNKNOWNTRANSACTIONEXCEPTION_TRANSACTION_IDENTIFIER);
+ terminatorParticipantProcessor.activateParticipant(testSystemExceptionBusinessActivityTerminator, TestUtil.SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER);
+ }
+
+ /**
+ * * Notification that the servlet context is about to be shut down.
+ * * All servlets and filters have been destroy()ed before any
+ * * ServletContextListeners are notified of context
+ * * destruction.
+ */
+public void contextDestroyed(ServletContextEvent sce) {
+ final CompletionCoordinatorProcessor completionCoordinatorProcessor = CompletionCoordinatorProcessor.getProcessor() ;
+ completionCoordinatorProcessor.deactivateParticipant(testNoExceptionCompletionCoordinatorParticipant);
+ completionCoordinatorProcessor.deactivateParticipant(testTransactionRolledExceptionCompletionCoordinatorParticipant);
+ completionCoordinatorProcessor.deactivateParticipant(testUnknownTransactionExceptionCompletionCoordinatorParticipant);
+ completionCoordinatorProcessor.deactivateParticipant(testSystemExceptionCompletionCoordinatorParticipant);
+
+ final ParticipantProcessor participantProcessor = ParticipantProcessor.getProcessor() ;
+ participantProcessor.deactivateParticipant(testPreparedVoteParticipantEngine);
+ participantProcessor.deactivateParticipant(testAbortedVoteParticipantEngine);
+ participantProcessor.deactivateParticipant(testReadOnlyParticipantEngine);
+ participantProcessor.deactivateParticipant(testNoExceptionParticipantEngine);
+ participantProcessor.deactivateParticipant(testTransactionRolledBackExceptionParticipantEngine);
+ participantProcessor.deactivateParticipant(testWrongStateExceptionParticipantEngine);
+ participantProcessor.deactivateParticipant(testSystemExceptionParticipantEngine);
+
+ final ParticipantCompletionParticipantProcessor participantCompletionParticipantProcessor = ParticipantCompletionParticipantProcessor.getProcessor() ;
+ participantCompletionParticipantProcessor.deactivateParticipant(testSystemExceptionBusinessAgreementWithParticipantCompletionParticipantEngine);
+ participantCompletionParticipantProcessor.deactivateParticipant(testWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipantEngine);
+ participantCompletionParticipantProcessor.deactivateParticipant(testNoExceptionBusinessAgreementWithParticipantCompletionParticipantEngine);
+ participantCompletionParticipantProcessor.deactivateParticipant(testFaultedExceptionBusinessAgreementWithParticipantCompletionParticipantEngine);
+
+ final CoordinatorCompletionParticipantProcessor coordinatorCompletionParticipantProcessor = CoordinatorCompletionParticipantProcessor.getProcessor() ;
+ coordinatorCompletionParticipantProcessor.deactivateParticipant(testSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine);
+ coordinatorCompletionParticipantProcessor.deactivateParticipant(testWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine);
+ coordinatorCompletionParticipantProcessor.deactivateParticipant(testNoExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine);
+ coordinatorCompletionParticipantProcessor.deactivateParticipant(testFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipantEngine);
+
+ // final ParticipantManagerParticipantProcessor participantManagerParticipantProcessor = ParticipantManagerParticipantProcessor.getParticipant() ;
+ // participantManagerParticipantProcessor.deactivateParticipant(testNoExceptionBAPMParticipant);
+ // participantManagerParticipantProcessor.deactivateParticipant(testWrongStateExceptionBAPMParticipant);
+ // participantManagerParticipantProcessor.deactivateParticipant(testSystemExceptionBAPMParticipant);
+
+ final TerminationCoordinatorProcessor terminatorParticipantProcessor = TerminationCoordinatorProcessor.getProcessor() ;
+ terminatorParticipantProcessor.deactivateParticipant(testNoExceptionBusinessActivityTerminator);
+ terminatorParticipantProcessor.deactivateParticipant(testTransactionRolledBackExceptionBusinessActivityTerminator);
+ terminatorParticipantProcessor.deactivateParticipant(testUnknownTransactionExceptionBusinessActivityTerminator);
+ terminatorParticipantProcessor.deactivateParticipant(testSystemExceptionBusinessActivityTerminator);
+ }
+
+ private static W3CEndpointReference getCoordinatorCompletionParticipantEndpoint(String id)
+ {
+ try {
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ final QName serviceName = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME;
+ final QName endpointName = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME;
+ final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME);
+ builder.serviceName(serviceName);
+ builder.endpointName(endpointName);
+ builder.address(address);
+ InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+ return builder.build();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private static W3CEndpointReference getTerminationParticipantEndpoint(String id)
+ {
+ try {
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ final QName serviceName = ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_QNAME;
+ final QName endpointName = ArjunaTX11Constants.TERMINATION_PARTICIPANT_PORT_QNAME;
+ final String address = ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME);
+ builder.serviceName(serviceName);
+ builder.endpointName(endpointName);
+ builder.address(address);
+ InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+ return builder.build();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private static W3CEndpointReference getCoordinatorEndpoint(String id)
+ {
+ try {
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ final QName serviceName = AtomicTransactionConstants.COORDINATOR_SERVICE_QNAME;
+ final QName endpointName = AtomicTransactionConstants.COORDINATOR_PORT_QNAME;
+ final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME);
+ builder.serviceName(serviceName);
+ builder.endpointName(endpointName);
+ builder.address(address);
+ InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+ return builder.build();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private static W3CEndpointReference getParticipantCompletionCoordinatorEndpoint(String id)
+ {
+ try {
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ final QName serviceName = BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_QNAME;
+ final QName endpointName = BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_PORT_QNAME;
+ final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME);
+ builder.serviceName(serviceName);
+ builder.endpointName(endpointName);
+ builder.address(address);
+ InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+ return builder.build();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private static W3CEndpointReference getCoordinatorCompletionCoordinatorEndpoint(String id)
+ {
+ try {
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ final QName serviceName = BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_QNAME;
+ final QName endpointName = BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_PORT_QNAME;
+ final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME);
+ builder.serviceName(serviceName);
+ builder.endpointName(endpointName);
+ builder.address(address);
+ InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+ return builder.build();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBAPMParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBAPMParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBAPMParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestNoExceptionBAPMParticipant.java,v 1.5.8.1 2005/11/22 10:37:37 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.namespace.QName;
+
+public class TestNoExceptionBAPMParticipant implements BAParticipantManager
+{
+
+ public void completed ()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ /**
+ * Cannot complete.
+ */
+
+ public void cannotComplete() throws WrongStateException, UnknownTransactionException, SystemException {
+ }
+
+ /**
+ * Fault.
+ */
+
+ public void fail(QName exceptionIdentifier) throws SystemException {
+ }
+
+ public void exit ()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown ()
+ throws SystemException
+ {
+ }
+
+ public void error ()
+ throws SystemException
+ {
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBusinessActivityTerminator.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBusinessActivityTerminator.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionBusinessActivityTerminator.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestNoExceptionBusinessActivityTerminator.java,v 1.3.20.1 2005/11/22 10:37:37 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BusinessActivityTerminator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestNoExceptionBusinessActivityTerminator implements BusinessActivityTerminator
+{
+ public TestNoExceptionBusinessActivityTerminator(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void close ()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ }
+
+ public void cancel ()
+ throws UnknownTransactionException, SystemException
+ {
+ }
+
+ public void complete ()
+ throws UnknownTransactionException, SystemException
+ {
+ }
+
+ public W3CEndpointReference getEndpoint() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionCompletionCoordinatorParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionCompletionCoordinatorParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestNoExceptionCompletionCoordinatorParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * TestNoExceptionCompletionCoordinatorParticipant.java
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestNoExceptionCompletionCoordinatorParticipant implements CompletionCoordinatorParticipant
+{
+ public TestNoExceptionCompletionCoordinatorParticipant(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void commit()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ }
+
+ public void rollback()
+ throws UnknownTransactionException, SystemException
+ {
+ }
+
+ public W3CEndpointReference getParticipant() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBAPMParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBAPMParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBAPMParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestSystemExceptionBAPMParticipant.java,v 1.5.8.1 2005/11/22 10:37:36 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.namespace.QName;
+
+public class TestSystemExceptionBAPMParticipant implements BAParticipantManager
+{
+ public void completed ()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ /**
+ * Cannot complete.
+ */
+
+ public void cannotComplete() throws WrongStateException, UnknownTransactionException, SystemException {
+ throw new SystemException();
+ }
+
+ /**
+ * Fault.
+ */
+
+ public void fail(QName exceptionIdentifier) throws SystemException {
+ throw new SystemException();
+ }
+
+ public void exit ()
+ throws WrongStateException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void unknown ()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error ()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBusinessActivityTerminator.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBusinessActivityTerminator.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionBusinessActivityTerminator.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestSystemExceptionBusinessActivityTerminator.java,v 1.3.20.1 2005/11/22 10:37:40 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BusinessActivityTerminator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestSystemExceptionBusinessActivityTerminator implements BusinessActivityTerminator
+{
+ public TestSystemExceptionBusinessActivityTerminator(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void close ()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void cancel ()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void complete ()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public W3CEndpointReference getEndpoint() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionCompletionCoordinatorParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionCompletionCoordinatorParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestSystemExceptionCompletionCoordinatorParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * TestSystemExceptionCompletionCoordinatorParticipant.java
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestSystemExceptionCompletionCoordinatorParticipant implements CompletionCoordinatorParticipant
+{
+ public TestSystemExceptionCompletionCoordinatorParticipant(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void commit()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void rollback()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public W3CEndpointReference getParticipant() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionBusinessActivityTerminator.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionBusinessActivityTerminator.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionBusinessActivityTerminator.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestTransactionRolledBackExceptionBusinessActivityTerminator.java,v 1.3.20.1 2005/11/22 10:37:37 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BusinessActivityTerminator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestTransactionRolledBackExceptionBusinessActivityTerminator implements BusinessActivityTerminator
+{
+ public TestTransactionRolledBackExceptionBusinessActivityTerminator(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void close ()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ throw new TransactionRolledBackException();
+ }
+
+ public void cancel ()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public void complete ()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public W3CEndpointReference getEndpoint() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionCompletionCoordinatorParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionCompletionCoordinatorParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestTransactionRolledBackExceptionCompletionCoordinatorParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * TestTransactionRolledBackExceptionCompletionCoordinatorParticipant.java
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestTransactionRolledBackExceptionCompletionCoordinatorParticipant implements CompletionCoordinatorParticipant
+{
+ public TestTransactionRolledBackExceptionCompletionCoordinatorParticipant(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void commit()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ throw new TransactionRolledBackException();
+ }
+
+ public void rollback()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new SystemException();
+ }
+
+ public W3CEndpointReference getParticipant() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionBusinessActivityTerminator.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionBusinessActivityTerminator.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionBusinessActivityTerminator.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestUnknownTransactionExceptionBusinessActivityTerminator.java,v 1.3.20.1 2005/11/22 10:37:41 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BusinessActivityTerminator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestUnknownTransactionExceptionBusinessActivityTerminator implements BusinessActivityTerminator
+{
+ public TestUnknownTransactionExceptionBusinessActivityTerminator(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void close ()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public void cancel ()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public void complete ()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public W3CEndpointReference getEndpoint() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionCompletionCoordinatorParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionCompletionCoordinatorParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUnknownTransactionExceptionCompletionCoordinatorParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * TestUnknownTransactionExceptionCompletionCoordinatorParticipant.java
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class TestUnknownTransactionExceptionCompletionCoordinatorParticipant implements CompletionCoordinatorParticipant
+{
+ public TestUnknownTransactionExceptionCompletionCoordinatorParticipant(W3CEndpointReference endpointReference)
+ {
+ this.endpointReference = endpointReference;
+ }
+
+ public void commit()
+ throws TransactionRolledBackException, UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public void rollback()
+ throws UnknownTransactionException, SystemException
+ {
+ throw new UnknownTransactionException();
+ }
+
+ public W3CEndpointReference getParticipant() {
+ return endpointReference;
+ }
+
+ private W3CEndpointReference endpointReference;
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUtil.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUtil.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestUtil.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,164 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * TestUtil.java
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import org.jboss.jbossts.xts.environment.XTSPropertyManager;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import javax.xml.namespace.QName;
+
+public class TestUtil
+{
+ public static final String NOEXCEPTION_TRANSACTION_IDENTIFIER = "NE123456TI";
+ public static final String TRANSACTIONROLLEDBACKEXCEPTION_TRANSACTION_IDENTIFIER = "TRBE123456TI";
+ public static final String UNKNOWNTRANSACTIONEXCEPTION_TRANSACTION_IDENTIFIER = "UTE123456TI";
+ public static final String SYSTEMEXCEPTION_TRANSACTION_IDENTIFIER = "SE123456TI";
+
+ public static final String NONEXISTENT_TRANSACTION_IDENTIFIER = "NONE123456TI";
+
+ public static final String PREPAREDVOTE_PARTICIPANT_IDENTIFIER = "PV123456PI";
+ public static final String ABORTEDVOTE_PARTICIPANT_IDENTIFIER = "AV123456PI";
+ public static final String READONLYVOTE_PARTICIPANT_IDENTIFIER = "ROV123456PI";
+
+ public static final String NOEXCEPTION_PARTICIPANT_IDENTIFIER = "NE123456PI";
+
+ public static final String FAULTEDEXCEPTION_PARTICIPANT_IDENTIFIER = "FE123456PI";
+
+ public static final String TRANSACTIONROLLEDBACKEXCEPTION_PARTICIPANT_IDENTIFIER = "TRBE123456PI";
+ public static final String WRONGSTATEEXCEPTION_PARTICIPANT_IDENTIFIER = "WSE123456PI";
+ public static final String SYSTEMEXCEPTION_PARTICIPANT_IDENTIFIER = "SE123456PI";
+
+ public static final String NONEXISTENT_PARTICIPANT_IDENTIFIER = "NONE123456PI";
+
+ final private static String bindHost = XTSPropertyManager.getWSCEnvironmentBean().getBindAddress11();
+
+ public static String participantServiceURI = "http://" + bindHost + ":8080/ws-t11-participant/ParticipantService";
+ public static String coordinatorServiceURI = "http://" + bindHost + ":8080/ws-t11-coordinator/CoordinatorService";
+ public static String completionInitiatorServiceURI = "http://" + bindHost + ":8080/ws-t11-client/CompletionInitiatorService";
+ public static String completionCoordinatorServiceURI = "http://" + bindHost + ":8080/ws-t11-coordinator/CompletionCoordinatorService";
+ private final static String ATOMIC_TRANSACTION_FAULT_ACTION = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/fault";
+ private final static String BUSINESS_ACTIVITY_FAULT_ACTION = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/fault";
+
+ public static String participantCompletionParticipantServiceURI = "http://" + bindHost + ":8080/ws-t11-participant/BusinessAgreementWithParticipantCompletionParticipantService";
+ public static String participantCompletionCoordinatorServiceURI = "http://" + bindHost + ":8080/ws-t11-coordinator/BusinessAgreementWithParticipantCompletionCoordinatorService";
+ public static String coordinatorCompletionParticipantServiceURI = "http://" + bindHost + ":8080/ws-t11-participant/BusinessAgreementWithCoordinatorCompletionParticipantService";
+ public static String coordinatorCompletionCoordinatorServiceURI = "http://" + bindHost + ":8080/ws-t11-coordinator/BusinessAgreementWithCoordinatorCompletionCoordinatorService";
+
+ public static synchronized String getAtomicTransactionFaultAction()
+ {
+ return ATOMIC_TRANSACTION_FAULT_ACTION;
+ }
+
+ public static synchronized String getBusinessActivityFaultAction()
+ {
+ return BUSINESS_ACTIVITY_FAULT_ACTION;
+ }
+
+ public static W3CEndpointReference getParticipantEndpoint(String id)
+ {
+ return getEndpoint(AtomicTransactionConstants.PARTICIPANT_SERVICE_QNAME,
+ AtomicTransactionConstants.PARTICIPANT_PORT_QNAME,
+ participantServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getCoordinatorEndpoint(String id)
+ {
+ return getEndpoint(AtomicTransactionConstants.COORDINATOR_SERVICE_QNAME,
+ AtomicTransactionConstants.COORDINATOR_PORT_QNAME,
+ coordinatorServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getCompletionInitiatorEndpoint(String id)
+ {
+ return getEndpoint(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_QNAME,
+ AtomicTransactionConstants.COMPLETION_INITIATOR_PORT_QNAME,
+ completionInitiatorServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getCompletionCoordinatorEndpoint(String id)
+ {
+ return getEndpoint(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_QNAME,
+ AtomicTransactionConstants.COMPLETION_COORDINATOR_PORT_QNAME,
+ completionCoordinatorServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getParticipantCompletionParticipantEndpoint(String id)
+ {
+ return getEndpoint(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_QNAME,
+ BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_PORT_QNAME,
+ participantCompletionParticipantServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getParticipantCompletionCoordinatorEndpoint(String id)
+ {
+ return getEndpoint(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_QNAME,
+ BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_PORT_QNAME,
+ participantCompletionCoordinatorServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getCoordinatorCompletionParticipantEndpoint(String id)
+ {
+ return getEndpoint(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME,
+ BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME,
+ coordinatorCompletionParticipantServiceURI,
+ id);
+ }
+
+ public static W3CEndpointReference getCoordinatorCompletionCoordinatorEndpoint(String id)
+ {
+ return getEndpoint(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_QNAME,
+ BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_PORT_QNAME,
+ coordinatorCompletionCoordinatorServiceURI,
+ id);
+ }
+
+ private static W3CEndpointReference getEndpoint(QName service, QName port, String address, String id)
+ {
+ try {
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ builder.serviceName(service);
+ builder.endpointName(port);
+ builder.address(address);
+ if (id != null) {
+ InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+ }
+ return builder.build();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestWrongStateExceptionBAPMParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestWrongStateExceptionBAPMParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/TestWrongStateExceptionBAPMParticipant.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: TestWrongStateExceptionBAPMParticipant.java,v 1.5.8.1 2005/11/22 10:37:38 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests;
+
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+import javax.xml.namespace.QName;
+
+public class TestWrongStateExceptionBAPMParticipant implements BAParticipantManager
+{
+ public void completed ()
+ throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void exit ()
+ throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void cannotComplete ()
+ throws WrongStateException, SystemException
+ {
+ throw new WrongStateException();
+ }
+
+ public void unknown ()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void fail (QName exceptionIdentifier)
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+
+ public void error ()
+ throws SystemException
+ {
+ throw new SystemException();
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,284 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.java,v 1.1.2.1 2004/05/26 10:04:55 nmcl Exp $
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Named;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.client.CoordinatorCompletionParticipantClient;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.wst11.tests.arq.TestCoordinatorCompletionParticipantProcessor.CoordinatorCompletionParticipantDetails;
+import com.arjuna.wst11.tests.TestUtil;
+
+ at Named
+public class BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase
+{
+ private CoordinatorCompletionParticipantProcessor origCoordinatorCompletionParticipantProcessor ;
+ private TestCoordinatorCompletionParticipantProcessor testCoordinatorCompletionParticipantProcessor = new TestCoordinatorCompletionParticipantProcessor() ;
+
+ public void setUp()
+ throws Exception
+ {
+ origCoordinatorCompletionParticipantProcessor = CoordinatorCompletionParticipantProcessor.setProcessor(testCoordinatorCompletionParticipantProcessor) ;
+ }
+
+ public void testSendClose()
+ throws Exception
+ {
+ final String messageId = "testSendClose" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendClose(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasClose()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendCancel()
+ throws Exception
+ {
+ final String messageId = "testSendCancel" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendCancel(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCancel()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendCompensate()
+ throws Exception
+ {
+ final String messageId = "testSendCompensate" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendCompensate(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCompensate()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendFaulted()
+ throws Exception
+ {
+ final String messageId = "testSendFaulted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendFailed(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasFailed()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendExited()
+ throws Exception
+ {
+ final String messageId = "testSendExited" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendExited(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasExited()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendStatus()
+ throws Exception
+ {
+ final String messageId = "testSendStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ final State state = State.STATE_ACTIVE ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue()) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasStatus()) ;
+ assertEquals(details.hasStatus().getState(), state.getValue()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendComplete()
+ throws Exception
+ {
+ final String messageId = "testSendComplete" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendComplete(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasComplete()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendGetStatus()
+ throws Exception
+ {
+ final String messageId = "testSendGetStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("8") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendGetStatus(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasGetStatus()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "testSendError" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9") ;
+ final String reason = "testSendErrorReason" ;
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ // this would be a better test if we could set the identifier as a reference parameter here
+ CoordinatorCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction()) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasSoapFault()) ;
+ assertEquals(details.hasSoapFault().getSoapFaultType(), soapFaultType) ;
+ assertEquals(details.hasSoapFault().getReason(), reason) ;
+ assertEquals(details.hasSoapFault().getSubcode(), subcode) ;
+
+ checkDetails(details, false, false, messageId, null);
+ }
+
+ public void testSendNotCompleted()
+ throws Exception
+ {
+ final String messageId = "testSendNotCompleted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("10") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId) ;
+
+ CoordinatorCompletionParticipantClient.getClient().sendNotCompleted(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasNotCompleted()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ CoordinatorCompletionParticipantProcessor.setProcessor(origCoordinatorCompletionParticipantProcessor) ;
+ }
+
+ /**
+ * check the message details to see that they have the correct to and from address and message id, a null
+ * reply to address and an arjuna context containing the correct instannce identifier
+ * @param details
+ * @param messageId
+ * @param instanceIdentifier
+ */
+
+ private void checkDetails(CoordinatorCompletionParticipantDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.coordinatorCompletionParticipantServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.coordinatorCompletionCoordinatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.coordinatorCompletionCoordinatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext) ;
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,272 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2004, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithCoordinatorCompletionParticipantTestCase.java,v 1.1.2.1 2004/05/26 10:04:55 nmcl Exp $
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.client.CoordinatorCompletionCoordinatorClient;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import com.arjuna.wst11.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails;
+import com.arjuna.wst11.tests.TestUtil;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+
+import javax.inject.Named;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.namespace.QName;
+
+ at Named
+public class BusinessAgreementWithCoordinatorCompletionParticipantTestCase
+{
+ private CoordinatorCompletionCoordinatorProcessor origCoordinatorCompletionCoordinatorProcessor ;
+ private TestCoordinatorCompletionCoordinatorProcessor testCoordinatorCompletionCoordinatorProcessor = new TestCoordinatorCompletionCoordinatorProcessor() ;
+
+ public void setUp()
+ throws Exception
+ {
+ origCoordinatorCompletionCoordinatorProcessor = CoordinatorCompletionCoordinatorProcessor.setProcessor(testCoordinatorCompletionCoordinatorProcessor) ;
+ }
+
+ public void testSendClosed()
+ throws Exception
+ {
+ final String messageId = "testSendClosed" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendClosed(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasClosed());
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendCancelled()
+ throws Exception
+ {
+ final String messageId = "testSendCancelled" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendCancelled(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCancelled());
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendCompensated()
+ throws Exception
+ {
+ final String messageId = "testSendCompensated" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendCompensated(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCompensated());
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendFault()
+ throws Exception
+ {
+ final String messageId = "testSendFault" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ final State state = State.STATE_FAILING_COMPENSATING ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendFail(endpoint, map, new InstanceIdentifier("sender"), state.getValue()) ;
+
+ CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasFail());
+ assertEquals(details.hasFail().getExceptionIdentifier(), state.getValue());
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendCompleted()
+ throws Exception
+ {
+ final String messageId = "testSendCompleted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendCompleted(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCompleted());
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendStatus()
+ throws Exception
+ {
+ final String messageId = "testSendStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ final State state = State.STATE_COMPENSATING;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue()) ;
+
+ CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasStatus());
+ assertEquals(details.hasStatus().getState(), state.getValue());
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "testSendError" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7") ;
+ final String reason = "testSendErrorReason" ;
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ // this would be a better test if we could set the identifier as a reference parameter here
+ CoordinatorCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction()) ;
+
+ final CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasSoapFault()) ;
+ assertEquals(details.hasSoapFault().getSoapFaultType(), soapFaultType) ;
+ assertEquals(details.hasSoapFault().getReason(), reason) ;
+ assertEquals(details.hasSoapFault().getSubcode(), subcode) ;
+
+ checkDetails(details, false, false, messageId, null);
+ }
+
+ public void testSendExit()
+ throws Exception
+ {
+ final String messageId = "testSendExit" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("8") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendExit(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasExit()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendGetStatus()
+ throws Exception
+ {
+ final String messageId = "testSendGetStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9") ;
+ W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId) ;
+
+ CoordinatorCompletionCoordinatorClient.getClient().sendGetStatus(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasGetStatus()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ CoordinatorCompletionCoordinatorProcessor.setProcessor(origCoordinatorCompletionCoordinatorProcessor) ;
+ }
+ /**
+ * check the message details to see that they have the correct to and from address and message id, a null
+ * reply to address and an arjuna context containing the correct instannce identifier
+ * @param details
+ * @param hasFrom
+ * @param hasFaultTo
+ * @param messageId
+ * @param instanceIdentifier
+ */
+
+ private void checkDetails(CoordinatorCompletionCoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.coordinatorCompletionCoordinatorServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.coordinatorCompletionParticipantServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.coordinatorCompletionParticipantServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext) ;
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,279 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithParticipantCompletionCoordinatorTestCase.java,v 1.1.2.1 2004/05/26 10:04:55 nmcl Exp $
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Named;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.client.ParticipantCompletionParticipantClient;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.wst11.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails;
+import com.arjuna.wst11.tests.TestUtil;
+
+ at Named
+public class BusinessAgreementWithParticipantCompletionCoordinatorTestCase
+{
+ private ParticipantCompletionParticipantProcessor origParticipantCompletionParticipantProcessor ;
+ private TestParticipantCompletionParticipantProcessor testParticipantCompletionParticipantProcessor = new TestParticipantCompletionParticipantProcessor() ;
+
+ public void setUp()
+ throws Exception
+ {
+ origParticipantCompletionParticipantProcessor = ParticipantCompletionParticipantProcessor.setProcessor(testParticipantCompletionParticipantProcessor) ;
+ final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ }
+
+
+ public void testSendClose()
+ throws Exception
+ {
+ final String messageId = "testSendClose" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendClose(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasClose()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCancel()
+ throws Exception
+ {
+ final String messageId = "testSendCancel" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendCancel(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCancel()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCompensate()
+ throws Exception
+ {
+ final String messageId = "testSendCompensate" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendCompensate(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCompensate()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendFaulted()
+ throws Exception
+ {
+ final String messageId = "testSendFaulted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendFailed(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasFaulted()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendExited()
+ throws Exception
+ {
+ final String messageId = "testSendExited" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendExited(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasExited()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendStatus()
+ throws Exception
+ {
+ final String messageId = "testSendStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ final State state = State.STATE_ACTIVE ;
+
+ ParticipantCompletionParticipantClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue()) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasStatus()); ;
+ assertEquals(details.hasStatus().getState(), state.getValue());
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendGetStatus()
+ throws Exception
+ {
+ final String messageId = "testSendGetStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendGetStatus(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasGetStatus()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "testSendGetStatus" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("8") ;
+ final String reason = "testSendErrorReason" ;
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction()) ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertNotNull(details.getSoapFault());
+ assertEquals(details.getSoapFault().getSoapFaultType(), soapFault.getSoapFaultType()) ;
+ assertEquals(details.getSoapFault().getReason(), soapFault.getReason()) ;
+ assertEquals(details.getSoapFault().getSubcode(), soapFault.getSubcode()) ;
+
+ checkDetails(details, false, false, messageId, null);
+ }
+
+
+ public void testSendNotCompleted()
+ throws Exception
+ {
+ final String messageId = "testSendNotCompleted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId) ;
+
+ ParticipantCompletionParticipantClient.getClient().sendNotCompleted(endpoint, map, new InstanceIdentifier("sender")); ;
+
+ final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasNotCompleted()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ ParticipantCompletionParticipantProcessor.setProcessor(origParticipantCompletionParticipantProcessor) ;
+ }
+
+ /**
+ * check the message details to see that they have the correct to and from address and message id, a null
+ * reply to address and an arjuna context containing the correct instannce identifier
+ * @param details
+ * @param hasFrom
+ * @param hasFaultTo
+ * @param messageId
+ * @param instanceIdentifier
+ */
+
+ private void checkDetails(ParticipantCompletionParticipantDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.participantCompletionParticipantServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.participantCompletionCoordinatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.participantCompletionCoordinatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext) ;
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,298 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithParticipantCompletionParticipantTestCase.java,v 1.1.2.1 2004/05/26 10:04:56 nmcl Exp $
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Named;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.client.ParticipantCompletionCoordinatorClient;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import com.arjuna.wst11.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails;
+import com.arjuna.wst11.tests.TestUtil;
+
+ at Named
+public class BusinessAgreementWithParticipantCompletionParticipantTestCase
+{
+ private ParticipantCompletionCoordinatorProcessor origParticipantCompletionCoordinatorProcessor ;
+ private TestParticipantCompletionCoordinatorProcessor testParticipantCompletionCoordinatorProcessor = new TestParticipantCompletionCoordinatorProcessor() ;
+
+ public void setUp()
+ throws Exception
+ {
+ origParticipantCompletionCoordinatorProcessor = ParticipantCompletionCoordinatorProcessor.setProcessor(testParticipantCompletionCoordinatorProcessor) ;
+ }
+
+
+ public void testSendClosed()
+ throws Exception
+ {
+ final String messageId = "testSendClosed" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendClosed(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasClosed()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCancelled()
+ throws Exception
+ {
+ final String messageId = "testSendCancelled" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendCancelled(endpoint, map, new InstanceIdentifier("sender")); ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCancelled()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCompensated()
+ throws Exception
+ {
+ final String messageId = "testSendCompensated" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendCompensated(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCompensated()) ;
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCompleted()
+ throws Exception
+ {
+ final String messageId = "testSendCompleted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendCompleted(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCompleted()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendStatus()
+ throws Exception
+ {
+ final String messageId = "testSendStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ final State state = State.STATE_ENDED ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue()) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasStatus()); ;
+ assertEquals(details.hasStatus().getState(), state.getValue()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "testSendError" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6") ;
+ final String reason = "testSendErrorReason" ;
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction()) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasSoapFault()) ;
+ assertEquals(details.hasSoapFault().getSoapFaultType(), soapFault.getSoapFaultType()) ;
+ assertEquals(details.hasSoapFault().getSubcode(), soapFault.getSubcode()) ;
+ assertEquals(details.hasSoapFault().getReason(), soapFault.getReason()) ;
+
+ checkDetails(details, false, false, messageId, null);
+ }
+
+
+ public void testSendExit()
+ throws Exception
+ {
+ final String messageId = "testSendExit" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendExit(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasExit()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendFault()
+ throws Exception
+ {
+ final String messageId = "testSendFault" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("8") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ final State state = State.STATE_FAILING_ACTIVE;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendFail(endpoint, map, new InstanceIdentifier("sender"), state.getValue()); ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertNotNull(details.hasFault());
+ assertEquals(details.hasFault().getExceptionIdentifier(), state.getValue()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendGetStatus()
+ throws Exception
+ {
+ final String messageId = "testSendGetStatus" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendGetStatus(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasGetStatus()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCannotComplete()
+ throws Exception
+ {
+ final String messageId = "testSendCannotComplete" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("10") ;
+ W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId) ;
+
+ ParticipantCompletionCoordinatorClient.getClient().sendCannotComplete(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCannotComplete()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ ParticipantCompletionCoordinatorProcessor.setProcessor(origParticipantCompletionCoordinatorProcessor) ;
+ }
+
+ /**
+ * check the message details to see that they have the correct to and from address and message id, a null
+ * reply to address and an arjuna context containing the correct instannce identifier
+ * @param details
+ * @param hasFrom
+ * @param hasFaultTo
+ * @param messageId
+ * @param instanceIdentifier
+ */
+
+ private void checkDetails(ParticipantCompletionCoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.participantCompletionCoordinatorServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.participantCompletionParticipantServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.participantCompletionParticipantServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext) ;
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * CompletionCoordinatorTestCase.java
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Named;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.client.CompletionInitiatorClient;
+import com.arjuna.webservices11.wsat.processors.CompletionInitiatorProcessor;
+import com.arjuna.wst11.tests.TestUtil;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+ at Named
+public class CompletionCoordinatorTestCase
+{
+ public void setUp()
+ throws Exception
+ {
+ }
+
+ public void testSendCommitted()
+ throws Exception
+ {
+ final String messageId = "123456" ;
+ final String instanceIdentifier = "testSendCommitted" ;
+ final W3CEndpointReference completionInitiatorEndpoint = TestUtil.getCompletionInitiatorEndpoint(instanceIdentifier);
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.completionInitiatorServiceURI, messageId) ;
+
+ final TestCompletionInitiatorCallback callback = new TestCompletionInitiatorCallback() {
+ public void committed(final Notification committed, final MAP map, final ArjunaContext arjunaContext)
+ {
+ assertEquals(map.getTo(), TestUtil.completionInitiatorServiceURI);
+ assertNull(map.getFrom());
+ assertNotNull(map.getFaultTo());
+ assertEquals(map.getFaultTo().getAddress(), TestUtil.completionCoordinatorServiceURI);
+ assertNotNull(map.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(map));
+ assertEquals(map.getMessageID(), messageId);
+
+ assertNotNull(arjunaContext) ;
+ assertEquals(instanceIdentifier, arjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ };
+ final CompletionInitiatorProcessor initiator = CompletionInitiatorProcessor.getProcessor() ;
+ initiator.registerCallback(instanceIdentifier, callback) ;
+
+ try
+ {
+ CompletionInitiatorClient.getClient().sendCommitted(completionInitiatorEndpoint, map, new InstanceIdentifier("sender")) ;
+ callback.waitUntilTriggered() ;
+ }
+ finally
+ {
+ initiator.removeCallback(instanceIdentifier) ;
+ }
+
+ assertTrue(callback.hasTriggered()) ;
+ assertFalse(callback.hasFailed()) ;
+ }
+
+ public void testSendAborted()
+ throws Exception
+ {
+ final String messageId = "123456" ;
+ final String instanceIdentifier = "testSendAborted" ;
+ final W3CEndpointReference completionInitiatorEndpoint = TestUtil.getCompletionInitiatorEndpoint(instanceIdentifier);
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.completionInitiatorServiceURI, messageId) ;
+
+ final TestCompletionInitiatorCallback callback = new TestCompletionInitiatorCallback() {
+ public void aborted(final Notification aborted, final MAP map, final ArjunaContext arjunaContext)
+ {
+ assertEquals(map.getTo(), TestUtil.completionInitiatorServiceURI);
+ assertNull(map.getFrom());
+ assertNotNull(map.getFaultTo());
+ assertEquals(map.getFaultTo().getAddress(), TestUtil.completionCoordinatorServiceURI);
+ assertNotNull(map.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(map));
+ assertNotNull(map.getMessageID());
+ assertEquals(map.getMessageID(), messageId);
+
+ assertNotNull(arjunaContext) ;
+ assertEquals(instanceIdentifier, arjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ };
+ final CompletionInitiatorProcessor initiator = CompletionInitiatorProcessor.getProcessor() ;
+ initiator.registerCallback(instanceIdentifier, callback) ;
+
+ try
+ {
+ CompletionInitiatorClient.getClient().sendAborted(completionInitiatorEndpoint, map, new InstanceIdentifier("sender")) ;
+ callback.waitUntilTriggered() ;
+ }
+ finally
+ {
+ initiator.removeCallback(instanceIdentifier) ;
+ }
+
+ assertTrue(callback.hasTriggered()) ;
+ assertFalse(callback.hasFailed()) ;
+ }
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "123456" ;
+ final String reason = "testSendErrorReason" ;
+ final String instanceIdentifier = "testSendError" ;
+ final W3CEndpointReference completionInitiatorEndpoint = TestUtil.getCompletionInitiatorEndpoint(instanceIdentifier);
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.completionInitiatorServiceURI, messageId) ;
+
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ final TestCompletionInitiatorCallback callback = new TestCompletionInitiatorCallback() {
+ public void soapFault(final SoapFault soapFault, final MAP map, final ArjunaContext arjunaContext)
+ {
+ assertEquals(map.getTo(), TestUtil.completionInitiatorServiceURI);
+ assertNull(map.getFrom());
+ assertNull(map.getFaultTo());
+ assertNotNull(map.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(map));
+ assertNotNull(map.getMessageID());
+ assertEquals(map.getMessageID(), messageId);
+
+ assertNotNull(arjunaContext) ;
+ assertEquals(instanceIdentifier, arjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+
+ assertNotNull(soapFault) ;
+ assertEquals(soapFaultType, soapFault.getSoapFaultType()) ;
+ assertEquals(subcode, soapFault.getSubcode()) ;
+ assertEquals(reason, soapFault.getReason()) ;
+ }
+ };
+ final CompletionInitiatorProcessor initiator = CompletionInitiatorProcessor.getProcessor() ;
+ initiator.registerCallback(instanceIdentifier, callback) ;
+
+ try
+ {
+ CompletionInitiatorClient.getClient().sendSoapFault(completionInitiatorEndpoint, map, soapFault, new InstanceIdentifier("sender")) ;
+ callback.waitUntilTriggered() ;
+ }
+ finally
+ {
+ initiator.removeCallback(instanceIdentifier) ;
+ }
+
+ assertTrue(callback.hasTriggered()) ;
+ assertFalse(callback.hasFailed()) ;
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionParticipantTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionParticipantTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/CompletionParticipantTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * CompletionParticipantTestCase.java
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.client.CompletionCoordinatorClient;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.wst11.tests.arq.TestCompletionCoordinatorProcessor.CompletionCoordinatorDetails;
+import com.arjuna.wst11.tests.TestUtil;
+
+import javax.inject.Named;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+ at Named
+public class CompletionParticipantTestCase
+{
+ private CompletionCoordinatorProcessor origCompletionCoordinatorProcessor ;
+
+ private TestCompletionCoordinatorProcessor testCompletionCoordinatorProcessor = new TestCompletionCoordinatorProcessor() ;
+
+ public void setUp()
+ throws Exception
+ {
+ origCompletionCoordinatorProcessor = CompletionCoordinatorProcessor.setProcessor(testCompletionCoordinatorProcessor) ;
+ }
+
+ public void testSendCommit()
+ throws Exception
+ {
+ final String messageId = "testSendCommit" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.completionCoordinatorServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ final W3CEndpointReference endpoint = TestUtil.getCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+
+ CompletionCoordinatorClient.getClient().sendCommit(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CompletionCoordinatorDetails details = testCompletionCoordinatorProcessor.getCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCommit()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void testSendRollback()
+ throws Exception
+ {
+ final String messageId = "testSendRollback" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.completionCoordinatorServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ final W3CEndpointReference endpoint = TestUtil.getCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+
+ CompletionCoordinatorClient.getClient().sendRollback(endpoint, map, new InstanceIdentifier("sender")) ;
+
+ final CompletionCoordinatorDetails details = testCompletionCoordinatorProcessor.getCompletionCoordinatorDetails(messageId, 10000) ;
+
+ assertTrue(details.hasRollback()) ;
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ CompletionCoordinatorProcessor.setProcessor(origCompletionCoordinatorProcessor) ;
+ }
+
+ private void checkDetails(CompletionCoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.completionCoordinatorServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.completionInitiatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.completionInitiatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext);
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionCoordinatorProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionCoordinatorProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+public class TestCompletionCoordinatorProcessor extends CompletionCoordinatorProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public CompletionCoordinatorDetails getCompletionCoordinatorDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final CompletionCoordinatorDetails details = (CompletionCoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final CompletionCoordinatorDetails details = (CompletionCoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Commit.
+ * @param commit The commit notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void commit(final Notification commit, final MAP map,
+ final ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID();
+ final CompletionCoordinatorDetails details = new CompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCommit(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Rollback.
+ * @param rollback The rollback notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void rollback(final Notification rollback, final MAP map,
+ final ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CompletionCoordinatorDetails details = new CompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setRollback(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Activate the participant.
+ * @param participant The participant.
+ * @param identifier The identifier.
+ */
+ public void activateParticipant(final CompletionCoordinatorParticipant participant, final String identifier)
+ {
+ }
+
+ /**
+ * Deactivate the participant.
+ * @param participant The participant.
+ */
+ public void deactivateParticipant(final CompletionCoordinatorParticipant participant)
+ {
+ }
+
+ public static class CompletionCoordinatorDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean commit ;
+ private boolean rollback ;
+
+ CompletionCoordinatorDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasCommit()
+ {
+ return commit ;
+ }
+
+ void setCommit(final boolean commit)
+ {
+ this.commit = commit ;
+ }
+
+ public boolean hasRollback()
+ {
+ return rollback ;
+ }
+
+ void setRollback(final boolean rollback)
+ {
+ this.rollback = rollback ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionInitiatorCallback.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionInitiatorCallback.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCompletionInitiatorCallback.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.CompletionInitiatorCallback;
+import org.jboss.ws.api.addressing.MAP;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+/** B
+ * Base callback class for tests.
+ * @author kevin
+ */
+public class TestCompletionInitiatorCallback extends CompletionInitiatorCallback
+{
+ /**
+ * An aborted response.
+ * @param aborted The aborted notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void aborted(final Notification aborted, final MAP map,
+ final ArjunaContext arjunaContext)
+ {
+ throw new RuntimeException("Unexpected aborted response") ;
+ }
+
+ /**
+ * A committed response.
+ * @param committed The committed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void committed(final Notification committed, final MAP map,
+ final ArjunaContext arjunaContext)
+ {
+ throw new RuntimeException("Unexpected committed response") ;
+ }
+
+ /**
+ * A SOAP fault response.
+ * @param soapFault The SOAP fault.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void soapFault(final SoapFault soapFault, final MAP map,
+ final ArjunaContext arjunaContext)
+ {
+ throw new RuntimeException("Unexpected SOAP fault response") ;
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionCoordinatorProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionCoordinatorProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,374 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices.SoapFault;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+public class TestCoordinatorCompletionCoordinatorProcessor extends CoordinatorCompletionCoordinatorProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public CoordinatorCompletionCoordinatorDetails getCoordinatorCompletionCoordinatorDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final CoordinatorCompletionCoordinatorDetails details = (CoordinatorCompletionCoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final CoordinatorCompletionCoordinatorDetails details = (CoordinatorCompletionCoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Activate the coordinator.
+ *
+ * @param coordinator The coordinator.
+ * @param identifier The identifier.
+ */
+ public void activateCoordinator(CoordinatorCompletionCoordinatorInboundEvents coordinator, String identifier) {
+ }
+
+ /**
+ * Deactivate the coordinator.
+ *
+ * @param coordinator The coordinator.
+ */
+ public void deactivateCoordinator(CoordinatorCompletionCoordinatorInboundEvents coordinator) {
+ }
+
+ public CoordinatorCompletionCoordinatorInboundEvents getCoordinator(String identifier) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ /**
+ * Cancelled.
+ *
+ * @param cancelled The cancelled notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void cancelled(NotificationType cancelled, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCancelled(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Closed.
+ *
+ * @param closed The closed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void closed(NotificationType closed, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setClosed(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Compensated.
+ *
+ * @param compensated The compensated notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void compensated(NotificationType compensated, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCompensated(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Completed.
+ *
+ * @param completed The completed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void completed(NotificationType completed, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCompleted(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void exit(NotificationType exit, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setExit(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Cannot complete.
+ *
+ * @param cannotComplete The cannot complete notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void cannotComplete(NotificationType cannotComplete, MAP map, ArjunaContext arjunaContext) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ /**
+ * Fault.
+ *
+ * @param fault The fault exception.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void fail(ExceptionType fault, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setFail(fault); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void getStatus(NotificationType getStatus, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setGetStatus(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Status.
+ *
+ * @param status The status.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void status(StatusType status, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setStatus(status); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * SOAP fault.
+ *
+ * @param soapFault The SOAP fault.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void soapFault(SoapFault soapFault, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionCoordinatorDetails details = new CoordinatorCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setSoapFault(soapFault); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public static class CoordinatorCompletionCoordinatorDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean closed ;
+ private boolean cancelled ;
+ private boolean compensated ;
+ private ExceptionType fail;
+ private boolean completed ;
+ private boolean cannotComplete ;
+ private StatusType status ;
+ private SoapFault soapFault ;
+ private boolean exit ;
+ private boolean getStatus ;
+
+ CoordinatorCompletionCoordinatorDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasExit()
+ {
+ return exit ;
+ }
+
+ void setExit(final boolean exit)
+ {
+ this.exit = exit ;
+ }
+
+ public boolean hasGetStatus()
+ {
+ return getStatus ;
+ }
+
+ void setGetStatus(final boolean getStatus)
+ {
+ this.getStatus = getStatus ;
+ }
+ public boolean hasClosed() {
+ return closed;
+ }
+
+ public void setClosed(boolean closed) {
+ this.closed = closed;
+ }
+
+ public boolean hasCancelled() {
+ return cancelled;
+ }
+
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ public boolean hasCompensated() {
+ return compensated;
+ }
+
+ public void setCompensated(boolean compensated) {
+ this.compensated = compensated;
+ }
+
+ public ExceptionType hasFail() {
+ return fail;
+ }
+
+ public void setFail(ExceptionType fail) {
+ this.fail = fail;
+ }
+
+ public boolean hasCompleted() {
+ return completed;
+ }
+
+ public void setCompleted(boolean completed) {
+ this.completed = completed;
+ }
+
+ public boolean hasCAnnotComplete() {
+ return cannotComplete;
+ }
+
+ public void setCannotComplete(boolean cannotComplete) {
+ this.cannotComplete = cannotComplete;
+ }
+
+ public StatusType hasStatus() {
+ return status;
+ }
+
+ public void setStatus(StatusType status) {
+ this.status = status;
+ }
+
+ public SoapFault hasSoapFault() {
+ return soapFault;
+ }
+
+ public void setSoapFault(SoapFault soapFault) {
+ this.soapFault = soapFault;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionParticipantProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorCompletionParticipantProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,382 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+public class TestCoordinatorCompletionParticipantProcessor extends CoordinatorCompletionParticipantProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public CoordinatorCompletionParticipantDetails getCoordinatorCompletionParticipantDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final CoordinatorCompletionParticipantDetails details = (CoordinatorCompletionParticipantDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final CoordinatorCompletionParticipantDetails details = (CoordinatorCompletionParticipantDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Activate the participant.
+ *
+ * @param participant The participant.
+ * @param identifier The identifier.
+ */
+ public void activateParticipant(CoordinatorCompletionParticipantInboundEvents participant, String identifier) {
+ }
+
+ /**
+ * Deactivate the participant.
+ *
+ * @param participant The participant.
+ */
+ public void deactivateParticipant(CoordinatorCompletionParticipantInboundEvents participant) {
+ }
+
+ /**
+ * Check whether a participant with the given id is currently active
+ *
+ * @param identifier The identifier.
+ */
+ public boolean isActive(String identifier) {
+ return false;
+ }
+
+ public void cancel(NotificationType cancel, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setCancel(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void close(NotificationType close, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setClose(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void compensate(NotificationType compensate, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setCompensate(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void complete(NotificationType complete, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setComplete(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Exited.
+ *
+ * @param exited The exited notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void exited(NotificationType exited, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setExited(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Not Completed.
+ *
+ * @param notCompleted The not completed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void notCompleted(NotificationType notCompleted, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setNotCompleted(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Faulted.
+ *
+ * @param failed The failed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void failed(NotificationType failed, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setFailed(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void getStatus(NotificationType getStatus, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setGetStatus(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Status.
+ *
+ * @param status The status.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void status(StatusType status, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setStatus(status) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * SOAP fault.
+ *
+ * @param soapFault The SOAP fault.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void soapFault(SoapFault soapFault, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorCompletionParticipantDetails details = new CoordinatorCompletionParticipantDetails(map, arjunaContext) ;
+ details.setSoapFault(soapFault) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void activateParticipant(BusinessAgreementWithCoordinatorCompletionParticipant participant, String identifier)
+ {
+ }
+
+ public void deactivateParticipant(BusinessAgreementWithCoordinatorCompletionParticipant participant)
+ {
+ }
+
+ public static class CoordinatorCompletionParticipantDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean cancel ;
+ private boolean close ;
+ private boolean compensate ;
+ private boolean complete ;
+ private boolean failed;
+ private boolean exited ;
+ private boolean notCompleted ;
+ private StatusType status ;
+ private boolean getStatus ;
+ private SoapFault soapFault ;
+
+ CoordinatorCompletionParticipantDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasCancel()
+ {
+ return cancel ;
+ }
+
+ void setCancel(final boolean cancel)
+ {
+ this.cancel = cancel ;
+ }
+
+ public boolean hasClose()
+ {
+ return close ;
+ }
+
+ void setClose(final boolean close)
+ {
+ this.close = close ;
+ }
+
+ public boolean hasCompensate()
+ {
+ return compensate ;
+ }
+
+ void setCompensate(final boolean compensate)
+ {
+ this.compensate = compensate ;
+ }
+
+ public boolean hasComplete()
+ {
+ return complete ;
+ }
+
+ void setComplete(final boolean complete)
+ {
+ this.complete = complete ;
+ }
+
+ public boolean hasGetStatus()
+ {
+ return getStatus ;
+ }
+
+ void setGetStatus(final boolean getStatus)
+ {
+ this.getStatus = getStatus ;
+ }
+ public boolean hasFailed() {
+ return failed;
+ }
+
+ public void setFailed(boolean failed) {
+ this.failed = failed;
+ }
+
+ public boolean hasExited() {
+ return exited;
+ }
+
+ public void setExited(boolean exited) {
+ this.exited = exited;
+ }
+
+ public boolean hasNotCompleted() {
+ return notCompleted;
+ }
+
+ public void setNotCompleted(boolean notCompleted) {
+ this.notCompleted = notCompleted;
+ }
+
+ public StatusType hasStatus() {
+ return status;
+ }
+
+ public void setStatus(StatusType status) {
+ this.status = status;
+ }
+
+ public SoapFault hasSoapFault() {
+ return soapFault;
+ }
+
+ public void setSoapFault(SoapFault soapFault) {
+ this.soapFault = soapFault;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestCoordinatorProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,261 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.CoordinatorInboundEvents;
+import com.arjuna.webservices11.wsat.processors.CoordinatorProcessor;
+import org.jboss.ws.api.addressing.MAP;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+public class TestCoordinatorProcessor extends CoordinatorProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public CoordinatorDetails getCoordinatorDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final CoordinatorDetails details = (CoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final CoordinatorDetails details = (CoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Activate the participant.
+ *
+ * @param coordinator The participant.
+ * @param identifier The identifier.
+ */
+ public void activateCoordinator(CoordinatorInboundEvents coordinator, String identifier) {
+ }
+
+ /**
+ * Deactivate the participant.
+ *
+ * @param coordinator The participant.
+ */
+ public void deactivateCoordinator(CoordinatorInboundEvents coordinator) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ /**
+ * Fetch the coordinator with a given identifier.
+ *
+ * @param identifier The identifier.
+ */
+ public CoordinatorInboundEvents getCoordinator(String identifier) {
+ return null;
+ }
+
+ public void aborted(Notification aborted,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorDetails details = new CoordinatorDetails(map, arjunaContext) ;
+ details.setAborted(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void committed(Notification committed,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorDetails details = new CoordinatorDetails(map, arjunaContext) ;
+ details.setCommitted(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void prepared(Notification prepared,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorDetails details = new CoordinatorDetails(map, arjunaContext) ;
+ details.setPrepared(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void readOnly(Notification readOnly,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorDetails details = new CoordinatorDetails(map, arjunaContext) ;
+ details.setReadOnly(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void replay(Notification replay,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorDetails details = new CoordinatorDetails(map, arjunaContext) ;
+ details.setReplay(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void soapFault(SoapFault soapFault, MAP map,
+ ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final CoordinatorDetails details = new CoordinatorDetails(map, arjunaContext) ;
+ details.setSoapFault(soapFault) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public static class CoordinatorDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean aborted ;
+ private boolean committed ;
+ private boolean prepared ;
+ private boolean readOnly ;
+ private boolean replay ;
+ private SoapFault soapFault ;
+
+ CoordinatorDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasAborted()
+ {
+ return aborted ;
+ }
+
+ void setAborted(final boolean aborted)
+ {
+ this.aborted = aborted ;
+ }
+
+ public boolean hasCommitted()
+ {
+ return committed ;
+ }
+
+ void setCommitted(final boolean committed)
+ {
+ this.committed = committed ;
+ }
+
+ public boolean hasPrepared()
+ {
+ return prepared ;
+ }
+
+ void setPrepared(final boolean prepared)
+ {
+ this.prepared = prepared ;
+ }
+
+ public boolean hasReadOnly() {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly) {
+ this.readOnly = readOnly;
+ }
+
+ public boolean hasReplay() {
+ return replay;
+ }
+
+ public void setReplay(boolean replay) {
+ this.replay = replay;
+ }
+
+ public SoapFault hasSoapFault()
+ {
+ return soapFault ;
+ }
+
+ void setSoapFault(final SoapFault soapFault)
+ {
+ this.soapFault = soapFault ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionCoordinatorProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionCoordinatorProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,391 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices.SoapFault;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+public class TestParticipantCompletionCoordinatorProcessor extends ParticipantCompletionCoordinatorProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public ParticipantCompletionCoordinatorDetails getParticipantCompletionCoordinatorDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final ParticipantCompletionCoordinatorDetails details = (ParticipantCompletionCoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final ParticipantCompletionCoordinatorDetails details = (ParticipantCompletionCoordinatorDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Activate the coordinator.
+ *
+ * @param coordinator The coordinator.
+ * @param identifier The identifier.
+ */
+ public void activateCoordinator(ParticipantCompletionCoordinatorInboundEvents coordinator, String identifier) {
+ }
+
+ /**
+ * Deactivate the coordinator.
+ *
+ * @param coordinator The coordinator.
+ */
+ public void deactivateCoordinator(ParticipantCompletionCoordinatorInboundEvents coordinator) {
+ }
+
+ public ParticipantCompletionCoordinatorInboundEvents getCoordinator(String identifier) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ /**
+ * Cancelled.
+ *
+ * @param cancelled The cancelled notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void cancelled(NotificationType cancelled, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCancelled(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Closed.
+ *
+ * @param closed The closed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void closed(NotificationType closed, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setClosed(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Compensated.
+ *
+ * @param compensated The compensated notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void compensated(NotificationType compensated, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCompensated(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Completed.
+ *
+ * @param completed The completed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void completed(NotificationType completed, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCompleted(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * CannotComplete.
+ *
+ * @param cannotComplete The cannot complete notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void cannotComplete(NotificationType cannotComplete, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setCannotComplete(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * exit
+ * @param exit The exit notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void exit(NotificationType exit, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setExit(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Fault.
+ *
+ * @param fault The fault exception.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void fail(ExceptionType fault, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setFault(fault) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void getStatus(NotificationType getStatus, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setGetStatus(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Status.
+ *
+ * @param status The status.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void status(StatusType status, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setStatus(status) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * SOAP fault.
+ *
+ * @param soapFault The SOAP fault.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void soapFault(SoapFault soapFault, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionCoordinatorDetails details = new ParticipantCompletionCoordinatorDetails(map, arjunaContext) ;
+ details.setSoapFault(soapFault) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public static class ParticipantCompletionCoordinatorDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean exit ;
+ private boolean getStatus ;
+ private boolean cancelled;
+ private boolean closed;
+ private boolean compensated;
+ private boolean completed;
+ private boolean cannotComplete;
+ private ExceptionType fault;
+ private StatusType status;
+ private SoapFault soapFault;
+
+ ParticipantCompletionCoordinatorDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasCannotComplete()
+ {
+ return cannotComplete ;
+ }
+
+ void setCannotComplete(final boolean cannotComplete)
+ {
+ this.cannotComplete = cannotComplete ;
+ }
+
+ public boolean hasExit()
+ {
+ return exit ;
+ }
+
+ void setExit(final boolean exit)
+ {
+ this.exit = exit ;
+ }
+
+ public boolean hasGetStatus()
+ {
+ return getStatus ;
+ }
+
+ void setGetStatus(final boolean getStatus)
+ {
+ this.getStatus = getStatus ;
+ }
+
+ public boolean hasCancelled() {
+ return cancelled;
+ }
+
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ public boolean hasClosed() {
+ return closed;
+ }
+
+ public void setClosed(boolean closed) {
+ this.closed = closed;
+ }
+
+ public boolean hasCompensated() {
+ return compensated;
+ }
+
+ public void setCompensated(boolean compensated) {
+ this.compensated = compensated;
+ }
+
+ public boolean hasCompleted() {
+ return completed;
+ }
+
+ public void setCompleted(boolean completed) {
+ this.completed = completed;
+ }
+
+ public ExceptionType hasFault() {
+ return fault;
+ }
+
+ public void setFault(ExceptionType fault) {
+ this.fault = fault;
+ }
+
+ public StatusType hasStatus() {
+ return status;
+ }
+
+ public void setStatus(StatusType status) {
+ this.status = status;
+ }
+
+ public SoapFault hasSoapFault() {
+ return soapFault;
+ }
+
+ public void setSoapFault(SoapFault soapFault) {
+ this.soapFault = soapFault;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionParticipantProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantCompletionParticipantProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,350 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices.SoapFault;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+public class TestParticipantCompletionParticipantProcessor extends ParticipantCompletionParticipantProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public ParticipantCompletionParticipantDetails getParticipantCompletionParticipantDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final ParticipantCompletionParticipantDetails details = (ParticipantCompletionParticipantDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final ParticipantCompletionParticipantDetails details = (ParticipantCompletionParticipantDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Activate the participant.
+ *
+ * @param participant The participant.
+ * @param identifier The identifier.
+ */
+ public void activateParticipant(ParticipantCompletionParticipantInboundEvents participant, String identifier) {
+ }
+
+ /**
+ * Deactivate the participant.
+ *
+ * @param participant The participant.
+ */
+ public void deactivateParticipant(ParticipantCompletionParticipantInboundEvents participant) {
+ }
+
+ /**
+ * Check whether a participant with the given id is currently active
+ *
+ * @param identifier The identifier.
+ */
+ public boolean isActive(String identifier) {
+ return false;
+ }
+
+ public void cancel(NotificationType cancel, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setCancel(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void close(NotificationType close, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setClose(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void compensate(NotificationType compensate, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setCompensate(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Exited.
+ *
+ * @param exited The exited notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void exited(NotificationType exited, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setExited(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Not Completed.
+ *
+ * @param notCompleted The not completed notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void notCompleted(NotificationType notCompleted, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setNotCompleted(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Faulted.
+ *
+ * @param faulted The faulted notification.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void failed(NotificationType faulted, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setFaulted(true); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void getStatus(NotificationType getStatus, MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setGetStatus(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * Status.
+ *
+ * @param status The status.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void status(StatusType status, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setStatus(status); ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ /**
+ * SOAP fault.
+ *
+ * @param soapFault The SOAP fault.
+ * @param map The addressing context.
+ * @param arjunaContext The arjuna context.
+ */
+ public void soapFault(SoapFault soapFault, MAP map, ArjunaContext arjunaContext) {
+ final String messageId = map.getMessageID() ;
+ final ParticipantCompletionParticipantDetails details = new ParticipantCompletionParticipantDetails(map, arjunaContext) ;
+ details.setSoapFault(soapFault) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ details.setSoapFault(soapFault);
+ }
+
+ public static class ParticipantCompletionParticipantDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean cancel ;
+ private boolean close ;
+ private boolean compensate ;
+ private boolean getStatus ;
+ private boolean faulted;
+ private boolean exited;
+ private boolean notCompleted;
+ private StatusType status;
+ private SoapFault soapFault;
+
+ ParticipantCompletionParticipantDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasCancel()
+ {
+ return cancel ;
+ }
+
+ void setCancel(final boolean cancel)
+ {
+ this.cancel = cancel ;
+ }
+
+ public boolean hasClose()
+ {
+ return close ;
+ }
+
+ void setClose(final boolean close)
+ {
+ this.close = close ;
+ }
+
+ public boolean hasCompensate()
+ {
+ return compensate ;
+ }
+
+ void setCompensate(final boolean compensate)
+ {
+ this.compensate = compensate ;
+ }
+
+ public boolean hasGetStatus()
+ {
+ return getStatus ;
+ }
+
+ void setGetStatus(final boolean getStatus)
+ {
+ this.getStatus = getStatus ;
+ }
+
+ public boolean hasFaulted() {
+ return faulted;
+ }
+
+ public void setFaulted(boolean faulted) {
+ this.faulted = faulted;
+ }
+
+ public boolean hasExited() {
+ return exited;
+ }
+
+ public void setExited(boolean exited) {
+ this.exited = exited;
+ }
+
+ public boolean hasNotCompleted() {
+ return notCompleted;
+ }
+
+ public void setNotCompleted(boolean notCompleted) {
+ this.notCompleted = notCompleted;
+ }
+
+ public StatusType hasStatus() {
+ return status;
+ }
+ public void setStatus(StatusType status) {
+ this.status = status;
+ }
+
+ public SoapFault getSoapFault() {
+ return soapFault;
+ }
+
+ public void setSoapFault(SoapFault soapFault) {
+ this.soapFault = soapFault;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantProcessor.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestParticipantProcessor.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,215 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.tests.arq;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.ParticipantInboundEvents;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import org.jboss.ws.api.addressing.MAP;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+public class TestParticipantProcessor extends ParticipantProcessor
+{
+ private Map messageIdMap = new HashMap() ;
+
+ public ParticipantDetails getParticipantDetails(final String messageId, final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ synchronized(messageIdMap)
+ {
+ long now = System.currentTimeMillis() ;
+ while(now < endTime)
+ {
+ final ParticipantDetails details = (ParticipantDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ try
+ {
+ messageIdMap.wait(endTime - now) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ now = System.currentTimeMillis() ;
+ }
+ final ParticipantDetails details = (ParticipantDetails)messageIdMap.remove(messageId) ;
+ if (details != null)
+ {
+ return details ;
+ }
+ }
+ throw new NullPointerException("Timeout occurred waiting for id: " + messageId) ;
+ }
+
+ /**
+ * Activate the participant.
+ *
+ * @param participant The participant.
+ * @param identifier The identifier.
+ */
+ public void activateParticipant(ParticipantInboundEvents participant, String identifier) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ /**
+ * Deactivate the participant.
+ *
+ * @param participant The participant.
+ */
+ public void deactivateParticipant(ParticipantInboundEvents participant) {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ /**
+ * Check whether a participant with the given id is currently active
+ *
+ * @param identifier The identifier.
+ */
+ public boolean isActive(String identifier) {
+ return true;
+ }
+
+ public void commit(Notification commit,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantDetails details = new ParticipantDetails(map, arjunaContext) ;
+ details.setCommit(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void prepare(Notification prepare,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantDetails details = new ParticipantDetails(map, arjunaContext) ;
+ details.setPrepare(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void rollback(Notification rollback,
+ MAP map, ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantDetails details = new ParticipantDetails(map, arjunaContext) ;
+ details.setRollback(true) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public void soapFault(SoapFault soapFault, MAP map,
+ ArjunaContext arjunaContext)
+ {
+ final String messageId = map.getMessageID() ;
+ final ParticipantDetails details = new ParticipantDetails(map, arjunaContext) ;
+ details.setSoapFault(soapFault) ;
+
+ synchronized(messageIdMap)
+ {
+ messageIdMap.put(messageId, details) ;
+ messageIdMap.notifyAll() ;
+ }
+ }
+
+ public static class ParticipantDetails
+ {
+ private final MAP map ;
+ private final ArjunaContext arjunaContext ;
+ private boolean commit ;
+ private boolean prepare ;
+ private boolean rollback ;
+ private SoapFault soapFault ;
+
+ ParticipantDetails(final MAP map, final ArjunaContext arjunaContext)
+ {
+ this.map = map ;
+ this.arjunaContext = arjunaContext ;
+ }
+
+ public MAP getMAP()
+ {
+ return map ;
+ }
+
+ public ArjunaContext getArjunaContext()
+ {
+ return arjunaContext ;
+ }
+
+ public boolean hasCommit()
+ {
+ return commit ;
+ }
+
+ void setCommit(final boolean commit)
+ {
+ this.commit = commit ;
+ }
+
+ public boolean hasPrepare()
+ {
+ return prepare ;
+ }
+
+ void setPrepare(final boolean prepare)
+ {
+ this.prepare = prepare ;
+ }
+
+ public boolean hasRollback()
+ {
+ return rollback ;
+ }
+
+ void setRollback(final boolean rollback)
+ {
+ this.rollback = rollback ;
+ }
+
+ public SoapFault getSoapFault()
+ {
+ return soapFault ;
+ }
+
+ void setSoapFault(final SoapFault soapFault)
+ {
+ this.soapFault = soapFault ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestSuite.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TestSuite.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * TestSuite.java
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import com.arjuna.wst11.tests.arq.*;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+ at RunWith(Suite.class)
+ @Suite.SuiteClasses({
+ CompletionParticipantTestCase.class,
+ CompletionCoordinatorTestCase.class,
+ TwoPCParticipantTestCase.class,
+ TwoPCCoordinatorTestCase.class,
+ BusinessAgreementWithParticipantCompletionParticipantTestCase.class,
+ BusinessAgreementWithParticipantCompletionCoordinatorTestCase.class,
+ BusinessAgreementWithCoordinatorCompletionParticipantTestCase.class,
+ BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.class
+ })
+public class TestSuite
+{
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TwoPCCoordinatorTestCase.java,v 1.6.2.1 2005/11/22 10:37:45 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Named;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.client.ParticipantClient;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.wst11.tests.arq.TestParticipantProcessor.ParticipantDetails;
+import com.arjuna.wst11.tests.TestUtil;
+
+ at Named
+public class TwoPCCoordinatorTestCase
+{
+ private ParticipantProcessor origParticipantProcessor ;
+
+ private TestParticipantProcessor testParticipantProcessor = new TestParticipantProcessor() ;
+
+ public void setUp()
+ throws Exception
+ {
+ origParticipantProcessor = ParticipantProcessor.setProcessor(testParticipantProcessor) ;
+ }
+
+
+ public void testSendPrepare()
+ throws Exception
+ {
+ final String messageId = "testSendPrepare" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
+
+ ParticipantClient.getClient().sendPrepare(participantEndpointReference, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasPrepare()) ;
+
+ checkDetails(details, true, true, messageId, null);
+ }
+
+
+ public void testSendCommit()
+ throws Exception
+ {
+ final String messageId = "testSendCommit" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
+
+ ParticipantClient.getClient().sendCommit(participantEndpointReference, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasCommit()) ;
+
+ checkDetails(details, true, true, messageId, null);
+ }
+
+
+ public void testSendRollback()
+ throws Exception
+ {
+ final String messageId = "testSendRollback" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3") ;
+ final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
+
+ ParticipantClient.getClient().sendRollback(participantEndpointReference, map, new InstanceIdentifier("sender")) ;
+
+ final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000) ;
+
+ assertTrue(details.hasRollback()) ;
+
+ checkDetails(details, true, true, messageId, null);
+ }
+
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "testSendError" ;
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId) ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4") ;
+
+ final String reason = "testSendErrorReason" ;
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ ParticipantClient.getClient().sendSoapFault(map, soapFault, new InstanceIdentifier("sender")) ;
+
+ final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000) ;
+ final SoapFault receivedSoapFault = details.getSoapFault() ;
+
+ assertNotNull(receivedSoapFault) ;
+ assertEquals(soapFaultType, receivedSoapFault.getSoapFaultType()) ;
+ assertEquals(subcode, receivedSoapFault.getSubcode()) ;
+ assertEquals(reason, receivedSoapFault.getReason()) ;
+
+ checkDetails(details, false, false, messageId, null);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ ParticipantProcessor.setProcessor(origParticipantProcessor) ;
+ }
+ /**
+ * check the message details to see that they have the correct to, from and faultto address and message id, a
+ * none reply to address and an arjuna context containing the correct instannce identifier
+ * @param details
+ * @param hasFrom
+ * @param hasFaultTo
+ * @param messageId
+ * @param instanceIdentifier
+ */
+
+ private void checkDetails(ParticipantDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.participantServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.coordinatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.coordinatorServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext) ;
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTestCase.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTestCase.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/main/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTestCase.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: TwoPCParticipantTestCase.java,v 1.6.2.1 2005/11/22 10:37:46 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.arq;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import static org.junit.Assert.*;
+
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsat.client.CoordinatorClient;
+import com.arjuna.webservices11.wsat.processors.CoordinatorProcessor;
+import com.arjuna.wst11.tests.arq.TestCoordinatorProcessor.CoordinatorDetails;
+import com.arjuna.wst11.tests.TestUtil;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.jboss.ws.api.addressing.MAP;
+
+public class TwoPCParticipantTestCase
+{
+ private CoordinatorProcessor origCoordinatorProcessor ;
+ private TestCoordinatorProcessor testCoordinatorProcessor = new TestCoordinatorProcessor();
+
+ public void setUp()
+ throws Exception
+ {
+ origCoordinatorProcessor = CoordinatorProcessor.getProcessor();
+ CoordinatorProcessor.setProcessor(testCoordinatorProcessor);
+ }
+
+
+ public void testSendPrepared()
+ throws Exception
+ {
+ final String messageId = "testSendPrepared" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1") ;
+ W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId) ;
+
+ CoordinatorClient.getClient().sendPrepared(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
+
+ CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
+ assertTrue(details.hasPrepared());
+
+ checkDetails(details, true, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendAborted()
+ throws Exception
+ {
+ final String messageId = "testSendAborted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2") ;
+ W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId) ;
+
+ CoordinatorClient.getClient().sendAborted(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
+
+ CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
+ assertTrue(details.hasAborted());
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendReadOnly()
+ throws Exception
+ {
+ final String messageId = "testSendReadOnly" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3") ;
+ W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId) ;
+
+ CoordinatorClient.getClient().sendReadOnly(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
+
+ CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
+ assertTrue(details.hasReadOnly());
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendCommitted()
+ throws Exception
+ {
+ final String messageId = "testSendCommitted" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4") ;
+ W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId) ;
+
+ CoordinatorClient.getClient().sendCommitted(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
+
+ CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
+ assertTrue(details.hasCommitted());
+
+ checkDetails(details, false, true, messageId, instanceIdentifier);
+ }
+
+
+ public void testSendError()
+ throws Exception
+ {
+ final String messageId = "testSendError" ;
+ final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5");
+ W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
+ final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
+ final String reason = "testSendErrorReason" ;
+ final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER ;
+ final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME ;
+ final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason) ;
+
+ CoordinatorClient.getClient().sendSoapFault(coordinatorEndpoint, map, soapFault, new InstanceIdentifier("sender"));
+
+ CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
+ assertNotNull(details.hasSoapFault());
+ assertEquals(details.hasSoapFault().getSoapFaultType(), soapFault.getSoapFaultType());
+ assertEquals(details.hasSoapFault().getReason(), soapFault.getReason());
+ assertEquals(details.hasSoapFault().getSubcode(), soapFault.getSubcode());
+
+ checkDetails(details, false, false, messageId, instanceIdentifier);
+ }
+
+ public void tearDown()
+ throws Exception
+ {
+ CoordinatorProcessor.setProcessor(origCoordinatorProcessor);
+ }
+
+ /**
+ * check the message details to see that they have the correct to, from and faultto address and message id, a
+ * none reply to address and an arjuna context containing the correct instannce identifier
+ * @param details
+ * @param hasFrom
+ * @param hasFaultTo
+ * @param messageId
+ * @param instanceIdentifier
+ */
+
+ private void checkDetails(CoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier)
+ {
+ MAP inMAP = details.getMAP();
+ ArjunaContext inArjunaContext = details.getArjunaContext();
+
+ assertEquals(inMAP.getTo(), TestUtil.coordinatorServiceURI);
+ assertNotNull(inMAP.getReplyTo());
+ assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
+ if (hasFrom) {
+ assertNotNull(inMAP.getFrom());
+ assertEquals(inMAP.getFrom().getAddress(), TestUtil.participantServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ if (hasFaultTo) {
+ assertNotNull(inMAP.getFaultTo());
+ assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.participantServiceURI);
+ } else {
+ assertNull(inMAP.getFrom());
+ }
+ assertNotNull(inMAP.getMessageID());
+ assertEquals(inMAP.getMessageID(), messageId);
+
+ if (instanceIdentifier == null) {
+ assertNull(inArjunaContext);
+ } else {
+ assertNotNull(inArjunaContext) ;
+ assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/WarDeployment.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/WarDeployment.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/WarDeployment.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,73 @@
+package com.arjuna.wst11.tests;
+
+import java.io.File;
+
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import com.arjuna.wst.tests.common.TestAbortedVoteParticipant;
+import com.arjuna.wst.tests.common.TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestNoExceptionParticipant;
+import com.arjuna.wst.tests.common.TestPreparedVoteParticipant;
+import com.arjuna.wst.tests.common.TestReadOnlyVoteParticipant;
+import com.arjuna.wst.tests.common.TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestSystemExceptionParticipant;
+import com.arjuna.wst.tests.common.TestTransactionRolledBackExceptionParticipant;
+import com.arjuna.wst.tests.common.TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.tests.common.TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.tests.common.TestWrongStateExceptionParticipant;
+
+public class WarDeployment {
+ public static WebArchive getDeployment(Class<?>...args){
+ WebArchive archive = ShrinkWrap
+ .create(WebArchive.class, "test.war")
+ .addClass(TestInitialisation.class)
+ .addClass(TestUtil.class)
+ .addClass(TestAbortedVoteParticipant.class)
+ .addClass(TestFaultedExceptionBusinessAgreementWithCoordinatorCompletionParticipant.class)
+ .addClass(TestFaultedExceptionBusinessAgreementWithParticipantCompletionParticipant.class)
+ .addClass(TestNoExceptionBusinessAgreementWithCoordinatorCompletionParticipant.class)
+ .addClass(TestNoExceptionBusinessAgreementWithParticipantCompletionParticipant.class)
+ .addClass(TestNoExceptionParticipant.class)
+ .addClass(TestPreparedVoteParticipant.class)
+ .addClass(TestReadOnlyVoteParticipant.class)
+ .addClass(TestTransactionRolledBackExceptionParticipant.class)
+ .addClass(TestWrongStateExceptionParticipant.class)
+ .addClass(TestSystemExceptionParticipant.class)
+ .addClass(TestSystemExceptionBusinessAgreementWithParticipantCompletionParticipant.class)
+ .addClass(TestWrongStateExceptionBusinessAgreementWithParticipantCompletionParticipant.class)
+ .addClass(TestSystemExceptionBusinessAgreementWithCoordinatorCompletionParticipant.class)
+ .addClass(TestWrongStateExceptionBusinessAgreementWithCoordinatorCompletionParticipant.class)
+ .addClass(TestNoExceptionCompletionCoordinatorParticipant.class)
+ .addClass(TestTransactionRolledBackExceptionCompletionCoordinatorParticipant.class)
+ .addClass(TestUnknownTransactionExceptionCompletionCoordinatorParticipant.class)
+ .addClass(TestSystemExceptionCompletionCoordinatorParticipant.class)
+ .addClass(TestNoExceptionBAPMParticipant.class)
+ .addClass(TestWrongStateExceptionBAPMParticipant.class)
+ .addClass(TestSystemExceptionBAPMParticipant.class)
+ .addClass(TestNoExceptionBusinessActivityTerminator.class)
+ .addClass(TestUnknownTransactionExceptionBusinessActivityTerminator.class)
+ .addClass(TestTransactionRolledBackExceptionBusinessActivityTerminator.class)
+ .addClass(TestSystemExceptionBusinessActivityTerminator.class)
+ .addClasses(args)
+ .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
+ .setWebXML(new File("src/test/resources/web.xml"));
+
+ archive.delete(ArchivePaths.create("META-INF/MANIFEST.MF"));
+
+ final String ManifestMF = "Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.modules,deployment.arquillian-service,org.jboss.msc,"
+ + "org.jboss.jts,org.jboss.ws.api,javax.xml.ws.api,org.jboss.xts,"
+ + "org.jboss.ws.jaxws-client services export,org.jboss.ws.cxf.jbossws-cxf-client services export\n";
+ archive.setManifest(new StringAsset(ManifestMF));
+
+ return archive;
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionCoordinatorTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,88 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestCoordinatorCompletionParticipantProcessor.CoordinatorCompletionParticipantDetails;
+
+ at RunWith(Arquillian.class)
+public class BusinessAgreementWithCoordinatorCompletionCoordinatorTest {
+ @Inject
+ BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ CoordinatorCompletionParticipantDetails.class,
+ TestCoordinatorCompletionParticipantProcessor.class,
+ BusinessAgreementWithCoordinatorCompletionCoordinatorTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCancel() throws Exception {
+ test.testSendCancel();
+ }
+
+ @Test
+ public void testSendClose() throws Exception {
+ test.testSendClose();
+ }
+
+ @Test
+ public void testSendCompensate() throws Exception {
+ test.testSendCompensate();
+ }
+
+ @Test
+ public void testSendComplete() throws Exception {
+ test.testSendComplete();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @Test
+ public void testSendExited() throws Exception {
+ test.testSendExited();
+ }
+
+ @Test
+ public void testSendFaulted() throws Exception {
+ test.testSendFaulted();
+ }
+
+ @Test
+ public void testSendGetStatus() throws Exception {
+ test.testSendGetStatus();
+ }
+
+ @Test
+ public void testSendNotCompleted() throws Exception {
+ test.testSendNotCompleted();
+ }
+
+ @Test
+ public void testSendStatus() throws Exception {
+ test.testSendStatus();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithCoordinatorCompletionParticipantTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,83 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails;
+
+ at RunWith(Arquillian.class)
+public class BusinessAgreementWithCoordinatorCompletionParticipantTest {
+ @Inject
+ BusinessAgreementWithCoordinatorCompletionParticipantTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ CoordinatorCompletionCoordinatorDetails.class,
+ TestCoordinatorCompletionCoordinatorProcessor.class,
+ BusinessAgreementWithCoordinatorCompletionParticipantTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCancelled() throws Exception {
+ test.testSendCancelled();
+ }
+
+ @Test
+ public void testSendClosed() throws Exception {
+ test.testSendClosed();
+ }
+
+ @Test
+ public void testSendCompensated() throws Exception {
+ test.testSendCompensated();
+ }
+
+ @Test
+ public void testSendCompleted() throws Exception {
+ test.testSendCompleted();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @Test
+ public void testSendExit() throws Exception {
+ test.testSendExit();
+ }
+
+ @Test
+ public void testSendFault() throws Exception {
+ test.testSendFault();
+ }
+
+ @Test
+ public void testSendGetStatus() throws Exception {
+ test.testSendGetStatus();
+ }
+
+ @Test
+ public void testSendStatus() throws Exception {
+ test.testSendStatus();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionCoordinatorTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,83 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails;
+
+ at RunWith(Arquillian.class)
+public class BusinessAgreementWithParticipantCompletionCoordinatorTest {
+ @Inject
+ BusinessAgreementWithParticipantCompletionCoordinatorTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ ParticipantCompletionParticipantDetails.class,
+ TestParticipantCompletionParticipantProcessor.class,
+ BusinessAgreementWithParticipantCompletionCoordinatorTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCancel() throws Exception {
+ test.testSendCancel();
+ }
+
+ @Test
+ public void testSendClose() throws Exception {
+ test.testSendClose();
+ }
+
+ @Test
+ public void testSendCompensate() throws Exception {
+ test.testSendCompensate();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @Test
+ public void testSendExited() throws Exception {
+ test.testSendExited();
+ }
+
+ @Test
+ public void testSendFaulted() throws Exception {
+ test.testSendFaulted();
+ }
+
+ @Test
+ public void testSendGetStatus() throws Exception {
+ test.testSendGetStatus();
+ }
+
+ @Test
+ public void testSendNotCompleted() throws Exception {
+ test.testSendNotCompleted();
+ }
+
+ @Test
+ public void testSendStatus() throws Exception {
+ test.testSendStatus();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/BusinessAgreementWithParticipantCompletionParticipantTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,88 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails;
+
+ at RunWith(Arquillian.class)
+public class BusinessAgreementWithParticipantCompletionParticipantTest {
+ @Inject
+ BusinessAgreementWithParticipantCompletionParticipantTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ ParticipantCompletionCoordinatorDetails.class,
+ TestParticipantCompletionCoordinatorProcessor.class,
+ BusinessAgreementWithParticipantCompletionParticipantTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCancelled() throws Exception {
+ test.testSendCancelled();
+ }
+
+ @Test
+ public void testSendCannotComplete() throws Exception {
+ test.testSendCannotComplete();
+ }
+
+ @Test
+ public void testSendClosed() throws Exception {
+ test.testSendClosed();
+ }
+
+ @Test
+ public void testSendCompensated() throws Exception {
+ test.testSendCompensated();
+ }
+
+ @Test
+ public void testSendCompleted() throws Exception {
+ test.testSendCompleted();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @Test
+ public void testSendExit() throws Exception {
+ test.testSendExit();
+ }
+
+ @Test
+ public void testSendFault() throws Exception {
+ test.testSendFault();
+ }
+
+ @Test
+ public void testSendGetStatus() throws Exception {
+ test.testSendGetStatus();
+ }
+
+ @Test
+ public void testSendStatus() throws Exception {
+ test.testSendStatus();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionCoordinatorTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,51 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class CompletionCoordinatorTest {
+ @Inject
+ CompletionCoordinatorTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ TestCompletionInitiatorCallback.class,
+ CompletionCoordinatorTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCommit() throws Exception {
+ test.testSendCommitted();
+ }
+
+ @Test
+ public void testSendAborted() throws Exception {
+ test.testSendAborted();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionParticipantTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionParticipantTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/CompletionParticipantTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,49 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestCompletionCoordinatorProcessor.CompletionCoordinatorDetails;
+
+ at RunWith(Arquillian.class)
+public class CompletionParticipantTest {
+ @Inject
+ CompletionParticipantTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ CompletionParticipantTestCase.class,
+ TestCompletionCoordinatorProcessor.class,
+ CompletionCoordinatorDetails.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCommit() throws Exception {
+ test.testSendCommit();
+
+ }
+
+ @Test
+ public void testSendRollback() throws Exception {
+ test.testSendRollback();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCCoordinatorTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,58 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestParticipantProcessor.ParticipantDetails;
+
+ at RunWith(Arquillian.class)
+public class TwoPCCoordinatorTest {
+ @Inject
+ TwoPCCoordinatorTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ ParticipantDetails.class,
+ TestParticipantProcessor.class,
+ TwoPCCoordinatorTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendPrepare() throws Exception {
+ test.testSendPrepare();
+ }
+
+ @Test
+ public void testSendCommit() throws Exception {
+ test.testSendCommit();
+ }
+
+ @Test
+ public void testSendRollback() throws Exception {
+ test.testSendRollback();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/java/com/arjuna/wst11/tests/arq/TwoPCParticipantTest.java 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,63 @@
+package com.arjuna.wst11.tests.arq;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.WarDeployment;
+import com.arjuna.wst11.tests.arq.TestCoordinatorProcessor.CoordinatorDetails;
+
+ at RunWith(Arquillian.class)
+public class TwoPCParticipantTest {
+ @Inject
+ TwoPCParticipantTestCase test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ TestCoordinatorProcessor.class,
+ CoordinatorDetails.class,
+ TwoPCParticipantTestCase.class);
+ }
+
+ @Before
+ public void setUp() throws Exception{
+ test.setUp();
+ }
+
+ @Test
+ public void testSendCommitted() throws Exception {
+ test.testSendCommitted();
+ }
+
+ @Test
+ public void testSendAborted() throws Exception {
+ test.testSendAborted();
+ }
+
+ @Test
+ public void testSendError() throws Exception {
+ test.testSendError();
+ }
+
+ @Test
+ public void testSendPrepared() throws Exception {
+ test.testSendPrepared();
+ }
+
+ @Test
+ public void testSendReadOnly() throws Exception {
+ test.testSendReadOnly();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ test.tearDown();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/arquillian.xml
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/arquillian.xml (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/arquillian.xml 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <!-- Example configuration for a remote JBoss AS 7 instance -->
+ <container qualifier="jboss-as" default="true">
+ <protocol type="jmx-as7">
+ <property name="executionType">REMOTE</property>
+ </protocol>
+ <configuration>
+ <property name="serverConfig">standalone-xts.xml</property>
+ </configuration>
+ </container>
+</arquillian>
Added: labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/web.xml
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/web.xml (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WS-T/src/test/resources/web.xml 2011-11-21 12:26:56 UTC (rev 37727)
@@ -0,0 +1,38 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags.
+ See the copyright.txt in the distribution for a full listing
+ of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ metadata-complete="false">
+
+ <display-name>Arjuna Web Services Transaction Tests</display-name>
+
+ <description>Arjuna Web Services Transaction Tests</description>
+
+ <!-- Initialise the tests -->
+ <listener>
+ <listener-class>com.arjuna.wst11.tests.TestInitialisation</listener-class>
+ </listener>
+
+</web-app>
More information about the jboss-svn-commits
mailing list