directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1035586 [1/2] - in /directory/studio/trunk/tests/test.integration.ui: ./ src/main/java/org/apache/directory/studio/test/integration/ui/ src/main/java/org/apache/directory/studio/test/integration/ui/bots/
Date Tue, 16 Nov 2010 11:03:12 GMT
Author: seelmann
Date: Tue Nov 16 11:03:12 2010
New Revision: 1035586

URL: http://svn.apache.org/viewvc?rev=1035586&view=rev
Log:
o Migrated UI tests to ApacheDS and Shared trunk
o Use library plugins where possible
o Some tests are still failing, tests can't be run from cmd line yet


Modified:
    directory/studio/trunk/tests/test.integration.ui/pom.xml
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.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/EntryEditorTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.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/PreferencesTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ReferralDialogTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/RenameEntryDialogTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SearchTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SwtResourcesTest.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConnectionsViewBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/NewEntryWizardBot.java

Modified: directory/studio/trunk/tests/test.integration.ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/pom.xml?rev=1035586&r1=1035585&r2=1035586&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/pom.xml (original)
+++ directory/studio/trunk/tests/test.integration.ui/pom.xml Tue Nov 16 11:03:12 2010
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-  
+
   http://www.apache.org/licenses/LICENSE-2.0
-  
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,15 +25,15 @@
     <artifactId>parent-tests</artifactId>
     <version>2.0.0-SNAPSHOT</version>
   </parent>
-  
+
   <artifactId>test.integration.ui</artifactId>
   <name>Apache Directory Studio UI Integration Tests</name>
   <packaging>jar</packaging>
 
   <description></description>
-  
+
   <profiles>
-  
+
     <!--linux-x86  -->
     <profile>
       <id>linux-x86</id>
@@ -50,7 +50,7 @@
         <integration-plugins-folder>plugins</integration-plugins-folder>
       </properties>
     </profile>
-    
+
     <!-- linux-x86_64 -->
     <profile>
       <id>linux-x86_64</id>
@@ -66,8 +66,8 @@
         <integration-cmdline-params>-os linux -ws gtk -arch x86_64</integration-cmdline-params>
         <integration-plugins-folder>plugins</integration-plugins-folder>
       </properties>
-    </profile>  
-    
+    </profile>
+
     <!-- linux-ppc -->
     <profile>
       <id>linux-ppc</id>
@@ -83,8 +83,8 @@
         <integration-cmdline-params>-os linux -ws gtk -arch ppc</integration-cmdline-params>
         <integration-plugins-folder>plugins</integration-plugins-folder>
       </properties>
-    </profile>  
-    
+    </profile>
+
     <!--win32  -->
     <profile>
        <id>win32</id>
@@ -99,8 +99,8 @@
         <integration-cmdline-params>-os win32 -ws win32 -arch x86</integration-cmdline-params>
         <integration-plugins-folder>plugins</integration-plugins-folder>
       </properties>
-    </profile>  
-    
+    </profile>
+
     <!-- macosx -->
     <profile>
       <id>macosx</id>
@@ -115,8 +115,8 @@
         <integration-cmdline-params>-os macosx -ws carbon -arch x86</integration-cmdline-params>
         <integration-plugins-folder>Apache Directory Studio.app/Contents/Resources/Java/plugins</integration-plugins-folder>
       </properties>
-    </profile>  
-    
+    </profile>
+
     <!-- launch UI tests using eclipse test framework -->
     <profile>
       <id>integration-ui</id>
@@ -132,19 +132,19 @@
                 <phase>test</phase>
                 <configuration>
                   <tasks>
-                    
+
                     <!-- cleanup and recreate test-sandbox -->
                     <delete dir="target/test-sandbox"/>
                     <mkdir dir="target/test-sandbox"/>
                     <mkdir dir="target/test-sandbox/workspace"/>
-                    
+
                     <!-- copy complete eclipse distribution to test-sandbox -->
                     <copy todir="target/test-sandbox">
                       <fileset dir="${eclipse-home}">
                         <exclude name="plugins/org.junit4*/**"/>
                       </fileset>
                     </copy>
-                    
+
                     <!-- copy apache directory studio plugins to test-sandbox -->
                     <copy todir="target/test-sandbox">
                       <fileset dir="../target/distributions">
@@ -152,21 +152,21 @@
                       </fileset>
                       <regexpmapper from="${integration-regexp}" to="\2"/>
                     </copy>
-                    
+
                     <!-- copy SWTbot and eclipse testing plugins to test-sandbox -->
                     <copy todir="target/test-sandbox/${integration-plugins-folder}">
                       <fileset dir="resources/test-plugins">
                         <include name="**/*" />
                       </fileset>
                     </copy>
-                    
+
                     <!-- copy test-integration-ui plugin to test-sandbox -->
                     <copy todir="target/test-sandbox/${integration-plugins-folder}">
                       <fileset dir="target">
                         <include name="test.integration.ui-*.jar" />
                       </fileset>
                     </copy>
-                    
+
                     <!-- launch the tests -->
                     <java fork="true" failonerror="true" classname="org.eclipse.core.launcher.Main">
                       <jvmarg line="-Xmx1024m -XX:MaxPermSize=512m"/>
@@ -177,7 +177,7 @@
                         </fileset>
                       </classpath>
                     </java>
-                    
+
                   </tasks>
                 </configuration>
                 <goals>
@@ -191,7 +191,7 @@
       </build>
     </profile>
   </profiles>
-  
+
   <build>
     <resources>
       <resource>
@@ -211,10 +211,17 @@
         <configuration>
           <skip>false</skip>
           <pde>true</pde>
-          <additionalProjectnatures>
+          <buildcommands>
+            <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+            <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+            <buildcommand>org.eclipse.pde.SchemaBuilder</buildcommand>
+          </buildcommands>
+          <projectnatures>
+            <projectnature>org.eclipse.jem.workbench.JavaEMFNature</projectnature>
             <projectnature>org.eclipse.pde.PluginNature</projectnature>
             <projectnature>org.eclipse.jdt.core.javanature</projectnature>
-          </additionalProjectnatures>
+            <projectnature>org.eclipse.jem.beaninfo.BeanInfoNature</projectnature>
+          </projectnatures>
           <classpathContainers>
             <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
             <classpathContainer>org.eclipse.pde.core.requiredPlugins</classpathContainer>
