cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1383523 - /cxf/branches/2.6.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
Date Tue, 11 Sep 2012 18:38:56 GMT
Author: dkulp
Date: Tue Sep 11 18:38:56 2012
New Revision: 1383523

URL: http://svn.apache.org/viewvc?rev=1383523&view=rev
Log:
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.6.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java

Modified: cxf/branches/2.6.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java?rev=1383523&r1=1383522&r2=1383523&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
(original)
+++ cxf/branches/2.6.x-fixes/testutils/src/main/java/org/apache/cxf/testutil/common/TestUtil.java
Tue Sep 11 18:38:56 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) {



Mime
View raw message