[jboss-svn-commits] JBL Code SVN: r32070 - in labs/jbosstm/trunk/ArjunaJTS/jts: classes/com/arjuna/ats/internal/jts/orbspecific/interposition/resources/osi and 5 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Mar 14 13:22:03 EDT 2010


Author: mark.little at jboss.com
Date: 2010-03-14 13:22:02 -0400 (Sun, 14 Mar 2010)
New Revision: 32070

Added:
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/context/
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/context/ContextManagerUnitTest.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/recovery/jacorb.properties
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/LoggingUnitTest.java
Modified:
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextManager.java
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/resources/osi/ServerOSITopLevelAction.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/participants/ExtendedResourceUnitTest.java
Log:
https://jira.jboss.org/jira/browse/JBTM-715

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextManager.java	2010-03-14 16:02:14 UTC (rev 32069)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextManager.java	2010-03-14 17:22:02 UTC (rev 32070)
@@ -31,8 +31,6 @@
 
 package com.arjuna.ats.internal.jts.context;
 
-import com.arjuna.orbportability.*;
-
 import org.omg.CosTransactions.*;
 
 import com.arjuna.ArjunaOTS.*;
@@ -44,19 +42,13 @@
 import com.arjuna.ats.internal.jts.OTSImpleManager;
 import com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple;
 
-import com.arjuna.ats.jts.extensions.*;
 import com.arjuna.ats.jts.OTSManager;
 import com.arjuna.ats.jts.logging.*;
 
 import com.arjuna.ats.internal.arjuna.thread.ThreadActionData;
 
-import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.ats.arjuna.coordinator.BasicAction;
-import com.arjuna.ats.arjuna.coordinator.CheckedAction;
-
 import com.arjuna.common.util.logging.*;
 
-import java.io.PrintStream;
 import java.util.*;
 import java.lang.Object;
 import org.omg.CORBA.*;
@@ -66,17 +58,10 @@
 import com.arjuna.ats.arjuna.exceptions.FatalError;
 import com.arjuna.ats.arjuna.utils.ThreadUtil;
 
-import org.omg.CosTransactions.SubtransactionsUnavailable;
-import org.omg.CosTransactions.NoTransaction;
-import org.omg.CosTransactions.HeuristicMixed;
-import org.omg.CosTransactions.HeuristicHazard;
-import org.omg.CosTransactions.InvalidControl;
 import org.omg.CORBA.SystemException;