@@ -253,17 +260,31 @@
         <extensions>true</extensions>
         <configuration>
           <manifestLocation>META-INF</manifestLocation>
-          <instructions>            
+          <instructions>
             <Bundle-SymbolicName>${groupId}.${artifactId};singleton:=true</Bundle-SymbolicName>
             <Bundle-Localization>plugin</Bundle-Localization>
             <Require-Bundle>org.eclipse.core.runtime,
  org.eclipse.ui,
+ org.apache.directory.studio.common.core,
+ org.apache.directory.studio.common.ui,
  org.apache.directory.studio.connection.core,
  org.apache.directory.studio.connection.ui,
  org.apache.directory.studio.ldapbrowser.common,
  org.apache.directory.studio.ldapbrowser.core,
  org.apache.directory.studio.ldapbrowser.ui,
  org.apache.directory.studio.apacheds,
+ org.apache.directory.shared.i18n,
+ org.apache.directory.shared.ldap,
+ org.apache.directory.shared.ldapschema,
+ org.apache.directory.shared.ldapclientapi,
+ org.apache.mina.core,
+ org.apache.commons.collections,
+ org.apache.commons.io,
+ org.apache.commons.lang,
+ org.bouncycastle.bcprovjdk15,
+ org.slf4j.api,
+ org.slf4j.log4j12,
+ org.apache.logging.log4j,
  org.junit4,
  org.eclipse.swtbot.junit4_x,
  org.eclipse.swtbot.swt.finder,
@@ -273,7 +294,7 @@
             <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
             <Embed-Directory>lib</Embed-Directory>
             <Embed-StripGroup>true</Embed-StripGroup>
-            <Embed-Transitive>true</Embed-Transitive>  
+            <Embed-Transitive>true</Embed-Transitive>
             <Export-Package>!*</Export-Package>
             <Import-Package>!</Import-Package>
             <Private-Package>!</Private-Package>
@@ -282,9 +303,9 @@
         <executions>
           <execution>
             <phase>process-classes</phase>
-            <goals>    
+            <goals>
               <goal>manifest</goal>
-            </goals>   
+            </goals>
           </execution>
         </executions>
       </plugin>
@@ -300,46 +321,116 @@
   </build>
 
   <dependencies>
+    <!-- Apache Directory Studio library plugins dependencies -->
     <dependency>
-      <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-core-integ</artifactId>
-      <version>1.5.5</version>
-    </dependency> 
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>org.bouncycastle.bcprovjdk15</artifactId>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
-      <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-server-integ</artifactId>
-      <version>1.5.5</version>
-    </dependency> 
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>org.apache.commons.lang</artifactId>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
-      <groupId>org.apache.directory.shared</groupId>
-      <artifactId>shared-ldap</artifactId>
-      <version>0.9.17</version>
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>org.apache.commons.codec</artifactId>
       <scope>provided</scope>
-    </dependency> 
+    </dependency>
     <dependency>
-      <groupId>org.apache.directory.shared</groupId>
-      <artifactId>shared-asn1</artifactId>
-      <version>0.9.17</version>
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>org.apache.directory.shared.ldap</artifactId>
       <scope>provided</scope>
-    </dependency> 
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-integ</artifactId>
+      <version>1.5.8-SNAPSHOT</version>
+      <!-- These excluded dependencies are included as eclipse bundles -->
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.directory.shared</groupId>
+          <artifactId>shared-i18n</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.directory.shared</groupId>
+          <artifactId>shared-ldap</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.directory.shared</groupId>
+          <artifactId>shared-ldap-schema</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.directory.shared</groupId>
+          <artifactId>ldap-client-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.mina</groupId>
+          <artifactId>mina-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>bouncycastle</groupId>
+          <artifactId>bcprov-jdk15</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-log4j12</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>log4j</groupId>
+          <artifactId>log4j</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-collections</groupId>
+          <artifactId>commons-collections</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-io</groupId>
+          <artifactId>commons-io</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-lang</groupId>
+          <artifactId>commons-lang</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>org.apache.commons.io</artifactId>
+      <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>common.core</artifactId>
+      <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
+      <groupId>org.apache.directory.studio</groupId>
+      <artifactId>common.ui</artifactId>
+      <scope>provided</scope>
     </dependency>
-    
     <dependency>
       <groupId>org.apache.directory.studio</groupId>
       <artifactId>connection.core</artifactId>
@@ -370,7 +461,7 @@
       <artifactId>apacheds</artifactId>
       <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
       <groupId>org.eclipse.swtbot.swt</groupId>
       <artifactId>finder</artifactId>
@@ -386,7 +477,7 @@
       <artifactId>hamcrest-all</artifactId>
       <scope>provided</scope>
     </dependency>
-    
+
     <dependency>
       <groupId>org.eclipse</groupId>
       <artifactId>osgi</artifactId>
@@ -438,5 +529,5 @@
       <scope>provided</scope>
     </dependency>
   </dependencies>
