You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/09/11 20:54:12 UTC

svn commit: r1383543 - /cxf/branches/2.5.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java

Author: dkulp
Date: Tue Sep 11 18:54:11 2012
New Revision: 1383543

URL: http://svn.apache.org/viewvc?rev=1383543&view=rev
Log:
Merged revisions 1383523 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1383523 | dkulp | 2012-09-11 14:38:56 -0400 (Tue, 11 Sep 2012) | 10 lines

  Merged revisions 1381675 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1381675 | dkulp | 2012-09-06 12:40:52 -0400 (Thu, 06 Sep 2012) | 2 lines

    Allow resetting of a port to reuse later

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java

Modified: cxf/branches/2.5.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java?rev=1383543&r1=1383542&r2=1383543&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java (original)
+++ cxf/branches/2.5.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java Tue Sep 11 18:54:11 2012
@@ -122,6 +122,24 @@ public final class TestUtil {
     public static String getPortNumber(String name) {
         return getPortNumber(name, name);
     }
+    
+    public static String getNewPortNumber(Class<?> cls) {
+        return getNewPortNumber(cls.getName(), cls.getSimpleName());
+    }
+    public static String getNewPortNumber(Class<?> cls, int count) {
+        return getNewPortNumber(cls.getName() + "." + count,
+                             cls.getSimpleName() + "." + count);
+    }
+    public static String getNewPortNumber(String name) {
+        return getNewPortNumber(name, name);
+    }
+    public static String getNewPortNumber(String fullName, String simpleName) {
+        ports.remove("testutil.ports." + fullName);
+        ports.remove("testutil.ports." + simpleName);
+        System.clearProperty("testutil.ports." + fullName);
+        System.clearProperty("testutil.ports." + simpleName);        
+        return getPortNumber(fullName, simpleName);
+    }    
     public static String getPortNumber(String fullName, String simpleName) {
         String p = ports.getProperty("testutil.ports." + fullName);
         if (p == null) {