-import org.omg.CORBA.UserException;
 import org.omg.CORBA.UNKNOWN;
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.BAD_OPERATION;
-import java.lang.OutOfMemoryError;
 import java.util.EmptyStackException;
 import org.omg.CORBA.ORBPackage.InvalidName;
 

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/resources/osi/ServerOSITopLevelAction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/resources/osi/ServerOSITopLevelAction.java	2010-03-14 16:02:14 UTC (rev 32069)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/resources/osi/ServerOSITopLevelAction.java	2010-03-14 17:22:02 UTC (rev 32070)
@@ -45,107 +45,121 @@
 
 public class ServerOSITopLevelAction extends ServerStrictTopLevelAction
 {
-    
+
     /*
-     * The ServerTopLevelAction is responsible for registering
-     * this resource with its parent.
+     * The ServerTopLevelAction is responsible for registering this resource
+     * with its parent.
      */
 
-public ServerOSITopLevelAction (ServerControl control,
-				    boolean doRegister)
+    public ServerOSITopLevelAction(ServerControl control, boolean doRegister)
     {
-	super(control, doRegister);
+        super(control, doRegister);
 
-	if (jtsLogger.logger.isDebugEnabled())
-	{
-	    jtsLogger.logger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC,
-					       com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerOSITopLevelAction::ServerOSITopLevelAction ( ServerControl, "+doRegister+" )");
-	}
+        if (jtsLogger.logger.isDebugEnabled())
+        {
+            jtsLogger.logger.debug(DebugLevel.CONSTRUCTORS,
+                    VisibilityLevel.VIS_PUBLIC,
+                    com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
+                    "ServerOSITopLevelAction::ServerOSITopLevelAction ( ServerControl, "
+                            + doRegister + " )");
+        }
     }
 
-/*
- * Will only be called by the remote top-level transaction.
- */
+    /*
+     * Will only be called by the remote top-level transaction.
+     */
 
-public org.omg.CosTransactions.Vote prepare () throws HeuristicMixed, HeuristicHazard, SystemException
+    public org.omg.CosTransactions.Vote prepare () throws HeuristicMixed,
+            HeuristicHazard, SystemException
     {
-	if (jtsLogger.logger.isDebugEnabled())
-	{
-	    jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
-					       com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerOSITopLevelAction::prepare for "+_theUid);
-	}
+        if (jtsLogger.logger.isDebugEnabled())
+        {
+            jtsLogger.logger.debug(DebugLevel.FUNCTIONS,
+                    VisibilityLevel.VIS_PUBLIC,
+                    com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
+                    "ServerOSITopLevelAction::prepare for " + _theUid);
+        }
 
-	/*
-	 * First remove entry for this transaction otid
-	 * from map. Have to do it here as we are going
-	 * to be deleted by the base class!
-	 */
-    
-	OTIDMap.remove(get_uid());
+        /*
+         * First remove entry for this transaction otid from map. Have to do it
+         * here as we are going to be deleted by the base class!
+         */
 
-	return super.prepare();
+        OTIDMap.remove(get_uid());
+
+        return super.prepare();
     }
 
-public void rollback () throws SystemException, HeuristicCommit, HeuristicMixed, HeuristicHazard
+    public void rollback () throws SystemException, HeuristicCommit,
+            HeuristicMixed, HeuristicHazard
     {
-	if (jtsLogger.logger.isDebugEnabled())
-	{
-	    jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
-					       com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerOSITopLevelAction::rollback for "+_theUid);
-	}
+        if (jtsLogger.logger.isDebugEnabled())
+        {
+            jtsLogger.logger.debug(DebugLevel.FUNCTIONS,
+                    VisibilityLevel.VIS_PUBLIC,
+                    com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
+                    "ServerOSITopLevelAction::rollback for " + _theUid);
+        }
 
-	OTIDMap.remove(get_uid());
-    
-	super.rollback();
+        OTIDMap.remove(get_uid());
+
+        super.rollback();
     }
 
-public void commit () throws SystemException, NotPrepared, HeuristicRollback, HeuristicMixed, HeuristicHazard
+    public void commit () throws SystemException, NotPrepared,
+            HeuristicRollback, HeuristicMixed, HeuristicHazard
     {
-	if (jtsLogger.logger.isDebugEnabled())
-	{
-	    jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
-					       com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerOSITopLevelAction::commit for "+_theUid);
-	}
+        if (jtsLogger.logger.isDebugEnabled())
+        {
+            jtsLogger.logger.debug(DebugLevel.FUNCTIONS,
+                    VisibilityLevel.VIS_PUBLIC,
+                    com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
+                    "ServerOSITopLevelAction::commit for " + _theUid);
+        }
 
-	OTIDMap.remove(get_uid());
-    
-	super.commit();
+        OTIDMap.remove(get_uid());
+
+        super.commit();
     }
 
-public void forget () throws SystemException
+    public void forget () throws SystemException
     {
-	if (jtsLogger.logger.isDebugEnabled())
-	{
-	    jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
-					       com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerOSITopLevelAction::forget for "+_theUid);
-	}
+        if (jtsLogger.logger.isDebugEnabled())
+        {
+            jtsLogger.logger.debug(DebugLevel.FUNCTIONS,
+                    VisibilityLevel.VIS_PUBLIC,
+                    com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
+                    "ServerOSITopLevelAction::forget for " + _theUid);
+        }
 
-	OTIDMap.remove(get_uid());
+        OTIDMap.remove(get_uid());
 
-	super.forget();
+        super.forget();
     }
 
-/*
- * Just because commit_one_phase is called by the coordinator does not
- * mean that we can use it - we may have many locally registered resources.
- */
+    /*
+     * Just because commit_one_phase is called by the coordinator does not mean
+     * that we can use it - we may have many locally registered resources.
+     */
 
-public void commit_one_phase () throws HeuristicHazard, SystemException
+    public void commit_one_phase () throws HeuristicHazard, SystemException
     {
-	if (jtsLogger.logger.isDebugEnabled())
-	{
-	    jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
-					       com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerOSITopLevelAction::commit_one_phase for "+_theUid);
-	}
+        if (jtsLogger.logger.isDebugEnabled())
+        {
+            jtsLogger.logger.debug(DebugLevel.FUNCTIONS,
+                    VisibilityLevel.VIS_PUBLIC,
+                    com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
+                    "ServerOSITopLevelAction::commit_one_phase for " + _theUid);
+        }
 
-	OTIDMap.remove(get_uid());
+        OTIDMap.remove(get_uid());
 
-	super.commit_one_phase();
+        super.commit_one_phase();
     }
 
-public String type ()
+    public String type ()
     {
-	return "/Resources/Arjuna/ServerTopLevelAction/ServerOSITopLevelAction";
+        return "/Resources/Arjuna/ServerTopLevelAction/ServerOSITopLevelAction";
     }
-    
+
 }

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/context/ContextManagerUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/context/ContextManagerUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/context/ContextManagerUnitTest.java	2010-03-14 17:22:02 UTC (rev 32070)
@@ -0,0 +1,95 @@
+/*
+ * 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 Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.context;
+
+import org.junit.Test;
+import org.omg.CosTransactions.Control;
+
+import com.arjuna.ArjunaOTS.ActionControl;
+import com.arjuna.ats.internal.jts.OTSImpleManager;
+import com.arjuna.ats.internal.jts.context.ContextManager;
+import com.arjuna.ats.internal.jts.context.ContextPropagationManager;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class ContextManagerUnitTest extends TestBase
+{
+    @Test
+    public void testContextPropagationManager () throws Exception
+    {
+        ContextPropagationManager manager = new ContextPropagationManager();
+    }
+    
+    @Test
+    public void testContextManager () throws Exception
+    {
+        ContextManager manager = new ContextManager();
+        
+        assertEquals(manager.current(Thread.currentThread().getName()), null);
+        assertEquals(manager.current(), null);
+        
+        OTSImpleManager.current().begin();
+        
+        manager.associate();
+        
+        OTSImpleManager.current().suspend();
+        
+        OTSImpleManager.current().begin();
+        
+        Control ct = OTSImpleManager.current().suspend();
+        
+        manager.addRemoteHierarchy(ct);
+
+        manager.popAction();
+        
+        OTSImpleManager.current().suspend();
+        
+        OTSImpleManager.current().begin();
+        
+        ActionControl cont = (ActionControl) OTSImpleManager.current().getControlWrapper().getImple().getControl();
+        
+        manager.addActionControlHierarchy(cont);
+        
+        manager.purgeActions();
+        
+        OTSImpleManager.current().suspend();
+        
+        OTSImpleManager.current().begin();
+        
+        manager.addControlImpleHierarchy(OTSImpleManager.current().getControlWrapper().getImple());
+        
+        manager.purgeActions();
+        
+        OTSImpleManager.current().suspend();
+    }
+}

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/recovery/jacorb.properties
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/recovery/jacorb.properties	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/recovery/jacorb.properties	2010-03-14 17:22:02 UTC (rev 32070)
@@ -0,0 +1,799 @@
+##
+##  JacORB configuration options
+##
+
+########################################
+#                                      #
+#   Initial references configuration   #
+#                                      #
+########################################
+
+#
+# URLs where IORs are stored (used in orb.resolve_initial_service())
+# DO EDIT these! (Only those that you are planning to use,
+# of course ;-).
+#
+# The ORBInitRef references are created on ORB startup time. In the
+# cases of the services themselves, this may lead to exceptions being
+# displayed (because the services aren't up yet). These exceptions
+# are handled properly and cause no harm!
+
+#ORBInitRef.NameService=corbaloc::160.45.110.41:38693/StandardNS/NameServer-POA/_root
+#ORBInitRef.NameService=file:/c:/NS_Ref
+ORBInitRef.NameService=http://www.x.y.z/~user/NS_Ref
+#ORBInitRef.TradingService=http://www.x.y.z/~user/TraderRef
+ORBInitRef.InterfaceRepository=file:/c:/IR_Ref
+
+########################################
+#                                      #
+#      Export of corbaloc IORs         #
+#                                      #
+########################################
+
+# allow for more readable corbaloc URLs by mapping the
+# actual object key to an arbitrary string. The mapping
+# below would permit clients of a name service to
+# access it using corbaloc::ipaddress:portnum/NameService
+# Note: it is NOT necessary to define this property for
+# the name service here because this is done already in the
+# code of the ns implementation.
+# This mapping can be altered programatically by the proprietary
+# function ORB::addObjectKey(NameService, file:/home/rnc/NameSingleton.ior)
+#
+# The property also accepts the following mappings:
+# IOR, resource, jndi, URL (e.g. file, http)
+# examples:
+# jacorb.orb.objectKeyMap.NameService=StandardNS/NameServer-POA/_root
+# jacorb.orb.objectKeyMap.NameService=file:/home/rnc/NameSingleton.ior
+
+##################################
+#                                #
+#   ORB version number output    #
+#                                #
+##################################
+
+# if on, the ORB's version number and a copyright statement is printed
+# any time the ORB is initialized
+jacorb.orb.print_version=on
+
+###########################
+#                         #
+#  Logging Configuration  #
+#                         #
+###########################
+
+# JacORB writes logging information through SLF4J, which passes it to an
+# arbitrary logging backend system, by default JDK logging.  JacORB does
+# not attempt to configure the backend system, that is left to the user.
+# The two properties below are only retained to ease upgrading from
+# previous JacORB versions.  If any of these properties is defined, and
+# JDK logging is in use, then JDK logging is configured by JacORB according
+# to these properties.  For a real configuration, see the file
+# logging_properties.template.
+
+# log levels:
+#
+# 0 = no logging (OFF)
+# 1 = errors (SEVERE)
+# 2 = warnings (WARNING)
+# 3 = informational messages (INFO)
+# 4 = debug-level output (FINE)
+jacorb.log.default.verbosity=4
+
+# where does output go? Terminal is default
+#jacorb.logfile=LOGFILEPATH
+
+# append to existing logfile?  This property is only used if
+# jacorb.logfile is defined.
+#jacorb.logfile.append=false
+
+# hexdump outgoing messages
+jacorb.debug.dump_outgoing_messages=off
+
+# hexdump incoming messages
+jacorb.debug.dump_incoming_messages=off
+
+##################################################
+#                                                #
+#    WARNING: The following properties should    #
+#    only be edited by the expert user. They     #
+#    can be left untouched in most cases!        #
+#                                                #
+##################################################
+
+
+
+################################
+#                              #
+#   Basic ORB Configuration    #
+#                              #
+################################
+
+# the GIOP minor version number to use for newly created IORs
+jacorb.giop_minor_version=2
+
+# number of retries if connection cannot directly be established
+jacorb.retries=5
+
+# how many msecs. do we wait between retries
+jacorb.retry_interval=500
+
+# log2 of maximum buffer size managed by the internal
+# buffer manager.
+#
+# This is NOT the maximum buffer size that
+# can be used, but just the largest size of buffers that
+# will be kept and managed. This value will be added to
+# an internal constant of 5, so the real value in bytes
+# is 2**(5+maxManagedBufSize-1). You only need to increase this
+# value if you are dealing with LOTS of LARGE data structures.
+# You may decrease it to make the buffer manager release large
+# buffers immediately rather than keeping them for later
+# reuse.
+jacorb.maxManagedBufSize=18
+
+# If this value is 0 an extra unlimited size buffer cache is created
+# for the CDROutputStreams. If this value is > 0 then the cache will
+# be purged every x msecs. If this value is -1 no caching of these
+# buffers will take place. This will reduce memory footprint at the
+# cost of decreased performance handling large data structures.
+# This value defaults to 0 if not set.
+#jacorb.bufferManagerMaxFlush=-1
+
+# Normally, a jacorb server will close the TCP/IP connection right
+# after sending a CloseConnection message. However, it may
+# occasionally happen that the client sends a message into the closed
+# connection because it hasn't handled the CloseConnection yet. To
+# avoid this situation, closing of the TCP/IP connection can be delayed.
+#jacorb.connection.delay_close=on
+#jacorb.connection.timeout_after_closeconnection=20000
+
+# Initial timeout for establishing a connection.
+jacorb.connection.client.connect_timeout=90000
+
+# Wait the specified number of msecs for a reply to a request. If
+# exceeded, a org.omg.CORBA.TIMEOUT exception will be thrown
+#jacorb.connection.client.pending_reply_timeout=0
+
+# client-side connection idle timeout, set to a non-zero value to close the
+# connection after so many msecs. Only connections that don't have pending
+# messages are closed, unless
+# jacorb.connection.client.timeout_ignores_pending_messages is turned on.
+#jacorb.connection.client.idle_timeout=0
+
+# shall the orb ignore pending messages when a connection idle timeout is
+# detected? If "on", the connection is closed regardless of any pending
+# messages, and all pending messages are cancelled (resulting in a
+# COMM_FAILURE, unless jacorb.connection.client.retry_on_failure is turned
+# on). Default is "off"
+#jacorb.connection.client.timeout_ignores_pending_messages=off
+
+# whenever a network failure is detected, the orb can either
+# (infinitely) retry all pending requests, or propagate a COMM_FAILURE
+# back into the client code. Default is "off", i.e. throw a
+# COMM_FAILURE. Note that this should only be used with idempotent operations
+# because the client side orb has no way of knowing the processing state of
+# the lost request on the server.
+#jacorb.connection.client.retry_on_failure=off
+
+# max time (msecs) a server keeps a connection open if nothing happens
+#jacorb.connection.server.timeout=10000
+
+# because JacORB uses blocking network IO, it assigns a thread to each
+# connection to listen and read messages. Threads are taken from a thread pool
+# that can be configured with these following properties. max_receptor_threads
+# is equal to the number of connections that can be serviced
+# simultaneously. When all threads are in use, new connections can still be
+# opened or accepted, but will not be listened on.
+#jacorb.connection.client.max_idle_receptor_threads=5
+#jacorb.connection.client.max_receptor_threads=1000
+#jacorb.connection.server.max_idle_receptor_threads=5
+#jacorb.connection.server.max_receptor_threads=1000
+
+# Max no of accepted connections on the server. Only effective in conjunction
+# with the next four properties. Please see section 15.2 "Connection
+# Management" in the ProgrammingGuide
+#jacorb.connection.max_server_connections=
+
+# The class name of the SelectionStrategy class
+#jacorb.connection.selection_strategy_class=
+
+# The class name of the StatisticsProvider class
+#jacorb.connection.statistics_provider_class=
+
+# The number of msecs that are waited until the next attempt to find
+# an idle connection is made (i.e. do not continuously spin)
+#jacorb.connection.wait_for_idle_interval=500
+
+# Sets keep-alive on server sockets. If the OS keepalive detects a TCP/IP
+# connection to be broken, the effect is the same as if the TCP/IP connection
+# has been closed gracefully.
+#jacorb.connection.server.keepalive=off
+
+# Sets keep-alive on client sockets. If the OS keepalive detects a TCP/IP
+# connection to be broken, the effect is the same as if the TCP/IP connection
+# has been closed gracefully. All pending replies will receive a
+# COMM_FAILURE.
+#jacorb.connection.client.keepalive=off
+
+#jacorb.reference_caching=off
+
+# Sets a timeout on the (SSL) server socket. This is a workaround for JDK 1.3
+# on linux where a thread blocked on accept() isn't notified when closing that
+# socket. See Java bug #4344135. NOTE: This is only useful in conjunction with
+# the SI&C SSL socket factories.
+#jacorb.listener.server_socket_timeout=0
+
+#
+# The following property specifies the class which is used for
+# reference caching. WeakHashtable uses WeakReferences, so entries
+# get gc'ed if only the Hashtable has a reference to them. This
+# is useful if you have many references to short-living non-persistent
+# CORBA objects. It is only available for java 1.2 and above.
+#
+# On the other hand the standard Hashtable keeps the references until
+# they are explicitely deleted by calling _release(). This is useful
+# for persistent and long-living CORBA objects.
+#
+#jacorb.hashtable_class=org.jacorb.util.WeakHashtable
+#
+jacorb.hashtable_class=java.util.Hashtable
+
+# use GIOP 1.2 byte order markers (since CORBA 2.4-5)
+jacorb.use_bom=off
+
+# add additional IIOP 1.0 profiles even if we are using IIOP 1.2
+jacorb.giop.add_1_0_profiles=off
+
+# Use DNS names in IORs
+jacorb.dns.enable=off
+
+# Compact Typecodes (off/on)
+jacorb.compactTypecodes=off
+
+# Cache typecode on read
+jacorb.cacheTypecodes=off
+
+# Cache poa names
+jacorb.cachePoaNames=off
+
+# Control if errors caused by an ORBInitializer (thrown exceptions or failure
+# to build class) will make ORB.init() fail or not. On failure, a
+# org.omg.CORBA.INITIALIZE exception will be thrown.
+#jacorb.orb_initializer.fail_on_error=off
+
+# A listener to receive a callback when the acceptor thread caught an
+# exception. The default JacORB implementation will shutdown the ORB on all
+# Errors and SSLExceptions (e.g. but not on IOExceptions)
+jacorb.acceptor_exception_listener=org.jacorb.orb.listener.DefaultAcceptorExceptionListener
+
+# If set to on this results in extra information being added to the
+# thread name i.e. connection endpoints and date/time thread started
+# processing - Server_TCP_IP_Transport only.
+jacorb.enhanced_thread_name=off
+
+# If this is set to a class implementing org.jacorb.orb.IORMutator
+# then this will be used to mutate incoming/outgoing Objects
+#jacorb.iormutator=
+
+# If true enable codesets. If false, this will ignore all codesetComponentInfo profiles
+# within an IOR and also disable explicit marshalling with codesets (re Strings).
+# jacorb.codeset=off
+
+# Overrides the detection from the local environment for the codeset used to
+# transmit characters. Note that this property is only effective once per JVM.
+# jacorb.native_char_codeset=ISO8859_1
+
+# Overrides the detection from the local environment for the codeset used to
+# transmit wide characters. ote that this property is only effective once per JVM.
+# jacorb.native_wchar_codeset=UTF16
+
+
+###########################################
+#                                         #
+#         Interoperability                #
+#                                         #
+###########################################
+
+# Turn off indirection encoding for repeated typecodes. This fixes
+# interoperability with certain broken ORB's eg. Orbix2000
+jacorb.interop.indirection_encoding_disable=off
+
+# Iona Comet CORBA/COM bridge can incorrectly encode buffer lengths.
+# Enabling this property adds additional length checking and adjustment
+# for interoperability with Comet.
+jacorb.interop.comet=off
+
+# Some ORBs (e.g. VisiBroker, ORBacus) do not set a byte value of 1
+# as a CDR encoded boolean true value. Enabling this property interprets
+# any non zero CDR encoded boolean value as true.
+jacorb.interop.lax_boolean_encoding=off
+
+# Control whether the method create_abstract_interface_tc performs
+# a validity check on the name parameter or not. Turning this check
+# off circumvents a bug in Sun's implementation of javax.rmi.CORBA.ValueHander,
+# which occasionally passes an invalid name (an empty string) to
+# ORBSingleton.create_abstract_interface_tc. If you are using RMI valuetypes,
+# you should turn this property off.
+jacorb.interop.strict_check_on_tc_creation=on
+
+# Custom-marshalled RMI valuetypes should be encoded as chunks, but some
+# ORBs are not able to decode chunked values. Disable this property for
+# interoperability with the ORB in Sun's JDK 1.4.2.
+jacorb.interop.chunk_custom_rmi_valuetypes=on
+
+# RMI/IIOP data encoded as chunks should contain the length
+# of the chunk. the sun orb does not send the length
+# always.
+# enable this property for interoperability with the Sun ORB.
+# http://lists.spline.inf.fu-berlin.de/mailman/htdig/jacorb-developer/2006-May/008251.html
+jacorb.interop.sun=off
+
+###########################################
+#                                         #
+#         Socket Factories                #
+#                                         #
+###########################################
+
+# A factory design pattern is used for the creation of sockets and server
+# sockets.
+# The jacorb.net.socket_factory property can be used to configure
+# a socket factory that must implement the operations defined in the
+# interface org.jacorb.orb.factory.SocketFactory.
+# The jacorb.net.server_socket_factory property can be used to configure a
+# server socket factory that must implement the operations defined in the
+# interface org.jacorb.orb.factory.ServerSocketFactory.
+#
+#jacorb.net.socket_factory=org.jacorb.orb.factory.DefaultSocketFactory
+#jacorb.net.server_socket_factory=org.jacorb.orb.factory.DefaultServerSocketFactory
+#jacorb.net.socket_factory=org.jacorb.orb.factory.PortRangeSocketFactory
+#jacorb.net.server_socket_factory=org.jacorb.orb.factory.PortRangeServerSocketFactory
+#
+# Additional socket factores are supported that allow for the configuration
+# of maximum and minimum port numbers that can be used. This can be used to
+# enable firewall traversal via a fixed port range. To use these socket factories
+# configure one or both of the following property pairs. The first property pair
+# configures the client socket factory and the second pair the server socket
+# factory.
+#
+#jacorb.net.socket_factory.port.min
+#jacorb.net.socket_factory.port.max
+#jacorb.net.server_socket_factory.port.min
+#jacorb.net.server_socket_factory.port.max
+
+# Listeners
+# The TCP listener listens for TCP socket connections and should be implemented
+# as defined by org.jacorb.orb.listener.TCPConnectionListener
+jacorb.net.tcp_listener=
+
+###########################################
+#                                         #
+#         BiDirectional GIOP              #
+#                                         #
+###########################################
+
+# uncomment this initializer if you want to use BiDirectional GIOP
+
+#org.omg.PortableInterceptor.ORBInitializerClass.bidir_init=org.jacorb.orb.giop.BiDirConnectionInitializer
+
+
+###########################################
+#                                         #
+#       Proxy address in IOR              #
+#                                         #
+###########################################
+
+#
+# Some times it is necessary to present an endpoint alias in an IOR
+# to allow clients outside a firewall to get a connection to a server
+# that is behind a NAT'ing firewall.
+#
+# WARNING: this is just "dumb" replacing, so you
+# have to take care of your configuration!
+#
+
+# The general form of this address is <protocol key>://<address>
+# The protocol key in the address must match the protocol(s) used by
+# the server. See the section on configuring Transport Factories for
+# information on loading specific protocols.
+#jacorb.ior_proxy_address=iiop://1.2.3.4:4711
+
+# Deprecated IIOP-specific form:
+# with these two properties it is possible to
+# tell the ORB what IP/port IORs should contain,
+# if the ServerSockets IP/port can't be used
+# (e.g. for traffic through a firewall).
+#
+# WARNING: this is just "dumb" replacing, so you
+# have to take care of your configuration!
+#
+
+#jacorb.ior_proxy_host=1.2.3.4
+#jacorb.ior_proxy_port=4711
+
+###########################################
+#                                         #
+#   The Object Adapter Internet Address   #
+#                                         #
+###########################################
+
+# IP address on multi-homed host (this gets encoded in
+# object references). NOTE: Adresses like 127.0.0.X
+# will only be accessible from the same machine!
+#OAIAddr=1.2.3.4
+#OAPort=4711
+
+# A new protocol-independent configuration is available
+# for use to configure an explicit endpoint using IIOP or
+# other protocols.
+#OAAddress=iiop://1.2.3.4:4711
+
+# The following option allows you to add further alternate
+# addresses to your IORs using TAG_ALTERNATE_IIOP_ADDRESS.
+# The value is either a comma-separated list of host:port addresses,
+# or the keyword "auto", which means that JacORB should add
+# the addresses of all known network interfaces on this machine.
+#jacorb.iiop.alternate_addresses = 1.2.3.4:12,1.2.3.5:12
+
+############################
+#                          #
+#   Default Interceptors   #
+#   Please leave them in!  #
+#                          #
+############################
+org.omg.PortableInterceptor.ORBInitializerClass.standard_init=org.jacorb.orb.standardInterceptors.IORInterceptorInitializer
+
+
+
+###############################################
+#                                             #
+#   Implementation Repository Configuration   #
+#                                             #
+###############################################
+# Switch off to avoid contacting the ImR on every server start-up
+jacorb.use_imr=off
+
+# Switch off if you don't want to write the ImR address into server IORs
+# (ignored if jacorb.use_imr=off)
+jacorb.use_imr_endpoint=on
+
+# if set to "on", servers that don't already have an entry on their
+# first call to the imr, will get automatically registered. Otherwise,
+# an UnknownServer exception is thrown.
+jacorb.imr.allow_auto_register=off
+
+# if set to "on", the imr will try to "ping" every object reference,
+# that it is going to return. If the reference is not alive, TRANSIENT
+# is thrown.
+jacorb.imr.check_object_liveness=off
+
+ORBInitRef.ImplementationRepository=http://www.x.y.z/~user/ImR_Ref
+
+jacorb.imr.table_file=Z:\table.dat
+jacorb.imr.backup_file=z:\backup.dat
+jacorb.imr.ior_file=/home/bwana/brose/public_html/ImR_Ref
+# Time (msecs) that the implementation will wait for a started server to register.
+jacorb.imr.timeout=
+
+# Host for ImR endpoint
+jacorb.imr.endpoint_host=
+# Port number for IMR endpoint
+jacorb.imr.endpoint_port_number=
+
+# how many millisecs should the imr wait, until a connection from an
+# application client is terminated. Default is 2000.
+jacorb.imr.connection_timeout=2000
+
+# the implementation name, should be set to a different
+# name in the code of persistent servers
+# jacorb.implname=StandardImplName
+
+#
+# This is supposed to be a generic startup string for everything
+# that calls Runtime.exec(). Might be replaced by jaco[.bat].
+#
+jacorb.java_exec=java -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton
+
+# with these two properties it is possible to
+# tell the ORB what IP / hostname  and port the IMR IOR and IMRified server IORs should
+# contain,  if the ServerSockets IP/port can't be used
+# (e.g. for traffic through a firewall).
+#
+# WARNING: this is just "dumb" replacement, so you
+# have to take care of your configuration!
+#
+#jacorb.imr.ior_proxy_host=1.2.3.4
+#jacorb.imr.ior_proxy_port=4711
+
+# protocol-independent form for assigning imr proxy endpoint
+#jacorb.imr.ior_proxy_address=iiop://1.2.3.4:4711
+
+#########################
+#                       #
+#   SSL Configuration   #
+#                       #
+#########################
+
+#
+# The port number used by SSL, will be dynmically assigned
+# by default
+#
+
+#OASSLPort=4711
+
+# This interceptor must be set if programs need access to
+# certificates using the CORBA Security API, SSL works also
+# without this interceptor
+
+#org.omg.PortableInterceptor.ORBInitializerClass.ForwardInit=org.jacorb.security.ssl.SecurityServiceInitializer
+
+# qualified classname of access decision object
+jacorb.security.access_decision=org.jacorb.security.level2.AccessDecisionImpl
+
+# list of qualified classnames of principal authenticator objects,
+# separated by commas (no whitespaces!). The first entry (that can
+# be successfully created) will be available through the
+# principal_authenticator property.
+jacorb.security.principal_authenticator=org.jacorb.security.level2.PrincipalAuthenticatorImpl
+
+# the qualified classname of the ssl socket factory class
+jacorb.ssl.socket_factory=org.jacorb.security.ssl.sun_jsse.SSLSocketFactory
+
+# the qualified classname of the ssl server socket factory class
+jacorb.ssl.server_socket_factory=org.jacorb.security.ssl.sun_jsse.SSLServerSocketFactory
+
+# IIOP/SSL parameters (numbers are hex values, without the leading "0x"):
+# NoProtection = 1
+# EstablishTrustInClient = 40
+# EstablishTrustInTarget = 20
+# mutual authentication = 60
+# please see the programming guide for more explanation
+
+jacorb.security.support_ssl=off
+
+jacorb.security.ssl.client.supported_options=0
+jacorb.security.ssl.client.required_options=0
+
+jacorb.security.ssl.server.supported_options=0
+jacorb.security.ssl.server.required_options=0
+
+#
+# If set, the following two values will be placed in the IOR, if
+# "corbaloc:ssliop" ssliop.
+#
+# If not set, only EstablishTrustInTarget is used for both supported
+# and required options. EstablishTrustInClient is not set, and the
+# rest of the Association Options aren't currently used anyway.
+#jacorb.security.ssl.corbaloc_ssliop.supported_options=0
+#jacorb.security.ssl.corbaloc_ssliop.required_options=0
+
+# The name and location of the keystore. This may be absolute or
+# relative to the home directory, or a file retrievable through the
+# classloader.
+#
+# NOTE (for Sun JSSE users): The "javax.net.ssl.trustStore[Password]"
+# properties don't seem to take effect, so you may want to add trusted
+# certificates to "normal" keystores. In this case, please set the
+# property "jacorb.security.jsse.trustees_from_ks"is to "on", so trusted
+# certificates are taken from the keystore instead of a dedicated
+# truststore.
+jacorb.security.keystore=
+jacorb.security.keystore_password=
+
+#
+# Sun JSSE specific settings
+#
+# Use the keystore to take trusted certs from.
+jacorb.security.jsse.trustees_from_ks=off
+
+# A comma-separated (no whitespaces!) list of cipher suite names. See
+# the JSSE docs on how to obtain the correct cipher suite strings
+jacorb.security.ssl.server.cipher_suites=
+jacorb.security.ssl.client.cipher_suites=
+
+# A comma seperated list of the names of the protocols to be set enabled on
+# the SSL socket.  See the JSSE documentation for
+# javax.net.ssl.SSLSocket#setEnabledProtocols()
+# NOTE: Does only apply to jdk1.4 and above
+#jacorb.security.ssl.client.protocols=
+#jacorb.security.ssl.server.protocols=
+
+# A user defined javax.net.ssl.TrustManager implemementation class name.
+# Will be used to intialise the SSLContext. See JSSE docs for javax.net.ssl.SSLContext#init().
+# Must be capable of instantiation via a no arg constructor.
+#jacorb.security.ssl.client.trust_manager=my.trust.Manager
+#jacorb.security.ssl.server.trust_manager=my.trust.Manager
+
+# Class name for a class that implements JacORB JSRandom interface. This
+# will be used to get a SecureRandom.
+jacorb.security.randomClassPlugin=
+
+# Listeners
+# The SSL listener listens for SSL sessions and should be implemented as defined
+# by org.jacorb.orb.listener.SSLSessionListener
+jacorb.security.ssl.ssl_listener=
+
+#########################
+#                       #
+#   POA Configuration   #
+#                       #
+#########################
+
+# displays a GUI monitoring tool for servers
+jacorb.poa.monitoring=off
+
+# POA log levels:
+# 0 = fatal errors only = "almost off" (FATAL ERRORS)
+# 1 = non-fatal errors and exceptions (ERROR)
+# 2 = important messages (WARN)
+# 3 = informational messages and exceptions (INFO)
+# 4 = debug-level output (DEBUG) (may confuse the unaware user :-)
+jacorb.poa.log.verbosity=3
+
+# thread pool configuration for request processing
+jacorb.poa.thread_pool_max=20
+jacorb.poa.thread_pool_min=5
+
+# If set then use shared thread pool amongst all the POAs.  Only used with
+# ORB_CTRL_MODEL.
+# jacorb.poa.thread_pool_shared = off
+
+# if set, request processing threads in thePOA
+# will run at this priority. If not set or invalid,
+# MAX_PRIORITY will be used.
+#jacorb.poa.thread_priority=
+
+# Properties controlling the POA's request queue.  If queue_wait is off,
+# then if there are more than queue_max requests in the queue, the
+# client gets TRANSIENT exceptions for any requests.  If queue_wait is on,
+# then the call blocks at the server side until no more than queue_min
+# requests are left in the queue.  The new request is then delivered as usual.
+jacorb.poa.queue_wait=off
+jacorb.poa.queue_max=100
+jacorb.poa.queue_min=10
+
+# Set this to on for server-side checking of expired ReplyEndTimePolicy.
+# (This also applies to RelativeRoundtripTimeoutPolicy.)  When this is on,
+# the clocks of the server and client machine need to be synchronized.
+#jacorb.poa.check_reply_end_time=off
+
+
+###################################
+#                                 #
+#  Transport Layer Configuration  #
+#                                 #
+###################################
+
+# Names of the factories classes for all installed transport plug-ins
+# (comma-separated list).
+
+#jacorb.transport.factories=org.jacorb.orb.iiop.IIOPFactories
+
+# ProfileId tags of all installed transports that should actually
+# listen on the server side.  This is a comma-separated list of numbers,
+# each number must correspond to one ProfileId tag from a factory in
+# jacorb.transport.factories.  In IORs produced by the server, the transport
+# profiles will appear in the order indicated by this list.
+
+#jacorb.transport.server.listeners=0
+
+# Name of a class that selects the transport profile to use on the
+# client side.
+
+#jacorb.transport.client.selector=org.jacorb.orb.DefaultProfileSelector
+
+
+##################################
+#                                #
+#   Name Service Configuration   #
+#                                #
+##################################
+
+# log levels:
+# 0 = fatal errors only = "almost off" (FATAL ERRORS)
+# 1 = non-fatal errors and exceptions (ERROR)
+# 2 = important messages (WARN)
+# 3 = informational messages and exceptions (INFO)
+# 4 = debug-level output (DEBUG) (may confuse the unaware user :-)
+
+jacorb.naming.log.verbosity=3
+
+#
+# name of the logger factory. Implement your own subclass of
+# org.jacorb.util.LoggerFactory and enter class name here to
+# customize logging behavior. Built-in default is org.jacorb.util.LogKitLoggerFactory
+#jacorb.log.loggerFactory=
+
+# Whether non active references are purged from name service
+# when list operation is invoked.
+
+jacorb.naming.purge=on
+
+# Whether resolve should return references without trying to
+# ping them to see if they're still alive first.
+
+jacorb.naming.noping=on
+
+# The file where the name server drops its IOR
+jacorb.naming.ior_filename=c:/NS_Ref
+
+
+########################################################
+#                                                      #
+#   Notification Service configuration, please see     #
+#   the JacORB ProgrammingGuide for a explanation      #
+#                                                      #
+########################################################
+
+jacorb.notification.filter.thread_pool_size = 2
+
+jacorb.notification.proxyconsumer.thread_pool_size = 2
+
+jacorb.notification.proxysupplier.thread_pool_size = 4
+
+jacorb.notification.supplier.poll_intervall = 1000
+
+jacorb.notification.max_batch_size = 1
+
+jacorb.notification.max_events_per_consumer = 100
+
+jacorb.notification.order_policy = PriorityOrder
+
+jacorb.notification.discard_policy = PriorityOrder
+
+jacorb.notification.consumer.backout_interval = 5000
+
+jacorb.notification.consumer.error_threshold = 3
+
+# valid values: ThreadPool, ThreadPerProxy
+jacorb.notification.proxysupplier.threadpolicy = ThreadPool
+
+jacorb.notification.default_filter_factory = builtin
+
+# jacorb.notification.supplier.max_number = 10
+
+# jacorb.notification.start_time_supported = 10
+
+jacorb.notification.stop_time_supported = on
+
+jacorb.notification.proxy.destroy_causes_disconnect = on
+
+# Notification Service log levels:
+org.jacorb.notification.log.verbosity = 3
+
+########################################
+#                                      #
+#   SAS configuration                  #
+#                                      #
+########################################
+
+jacorb.SAS.log.verbosity=INFO
+jacorb.SAS.CSS.log.verbosity=INFO
+jacorb.SAS.TSS.log.verbosity=INFO
+
+# This option defines the specific SAS context generator/validator
+# Currently supported contexts include:
+#    NullContext       - Sends a NULL SAS Context
+#    GssUpContext      - Uses GSSUP security
+#    KerberosContext   - uses Kerberos security
+# At least one context must be selected for SAS support
+#jacorb.security.sas.contextClass=org.jacorb.security.sas.NullContext
+#jacorb.security.sas.contextClass=org.jacorb.security.sas.GssUpContext
+#jacorb.security.sas.contextClass=org.jacorb.security.sas.KerberosContext
+
+# This initializer installs the SAS interceptors
+# Comment out this line if you do not want SAS support
+#org.omg.PortableInterceptor.ORBInitializerClass.SAS=org.jacorb.security.sas.SASInitializer
+
+# This option is used for GSSUP security and sets up the GSS Provider
+# Comment out this line if you are not using GSS UP authentication
+#org.omg.PortableInterceptor.ORBInitializerClass.GSSUPProvider=org.jacorb.security.sas.GSSUPProviderInitializer
+
+########################################
+#                                      #
+#   Custom configuration               #
+#                                      #
+########################################
+
+
+# any other custom properties can be added here.

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/participants/ExtendedResourceUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/participants/ExtendedResourceUnitTest.java	2010-03-14 16:02:14 UTC (rev 32069)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/participants/ExtendedResourceUnitTest.java	2010-03-14 17:22:02 UTC (rev 32070)
@@ -36,8 +36,11 @@
 
 import org.junit.Test;
 
+import com.arjuna.ats.arjuna.ObjectType;
 import com.arjuna.ats.arjuna.common.Uid;
 import com.arjuna.ats.arjuna.coordinator.TwoPhaseOutcome;
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
 import com.arjuna.ats.internal.jts.OTSImpleManager;
 import com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple;
 import com.arjuna.ats.internal.jts.resources.ExtendedResourceRecord;
@@ -65,6 +68,25 @@
         
         res1.setValue(null);
         res1.print(new PrintWriter(new ByteArrayOutputStream()));
+        
+        OutputObjectState os = new OutputObjectState();
+        
+        assertTrue(res1.save_state(os, ObjectType.ANDPERSISTENT));
+        
+        InputObjectState is = new InputObjectState(os);
+        
+        assertTrue(res1.restore_state(is, ObjectType.ANDPERSISTENT));
+        
+        assertFalse(res2.doSave());
+        
+        assertFalse(res1.shouldAdd(res2));
+        assertFalse(res1.shouldAlter(res2));
+        assertFalse(res1.shouldMerge(res2));
+        assertFalse(res1.shouldReplace(res2));
+        
+        res1 = new ExtendedResourceRecord();
+        
+        assertTrue(res1.getRCUid().notEquals(res2.getRCUid()));
     }
     
     @Test
@@ -125,4 +147,54 @@
         OTSImpleManager.current().rollback();
         OTSImpleManager.current().rollback();
     }
+    
+    @Test
+    public void testTopLevelCommit () throws Exception
+    {
+        DemoArjunaResource ares = new DemoArjunaResource();
+        
+        OTSImpleManager.current().begin();
+        
+        ArjunaTransactionImple tx = OTSImpleManager.current().getControlWrapper().getImple().getImplHandle();
+        
+        ExtendedResourceRecord res = new ExtendedResourceRecord(false, new Uid(), ares.getReference(), tx.getControlHandle().get_coordinator(), new Uid(), OTSImpleManager.current().getControlWrapper().getImple().getImplHandle());
+        
+        assertEquals(res.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
+        assertEquals(res.topLevelCommit(), TwoPhaseOutcome.FINISH_OK);
+        
+        OTSImpleManager.current().rollback();
+    }
+    
+    @Test
+    public void testTopLevelAbort () throws Exception
+    {
+        DemoArjunaResource ares = new DemoArjunaResource();
+        
+        OTSImpleManager.current().begin();
+        
+        ArjunaTransactionImple tx = OTSImpleManager.current().getControlWrapper().getImple().getImplHandle();
+        
+        ExtendedResourceRecord res = new ExtendedResourceRecord(false, new Uid(), ares.getReference(), tx.getControlHandle().get_coordinator(), new Uid(), OTSImpleManager.current().getControlWrapper().getImple().getImplHandle());
+        
+        assertEquals(res.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
+        assertEquals(res.topLevelAbort(), TwoPhaseOutcome.FINISH_OK);
+        
+        OTSImpleManager.current().rollback();
+    }
+    
+    @Test
+    public void testOnePhaseCommit () throws Exception
+    {
+        DemoArjunaResource ares = new DemoArjunaResource();
+        
+        OTSImpleManager.current().begin();
+        
+        ArjunaTransactionImple tx = OTSImpleManager.current().getControlWrapper().getImple().getImplHandle();
+        
+        ExtendedResourceRecord res = new ExtendedResourceRecord(false, new Uid(), ares.getReference(), tx.getControlHandle().get_coordinator(), new Uid(), OTSImpleManager.current().getControlWrapper().getImple().getImplHandle());
+        
+        assertEquals(res.topLevelOnePhaseCommit(), TwoPhaseOutcome.FINISH_OK);
+        
+        OTSImpleManager.current().rollback();
+    }
 }

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/LoggingUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/LoggingUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/LoggingUnitTest.java	2010-03-14 17:22:02 UTC (rev 32070)
@@ -0,0 +1,55 @@
+/*
+ * 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 Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.utils;
+
+import org.junit.Test;
+
+import com.arjuna.ats.jts.logging.FacilityCode;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class LoggingUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        FacilityCode fc = new FacilityCode();
+        
+        assertEquals(fc.getLevel("FAC_OTS"), FacilityCode.FAC_OTS);
+        assertEquals(fc.getLevel("FAC_INTERCEPTOR"), FacilityCode.FAC_INTERCEPTOR);
+        assertEquals(fc.getLevel("foobar"), FacilityCode.FAC_NONE);
+        
+        assertEquals(fc.printString(FacilityCode.FAC_OTS), "FAC_OTS");
+        assertEquals(fc.printString(FacilityCode.FAC_INTERCEPTOR), "FAC_INTERCEPTOR");
+    }
+}



More information about the jboss-svn-commits mailing list