-  
+
 </project>

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java?rev=1035586&r1=1035585&r2=1035586&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java (original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ApacheDSPluginTest.java Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -45,7 +45,7 @@ import org.junit.Test;
 
 /**
  * Tests the Apache DS Plugin's UI.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -125,7 +125,7 @@ public class ApacheDSPluginTest
 
 
     /**
-     * Verifies that the 'New Server' does not allow the creation of 
+     * Verifies that the 'New Server' does not allow the creation of
      * 2 servers with the same name.
      */
     @Test
@@ -245,7 +245,7 @@ public class ApacheDSPluginTest
 
         // Checking if the connection is open
         waitForConnectionOpened( connection );
-        assertTrue( connection.getJNDIConnectionWrapper().isConnected() );
+        assertTrue( connection.getConnectionWrapper().isConnected() );
 
         // Closing the connection
         connectionsViewBot.selectConnection( serverName );
@@ -253,7 +253,7 @@ public class ApacheDSPluginTest
 
         // Checking if the connection is closed
         waitForConnectionClosed( connection );
-        assertFalse( connection.getJNDIConnectionWrapper().isConnected() );
+        assertFalse( connection.getConnectionWrapper().isConnected() );
 
         // Deleting the connection
         connectionsViewBot.deleteTestConnections();
@@ -349,7 +349,7 @@ public class ApacheDSPluginTest
         {
             public boolean test() throws Exception
             {
-                return connection.getJNDIConnectionWrapper().isConnected();
+                return connection.getConnectionWrapper().isConnected();
             }
 
 
@@ -373,7 +373,7 @@ public class ApacheDSPluginTest
         {
             public boolean test() throws Exception
             {
-                return !connection.getJNDIConnectionWrapper().isConnected();
+                return !connection.getConnectionWrapper().isConnected();
             }
 
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java?rev=1035586&r1=1035585&r2=1035586&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java (original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java Tue Nov 16 11:03:12 2010
@@ -6,24 +6,20 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.studio.test.integration.ui;
 
 
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.SetupMode;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.core.integ.annotations.Mode;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
 import org.junit.runner.RunWith;
@@ -32,7 +28,7 @@ import org.junit.runners.Suite;
 
 /**
  * Test suite.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -41,8 +37,6 @@ import org.junit.runners.Suite;
     { BrowserTest.class, EntryEditorTest.class, ImportExportTest.class, NewConnectionWizardTest.class,
         NewEntryWizardTest.class, PreferencesTest.class, ReferralDialogTest.class, RenameEntryDialogTest.class,
         SearchTest.class })
-@CleanupLevel(Level.SUITE)
-@Mode(SetupMode.ROLLBACK)
 public class AutomatedSuite
 {
     static

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=1035586&r1=1035585&r2=1035586&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 Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -28,15 +28,14 @@ import static junit.framework.Assert.ass
 import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
-import org.apache.directory.server.core.entry.DefaultServerEntry;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifFiles;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifFiles;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
@@ -62,18 +61,17 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the LDAP browser.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.SUITE)
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles(
-    { "BrowserTest.ldif" })
-public class BrowserTest
+    { "org/apache/directory/studio/test/integration/ui/BrowserTest.ldif" })
+public class BrowserTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     private StudioBot studioBot;
     private ConnectionsViewBot connectionsViewBot;
     private BrowserViewBot browserViewBot;
@@ -89,6 +87,8 @@ public class BrowserTest
         studioBot = new StudioBot();
         studioBot.resetLdapPerspective();
         connectionsViewBot = studioBot.getConnectionView();
+        System.out.println(connectionsViewBot);
+        System.out.println(ldapServer);
         connection = connectionsViewBot.createTestConnection( "BrowserTest", ldapServer.getPort() );
         browserViewBot = studioBot.getBrowserView();
         searchLogsViewBot = studioBot.getSearchLogsViewBot();
@@ -105,8 +105,8 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-463.
-     * 
-     * When expanding an entry in the browser only one search request 
+     *
+     * When expanding an entry in the browser only one search request
      * should be send to the server
      *
      * @throws Exception
@@ -136,7 +136,7 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-512.
-     * 
+     *
      * Verify minimum UI updates when deleting multiple entries.
      *
      * @throws Exception
@@ -168,8 +168,8 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-575.
-     * 
-     * When opening a bookmark the entry editor should be opened and the 
+     *
+     * When opening a bookmark the entry editor should be opened and the
      * bookmark entry's attributes should be displayed.
      *
      * @throws Exception
@@ -181,7 +181,7 @@ public class BrowserTest
         IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
             .getBrowserConnection( connection );
         browserConnection.getBookmarkManager().addBookmark(
-            new Bookmark( browserConnection, new LdapDN( "uid=user.1,ou=users,ou=system" ), "Existing Bookmark" ) );
+            new Bookmark( browserConnection, new DN( "uid=user.1,ou=users,ou=system" ), "Existing Bookmark" ) );
 
         // select the bookmark
         browserViewBot.selectEntry( "Bookmarks", "Existing Bookmark" );
@@ -200,7 +200,7 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-481.
-     * 
+     *
      * Check proper operation of refresh action.
      *
      * @throws Exception
@@ -213,8 +213,8 @@ public class BrowserTest
         assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
 
         // add the entry directly in the server
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        entry.setDn( new DN( "cn=refresh,ou=users,ou=system" ) );
         entry.add( "objectClass", "top", "person" );
         entry.add( "cn", "refresh" );
         entry.add( "sn", "refresh" );
@@ -233,7 +233,7 @@ public class BrowserTest
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" );
 
         // delete the entry directly in the server
-        ldapServer.getDirectoryService().getAdminSession().delete( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        ldapServer.getDirectoryService().getAdminSession().delete( new DN( "cn=refresh,ou=users,ou=system" ) );
 
         // check the entry still is now visible in the tree
         assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
@@ -250,7 +250,7 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-481.
-     * 
+     *
      * Check proper operation of refresh action.
      *
      * @throws Exception
@@ -263,8 +263,8 @@ public class BrowserTest
         assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
 
         // add the entry directly in the server
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        entry.setDn( new DN( "cn=refresh,ou=users,ou=system" ) );
         entry.add( "objectClass", "top", "person" );
         entry.add( "cn", "refresh" );
         entry.add( "sn", "refresh" );
@@ -283,7 +283,7 @@ public class BrowserTest
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" );
 
         // delete the entry directly in the server
-        ldapServer.getDirectoryService().getAdminSession().delete( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        ldapServer.getDirectoryService().getAdminSession().delete( new DN( "cn=refresh,ou=users,ou=system" ) );
 
         // check the entry still is now visible in the tree
         assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
@@ -300,7 +300,7 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-481.
-     * 
+     *
      * Check proper operation of refresh action.
      *
      * @throws Exception
@@ -313,8 +313,8 @@ public class BrowserTest
         assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
 
         // add the entry directly in the server
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        entry.setDn( new DN( "cn=refresh,ou=users,ou=system" ) );
         entry.add( "objectClass", "top", "person" );
         entry.add( "cn", "refresh" );
         entry.add( "sn", "refresh" );
@@ -333,7 +333,7 @@ public class BrowserTest
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" );
 
         // delete the entry directly in the server
-        ldapServer.getDirectoryService().getAdminSession().delete( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        ldapServer.getDirectoryService().getAdminSession().delete( new DN( "cn=refresh,ou=users,ou=system" ) );
 
         // check the entry still is now visible in the tree
         assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
@@ -350,7 +350,7 @@ public class BrowserTest
 
     /**
      * Test for DIRSTUDIO-481.
-     * 
+     *
      * Check proper operation of refresh action.
      *
      * @throws Exception
@@ -360,8 +360,8 @@ public class BrowserTest
     {
         // preparation: add referral entry and set referral handling
         String url = "ldap://localhost:" + ldapServer.getPort() + "/ou=users,ou=system";
-        ServerEntry refEntry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        refEntry.setDn( new LdapDN( "cn=referral,ou=system" ) );
+        Entry refEntry = new DefaultEntry( service.getSchemaManager() );
+        refEntry.setDn( new DN( "cn=referral,ou=system" ) );
         refEntry.add( "objectClass", "top", "referral", "extensibleObject" );
         refEntry.add( "cn", "referral" );
         refEntry.add( "ref", url );
@@ -379,8 +379,8 @@ public class BrowserTest
         assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", url, "cn=refresh" ) );
 
         // add the entry directly in the server
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        entry.setDn( new DN( "cn=refresh,ou=users,ou=system" ) );
         entry.add( "objectClass", "top", "person" );
         entry.add( "cn", "refresh" );
         entry.add( "sn", "refresh" );
@@ -399,7 +399,7 @@ public class BrowserTest
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", url, "cn=refresh" );
 
         // delete the entry directly in the server
-        ldapServer.getDirectoryService().getAdminSession().delete( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
+        ldapServer.getDirectoryService().getAdminSession().delete( new DN( "cn=refresh,ou=users,ou=system" ) );
 
         // check the entry still is now visible in the tree
         assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", url, "cn=refresh" ) );
@@ -468,7 +468,7 @@ public class BrowserTest
             ErrorDialog.AUTOMATED_MODE = errorDialogAutomatedMode;
         }
 
-        // check that modification logs is still empty 
+        // check that modification logs is still empty
         // to ensure that no modification was sent to the server
         assertEquals( "No modification expected", "", modificationLogsViewBot.getModificationLogsText() );
     }
@@ -484,8 +484,8 @@ public class BrowserTest
         ApacheDsUtils.enableSchema( ldapServer, "nis" );
 
         // create entry with multi-valued RDN containing an IP address value
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=loopback+ipHostNumber=127.0.0.1,ou=users,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        entry.setDn( new DN( "cn=loopback+ipHostNumber=127.0.0.1,ou=users,ou=system" ) );
         entry.add( "objectClass", "top", "device", "ipHost" );
         entry.add( "cn", "loopback" );
         entry.add( "ipHostNumber", "127.0.0.1" );
@@ -500,7 +500,7 @@ public class BrowserTest
     /**
      * DIRSTUDIO-637: copy/paste of attributes no longer works.
      * Test copy/paste of a value to a bookmark.
-     * 
+     *
      * @throws Exception
      *             the exception
      */
@@ -511,7 +511,7 @@ public class BrowserTest
         IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
             .getBrowserConnection( connection );
         browserConnection.getBookmarkManager().addBookmark(
-            new Bookmark( browserConnection, new LdapDN( "uid=user.2,ou=users,ou=system" ), "My Bookmark" ) );
+            new Bookmark( browserConnection, new DN( "uid=user.2,ou=users,ou=system" ), "My Bookmark" ) );
 
         // copy a value
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=user.1" );
@@ -535,8 +535,8 @@ public class BrowserTest
         entryEditorBot.getAttributeValues().contains( "uid: user.1" );
 
         // assert pasted value was written to directory
-        ClonedServerEntry entry = ldapServer.getDirectoryService().getAdminSession().lookup(
-            new LdapDN( "uid=user.2,ou=users,ou=system" ) );
+        Entry entry = ldapServer.getDirectoryService().getAdminSession().lookup(
+            new DN( "uid=user.2,ou=users,ou=system" ) );
         assertTrue( entry.contains( "uid", "user.1" ) );
     }
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java?rev=1035586&r1=1035585&r2=1035586&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java (original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -27,13 +27,13 @@ import static junit.framework.Assert.ass
 import static org.eclipse.swtbot.swt.finder.SWTBotTestCase.assertContains;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifFiles;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifFiles;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.test.integration.ui.bots.BrowserViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot;
@@ -53,18 +53,17 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the entry editor.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.SUITE)
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles(
-    { "EntryEditorTest.ldif" })
-public class EntryEditorTest
+    { "org/apache/directory/studio/test/integration/ui/EntryEditorTest.ldif" })
+public class EntryEditorTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     private StudioBot studioBot;
     private ConnectionsViewBot connectionsViewBot;
     private BrowserViewBot browserViewBot;
@@ -92,7 +91,7 @@ public class EntryEditorTest
 
     /**
      * Test adding, editing and deleting of attributes in the entry editor.
-     * 
+     *
      * @throws Exception
      *             the exception
      */
@@ -117,8 +116,8 @@ public class EntryEditorTest
         entryEditorBot.typeValueAndFinish( "This is the 1st description." );
         assertEquals( 9, entryEditorBot.getAttributeValues().size() );
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
-        assertContains( "add: description\ndescription: This is the 1st description.", modificationLogsViewBot
-            .getModificationLogsText() );
+        assertContains( "add: description\ndescription: This is the 1st description.",
+            modificationLogsViewBot.getModificationLogsText() );
 
         // add second value
         entryEditorBot.activate();
@@ -127,8 +126,8 @@ public class EntryEditorTest
         assertEquals( 10, entryEditorBot.getAttributeValues().size() );
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 2nd description." ) );
-        assertContains( "add: description\ndescription: This is the 2nd description.", modificationLogsViewBot
-            .getModificationLogsText() );
+        assertContains( "add: description\ndescription: This is the 2nd description.",
+            modificationLogsViewBot.getModificationLogsText() );
 
         // edit second value
         entryEditorBot.editValue( "description", "This is the 2nd description." );
@@ -138,18 +137,18 @@ public class EntryEditorTest
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
         assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 2nd description." ) );
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 3rd description." ) );
-        assertContains( "delete: description\ndescription: This is the 2nd description.", modificationLogsViewBot
-            .getModificationLogsText() );
-        assertContains( "add: description\ndescription: This is the 3rd description.", modificationLogsViewBot
-            .getModificationLogsText() );
+        assertContains( "delete: description\ndescription: This is the 2nd description.",
+            modificationLogsViewBot.getModificationLogsText() );
+        assertContains( "add: description\ndescription: This is the 3rd description.",
+            modificationLogsViewBot.getModificationLogsText() );
 
         // delete second value
         entryEditorBot.deleteValue( "description", "This is the 3rd description." );
         assertEquals( 9, entryEditorBot.getAttributeValues().size() );
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
         assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 3rd description." ) );
-        assertContains( "delete: description\ndescription: This is the 3rd description.", modificationLogsViewBot
-            .getModificationLogsText() );
+        assertContains( "delete: description\ndescription: This is the 3rd description.",
+            modificationLogsViewBot.getModificationLogsText() );
 
         // edit 1st value
         entryEditorBot.editValue( "description", "This is the 1st description." );
@@ -157,8 +156,8 @@ public class EntryEditorTest
         assertEquals( 9, entryEditorBot.getAttributeValues().size() );
         assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the 1st description." ) );
         assertTrue( entryEditorBot.getAttributeValues().contains( "description: This is the final description." ) );
-        assertContains( "replace: description\ndescription: This is the final description.", modificationLogsViewBot
-            .getModificationLogsText() );
+        assertContains( "replace: description\ndescription: This is the final description.",
+            modificationLogsViewBot.getModificationLogsText() );
 
         // delete 1st value/attribute
         entryEditorBot.deleteValue( "description", "This is the final description." );
@@ -166,14 +165,14 @@ public class EntryEditorTest
         assertFalse( entryEditorBot.getAttributeValues().contains( "description: This is the final description." ) );
         assertContains( "delete: description\n-", modificationLogsViewBot.getModificationLogsText() );
 
-        assertEquals( "Expected 6 modifications.", 6, StringUtils.countMatches( modificationLogsViewBot
-            .getModificationLogsText(), "#!RESULT OK" ) );
+        assertEquals( "Expected 6 modifications.", 6,
+            StringUtils.countMatches( modificationLogsViewBot.getModificationLogsText(), "#!RESULT OK" ) );
     }
 
 
     /**
-     * DIRSTUDIO-483: DN Editor escapes all non-ascii characters 
-     * 
+     * DIRSTUDIO-483: DN Editor escapes all non-ascii characters
+     *
      * @throws Exception
      *             the exception
      */
