directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1723793 - /directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/
Date Fri, 08 Jan 2016 21:05:19 GMT
Author: seelmann
Date: Fri Jan  8 21:05:19 2016
New Revision: 1723793

URL: http://svn.apache.org/viewvc?rev=1723793&view=rev
Log:
Fix tests on Jenkins

Modified:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDsUtils.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDsUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDsUtils.java?rev=1723793&r1=1723792&r2=1723793&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDsUtils.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDsUtils.java
Fri Jan  8 21:05:19 2016
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST;
+
 import java.util.Hashtable;
 
 import javax.naming.Context;
@@ -46,7 +48,7 @@ public class ApacheDsUtils
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPort() );
+        env.put( Context.PROVIDER_URL, "ldap://" + LOCALHOST + ":" + ldapServer.getPort()
);
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java?rev=1723793&r1=1723792&r2=1723793&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/BrowserTest.java
Fri Jan  8 21:05:19 2016
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST;
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST_ADDRESS;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -357,7 +359,7 @@ public class BrowserTest extends Abstrac
     public void testRefreshSearchContinuation() throws Exception
     {
         // preparation: add referral entry and set referral handling
-        String url = "ldap://localhost:" + ldapServer.getPort() + "/ou=users,ou=system";
+        String url = "ldap://" + LOCALHOST + ":" + ldapServer.getPort() + "/ou=users,ou=system";
         Entry refEntry = new DefaultEntry( service.getSchemaManager() );
         refEntry.setDn( new Dn( "cn=referral,ou=system" ) );
         refEntry.add( "objectClass", "top", "referral", "extensibleObject" );
@@ -483,15 +485,16 @@ public class BrowserTest extends Abstrac
 
         // create entry with multi-valued RDN containing an IP address value
         Entry entry = new DefaultEntry( service.getSchemaManager() );
-        entry.setDn( new Dn( "cn=loopback+ipHostNumber=127.0.0.1,ou=users,ou=system" ) );
+        entry.setDn( new Dn( "cn=loopback+ipHostNumber=" + LOCALHOST_ADDRESS + ",ou=users,ou=system"
) );
         entry.add( "objectClass", "top", "device", "ipHost" );
         entry.add( "cn", "loopback" );
-        entry.add( "ipHostNumber", "127.0.0.1" );
+        entry.add( "ipHostNumber", LOCALHOST_ADDRESS );
         ldapServer.getDirectoryService().getAdminSession().add( entry );
 
         assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users",
-            "cn=loopback+ipHostNumber=127.0.0.1" ) );
-        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=loopback+ipHostNumber=127.0.0.1"
);
+            "cn=loopback+ipHostNumber=" + LOCALHOST_ADDRESS ) );
+        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users",
+            "cn=loopback+ipHostNumber=" + LOCALHOST_ADDRESS );
     }
 
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java?rev=1723793&r1=1723792&r2=1723793&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/Constants.java
Fri Jan  8 21:05:19 2016
@@ -41,4 +41,19 @@ public final class Constants
         }
     }
 
+    public static final String LOCALHOST_ADDRESS = getLocalHostAddress();
+
+
+    private static String getLocalHostAddress()
+    {
+        try
+        {
+            return InetAddress.getLocalHost().getHostAddress();
+        }
+        catch ( UnknownHostException e )
+        {
+            return "localhost";
+        }
+    }
+
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java?rev=1723793&r1=1723792&r2=1723793&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
Fri Jan  8 21:05:19 2016
@@ -22,6 +22,7 @@ package org.apache.directory.studio.test
 
 
 import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST;
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST_ADDRESS;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -390,7 +391,7 @@ public class NewConnectionWizardTest ext
         assertNull( "Expected OK", result1 );
 
         // enter connection parameter with IPv4 address
-        wizardBot.typeHost( InetAddress.getLocalHost().getHostAddress() );
+        wizardBot.typeHost( LOCALHOST_ADDRESS );
         wizardBot.typePort( ldapServer.getPort() );
 
         // click "Check Network Parameter" button

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java?rev=1723793&r1=1723792&r2=1723793&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewEntryWizardTest.java
Fri Jan  8 21:05:19 2016
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST;
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST_ADDRESS;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -80,7 +82,7 @@ public class NewEntryWizardTest extends
         entry.setDn( new Dn( "cn=referral,ou=system" ) );
         entry.add( "objectClass", "top", "referral", "extensibleObject" );
         entry.add( "cn", "referralDialogTest" );
-        entry.add( "ref", "ldap://localhost:" + ldapServer.getPort() + "/ou=users,ou=system"
);
+        entry.add( "ref", "ldap://"+LOCALHOST+":" + ldapServer.getPort() + "/ou=users,ou=system"
);
         service.getAdminSession().add( entry );
 
         studioBot = new StudioBot();
@@ -414,12 +416,13 @@ public class NewEntryWizardTest extends
         wizardBot.setRdnType( 1, "cn" );
         wizardBot.setRdnValue( 1, "loopback" );
         wizardBot.setRdnType( 2, "ipHostNumber" );
-        wizardBot.setRdnValue( 2, "127.0.0.1" );
+        wizardBot.setRdnValue( 2, LOCALHOST_ADDRESS );
         wizardBot.clickNextButton();
 
         wizardBot.clickFinishButton();
 
-        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "cn=loopback+ipHostNumber=127.0.0.1"
) );
-        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "cn=loopback+ipHostNumber=127.0.0.1"
);
+        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system",
+            "cn=loopback+ipHostNumber=" + LOCALHOST_ADDRESS ) );
+        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "cn=loopback+ipHostNumber="
+ LOCALHOST_ADDRESS );
     }
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java?rev=1723793&r1=1723792&r2=1723793&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
Fri Jan  8 21:05:19 2016
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
+import static org.apache.directory.studio.test.integration.ui.Constants.LOCALHOST;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -81,7 +82,7 @@ public class ReferralDialogTest extends
         entry.setDn( new Dn( "cn=referralDialogTest,ou=system" ) );
         entry.add( "objectClass", "top", "referral", "extensibleObject" );
         entry.add( "cn", "referralDialogTest" );
-        entry.add( "ref", "ldap://localhost:" + ldapServer.getPort() + "/ou=users,ou=system"
);
+        entry.add( "ref", "ldap://" + LOCALHOST + ":" + ldapServer.getPort() + "/ou=users,ou=system"
);
         service.getAdminSession().add( entry );
 
         // get paths
@@ -90,7 +91,8 @@ public class ReferralDialogTest extends
         referralPath = new String[]
             { "DIT", "Root DSE", "ou=system", "cn=referralDialogTest" };
         targetPath = new String[]
-            { "DIT", "Root DSE", "ou=system", "ldap://localhost:" + ldapServer.getPort()
+ "/ou=users,ou=system" };
+            { "DIT", "Root DSE", "ou=system",
+                "ldap://" + LOCALHOST + ":" + ldapServer.getPort() + "/ou=users,ou=system"
};
     }
 
 



Mime
View raw message