cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1070579 [1/2] - in /cxf/trunk: distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/ rt/ws/rm/src/main/java/org/apache/cxf/w...
Date Mon, 14 Feb 2011 17:15:06 GMT
Author: dkulp
Date: Mon Feb 14 17:15:05 2011
New Revision: 1070579

URL: http://svn.apache.org/viewvc?rev=1070579&view=rev
Log:
[CXF-3308] Change to using long instead of BigInteger for WS-RM
sequences to make the code easier to maintain and use.
Patch from Dennis Sosnoski applied

Modified:
    cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractSequence.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/PolicyUtils.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-policy.xjb
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm.xjb
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/policy/PolicyUtilsTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DeliveryAssuranceOnewayTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java

Modified: cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java (original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java Mon Feb 14 17:15:05 2011
@@ -21,7 +21,6 @@ package demo.ws_rm.common;
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.math.BigInteger;
 import java.util.ListIterator;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -107,7 +106,7 @@ public class MessageLossSimulator extend
         @Override
         protected void onFirstWrite() throws IOException {
             if (LOG.isLoggable(Level.FINE)) {
-                BigInteger nr = RMContextUtils.retrieveRMProperties(outMessage, true)
+                Long nr = RMContextUtils.retrieveRMProperties(outMessage, true)
                     .getSequence().getMessageNumber();
                 LOG.fine("Losing message " + nr);
             }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractSequence.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractSequence.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractSequence.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractSequence.java Mon Feb 14 17:15:05 2011
@@ -19,8 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
-
 import org.apache.cxf.ws.rm.SequenceAcknowledgement.AcknowledgementRange;
 
 
@@ -67,9 +65,9 @@ public abstract class AbstractSequence {
         }
     }
     
-    public synchronized boolean isAcknowledged(BigInteger m) {
+    public synchronized boolean isAcknowledged(long m) {
         for (AcknowledgementRange r : acknowledgement.getAcknowledgementRange()) {
-            if (m.subtract(r.getLower()).signum() >= 0 && r.getUpper().subtract(m).signum() >= 0) {
+            if (m >= r.getLower().longValue() && r.getUpper().longValue() >= m) {
                 return true;
             }
         }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/DestinationSequence.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedList;
@@ -49,23 +48,23 @@ public class DestinationSequence extends
 
     private Destination destination;
     private EndpointReferenceType acksTo;
-    private BigInteger lastMessageNumber;
+    private long lastMessageNumber;
     private SequenceMonitor monitor;
     private boolean acknowledgeOnNextOccasion;
     private List<DeferredAcknowledgment> deferredAcknowledgments;
     private SequenceTermination scheduledTermination;
     private String correlationID;
-    private BigInteger inProcessNumber;
-    private BigInteger highNumberCompleted = BigInteger.ZERO;
+    private long inProcessNumber;
+    private long highNumberCompleted;
     private List<Continuation> continuations = new LinkedList<Continuation>();
     
     public DestinationSequence(Identifier i, EndpointReferenceType a, Destination d) {
-        this(i, a, null, null);
+        this(i, a, 0, null);
         destination = d;
     }
     
     public DestinationSequence(Identifier i, EndpointReferenceType a,
-                              BigInteger lmn, SequenceAcknowledgement ac) {
+                              long lmn, SequenceAcknowledgement ac) {
         super(i);
         acksTo = a;
         lastMessageNumber = lmn;
@@ -85,9 +84,9 @@ public class DestinationSequence extends
     }
     
     /**
-     * @return the message number of the last message or null if the last message had not been received.
+     * @return the message number of the last message or 0 if the last message had not been received.
      */
-    public BigInteger getLastMessageNumber() {
+    public long getLastMessageNumber() {
         return lastMessageNumber;
     }
     
@@ -107,9 +106,9 @@ public class DestinationSequence extends
     
     public void acknowledge(Message message) throws SequenceFault {
         SequenceType st = RMContextUtils.retrieveRMProperties(message, false).getSequence();
-        BigInteger messageNumber = st.getMessageNumber();
+        long messageNumber = st.getMessageNumber().longValue();
         LOG.fine("Acknowledging message: " + messageNumber);
-        if (null != lastMessageNumber && messageNumber.compareTo(lastMessageNumber) > 0) {
+        if (0 != lastMessageNumber && messageNumber > lastMessageNumber) {
             throw new SequenceFaultFactory().createLastMessageNumberExceededFault(st.getIdentifier());
         }        
         
@@ -125,14 +124,13 @@ public class DestinationSequence extends
                     done = true;
                     break;
                 } else {
-                    BigInteger diff = r.getLower().subtract(messageNumber);
-                    if (diff.signum() == 1) {
-                        if (diff.equals(BigInteger.ONE)) {
-                            r.setLower(messageNumber);
-                            done = true;
-                        }
+                    long diff = r.getLower() - messageNumber;
+                    if (diff == 1) {
+                        r.setLower(messageNumber);
+                        done = true;
+                    } else if (diff > 0) {
                         break;
-                    } else if (messageNumber.subtract(r.getUpper()).equals(BigInteger.ONE)) {
+                    } else if (messageNumber - r.getUpper().longValue() == 1) {
                         r.setUpper(messageNumber);
                         done = true;
                         break;
@@ -157,7 +155,7 @@ public class DestinationSequence extends
         long acknowledgementInterval = 0;
         AcknowledgementInterval ai = rma.getAcknowledgementInterval();
         if (null != ai) {
-            BigInteger val = ai.getMilliseconds(); 
+            Long val = ai.getMilliseconds(); 
             if (null != val) {
                 acknowledgementInterval = val.longValue();
             }
@@ -168,7 +166,7 @@ public class DestinationSequence extends
         long inactivityTimeout = 0;
         InactivityTimeout iat = rma.getInactivityTimeout();
         if (null != iat) {
-            BigInteger val = iat.getMilliseconds(); 
+            Long val = iat.getMilliseconds(); 
             if (null != val) {
                 inactivityTimeout = val.longValue();
             }
@@ -182,7 +180,7 @@ public class DestinationSequence extends
         for (int i = ranges.size() - 1; i > 0; i--) {
             AcknowledgementRange current = ranges.get(i);
             AcknowledgementRange previous = ranges.get(i - 1);
-            if (current.getLower().subtract(previous.getUpper()).equals(BigInteger.ONE)) {
+            if (current.getLower().longValue() - previous.getUpper().longValue() == 1) {
                 previous.setUpper(current.getUpper());
                 ranges.remove(i);
             }
@@ -206,7 +204,7 @@ public class DestinationSequence extends
         return monitor;
     }
     
-    void setLastMessageNumber(BigInteger lmn) {
+    void setLastMessageNumber(long lmn) {
         lastMessageNumber = lmn;
     }
       
@@ -227,7 +225,7 @@ public class DestinationSequence extends
      * @return <code>true</code> if message processing to continue, <code>false</code> if to be dropped
      * @throws Fault if message had already been acknowledged
      */
-    boolean applyDeliveryAssurance(BigInteger mn, Message message) throws RMException {
+    boolean applyDeliveryAssurance(long mn, Message message) throws RMException {
         Continuation cont = getContinuation(message);
         DeliveryAssuranceType da = destination.getManager().getDeliveryAssurance();
         if (cont != null && da.isSetInOrder() && !cont.isNew()) {
@@ -254,22 +252,21 @@ public class DestinationSequence extends
         return message.get(Continuation.class);
     }
     
-    synchronized boolean waitInQueue(BigInteger mn, boolean canSkip,
+    synchronized boolean waitInQueue(long mn, boolean canSkip,
                                      Message message, Continuation continuation) {
         while (true) {
             
             // can process now if no other in process and this one is next
-            if (inProcessNumber == null) {
-                BigInteger diff = mn.subtract(highNumberCompleted);
-                if (BigInteger.ONE.equals(diff) || (canSkip && diff.signum() > 0)) {
+            if (inProcessNumber == 0) {
+                long diff = mn - highNumberCompleted;
+                if (diff == 1 || canSkip && diff > 0) {
                     inProcessNumber = mn;
                     return true;
                 }
             }
             
             // can abort now if same message in process or already processed
-            BigInteger compare = inProcessNumber == null ? highNumberCompleted : inProcessNumber;
-            if (compare.compareTo(mn) >= 0) {
+            if (mn == inProcessNumber || isAcknowledged(mn)) {
                 return false;
             }
             if (continuation == null) {
@@ -307,18 +304,18 @@ public class DestinationSequence extends
         notifyAll();
     }
     
-    synchronized void processingComplete(BigInteger mn) {
-        inProcessNumber = null;
+    synchronized void processingComplete(long mn) {
+        inProcessNumber = 0;
         highNumberCompleted = mn;
         wakeupAll();
     }
     
-    void purgeAcknowledged(BigInteger messageNr) {
+    void purgeAcknowledged(long messageNr) {
         RMStore store = destination.getManager().getStore();
         if (null == store) {
             return;
         }
-        Collection<BigInteger> messageNrs = new ArrayList<BigInteger>();
+        Collection<Long> messageNrs = new ArrayList<Long>();
         messageNrs.add(messageNr);
         store.removeMessages(getIdentifier(), messageNrs, false);
     }
@@ -357,7 +354,7 @@ public class DestinationSequence extends
             LOG.fine("Schedule immediate acknowledgment");
             scheduleImmediateAcknowledgement();
             destination.getManager().getTimer().schedule(
-                new ImmediateFallbackAcknowledgment(), ap.getImmediaAcksTimeout().longValue());
+                new ImmediateFallbackAcknowledgment(), ap.getImmediaAcksTimeout());
            
         }
     }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -223,7 +222,7 @@ public class RMManager implements Server
             rma.setBaseRetransmissionInterval(bri);
         }
         if (null == bri.getMilliseconds()) {
-            bri.setMilliseconds(new BigInteger(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL));
+            bri.setMilliseconds(new Long(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL));
         }
 
         rmAssertion = rma;
@@ -443,7 +442,7 @@ public class RMManager implements Server
                 SequenceType st = RMUtils.getWSRMFactory().createSequenceType();
                 st.setIdentifier(ss.getIdentifier());
                 st.setMessageNumber(m.getMessageNumber());
-                if (ss.isLastMessage() && ss.getCurrentMessageNr().equals(m.getMessageNumber())) {
+                if (ss.isLastMessage() && ss.getCurrentMessageNr() == m.getMessageNumber()) {
                     st.setLastMessage(RMUtils.getWSRMFactory().createSequenceTypeLastMessage());
                 }
                 RMProperties rmps = new RMProperties();

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.Collection;
 import java.util.Map;
 import java.util.logging.Level;
@@ -103,7 +102,7 @@ public class RMOutInterceptor extends Ab
         
         RMProperties rmpsIn = null;
         Identifier inSeqId = null;
-        BigInteger inMessageNumber = null;
+        long inMessageNumber = 0;
         
         if (isApplicationMessage) {
             rmpsIn = (RMProperties)RMContextUtils.retrieveRMProperties(message, false);

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.Date;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -38,7 +37,7 @@ public class SourceSequence extends Abst
 
     private Date expires;
     private Source source;
-    private BigInteger currentMessageNumber;
+    private long currentMessageNumber;
     private boolean lastMessage;
     private Identifier offeringId;
     private org.apache.cxf.ws.addressing.EndpointReferenceType target;
@@ -48,10 +47,10 @@ public class SourceSequence extends Abst
     }
 
     public SourceSequence(Identifier i, Date e, Identifier oi) {
-        this(i, e, oi, BigInteger.ZERO, false);
+        this(i, e, oi, 0, false);
     }
 
-    public SourceSequence(Identifier i, Date e, Identifier oi, BigInteger cmn, boolean lm) {
+    public SourceSequence(Identifier i, Date e, Identifier oi, long cmn, boolean lm) {
         super(i);
         expires = e;
 
@@ -67,7 +66,7 @@ public class SourceSequence extends Abst
      * @return the message number assigned to the most recent outgoing
      *         application message.
      */
-    public BigInteger getCurrentMessageNr() {
+    public long getCurrentMessageNr() {
         return currentMessageNumber;
     }
 
@@ -125,7 +124,7 @@ public class SourceSequence extends Abst
 
         if (acknowledgement.getAcknowledgementRange().size() == 1) {
             AcknowledgementRange r = acknowledgement.getAcknowledgementRange().get(0);
-            return r.getLower().equals(BigInteger.ONE) && r.getUpper().equals(currentMessageNumber);
+            return r.getLower().longValue() == 1 && r.getUpper().longValue() == currentMessageNumber;
         }
         return false;
     }
@@ -193,8 +192,8 @@ public class SourceSequence extends Abst
      * 
      * @return the next message number.
      */
-    BigInteger nextMessageNumber() {
-        return nextMessageNumber(null, null, false);
+    long nextMessageNumber() {
+        return nextMessageNumber(null, 0, false);
     }
 
     /**
@@ -206,12 +205,12 @@ public class SourceSequence extends Abst
      * 
      * @return the next message number.
      */
-    public BigInteger nextMessageNumber(Identifier inSeqId, BigInteger inMsgNumber, boolean last) {
+    public long nextMessageNumber(Identifier inSeqId, long inMsgNumber, boolean last) {
         assert !lastMessage;
 
-        BigInteger result = null;
+        long result = 0;
         synchronized (this) {
-            currentMessageNumber = currentMessageNumber.add(BigInteger.ONE);
+            currentMessageNumber++;
             if (last) {
                 lastMessage = true;
             } else { 
@@ -250,20 +249,20 @@ public class SourceSequence extends Abst
      * Checks if the current message should be the last message in this sequence
      * and if so sets the lastMessageNumber property.
      */
-    private void checkLastMessage(Identifier inSeqId, BigInteger inMsgNumber) {
+    private void checkLastMessage(Identifier inSeqId, long inMsgNumber) {
 
         // check if this is a response to a message that was is the last message
         // in the sequence
         // that included this sequence as an offer
 
-        if (null != inSeqId && null != inMsgNumber) {
+        if (null != inSeqId && 0 != inMsgNumber) {
             Destination destination = source.getReliableEndpoint().getDestination();
             DestinationSequence inSeq = null;
             if (null != destination) {
                 inSeq = destination.getSequence(inSeqId);
             }
 
-            if (null != inSeq && offeredBy(inSeqId) && inMsgNumber.equals(inSeq.getLastMessageNumber())) {
+            if (null != inSeq && offeredBy(inSeqId) && inMsgNumber == inSeq.getLastMessageNumber()) {
                 lastMessage = true;
             }
         }
@@ -274,8 +273,7 @@ public class SourceSequence extends Abst
 
             assert null != stp;
 
-            if ((!stp.getMaxLength().equals(BigInteger.ZERO) && stp.getMaxLength()
-                .compareTo(currentMessageNumber) <= 0)
+            if ((stp.getMaxLength() != 0 && stp.getMaxLength() <= currentMessageNumber)
                 || (stp.getMaxRanges() > 0 && acknowledgement.getAcknowledgementRange().size() >= stp
                     .getMaxRanges())
                 || (stp.getMaxUnacknowledged() > 0 && source.getManager().getRetransmissionQueue()

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMMessage.java Mon Feb 14 17:15:05 2011
@@ -18,20 +18,17 @@
  */
 package org.apache.cxf.ws.rm.persistence;
 
-import java.math.BigInteger;
-
-
 public class RMMessage {
     
     private byte[] content;
-    private BigInteger messageNumber;
+    private long messageNumber;
     private String to;
     
     /**
      * Returns the message number of the message within its sequence.
      * @return the message number
      */
-    public BigInteger getMessageNumber() {
+    public long getMessageNumber() {
         return  messageNumber;
     }
     
@@ -39,7 +36,7 @@ public class RMMessage {
      * Sets the message number of the message within its sequence.
      * @param messageNumber the message number
      */
-    public void setMessageNumber(BigInteger mn) {
+    public void setMessageNumber(long mn) {
         messageNumber = mn;
     }
     

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/RMStore.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm.persistence;
 
-import java.math.BigInteger;
 import java.util.Collection;
 
 import org.apache.cxf.ws.rm.DestinationSequence;
@@ -109,5 +108,5 @@ public interface RMStore {
      * @param messageNrs the collection of message numbers
      * @param outbound true if the message is outbound
      */
-    void removeMessages(Identifier sid, Collection<BigInteger> messageNrs, boolean outbound);
+    void removeMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound);
 }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java Mon Feb 14 17:15:05 2011
@@ -25,7 +25,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.sql.Blob;
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -67,23 +66,23 @@ public class RMTxStore implements RMStor
         "CREATE TABLE CXF_RM_DEST_SEQUENCES " 
         + "(SEQ_ID VARCHAR(256) NOT NULL, "
         + "ACKS_TO VARCHAR(1024) NOT NULL, "
-        + "LAST_MSG_NO DECIMAL(31, 0), "
+        + "LAST_MSG_NO BIGINT, "
         + "ENDPOINT_ID VARCHAR(1024), "
         + "ACKNOWLEDGED BLOB, "
         + "PRIMARY KEY (SEQ_ID))";
     private static final String CREATE_SRC_SEQUENCES_TABLE_STMT =
         "CREATE TABLE CXF_RM_SRC_SEQUENCES " 
         + "(SEQ_ID VARCHAR(256) NOT NULL, "
-        + "CUR_MSG_NO DECIMAL(31, 0) DEFAULT 1 NOT NULL, "
+        + "CUR_MSG_NO BIGINT DEFAULT 1 NOT NULL, "
         + "LAST_MSG CHAR(1), "
-        + "EXPIRY DECIMAL(31, 0), "
+        + "EXPIRY BIGINT, "
         + "OFFERING_SEQ_ID VARCHAR(256), "
         + "ENDPOINT_ID VARCHAR(1024), "            
         + "PRIMARY KEY (SEQ_ID))";
     private static final String CREATE_MESSAGES_TABLE_STMT =
         "CREATE TABLE {0} " 
         + "(SEQ_ID VARCHAR(256) NOT NULL, "
-        + "MSG_NO DECIMAL(31, 0) NOT NULL, "
+        + "MSG_NO BIGINT NOT NULL, "
         + "SEND_TO VARCHAR(256), "
         + "CONTENT BLOB, "
         + "PRIMARY KEY (SEQ_ID, MSG_NO))";
@@ -297,15 +296,14 @@ public class RMTxStore implements RMStor
                 Identifier sid = RMUtils.getWSRMFactory().createIdentifier();                
                 sid.setValue(res.getString(1));
                 EndpointReferenceType acksTo = RMUtils.createReference2004(res.getString(2));  
-                BigDecimal lm = res.getBigDecimal(3);
+                long lm = res.getLong(3);
                 InputStream is = res.getBinaryStream(4); 
                 SequenceAcknowledgement ack = null;
                 if (null != is) {
                     ack = PersistenceUtils.getInstance()
                         .deserialiseAcknowledgment(is); 
                 }
-                DestinationSequence seq = new DestinationSequence(sid, acksTo, 
-                                                                  lm == null ? null : lm.toBigInteger(), ack);
+                DestinationSequence seq = new DestinationSequence(sid, acksTo, lm, ack);
                 seqs.add(seq);                                                 
             }
         } catch (SQLException ex) {
@@ -330,7 +328,7 @@ public class RMTxStore implements RMStor
             while (res.next()) {
                 Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
                 sid.setValue(res.getString(1));
-                BigInteger cmn = res.getBigDecimal(2).toBigInteger();
+                long cmn = res.getLong(2);
                 boolean lm = res.getBoolean(3);
                 long lval = res.getLong(4);
                 Date expiry = 0 == lval ? null : new Date(lval);
@@ -366,7 +364,7 @@ public class RMTxStore implements RMStor
             stmt.setString(1, sid.getValue());
             ResultSet res = stmt.executeQuery();
             while (res.next()) {
-                BigInteger mn = res.getBigDecimal(1).toBigInteger();
+                long mn = res.getLong(1);
                 String to = res.getString(2);
                 Blob blob = res.getBlob(3);
                 byte[] bytes = blob.getBytes(1, (int)blob.length());     
@@ -420,7 +418,7 @@ public class RMTxStore implements RMStor
         }        
     }
 
-    public void removeMessages(Identifier sid, Collection<BigInteger> messageNrs, boolean outbound) {
+    public void removeMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound) {
         try {
             beginTransaction();
             PreparedStatement stmt = outbound ? deleteOutboundMessageStmt : deleteInboundMessageStmt;
@@ -436,8 +434,8 @@ public class RMTxStore implements RMStor
 
             stmt.setString(1, sid.getValue());
                         
-            for (BigInteger messageNr : messageNrs) {
-                stmt.setBigDecimal(2, new BigDecimal(messageNr));
+            for (Long messageNr : messageNrs) {
+                stmt.setLong(2, messageNr);
                 stmt.execute();
             }
             
@@ -480,7 +478,7 @@ public class RMTxStore implements RMStor
     protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound)         
         throws IOException, SQLException {
         String id = sid.getValue();
-        BigInteger nr = msg.getMessageNumber();
+        long nr = msg.getMessageNumber();
         String to = msg.getTo();
         LOG.log(Level.FINE, "Storing {0} message number {1} for sequence {2}, to = {3}",
             new Object[] {outbound ? "outbound" : "inbound", nr, id, to});
@@ -526,9 +524,8 @@ public class RMTxStore implements RMStor
         if (null == updateDestSequenceStmt) {
             updateDestSequenceStmt = connection.prepareStatement(UPDATE_DEST_SEQUENCE_STMT_STR);
         }
-        BigInteger lastMessageNr = seq.getLastMessageNumber();
-        updateDestSequenceStmt.setBigDecimal(1, lastMessageNr == null ? null
-            : new BigDecimal(lastMessageNr)); 
+        long lastMessageNr = seq.getLastMessageNumber();
+        updateDestSequenceStmt.setLong(1, lastMessageNr); 
         InputStream is = PersistenceUtils.getInstance()
             .serialiseAcknowledgment(seq.getAcknowledgment());
         updateDestSequenceStmt.setBinaryStream(2, is, is.available()); 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/PolicyUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/PolicyUtils.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/PolicyUtils.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/PolicyUtils.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm.policy;
 
-import java.math.BigInteger;
 import java.util.Collection;
 
 import org.apache.cxf.message.Message;
@@ -77,11 +76,11 @@ public final class PolicyUtils {
         
         // use maximum of inactivity timeout
         
-        BigInteger aval = null;
+        Long aval = null;
         if (null != a.getInactivityTimeout()) {
             aval = a.getInactivityTimeout().getMilliseconds();
         }
-        BigInteger bval = null;
+        Long bval = null;
         if (null != b.getInactivityTimeout()) {
             bval = b.getInactivityTimeout().getMilliseconds();            
         }
@@ -147,11 +146,11 @@ public final class PolicyUtils {
             return true;
         }
         
-        BigInteger aval = null;
+        Long aval = null;
         if (null != a.getInactivityTimeout()) {
             aval = a.getInactivityTimeout().getMilliseconds();
         }
-        BigInteger bval = null;
+        Long bval = null;
         if (null != b.getInactivityTimeout()) {
             bval = b.getInactivityTimeout().getMilliseconds();            
         }
@@ -188,7 +187,7 @@ public final class PolicyUtils {
             : null != b.getExponentialBackoff();         
     }
         
-    private static boolean equals(BigInteger aval, BigInteger bval) {
+    private static boolean equals(Long aval, Long bval) {
         if (null != aval) {
             if (null != bval) {
                 if (!aval.equals(bval)) {

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java Mon Feb 14 17:15:05 2011
@@ -22,7 +22,6 @@ package org.apache.cxf.ws.rm.soap;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.math.BigInteger;
 import java.net.ConnectException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -116,7 +115,7 @@ public class RetransmissionQueueImpl imp
      * @param seq the sequence object.
      */
     public void purgeAcknowledged(SourceSequence seq) {
-        Collection<BigInteger> purged = new ArrayList<BigInteger>();
+        Collection<Long> purged = new ArrayList<Long>();
         synchronized (this) {
             LOG.fine("Start purging resend candidates.");
             List<ResendCandidate> sequenceCandidates = getSequenceCandidates(seq);
@@ -126,7 +125,7 @@ public class RetransmissionQueueImpl imp
                     RMProperties properties = RMContextUtils.retrieveRMProperties(candidate.getMessage(),
                                                                                   true);
                     SequenceType st = properties.getSequence();
-                    BigInteger m = st.getMessageNumber();
+                    long m = st.getMessageNumber().longValue();
                     if (seq.isAcknowledged(m)) {
                         sequenceCandidates.remove(i);
                         candidate.resolved();

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd Mon Feb 14 17:15:05 2011
@@ -113,7 +113,7 @@
     </xs:complexType>
 
     <xs:complexType name="SequenceTerminationPolicyType">    
-        <xs:attribute name="maxLength" type="xs:unsignedLong" use="optional" default="0">
+        <xs:attribute name="maxLength" type="xs:long" use="optional" default="0">
             <xs:annotation>
                 <xs:documentation>
                     The maximum length of a sequence. 
@@ -168,7 +168,7 @@
                 </xs:documentation>
             </xs:annotation>      
         </xs:attribute> 
-        <xs:attribute name="ImmediaAcksTimeout" type="xs:unsignedLong" use="optional" default="1000">
+        <xs:attribute name="ImmediaAcksTimeout" type="xs:long" use="optional" default="1000">
         <xs:annotation>
                 <xs:documentation>
                     Timeout in millisecond. If timeout for a immediateAcks, then consider there's no 

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-policy.xjb
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-policy.xjb?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-policy.xjb (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-policy.xjb Mon Feb 14 17:15:05 2011
@@ -26,6 +26,8 @@
         <jaxb:schemaBindings>
             <jaxb:package name="org.apache.cxf.ws.rm.policy"/>
         </jaxb:schemaBindings>
-        <jaxb:globalBindings generateIsSetMethod="true"/>
+        <jaxb:globalBindings generateIsSetMethod="true">
+          <jaxb:javaType name="java.lang.Long" xmlType="xs:unsignedLong"/>
+        </jaxb:globalBindings>
     </jaxb:bindings>
 </jaxb:bindings>

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm.xjb
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm.xjb?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm.xjb (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm.xjb Mon Feb 14 17:15:05 2011
@@ -31,5 +31,8 @@
         <jaxb:schemaBindings>
             <jaxb:package name="org.apache.cxf.ws.rm"/>
         </jaxb:schemaBindings>
+        <jaxb:globalBindings generateIsSetMethod="true">
+            <jaxb:javaType name="java.lang.Long" xmlType="xs:unsignedLong"/>
+        </jaxb:globalBindings>
     </jaxb:bindings>
 </jaxb:bindings>

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationSequenceTest.java Mon Feb 14 17:15:05 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -86,15 +85,15 @@ public class DestinationSequenceTest ext
         
         DestinationSequence seq = new DestinationSequence(id, ref, destination);
         assertEquals(id, seq.getIdentifier());
-        assertNull(seq.getLastMessageNumber());
+        assertEquals(0, seq.getLastMessageNumber());
         assertSame(ref, seq.getAcksTo());
         assertNotNull(seq.getAcknowledgment());
         assertNotNull(seq.getMonitor());   
         
         SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();        
-        seq = new DestinationSequence(id, ref, BigInteger.TEN, ack);
+        seq = new DestinationSequence(id, ref, 10, ack);
         assertEquals(id, seq.getIdentifier());
-        assertEquals(BigInteger.TEN, seq.getLastMessageNumber());
+        assertEquals(10, seq.getLastMessageNumber());
         assertSame(ref, seq.getAcksTo());
         assertSame(ack, seq.getAcknowledgment());
         assertNotNull(seq.getMonitor());  
@@ -176,7 +175,7 @@ public class DestinationSequenceTest ext
         DestinationSequence seq = new DestinationSequence(id, ref, destination);
         
         seq.acknowledge(message1);
-        seq.setLastMessageNumber(BigInteger.ONE);
+        seq.setLastMessageNumber(1);
         try {
             seq.acknowledge(message2);
             fail("Expected SequenceFault not thrown.");
@@ -289,20 +288,20 @@ public class DestinationSequenceTest ext
         AcknowledgementRange r;
         for (int i = 0; i < 5; i++) {
             r = new AcknowledgementRange();
-            r.setLower(new BigInteger(Integer.toString(3 * i + 1)));
-            r.setUpper(new BigInteger(Integer.toString(3 * i + 3)));
+            r.setLower(new Long(3 * i + 1));
+            r.setUpper(new Long(3 * i + 3));
             ranges.add(r);
         }
         seq.mergeRanges();
         assertEquals(1, ranges.size());
         r = ranges.get(0);
-        assertEquals(BigInteger.ONE, r.getLower());
-        assertEquals(new BigInteger("15"), r.getUpper());
+        assertEquals(new Long(1), r.getLower());
+        assertEquals(new Long(15), r.getUpper());
         ranges.clear();
         for (int i = 0; i < 5; i++) {
             r = new AcknowledgementRange();
-            r.setLower(new BigInteger(Integer.toString(3 * i + 1)));
-            r.setUpper(new BigInteger(Integer.toString(3 * i + 2)));
+            r.setLower(new Long(3 * i + 1));
+            r.setUpper(new Long(3 * i + 2));
             ranges.add(r);
         }
         seq.mergeRanges();
@@ -311,19 +310,19 @@ public class DestinationSequenceTest ext
         for (int i = 0; i < 5; i++) {
             if (i != 2) {
                 r = new AcknowledgementRange();
-                r.setLower(new BigInteger(Integer.toString(3 * i + 1)));
-                r.setUpper(new BigInteger(Integer.toString(3 * i + 3)));
+                r.setLower(new Long(3 * i + 1));
+                r.setUpper(new Long(3 * i + 3));
                 ranges.add(r);
             }
         }
         seq.mergeRanges();
         assertEquals(2, ranges.size());
         r = ranges.get(0);
-        assertEquals(BigInteger.ONE, r.getLower());
-        assertEquals(new BigInteger("6"), r.getUpper());
+        assertEquals(new Long(1), r.getLower());
+        assertEquals(new Long(6), r.getUpper());
         r = ranges.get(1);
-        assertEquals(BigInteger.TEN, r.getLower());
-        assertEquals(new BigInteger("15"), r.getUpper());        
+        assertEquals(new Long(10), r.getLower());
+        assertEquals(new Long(15), r.getUpper());        
     }
     
     @Test
@@ -411,7 +410,7 @@ public class DestinationSequenceTest ext
         ap.setIntraMessageThreshold(0);
         AcknowledgementInterval ai = new org.apache.cxf.ws.rm.policy.ObjectFactory()
             .createRMAssertionAcknowledgementInterval();
-        ai.setMilliseconds(new BigInteger("200"));
+        ai.setMilliseconds(new Long(200));
         rma.setAcknowledgementInterval(ai);        
 
         assertTrue(!seq.sendAcknowledgement());   
@@ -450,7 +449,7 @@ public class DestinationSequenceTest ext
     public void testApplyDeliveryAssuranceAtMostOnce() throws RMException {
         setUpDestination();
         
-        BigInteger mn = BigInteger.TEN;        
+        long mn = 10;        
         SequenceAcknowledgement ack = control.createMock(SequenceAcknowledgement.class);
         List<AcknowledgementRange> ranges = new ArrayList<AcknowledgementRange>();
         AcknowledgementRange r = control.createMock(AcknowledgementRange.class);
@@ -460,7 +459,7 @@ public class DestinationSequenceTest ext
         EasyMock.expect(da.isSetAtMostOnce()).andReturn(true);                    
         
         control.replay();        
-        DestinationSequence ds = new DestinationSequence(id, ref, null, ack);
+        DestinationSequence ds = new DestinationSequence(id, ref, 0, ack);
         ds.setDestination(destination);
         ds.applyDeliveryAssurance(mn, null);
         control.verify();
@@ -471,8 +470,8 @@ public class DestinationSequenceTest ext
         EasyMock.expect(manager.getDeliveryAssurance()).andReturn(da);
         EasyMock.expect(da.isSetAtMostOnce()).andReturn(true);            
         EasyMock.expect(ack.getAcknowledgementRange()).andReturn(ranges);
-        EasyMock.expect(r.getLower()).andReturn(new BigInteger("5"));
-        EasyMock.expect(r.getUpper()).andReturn(new BigInteger("15"));
+        EasyMock.expect(r.getLower()).andReturn(new Long(5));
+        EasyMock.expect(r.getUpper()).andReturn(new Long(15));
         control.replay();     
         try {
             ds.applyDeliveryAssurance(mn, null);
@@ -504,16 +503,16 @@ public class DestinationSequenceTest ext
         
         final AcknowledgementRange r = 
             factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setUpper(new BigInteger(Integer.toString(messages.length)));
+        r.setUpper(new Long(messages.length));
         ranges.add(r);
-        final DestinationSequence ds = new DestinationSequence(id, ref, null, ack);
+        final DestinationSequence ds = new DestinationSequence(id, ref, 0, ack);
         ds.setDestination(destination);
           
         class Acknowledger extends Thread {
             Message message;
-            BigInteger messageNr;
+            long messageNr;
             
-            Acknowledger(Message m, BigInteger mn) {
+            Acknowledger(Message m, long mn) {
                 message = m;
                 messageNr = mn;
             }
@@ -532,7 +531,7 @@ public class DestinationSequenceTest ext
         
         Thread[] threads = new Thread[messages.length];
         for (int i = messages.length - 1; i >= 0; i--) {
-            threads[i] = new Acknowledger(messages[i], new BigInteger(Integer.toString(i + 1)));
+            threads[i] = new Acknowledger(messages[i], i + 1);
             threads[i].start();
             try {
                 Thread.sleep(100);
@@ -572,7 +571,7 @@ public class DestinationSequenceTest ext
 
         control.replay();
         InactivityTimeout iat = new RMAssertion.InactivityTimeout();
-        iat.setMilliseconds(new BigInteger("200"));
+        iat.setMilliseconds(new Long(200));
         rma.setInactivityTimeout(iat); 
         
         seq.acknowledge(message);
@@ -652,10 +651,10 @@ public class DestinationSequenceTest ext
         RMStore store = control.createMock(RMStore.class);
         EasyMock.expect(manager.getStore()).andReturn(store);
         store.removeMessages(EasyMock.eq(id), 
-            CastUtils.cast(EasyMock.isA(Collection.class), BigInteger.class), EasyMock.eq(false));
+            CastUtils.cast(EasyMock.isA(Collection.class), Long.class), EasyMock.eq(false));
         EasyMock.expectLastCall();
         control.replay();
-        seq.purgeAcknowledged(BigInteger.ONE);
+        seq.purgeAcknowledged(1);
         control.verify();
     }
     
@@ -709,7 +708,7 @@ public class DestinationSequenceTest ext
         rma = policyFactory.createRMAssertion();
         BaseRetransmissionInterval bri =
             policyFactory.createRMAssertionBaseRetransmissionInterval();
-        bri.setMilliseconds(new BigInteger("3000"));
+        bri.setMilliseconds(new Long(3000));
         rma.setBaseRetransmissionInterval(bri);  
 
         EasyMock.expect(manager.getRMAssertion()).andReturn(rma).anyTimes();
@@ -735,7 +734,7 @@ public class DestinationSequenceTest ext
         EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_INBOUND)).andReturn(rmps);
         SequenceType st = control.createMock(SequenceType.class);
         EasyMock.expect(rmps.getSequence()).andReturn(st);
-        BigInteger val = new BigInteger(messageNr);
+        Long val = new Long(messageNr);
         EasyMock.expect(st.getMessageNumber()).andReturn(val);
         return message;        
     }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java Mon Feb 14 17:15:05 2011
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm;
 
 import java.lang.reflect.Method;
-import java.math.BigInteger;
 
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
@@ -143,7 +142,7 @@ public class DestinationTest extends Ass
         EasyMock.expect(st.getIdentifier()).andReturn(id);
         DestinationSequence ds = control.createMock(DestinationSequence.class);
         EasyMock.expect(destination.getSequence(id)).andReturn(ds);
-        BigInteger nr = BigInteger.TEN;
+        long nr = 10;
         EasyMock.expect(st.getMessageNumber()).andReturn(nr);  
         RMException ex = new RMException(new RuntimeException("already acknowledged"));
         ds.applyDeliveryAssurance(nr, message);
@@ -172,7 +171,7 @@ public class DestinationTest extends Ass
         EasyMock.expect(rmps.getSequence()).andReturn(st);
         Identifier id = control.createMock(Identifier.class);
         EasyMock.expect(st.getIdentifier()).andReturn(id); 
-        BigInteger nr = BigInteger.TEN;
+        long nr = 10;
         EasyMock.expect(st.getMessageNumber()).andReturn(nr).times(2);
         DestinationSequence ds = control.createMock(DestinationSequence.class);
         EasyMock.expect(destination.getSequence(id)).andReturn(ds);

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerConfigurationTest.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.Collection;
 
 import org.apache.cxf.Bus;
@@ -77,8 +76,7 @@ public class RMManagerConfigurationTest 
         assertNotNull(manager);
         assertTrue(manager.getSourcePolicy().getSequenceTerminationPolicy().isTerminateOnShutdown());
         assertEquals(0L, manager.getDestinationPolicy().getAcksPolicy().getIntraMessageThreshold());
-        assertEquals(2000L, manager.getDestinationPolicy().getAcksPolicy().
-                getImmediaAcksTimeout().longValue());
+        assertEquals(2000L, manager.getDestinationPolicy().getAcksPolicy().getImmediaAcksTimeout());
         assertEquals(10000L, manager.getRMAssertion().getBaseRetransmissionInterval()
                      .getMilliseconds().longValue());
         assertEquals(10000L, manager.getRMAssertion().getAcknowledgementInterval()
@@ -146,7 +144,7 @@ public class RMManagerConfigurationTest 
             
         }
 
-        public void removeMessages(Identifier sid, Collection<BigInteger> messageNrs, boolean outbound) {
+        public void removeMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound) {
             // TODO Auto-generated method stub
             
         }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java Mon Feb 14 17:15:05 2011
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm;
 
 import java.lang.reflect.Method;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
@@ -125,7 +124,7 @@ public class RMManagerTest extends Asser
         assertEquals(0, stp.getMaxRanges());
         assertEquals(0, stp.getMaxUnacknowledged());
         assertTrue(!stp.isTerminateOnShutdown());
-        assertEquals(BigInteger.ZERO, stp.getMaxLength());   
+        assertEquals(0, stp.getMaxLength());   
     } 
     
     @Test
@@ -579,11 +578,11 @@ public class RMManagerTest extends Asser
         EasyMock.expect(endpoint.getBinding()).andReturn(binding).anyTimes();
        
         EasyMock.expect(ss.isLastMessage()).andReturn(true).anyTimes();
-        EasyMock.expect(ss.getCurrentMessageNr()).andReturn(BigInteger.TEN).anyTimes();
+        EasyMock.expect(ss.getCurrentMessageNr()).andReturn(new Long(10)).anyTimes();
         if (null == m) {
             return;
         }
-        EasyMock.expect(m.getMessageNumber()).andReturn(BigInteger.TEN).times(2);
+        EasyMock.expect(m.getMessageNumber()).andReturn(new Long(10)).times(2);
         if (null == conduit) {
             EasyMock.expect(m.getTo()).andReturn("toAddress");
         }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java Mon Feb 14 17:15:05 2011
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm;
 
 import java.lang.reflect.Method;
-import java.math.BigInteger;
 import java.util.Iterator;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -139,20 +138,20 @@ public class RMOutInterceptorTest extend
         EasyMock.expect(manager.getSequence((Identifier)EasyMock.isNull(), EasyMock.same(message), 
                                         EasyMock.same(maps))).andReturn(sseq);
         EasyMock.expect(sseq.nextMessageNumber((Identifier)EasyMock.isNull(), 
-            (BigInteger)EasyMock.isNull(), EasyMock.eq(false))).andReturn(BigInteger.TEN);
+            (Long)EasyMock.eq(0L), EasyMock.eq(false))).andReturn(new Long(10));
         EasyMock.expect(sseq.isLastMessage()).andReturn(false).times(2);
         interceptor.addAcknowledgements(EasyMock.same(destination), EasyMock.same(rmpsOut), 
             (Identifier)EasyMock.isNull(), EasyMock.isA(AttributedURI.class));
         EasyMock.expectLastCall();
         Identifier sid = control.createMock(Identifier.class);
         EasyMock.expect(sseq.getIdentifier()).andReturn(sid);
-        EasyMock.expect(sseq.getCurrentMessageNr()).andReturn(BigInteger.TEN);
+        EasyMock.expect(sseq.getCurrentMessageNr()).andReturn(new Long(10));
 
         
         control.replay();
         interceptor.handle(message);
         assertSame(sid, rmpsOut.getSequence().getIdentifier());        
-        assertEquals(BigInteger.TEN, rmpsOut.getSequence().getMessageNumber());
+        assertEquals(new Long(10), rmpsOut.getSequence().getMessageNumber());
         assertNull(rmpsOut.getSequence().getLastMessage());
         control.verify();
     }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/SourceSequenceTest.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm;
 
-import java.math.BigInteger;
 import java.util.Date;
 
 import javax.xml.datatype.Duration;
@@ -94,7 +93,7 @@ public class SourceSequenceTest extends 
         assertEquals(id, seq.getIdentifier());
         assertTrue(!seq.isLastMessage());
         assertTrue(!seq.isExpired());
-        assertEquals(BigInteger.ZERO, seq.getCurrentMessageNr());
+        assertEquals(0, seq.getCurrentMessageNr());
         assertNotNull(seq.getAcknowledgement());
         assertEquals(0, seq.getAcknowledgement().getAcknowledgementRange().size());
         assertTrue(!seq.allAcknowledged());
@@ -106,7 +105,7 @@ public class SourceSequenceTest extends 
         assertEquals(id, seq.getIdentifier());
         assertTrue(!seq.isLastMessage());
         assertTrue(!seq.isExpired());
-        assertEquals(BigInteger.ZERO, seq.getCurrentMessageNr());
+        assertEquals(0, seq.getCurrentMessageNr());
         assertNotNull(seq.getAcknowledgement());
         assertEquals(0, seq.getAcknowledgement().getAcknowledgementRange().size());
         assertTrue(!seq.allAcknowledged());
@@ -172,16 +171,16 @@ public class SourceSequenceTest extends 
         ack = factory.createSequenceAcknowledgement();
         SequenceAcknowledgement.AcknowledgementRange r = 
             factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setLower(new BigInteger("1"));
-        r.setUpper(new BigInteger("2"));
+        r.setLower(new Long(1));
+        r.setUpper(new Long(2));
         ack.getAcknowledgementRange().add(r);
         r = factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setLower(new BigInteger("4"));
-        r.setUpper(new BigInteger("6"));
+        r.setLower(new Long(4));
+        r.setUpper(new Long(6));
         ack.getAcknowledgementRange().add(r);
         r = factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setLower(new BigInteger("8"));
-        r.setUpper(new BigInteger("10"));
+        r.setLower(new Long(8));
+        r.setUpper(new Long(10));
         ack.getAcknowledgementRange().add(r);
         rq.purgeAcknowledged(seq);
         EasyMock.expectLastCall();
@@ -190,15 +189,15 @@ public class SourceSequenceTest extends 
         seq.setAcknowledged(ack);
         assertSame(ack, seq.getAcknowledgement());
         assertEquals(3, ack.getAcknowledgementRange().size());
-        assertTrue(!seq.isAcknowledged(new BigInteger("3")));  
-        assertTrue(seq.isAcknowledged(new BigInteger("5")));
+        assertTrue(!seq.isAcknowledged(3));  
+        assertTrue(seq.isAcknowledged(5));
         control.verify();
     } 
 
     @Test
     public void testAllAcknowledged() throws SequenceFault, RMException {
         
-        SourceSequence seq = new SourceSequence(id, null, null, new BigInteger("4"), false);        
+        SourceSequence seq = new SourceSequence(id, null, null, 4, false);        
         setUpSource();
         seq.setSource(source);
         
@@ -208,8 +207,8 @@ public class SourceSequenceTest extends 
         SequenceAcknowledgement ack = factory.createSequenceAcknowledgement();
         SequenceAcknowledgement.AcknowledgementRange r = 
             factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setLower(BigInteger.ONE);
-        r.setUpper(new BigInteger("2"));
+        r.setLower(new Long(1));
+        r.setUpper(new Long(2));
         ack.getAcknowledgementRange().add(r);
         rq.purgeAcknowledged(seq);
         EasyMock.expectLastCall();
@@ -217,7 +216,7 @@ public class SourceSequenceTest extends 
         control.replay();
         seq.setAcknowledged(ack);
         assertTrue(!seq.allAcknowledged());
-        r.setUpper(new BigInteger("4"));
+        r.setUpper(new Long(4));
         assertTrue(seq.allAcknowledged());
         control.verify();
     }
@@ -241,15 +240,15 @@ public class SourceSequenceTest extends 
         
         seq = new SourceSequence(id); 
         seq.setSource(source);
-        stp.setMaxLength(BigInteger.ONE);
+        stp.setMaxLength(1);
         assertTrue(nextMessages(seq, 10));
-        assertEquals(BigInteger.ONE, seq.getCurrentMessageNr());
+        assertEquals(1, seq.getCurrentMessageNr());
         control.verify();
         
         // termination policy max length = 5
         seq = new SourceSequence(id); 
         seq.setSource(source);
-        stp.setMaxLength(new BigInteger("5"));
+        stp.setMaxLength(5);
         assertTrue(!nextMessages(seq, 2));
         control.verify();
         
@@ -257,18 +256,18 @@ public class SourceSequenceTest extends 
         
         seq = new SourceSequence(id); 
         seq.setSource(source);
-        stp.setMaxLength(null);
+        stp.setMaxLength(0);
         stp.setMaxRanges(new Integer(3));
         acknowledge(seq, 1, 2, 4, 5, 6, 8, 9, 10);
         assertTrue(nextMessages(seq, 10));
-        assertEquals(BigInteger.ONE, seq.getCurrentMessageNr());
+        assertEquals(1, seq.getCurrentMessageNr());
         control.verify();
         
         // termination policy max range not exceeded
         
         seq = new SourceSequence(id); 
         seq.setSource(source);
-        stp.setMaxLength(null);
+        stp.setMaxLength(0);
         stp.setMaxRanges(new Integer(4));
         acknowledge(seq, 1, 2, 4, 5, 6, 8, 9, 10);
         assertTrue(!nextMessages(seq, 10));
@@ -303,14 +302,14 @@ public class SourceSequenceTest extends 
         DestinationSequence dseq = control.createMock(DestinationSequence.class); 
         Identifier did = control.createMock(Identifier.class);
         EasyMock.expect(destination.getSequence(did)).andReturn(dseq).anyTimes();
-        EasyMock.expect(dseq.getLastMessageNumber()).andReturn(BigInteger.ONE).anyTimes();
+        EasyMock.expect(dseq.getLastMessageNumber()).andReturn(new Long(1)).anyTimes();
         EasyMock.expect(did.getValue()).andReturn("dseq").anyTimes();
         
         control.replay();
         
         seq = new SourceSequence(id, null, did);  
         seq.setSource(source);        
-        seq.nextMessageNumber(did, BigInteger.ONE, false);
+        seq.nextMessageNumber(did, 1, false);
         assertTrue(seq.isLastMessage());
         
         control.verify();
@@ -320,7 +319,7 @@ public class SourceSequenceTest extends 
                                  int n) {
         int i = 0;
         while ((i < n) && !seq.isLastMessage()) {            
-            assertNotNull(seq.nextMessageNumber());
+            seq.nextMessageNumber();
             i++;
         }
         return seq.isLastMessage();
@@ -332,16 +331,14 @@ public class SourceSequenceTest extends 
         while (i < messageNumbers.length) {
             SequenceAcknowledgement.AcknowledgementRange r = 
                 factory.createSequenceAcknowledgementAcknowledgementRange();
-            Integer li = new Integer(messageNumbers[i]);
-            BigInteger l = new BigInteger(li.toString());
+            Long l = new Long(messageNumbers[i]);
             r.setLower(l);
             i++;
             
             while (i < messageNumbers.length && (messageNumbers[i] - messageNumbers[i - 1]) == 1) {
                 i++;
             }
-            Integer ui = new Integer(messageNumbers[i - 1]);
-            BigInteger u = new BigInteger(ui.toString());
+            Long u = new Long(messageNumbers[i - 1]);
             r.setUpper(u);
             ack.getAcknowledgementRange().add(r);
         }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java Mon Feb 14 17:15:05 2011
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm.persistence;
 
 import java.io.InputStream;
-import java.math.BigInteger;
 
 import org.apache.cxf.ws.rm.SequenceAcknowledgement;
 import org.apache.cxf.ws.rm.SequenceAcknowledgement.AcknowledgementRange;
@@ -36,8 +35,8 @@ public class PersistenceUtilsTest extend
     public void testSerialiseDeserialiseAcknowledgement() {
         SequenceAcknowledgement ack = new SequenceAcknowledgement();
         AcknowledgementRange range = new AcknowledgementRange();
-        range.setLower(BigInteger.ONE);
-        range.setUpper(BigInteger.TEN);
+        range.setLower(new Long(1));
+        range.setUpper(new Long(10));
         ack.getAcknowledgementRange().add(range);
         PersistenceUtils utils = PersistenceUtils.getInstance();
         InputStream is = utils.serialiseAcknowledgment(ack);

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreTest.java Mon Feb 14 17:15:05 2011
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.rm.persistence.jdbc;
 
 import java.io.IOException;
-import java.math.BigInteger;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -56,6 +55,10 @@ public class RMTxStoreTest extends Asser
     private static final String NON_ANON_ACKS_TO = 
         "http://localhost:9999/decoupled_endpoint";
     
+    private static final Long ZERO = new Long(0);
+    private static final Long ONE = new Long(1);
+    private static final Long TEN = new Long(10);
+    
     private static RMTxStore store;    
     private static SequenceAcknowledgement ack1;
     private static SequenceAcknowledgement ack2;
@@ -74,18 +77,19 @@ public class RMTxStoreTest extends Asser
         ack1 = new SequenceAcknowledgement();
         SequenceAcknowledgement.AcknowledgementRange range = 
             new SequenceAcknowledgement.AcknowledgementRange();
-        range.setLower(BigInteger.ONE);
-        range.setUpper(BigInteger.ONE);
+        
+        range.setLower(ONE);
+        range.setUpper(ONE);
         ack1.getAcknowledgementRange().add(range);
         
         ack2 = new SequenceAcknowledgement();
         range = new SequenceAcknowledgement.AcknowledgementRange();
-        range.setLower(BigInteger.ONE);
-        range.setUpper(BigInteger.ONE);
+        range.setLower(ONE);
+        range.setUpper(ONE);
         ack2.getAcknowledgementRange().add(range);
         range = new SequenceAcknowledgement.AcknowledgementRange();
-        range.setLower(new BigInteger("3"));
-        range.setUpper(BigInteger.TEN);
+        range.setLower(new Long(3));
+        range.setUpper(TEN);
         ack2.getAcknowledgementRange().add(range);
     }
     
@@ -221,7 +225,7 @@ public class RMTxStoreTest extends Asser
         RMMessage msg = control.createMock(RMMessage.class);
         Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
         sid1.setValue("sequence1");
-        EasyMock.expect(msg.getMessageNumber()).andReturn(BigInteger.ONE).times(2); 
+        EasyMock.expect(msg.getMessageNumber()).andReturn(ONE).times(2); 
         byte[] bytes = new byte[89];
         EasyMock.expect(msg.getContent()).andReturn(bytes).times(2);
         
@@ -233,7 +237,7 @@ public class RMTxStoreTest extends Asser
         control.verify();
         
         control.reset();
-        EasyMock.expect(msg.getMessageNumber()).andReturn(BigInteger.ONE); 
+        EasyMock.expect(msg.getMessageNumber()).andReturn(ONE); 
         EasyMock.expect(msg.getContent()).andReturn(bytes);
         
         control.replay();
@@ -247,7 +251,7 @@ public class RMTxStoreTest extends Asser
         control.verify();
         
         control.reset();
-        EasyMock.expect(msg.getMessageNumber()).andReturn(BigInteger.TEN).times(2); 
+        EasyMock.expect(msg.getMessageNumber()).andReturn(TEN).times(2); 
         EasyMock.expect(msg.getContent()).andReturn(bytes).times(2); 
         
         control.replay();
@@ -257,11 +261,11 @@ public class RMTxStoreTest extends Asser
         store.commit();
         control.verify();
         
-        Collection<BigInteger> messageNrs = new ArrayList<BigInteger>();
-        messageNrs.add(BigInteger.ZERO);
-        messageNrs.add(BigInteger.TEN);
-        messageNrs.add(BigInteger.ONE);
-        messageNrs.add(BigInteger.TEN);
+        Collection<Long> messageNrs = new ArrayList<Long>();
+        messageNrs.add(ZERO);
+        messageNrs.add(TEN);
+        messageNrs.add(ONE);
+        messageNrs.add(TEN);
         
         store.removeMessages(sid1, messageNrs, true);
         store.removeMessages(sid1, messageNrs, false);
@@ -296,7 +300,7 @@ public class RMTxStoreTest extends Asser
         store.abort();
         
         control.reset();
-        EasyMock.expect(seq.getLastMessageNumber()).andReturn(BigInteger.TEN);
+        EasyMock.expect(seq.getLastMessageNumber()).andReturn(TEN);
         EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);        
         EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
         
@@ -323,7 +327,7 @@ public class RMTxStoreTest extends Asser
         control.verify();        
         
         control.reset();
-        EasyMock.expect(seq.getCurrentMessageNr()).andReturn(BigInteger.ONE);
+        EasyMock.expect(seq.getCurrentMessageNr()).andReturn(ONE);
         EasyMock.expect(seq.isLastMessage()).andReturn(false);
         EasyMock.expect(seq.getIdentifier()).andReturn(sid1);   
         
@@ -333,7 +337,7 @@ public class RMTxStoreTest extends Asser
         store.abort();
         
         control.reset();
-        EasyMock.expect(seq.getCurrentMessageNr()).andReturn(BigInteger.TEN);
+        EasyMock.expect(seq.getCurrentMessageNr()).andReturn(TEN);
         EasyMock.expect(seq.isLastMessage()).andReturn(true);  
         EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
         
@@ -420,8 +424,8 @@ public class RMTxStoreTest extends Asser
         assertEquals(0, out.size());
         
         try {
-            setupMessage(sid1, BigInteger.ONE, null, true);
-            setupMessage(sid1, BigInteger.ONE, null, false);
+            setupMessage(sid1, ONE, null, true);
+            setupMessage(sid1, ONE, null, false);
 
             out = store.getMessages(sid1, true);
             assertEquals(1, out.size());
@@ -431,8 +435,8 @@ public class RMTxStoreTest extends Asser
             assertEquals(1, in.size());
             checkRecoveredMessages(in);
             
-            setupMessage(sid1, BigInteger.TEN, NON_ANON_ACKS_TO, true);
-            setupMessage(sid1, BigInteger.TEN, NON_ANON_ACKS_TO, false);
+            setupMessage(sid1, TEN, NON_ANON_ACKS_TO, true);
+            setupMessage(sid1, TEN, NON_ANON_ACKS_TO, false);
             
             out = store.getMessages(sid1, true);
             assertEquals(2, out.size());
@@ -442,9 +446,9 @@ public class RMTxStoreTest extends Asser
             assertEquals(2, in.size());
             checkRecoveredMessages(in);
         } finally {
-            Collection<BigInteger> msgNrs = new ArrayList<BigInteger>();
-            msgNrs.add(BigInteger.ONE);
-            msgNrs.add(BigInteger.TEN);
+            Collection<Long> msgNrs = new ArrayList<Long>();
+            msgNrs.add(ONE);
+            msgNrs.add(TEN);
          
             store.removeMessages(sid1, msgNrs, true);
             store.removeMessages(sid1, msgNrs, false);
@@ -459,11 +463,11 @@ public class RMTxStoreTest extends Asser
         EndpointReferenceType epr = RMUtils.createAnonymousReference2004();
         
         SequenceAcknowledgement ack = ack1;
-        BigInteger lmn = null;
+        Long lmn = ZERO;
          
         if ("sequence2".equals(s)) {
             ack = ack2;
-            lmn = BigInteger.TEN;
+            lmn = TEN;
         }
         
         EasyMock.expect(seq.getIdentifier()).andReturn(sid);
@@ -490,14 +494,14 @@ public class RMTxStoreTest extends Asser
             
         Date expiry = null;
         Identifier osid = null;
-        BigInteger cmn = BigInteger.ONE;
+        Long cmn = ONE;
         boolean lm = false;
         
         if ("sequence2".equals(s)) {
             expiry = new Date(System.currentTimeMillis() + 3600 * 1000);
             osid = RMUtils.getWSRMFactory().createIdentifier();
             osid.setValue("offeringSequence");
-            cmn = BigInteger.TEN;
+            cmn = TEN;
             lm = true;            
         } 
         
@@ -519,7 +523,7 @@ public class RMTxStoreTest extends Asser
         return sid;
     }
     
-    private void setupMessage(Identifier sid, BigInteger mn, String to, boolean outbound) 
+    private void setupMessage(Identifier sid, Long mn, String to, boolean outbound) 
         throws IOException, SQLException  {
         RMMessage msg = control.createMock(RMMessage.class);
         EasyMock.expect(msg.getMessageNumber()).andReturn(mn);
@@ -541,22 +545,22 @@ public class RMTxStoreTest extends Asser
                                           || "sequence2".equals(recovered.getIdentifier().getValue()));
             assertEquals(RMConstants.getAnonymousAddress(), recovered.getAcksTo().getAddress().getValue());
             if ("sequence1".equals(recovered.getIdentifier().getValue())) {                      
-                assertNull(recovered.getLastMessageNumber());                
+                assertEquals(0, recovered.getLastMessageNumber());                
                 assertEquals(1, recovered.getAcknowledgment().getAcknowledgementRange().size());
                 SequenceAcknowledgement.AcknowledgementRange r = 
                     recovered.getAcknowledgment().getAcknowledgementRange().get(0);
-                assertEquals(BigInteger.ONE, r.getLower());
-                assertEquals(BigInteger.ONE, r.getUpper());
+                assertEquals(ONE, r.getLower());
+                assertEquals(ONE, r.getUpper());
             } else {
-                assertEquals(BigInteger.TEN, recovered.getLastMessageNumber());
+                assertEquals(10, recovered.getLastMessageNumber());
                 assertEquals(2, recovered.getAcknowledgment().getAcknowledgementRange().size());
                 SequenceAcknowledgement.AcknowledgementRange r = 
                     recovered.getAcknowledgment().getAcknowledgementRange().get(0);
-                assertEquals(BigInteger.ONE, r.getLower());
-                assertEquals(BigInteger.ONE, r.getUpper());
+                assertEquals(ONE, r.getLower());
+                assertEquals(ONE, r.getUpper());
                 r = recovered.getAcknowledgment().getAcknowledgementRange().get(1);
-                assertEquals(new BigInteger("3"), r.getLower());
-                assertEquals(BigInteger.TEN, r.getUpper());                
+                assertEquals(new Long(3), r.getLower());
+                assertEquals(TEN, r.getUpper());                
             }
         }
     }
@@ -568,12 +572,12 @@ public class RMTxStoreTest extends Asser
                                           || "sequence2".equals(recovered.getIdentifier().getValue()));
             if ("sequence1".equals(recovered.getIdentifier().getValue())) {                      
                 assertFalse(recovered.isLastMessage());
-                assertEquals(BigInteger.ONE, recovered.getCurrentMessageNr());  
+                assertEquals(1, recovered.getCurrentMessageNr());  
                 assertNull(recovered.getExpires());
                 assertNull(recovered.getOfferingSequenceIdentifier());
             } else {
                 assertTrue(recovered.isLastMessage());
-                assertEquals(BigInteger.TEN, recovered.getCurrentMessageNr()); 
+                assertEquals(10, recovered.getCurrentMessageNr()); 
                 assertNotNull(recovered.getExpires());
                 assertEquals("offeringSequence", recovered.getOfferingSequenceIdentifier().getValue());
             }
@@ -582,15 +586,15 @@ public class RMTxStoreTest extends Asser
     
     private void checkRecoveredMessages(Collection<RMMessage> msgs) {
         for (RMMessage msg : msgs) {
-            BigInteger mn = msg.getMessageNumber();
-            assertTrue(BigInteger.ONE.equals(mn) || BigInteger.TEN.equals(mn));
-            if (BigInteger.TEN.equals(mn)) {
+            long mn = msg.getMessageNumber();
+            assertTrue(mn == 1 || mn == 10);
+            if (mn == 10) {
                 assertEquals(NON_ANON_ACKS_TO, msg.getTo());
             } else {
                 assertNull(msg.getTo());
             }
             byte[] actual = msg.getContent();
-            assertEquals(new String("Message " + mn.longValue()), IOUtils.newStringFromBytes(actual));
+            assertEquals(new String("Message " + mn), IOUtils.newStringFromBytes(actual));
         }
     }
     

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/policy/PolicyUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/policy/PolicyUtilsTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/policy/PolicyUtilsTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/policy/PolicyUtilsTest.java Mon Feb 14 17:15:05 2011
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.ws.rm.policy;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -59,7 +58,7 @@ public class PolicyUtilsTest extends Ass
         assertTrue(PolicyUtils.equals(a, b));
         
         InactivityTimeout iat = new RMAssertion.InactivityTimeout();
-        iat.setMilliseconds(BigInteger.TEN);
+        iat.setMilliseconds(new Long(10));
         a.setInactivityTimeout(iat);
         assertTrue(!PolicyUtils.equals(a, b));
         b.setInactivityTimeout(iat);
@@ -79,10 +78,10 @@ public class PolicyUtilsTest extends Ass
         assertSame(a, PolicyUtils.intersect(a, b));
         
         InactivityTimeout aiat = new RMAssertion.InactivityTimeout();
-        aiat.setMilliseconds(new BigInteger("3600000"));
+        aiat.setMilliseconds(new Long(3600000));
         a.setInactivityTimeout(aiat);
         InactivityTimeout biat = new RMAssertion.InactivityTimeout();
-        biat.setMilliseconds(new BigInteger("7200000"));
+        biat.setMilliseconds(new Long(7200000));
         b.setInactivityTimeout(biat);
         
         RMAssertion c = PolicyUtils.intersect(a, b);
@@ -92,10 +91,10 @@ public class PolicyUtilsTest extends Ass
         assertNull(c.getExponentialBackoff());
         
         BaseRetransmissionInterval abri = new RMAssertion.BaseRetransmissionInterval();
-        abri.setMilliseconds(new BigInteger("10000"));
+        abri.setMilliseconds(new Long(10000));
         a.setBaseRetransmissionInterval(abri);
         BaseRetransmissionInterval bbri = new RMAssertion.BaseRetransmissionInterval();
-        bbri.setMilliseconds(new BigInteger("20000"));
+        bbri.setMilliseconds(new Long(20000));
         b.setBaseRetransmissionInterval(bbri);
         
         c = PolicyUtils.intersect(a, b);
@@ -105,7 +104,7 @@ public class PolicyUtilsTest extends Ass
         assertNull(c.getExponentialBackoff());
        
         AcknowledgementInterval aai = new RMAssertion.AcknowledgementInterval();
-        aai.setMilliseconds(new BigInteger("2000"));
+        aai.setMilliseconds(new Long(2000));
         a.setAcknowledgementInterval(aai);
         
         c = PolicyUtils.intersect(a, b);
@@ -126,7 +125,7 @@ public class PolicyUtilsTest extends Ass
     public void testGetRMAssertion() {
         RMAssertion a = new RMAssertion();
         BaseRetransmissionInterval abri = new RMAssertion.BaseRetransmissionInterval();
-        abri.setMilliseconds(new BigInteger("3000"));
+        abri.setMilliseconds(new Long(3000));
         a.setBaseRetransmissionInterval(abri);
         a.setExponentialBackoff(new RMAssertion.ExponentialBackoff());
         
@@ -148,7 +147,7 @@ public class PolicyUtilsTest extends Ass
         control.reset();
         RMAssertion b = new RMAssertion();
         BaseRetransmissionInterval bbri = new RMAssertion.BaseRetransmissionInterval();
-        bbri.setMilliseconds(new BigInteger("2000"));
+        bbri.setMilliseconds(new Long(2000));
         b.setBaseRetransmissionInterval(bbri);
         JaxbAssertion<RMAssertion> assertion = new JaxbAssertion<RMAssertion>();
         assertion.setName(RMConstants.getRMAssertionQName());

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java Mon Feb 14 17:15:05 2011
@@ -21,7 +21,6 @@ package org.apache.cxf.ws.rm.soap;
 
 import java.io.InputStream;
 import java.lang.reflect.Method;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -67,8 +66,10 @@ import org.junit.Test;
 public class RMSoapInterceptorTest extends Assert {
 
     private static final String SEQ_IDENTIFIER = "http://Business456.com/RM/ABC";
-    private static final BigInteger MSG1_MESSAGE_NUMBER = BigInteger.ONE;
-    private static final BigInteger MSG2_MESSAGE_NUMBER = BigInteger.ONE.add(BigInteger.ONE);
+    private static final Long ONE = new Long(1);
+    private static final Long TEN = new Long(10);
+    private static final Long MSG1_MESSAGE_NUMBER = ONE;
+    private static final Long MSG2_MESSAGE_NUMBER = new Long(2);
 
     private IMocksControl control;
     
@@ -305,25 +306,25 @@ public class RMSoapInterceptorTest exten
         Identifier sid = factory.createIdentifier();
         sid.setValue("sequence1");
         s1.setIdentifier(sid);
-        s1.setMessageNumber(BigInteger.ONE);
+        s1.setMessageNumber(ONE);
         s2 = factory.createSequenceType();
         sid = factory.createIdentifier();
         sid.setValue("sequence2");
         s2.setIdentifier(sid);
-        s2.setMessageNumber(BigInteger.TEN);
+        s2.setMessageNumber(TEN);
 
         ack1 = factory.createSequenceAcknowledgement();
         SequenceAcknowledgement.AcknowledgementRange r = 
             factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setLower(BigInteger.ONE);
-        r.setUpper(BigInteger.ONE);
+        r.setLower(ONE);
+        r.setUpper(ONE);
         ack1.getAcknowledgementRange().add(r);
         ack1.setIdentifier(s1.getIdentifier());
 
         ack2 = factory.createSequenceAcknowledgement();
         r = factory.createSequenceAcknowledgementAcknowledgementRange();
-        r.setLower(BigInteger.ONE);
-        r.setUpper(BigInteger.TEN);
+        r.setLower(ONE);
+        r.setUpper(TEN);
         ack2.getAcknowledgementRange().add(r);
         ack2.setIdentifier(s2.getIdentifier());
 

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImplTest.java Mon Feb 14 17:15:05 2011
@@ -20,7 +20,6 @@
 
 package org.apache.cxf.ws.rm.soap;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -48,6 +47,8 @@ import org.junit.Test;
  * Test resend logic.
  */
 public class RetransmissionQueueImplTest extends Assert {
+    private static final Long ONE = new Long(1);
+    private static final Long TEN = new Long(10);
 
     private IMocksControl control;
     private RMManager manager;
@@ -185,7 +186,7 @@ public class RetransmissionQueueImplTest
     
     @Test
     public void testPurgeAcknowledgedSome() {
-        BigInteger[] messageNumbers = {BigInteger.TEN, BigInteger.ONE};
+        Long[] messageNumbers = {TEN, ONE};
         SourceSequence sequence = setUpSequence("sequence1",
                                           messageNumbers, 
                                           new boolean[] {true, false});
@@ -214,7 +215,7 @@ public class RetransmissionQueueImplTest
     
     @Test
     public void testPurgeAcknowledgedNone() {
-        BigInteger[] messageNumbers = {BigInteger.TEN, BigInteger.ONE};
+        Long[] messageNumbers = {TEN, ONE};
         SourceSequence sequence = setUpSequence("sequence1",
                                            messageNumbers, 
                                            new boolean[] {false, false});
@@ -243,7 +244,7 @@ public class RetransmissionQueueImplTest
 
     @Test
     public void testPurgeAcknowledgedAll() {
-        BigInteger[] messageNumbers = {BigInteger.TEN, BigInteger.ONE};
+        Long[] messageNumbers = {TEN, ONE};
         SourceSequence sequence = setUpSequence("sequence1",
                                           messageNumbers,
                                           new boolean[] {true, true});
@@ -277,7 +278,7 @@ public class RetransmissionQueueImplTest
 
     @Test
     public void testCountUnacknowledged() {
-        BigInteger[] messageNumbers = {BigInteger.TEN, BigInteger.ONE};
+        Long[] messageNumbers = {TEN, ONE};
         SourceSequence sequence = setUpSequence("sequence1",
                                           messageNumbers, 
                                           null);
@@ -304,7 +305,7 @@ public class RetransmissionQueueImplTest
     
     @Test
     public void testCountUnacknowledgedUnknownSequence() {
-        BigInteger[] messageNumbers = {BigInteger.TEN, BigInteger.ONE};
+        Long[] messageNumbers = {TEN, ONE};
         SourceSequence sequence = setUpSequence("sequence1",
                                           messageNumbers, 
                                           null);
@@ -325,13 +326,12 @@ public class RetransmissionQueueImplTest
         return setUpMessage(sid, null);
     }
 
-    private Message setUpMessage(String sid,
-                                        BigInteger messageNumber) {
+    private Message setUpMessage(String sid, Long messageNumber) {
         return setUpMessage(sid, messageNumber, true);
     }
 
     private Message setUpMessage(String sid,
-                                        BigInteger messageNumber,
+                                        Long messageNumber,
                                         boolean storeSequence) {
         Message message =
             createMock(Message.class);
@@ -349,7 +349,7 @@ public class RetransmissionQueueImplTest
         RMAssertion.BaseRetransmissionInterval bri = 
             createMock(RMAssertion.BaseRetransmissionInterval.class);
         EasyMock.expect(rma.getBaseRetransmissionInterval()).andReturn(bri);
-        EasyMock.expect(bri.getMilliseconds()).andReturn(new BigInteger("5000"));
+        EasyMock.expect(bri.getMilliseconds()).andReturn(new Long(5000));
         RMAssertion.ExponentialBackoff eb = createMock(RMAssertion.ExponentialBackoff.class);
         EasyMock.expect(rma.getExponentialBackoff()).andReturn(eb);        
     }
@@ -364,7 +364,7 @@ public class RetransmissionQueueImplTest
     
     private SequenceType setUpSequenceType(Message message,
                                            String sid,
-                                           BigInteger messageNumber) {
+                                           Long messageNumber) {
         RMProperties rmps = createMock(RMProperties.class);
         if (message != null) {
             message.get(RMMessageConstants.RM_PROPERTIES_OUTBOUND);
@@ -392,7 +392,7 @@ public class RetransmissionQueueImplTest
     }
     
     private SourceSequence setUpSequence(String sid, 
-                                   BigInteger[] messageNumbers,
+                                   Long[] messageNumbers,
                                    boolean[] isAcked) {
         SourceSequence sequence = createMock(SourceSequence.class);
         Identifier id = createMock(Identifier.class);

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java?rev=1070579&r1=1070578&r2=1070579&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java Mon Feb 14 17:15:05 2011
@@ -19,8 +19,6 @@
 
 package org.apache.cxf.ws.rm.soap;
 
-import java.math.BigInteger;
-
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
@@ -131,8 +129,8 @@ public class SoapFaultFactoryTest extend
         ack.setIdentifier(id);
         SequenceAcknowledgement.AcknowledgementRange range = 
             new SequenceAcknowledgement.AcknowledgementRange();
-        range.setLower(BigInteger.ONE);
-        range.setUpper(BigInteger.TEN);
+        range.setLower(new Long(1));
+        range.setUpper(new Long(10));
         ack.getAcknowledgementRange().add(range);   
         setupSequenceFault(true, RMConstants.getInvalidAcknowledgmentFaultCode(), ack);        
         control.replay();



Mime
View raw message