@@ -211,15 +210,15 @@ public class EntryEditorTest
         assertEquals( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system", dnEditorBot.getDnText() );
         dnEditorBot.clickCancelButton();
 
-        assertEquals( "Expected 1 modification.", 1, StringUtils.countMatches( modificationLogsViewBot
-            .getModificationLogsText(), "#!RESULT OK" ) );
+        assertEquals( "Expected 1 modification.", 1,
+            StringUtils.countMatches( modificationLogsViewBot.getModificationLogsText(), "#!RESULT OK" ) );
     }
 
 
     /**
      * DIRSTUDIO-637: copy/paste of attributes no longer works.
      * Test copy/paste within entry editor.
-     * 
+     *
      * @throws Exception
      *             the exception
      */
@@ -250,8 +249,8 @@ public class EntryEditorTest
         entryEditorBot.getAttributeValues().contains( "uid: bjensen" );
 
         // assert pasted value was written to directory
-        ClonedServerEntry entry = ldapServer.getDirectoryService().getAdminSession().lookup(
-            new LdapDN( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" ) );
+        Entry entry = ldapServer.getDirectoryService().getAdminSession()
+            .lookup( new DN( "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\",ou=users,ou=system" ) );
         assertTrue( entry.contains( "uid", "bjensen" ) );
     }
 

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java?rev=1035586&r1=1035585&r2=1035586&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java (original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ImportExportTest.java Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -32,13 +32,14 @@ import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifFiles;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifFiles;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.test.integration.ui.bots.BrowserViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot;
@@ -55,18 +56,17 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the import and export (LDIF, DSML).
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.SUITE)
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
 @ApplyLdifFiles(
-    { "ImportExportTest.ldif" })
-public class ImportExportTest
+    { "org/apache/directory/studio/test/integration/ui/ImportExportTest.ldif" })
+public class ImportExportTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     private StudioBot studioBot;
     private ConnectionsViewBot connectionsViewBot;
     private BrowserViewBot browserViewBot;
@@ -92,12 +92,12 @@ public class ImportExportTest
 
     /**
      * Test for DIRSTUDIO-395.
-     * 
+     *
      * <li>export an entry with German umlaut in DN to LDIF</li> <li>verify that
      * exported LDIF starts with the Base64 encoded DN</li> <li>delete the entry
      * </li> <li>import the exported LDIF</li> <li>verify that entry with umlaut
      * exists</li>
-     * 
+     *
      * @throws Exception
      *             the exception
      */
@@ -143,12 +143,12 @@ public class ImportExportTest
 
     /**
      * Test for DIRSTUDIO-395.
-     * 
+     *
      * <li>export an entry with German umlaut in DN to DSML</li> <li>verify that
      * exported DSML starts with the Base64 encoded DN</li> <li>delete the entry
      * </li> <li>import the exported DSML</li> <li>verify that entry with umlaut
      * exists</li>
-     * 
+     *
      * @throws Exception
      *             the exception
      */
@@ -171,8 +171,8 @@ public class ImportExportTest
 
         // verify that exported DSML contains the Base64 encoded DN
         String content = FileUtils.readFileToString( new File( file ), "UTF-8" );
-        assertTrue( "DSML must contain DN with umlaut.", content
-            .contains( "dn=\"cn=Wolfgang K\u00f6lbel,ou=users,ou=system\"" ) );
+        assertTrue( "DSML must contain DN with umlaut.",
+            content.contains( "dn=\"cn=Wolfgang K\u00f6lbel,ou=users,ou=system\"" ) );
 
         // delete entry
         DeleteDialogBot dialogBot = browserViewBot.openDeleteDialog();
@@ -193,10 +193,10 @@ public class ImportExportTest
 
     /**
      * Test for DIRSTUDIO-465.
-     * 
-     * Import a new context entry must refresh the root DSE and 
+     *
+     * Import a new context entry must refresh the root DSE and
      * show the new context entry in the LDAP Browser view.
-     * 
+     *
      * @throws Exception
      *             the exception
      */
@@ -206,7 +206,7 @@ public class ImportExportTest
         // add a new partition
         Partition partition = new JdbmPartition();
         partition.setId( "example" );
-        partition.setSuffix( "dc=example,dc=com" );
+        partition.setSuffix( new DN( "dc=example,dc=com" ) );
         ldapServer.getDirectoryService().addPartition( partition );
 
         // refresh root DSE and ensure that the partition is in root DSE
@@ -233,7 +233,7 @@ public class ImportExportTest
 
     /**
      * Test for DIRSTUDIO-489.
-     * 
+     *
      * Verify that there are no UI updates when importing an LDIF.
      *
      * @throws Exception
@@ -261,7 +261,7 @@ public class ImportExportTest
 
         browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "uid=User.1" );
 
-        // verify that only three two events were fired between Import 
+        // verify that only three two events were fired between Import
         long fireCount = fireCount1 - fireCount0;
         assertEquals( "Only 2 event firings expected when importing LDIF.", 2, fireCount );
     }

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=1035586&r1=1035585&r2=1035586&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 Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -45,17 +45,16 @@ import java.util.List;
 
 import javax.security.auth.x500.X500Principal;
 
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.entry.client.ClientModification;
-import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.message.ModifyRequest;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionManager;
@@ -75,16 +74,15 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the new connection wizard.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.CLASS)
-public class NewConnectionWizardTest
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+public class NewConnectionWizardTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-    public static LdapServer ldapsService;
     private File ksFile;
 
     private StudioBot studioBot;
@@ -96,17 +94,17 @@ public class NewConnectionWizardTest
     public void setUpLdaps() throws Exception
     {
         // TODO: setup LDAPS
-//        if ( ldapsService == null )
-//        {
-//            ldapsService = new LdapServer();
-//            ldapsService.setDirectoryService( ldapService.getDirectoryService() );
-//            int port = AvailablePortFinder.getNextAvailable( ldapService.getPort() + 10 );
-//            ldapsService.setTcpTransport( new TcpTransport( port ) );
-//            ldapsService.setEnabled( true );
-//            ldapsService.setEnableLdaps( true );
-//            ldapsService.setConfidentialityRequired( true );
-//            ldapsService.start();
-//        }
+        //        if ( ldapsService == null )
+        //        {
+        //            ldapsService = new LdapServer();
+        //            ldapsService.setDirectoryService( ldapService.getDirectoryService() );
+        //            int port = AvailablePortFinder.getNextAvailable( ldapService.getPort() + 10 );
+        //            ldapsService.setTcpTransport( new TcpTransport( port ) );
+        //            ldapsService.setEnabled( true );
+        //            ldapsService.setEnableLdaps( true );
+        //            ldapsService.setConfidentialityRequired( true );
+        //            ldapsService.start();
+        //        }
     }
 
 
@@ -231,7 +229,7 @@ public class NewConnectionWizardTest
         assertFalse( wizardBot.isFinishButtonEnabled() );
         assertTrue( wizardBot.isCancelButtonEnabled() );
 
-        // enter user again 
+        // enter user again
         wizardBot.typeUser( "uid=admin,ou=system" );
         // ensure "<Back" is enabled, "Next >" and "Finish" is enabled
         assertTrue( wizardBot.isBackButtonEnabled() );
@@ -413,17 +411,17 @@ public class NewConnectionWizardTest
 
         // disabled this test because it does not work properly
         // as it depends from the network connection settings.
-//        // enter connection parameter with non-routed IP address
-//        String ipAddress = "10.11.12.13";
-//        wizardBot.typeHost( ipAddress );
-//        wizardBot.typePort( ldapServer.getPort() );
-//
-//        // click "Check Network Parameter" button and get the result
-//        String result3 = wizardBot.clickCheckNetworkParameterButton();
-//        assertNotNull( "Expected Error", result3 );
-//        assertTrue( "'No route to host' or 'Network is unreachable' message must occur in error message", //
-//            result3.contains( "No route to host" ) || result3.contains( "Network is unreachable" ) );
-//        assertTrue( "IP address must occur in error message", result3.contains( ipAddress ) );
+        //        // enter connection parameter with non-routed IP address
+        //        String ipAddress = "10.11.12.13";
+        //        wizardBot.typeHost( ipAddress );
+        //        wizardBot.typePort( ldapServer.getPort() );
+        //
+        //        // click "Check Network Parameter" button and get the result
+        //        String result3 = wizardBot.clickCheckNetworkParameterButton();
+        //        assertNotNull( "Expected Error", result3 );
+        //        assertTrue( "'No route to host' or 'Network is unreachable' message must occur in error message", //
+        //            result3.contains( "No route to host" ) || result3.contains( "Network is unreachable" ) );
+        //        assertTrue( "IP address must occur in error message", result3.contains( ipAddress ) );
 
         wizardBot.clickCancelButton();
     }
@@ -479,15 +477,16 @@ public class NewConnectionWizardTest
 
 
     /**
-     * Tests StartTLS with an valid certificate. This is simulated 
+     * Tests StartTLS with an valid certificate. This is simulated
      * by putting the self-signed certificate into a temporary key store
      * and using this key store for JNDI
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateValidationOK() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=localhost", "cn=localhost", startDate, endDate );
@@ -527,10 +526,11 @@ public class NewConnectionWizardTest
      * Tests StartTLS with an expired certificate.
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateValidationExpired() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         updateCertificate( "cn=localhost", "cn=localhost", startDate, endDate );
@@ -562,10 +562,11 @@ public class NewConnectionWizardTest
      * Tests SSL with an not yet valid certificate.
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateValidationNotYetValid() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS + YEAR_MILLIS );
         updateCertificate( "cn=localhost", "cn=localhost", startDate, endDate );
@@ -597,10 +598,11 @@ public class NewConnectionWizardTest
      * Tests StartTLS with an invalid certificate (unknown issuer).
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateValidationIssuerUnknown() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost", startDate, endDate );
@@ -633,10 +635,11 @@ public class NewConnectionWizardTest
      * doesn't match the server's host name (localhost)
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateValidationHostnameMismatch() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=ldap.example.com", startDate, endDate );
@@ -674,10 +677,11 @@ public class NewConnectionWizardTest
      * @throws Exception
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateDontTrust() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost", startDate, endDate );
@@ -741,10 +745,11 @@ public class NewConnectionWizardTest
      * @throws Exception
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateTrustTemporary() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost2", startDate, endDate );
@@ -787,10 +792,11 @@ public class NewConnectionWizardTest
      * @throws Exception
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testStartTlsCertificateTrustPermanent() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost3", startDate, endDate );
@@ -824,15 +830,16 @@ public class NewConnectionWizardTest
 
 
     /**
-     * Tests ldaps:// with an valid certificate. This is simulated 
+     * Tests ldaps:// with an valid certificate. This is simulated
      * by putting the self-signed certificate into a temporary key store
      * and using this key store for JNDI
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testLdapsCertificateValidationOK() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=localhost", "cn=localhost", startDate, endDate );
@@ -848,7 +855,7 @@ public class NewConnectionWizardTest
         // enter connection parameter and authentication parameter
         wizardBot.typeConnectionName( "NewConnectionWizardTest" );
         wizardBot.typeHost( "localhost" );
-        wizardBot.typePort( ldapsService.getPort() );
+        wizardBot.typePort( ldapServer.getPortSSL() );
         wizardBot.selectLdapsEncryption();
         wizardBot.clickNextButton();
         wizardBot.typeUser( "uid=admin,ou=system" );
@@ -863,10 +870,11 @@ public class NewConnectionWizardTest
 
 
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testLdapsCertificateValidationNotOK() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS + YEAR_MILLIS );
         updateCertificate( "cn=localhost", "cn=localhost", startDate, endDate );
@@ -874,7 +882,7 @@ public class NewConnectionWizardTest
         // enter connection parameter and authentication parameter
         wizardBot.typeConnectionName( "NewConnectionWizardTest" );
         wizardBot.typeHost( "localhost" );
-        wizardBot.typePort( ldapsService.getPort() );
+        wizardBot.typePort( ldapServer.getPortSSL() );
         wizardBot.selectLdapsEncryption();
         wizardBot.clickNextButton();
         wizardBot.typeUser( "uid=admin,ou=system" );
@@ -904,10 +912,11 @@ public class NewConnectionWizardTest
      * @throws Exception
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testLdapsCertificateDontTrust() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost4", startDate, endDate );
@@ -915,7 +924,7 @@ public class NewConnectionWizardTest
         // enter connection parameter and authentication parameter
         wizardBot.typeConnectionName( "NewConnectionWizardTest" );
         wizardBot.typeHost( "localhost" );
-        wizardBot.typePort( ldapsService.getPort() );
+        wizardBot.typePort( ldapServer.getPortSSL() );
         wizardBot.selectLdapsEncryption();
         wizardBot.clickNextButton();
         wizardBot.typeUser( "uid=admin,ou=system" );
@@ -962,10 +971,11 @@ public class NewConnectionWizardTest
      * @throws Exception
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testLdapsCertificateTrustTemporary() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost5", startDate, endDate );
@@ -973,7 +983,7 @@ public class NewConnectionWizardTest
         // enter connection parameter and authentication parameter
         wizardBot.typeConnectionName( "NewConnectionWizardTest" );
         wizardBot.typeHost( "localhost" );
-        wizardBot.typePort( ldapsService.getPort() );
+        wizardBot.typePort( ldapServer.getPortSSL() );
         wizardBot.selectLdapsEncryption();
         wizardBot.clickNextButton();
         wizardBot.typeUser( "uid=admin,ou=system" );
@@ -1008,10 +1018,11 @@ public class NewConnectionWizardTest
      * @throws Exception
      */
     @Test
-    @Ignore // till DIRSERVER-1373 is fixed
+    @Ignore
+    // till DIRSERVER-1373 is fixed
     public void testLdapsCertificateTrustPermanent() throws Exception
     {
-        // prepare certificate 
+        // prepare certificate
         Date startDate = new Date( System.currentTimeMillis() - YEAR_MILLIS );
         Date endDate = new Date( System.currentTimeMillis() + YEAR_MILLIS );
         updateCertificate( "cn=TheUnknownStuntman", "cn=localhost6", startDate, endDate );
@@ -1019,7 +1030,7 @@ public class NewConnectionWizardTest
         // enter connection parameter and authentication parameter
         wizardBot.typeConnectionName( "NewConnectionWizardTest" );
         wizardBot.typeHost( "localhost" );
-        wizardBot.typePort( ldapsService.getPort() );
+        wizardBot.typePort( ldapServer.getPortSSL() );
         wizardBot.selectLdapsEncryption();
         wizardBot.clickNextButton();
         wizardBot.typeUser( "uid=admin,ou=system" );
@@ -1046,18 +1057,18 @@ public class NewConnectionWizardTest
         wizardBot.clickCancelButton();
     }
 
-    /* 
+    /*
      * Eventually we have to make several of these parameters configurable,
      * however note to pass export restrictions we must use a key size of
      * 512 or less here as the default.  Users can configure this setting
-     * later based on their own legal situations.  This is required to 
+     * later based on their own legal situations.  This is required to
      * classify ApacheDS in the ECCN 5D002 category.  Please see the following
      * page for more information:
-     * 
+     *
      *    http://www.apache.org/dev/crypto.html
-     * 
+     *
      * Also ApacheDS must be classified on the following page:
-     * 
+     *
      *    http://www.apache.org/licenses/exports
      */
     private static final int KEY_SIZE = 512;
@@ -1072,16 +1083,16 @@ public class NewConnectionWizardTest
 
 
     /**
-     * 
+     *
      */
     private void updateCertificate( String issuerDN, String subjectDN, Date startDate, Date expiryDate )
         throws Exception
     {
-        LdapDN dn = new LdapDN( PRINCIPAL );
+        DN dn = new DN( PRINCIPAL );
         List<Modification> modifications = new ArrayList<Modification>();
 
         // Get old key algorithm
-        ClonedServerEntry entry = ldapServer.getDirectoryService().getAdminSession().lookup( dn );
+        Entry entry = ldapServer.getDirectoryService().getAdminSession().lookup( dn );
         String keyAlgo = entry.get( KEY_ALGORITHM_AT ).getString();
 
         // Generate key pair
@@ -1089,19 +1100,11 @@ public class NewConnectionWizardTest
         generator.initialize( KEY_SIZE );
         KeyPair keypair = generator.genKeyPair();
 
-        // Generate the private key attributes 
+        // Generate the private key attributes
         PrivateKey privateKey = keypair.getPrivate();
-        modifications.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultClientAttribute(
-            PRIVATE_KEY_AT, privateKey.getEncoded() ) ) );
-        modifications.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultClientAttribute(
-            PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() ) ) );
 
         // Generate public key
         PublicKey publicKey = keypair.getPublic();
-        modifications.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultClientAttribute(
-            PUBLIC_KEY_AT, publicKey.getEncoded() ) ) );
-        modifications.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultClientAttribute(
-            PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() ) ) );
 
         // Generate the self-signed certificate
         BigInteger serialNumber = BigInteger.valueOf( System.currentTimeMillis() );
@@ -1116,12 +1119,17 @@ public class NewConnectionWizardTest
         certGen.setPublicKey( publicKey );
         certGen.setSignatureAlgorithm( "SHA1With" + keyAlgo );
         X509Certificate cert = certGen.generate( privateKey, "BC" );
-        modifications.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultClientAttribute(
-            USER_CERTIFICATE_AT, cert.getEncoded() ) ) );
 
         // Write the modifications
+        ModifyRequest request = new ModifyRequestImpl();
+        request.setName( dn );
+        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
+        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
+        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
+        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
+        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
         ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );
-        
+
         // TODO: activate when DIRSERVER-1373 is fixed
         //ldapService.reloadSslContext();
         //ldapsService.reloadSslContext();
@@ -1137,7 +1145,7 @@ public class NewConnectionWizardTest
         ksFile = File.createTempFile( "testStore", "ks" );
 
         CoreSession session = ldapServer.getDirectoryService().getAdminSession();
-        ClonedServerEntry entry = session.lookup( new LdapDN( "uid=admin,ou=system" ), new String[]
+        Entry entry = session.lookup( new DN( "uid=admin,ou=system" ), new String[]
             { USER_CERTIFICATE_AT } );
         byte[] userCertificate = entry.get( USER_CERTIFICATE_AT ).getBytes();
         assertNotNull( userCertificate );

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=1035586&r1=1035585&r2=1035586&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 Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -25,13 +25,13 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
 
-import org.apache.directory.server.core.entry.DefaultServerEntry;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
@@ -50,16 +50,15 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the new entry wizard.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.SUITE)
-public class NewEntryWizardTest
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+public class NewEntryWizardTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     private StudioBot studioBot;
     private ConnectionsViewBot connectionsViewBot;
     private BrowserViewBot browserViewBot;
@@ -77,8 +76,8 @@ public class NewEntryWizardTest
         ApacheDsUtils.enableSchema( ldapServer, "nis" );
 
         // create referral entry
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=referral,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        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" );
@@ -187,7 +186,7 @@ public class NewEntryWizardTest
 
     /**
      * Test for DIRSTUDIO-350.
-     * 
+     *
      * Create entries with upper case attribute types and ensures that the
      * retrieved entries still are in upper case.
      */
@@ -226,8 +225,8 @@ public class NewEntryWizardTest
 
         wizardBot.setRdnType( 1, "O" );
         wizardBot.setRdnValue( 1, "testCreateOrganizationEntry2" );
-        assertEquals( "O=testCreateOrganizationEntry2,O=testCreateOrganizationEntry,ou=system", wizardBot
-            .getDnPreview() );
+        assertEquals( "O=testCreateOrganizationEntry2,O=testCreateOrganizationEntry,ou=system",
+            wizardBot.getDnPreview() );
         wizardBot.clickNextButton();
 
         wizardBot.clickFinishButton();
@@ -241,7 +240,7 @@ public class NewEntryWizardTest
 
     /**
      * Test for DIRSTUDIO-360.
-     * 
+     *
      * Create entries with a slash '/' in the RDN value.
      */
     @Test
@@ -308,7 +307,7 @@ public class NewEntryWizardTest
 
         // click cancel button, check the wizard is not closed
         referralDialogBot.clickCancelButton();
-        // timing issues, use ugly sleep for now, should use some condition but have no idea. 
+        // timing issues, use ugly sleep for now, should use some condition but have no idea.
         SWTUtils.sleep( 1000 );
         assertTrue( wizardBot.isVisible() );
         assertTrue( wizardBot.isFinishButtonEnabled() );
@@ -364,7 +363,7 @@ public class NewEntryWizardTest
 
     /**
      * Test for DIRSTUDIO-589, DIRSTUDIO-591, DIRSHARED-38.
-     * 
+     *
      * Create an entry with sharp in DN: cn=\#123456.
      */
     @Test
@@ -394,7 +393,7 @@ public class NewEntryWizardTest
 
     /**
      * Test for DIRSTUDIO-603, DIRSHARED-41.
-     * 
+     *
      * Create an entry with multi-valued RDN and numeric OID (IP address) in RDN value.
      */
     @Test

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java?rev=1035586&r1=1035585&r2=1035586&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java (original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/PreferencesTest.java Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -29,10 +29,8 @@ import java.net.URL;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.studio.test.integration.ui.bots.CertificateValidationPreferencePageBot;
 import org.apache.directory.studio.test.integration.ui.bots.PreferencesBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
@@ -45,16 +43,13 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the preferences.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.SUITE)
-public class PreferencesTest
+@RunWith(FrameworkRunner.class)
+public class PreferencesTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     private StudioBot studioBot;
 
 
@@ -73,7 +68,7 @@ public class PreferencesTest
 
 
     /**
-     * Test for DIRSTUDIO-580 
+     * Test for DIRSTUDIO-580
      * (Setting "Validate certificates for secure LDAP connections" is not saved).
      *
      * @throws Exception

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=1035586&r1=1035585&r2=1035586&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 Tue Nov 16 11:03:12 2010
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.studio.test.integration.ui;
@@ -25,13 +25,13 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
 
-import org.apache.directory.server.core.entry.DefaultServerEntry;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
@@ -47,16 +47,15 @@ import org.junit.runner.RunWith;
 
 /**
  * Tests the referral dialog.
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith(SiRunner.class)
-@CleanupLevel(Level.SUITE)
-public class ReferralDialogTest
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+public class ReferralDialogTest extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     private StudioBot studioBot;
     private ConnectionsViewBot connectionsViewBot;
     private BrowserViewBot browserViewBot;
@@ -78,8 +77,8 @@ public class ReferralDialogTest
         browserViewBot = studioBot.getBrowserView();
 
         // create referral entry
-        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
-        entry.setDn( new LdapDN( "cn=referralDialogTest,ou=system" ) );
+        Entry entry = new DefaultEntry( service.getSchemaManager() );
+        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" );
@@ -105,7 +104,7 @@ public class ReferralDialogTest
 
     /**
      * Test for DIRSTUDIO-343.
-     * 
+     *
      * Follows a continuation reference.
      */
     @Test
@@ -133,7 +132,7 @@ public class ReferralDialogTest
 
     /**
      * Test for DIRSTUDIO-343.
-     * 
+     *
      * Does not follow a continuation reference by clicking the cancel button in
      * the referral dialog.
      */



Mime
View raw message