directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1718178 - in /directory/studio/trunk: plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ ...
Date Sun, 06 Dec 2015 14:03:01 GMT
Author: seelmann
Date: Sun Dec  6 14:03:01 2015
New Revision: 1718178

URL: http://svn.apache.org/viewvc?rev=1718178&view=rev
Log:
DIRSTUDIO-1077 (Logging for embedded ApacheDS servers broken, log4j.properties is deleted):
* Don't delete whole conf directory but only ou=config and ou=config.ldif
* Check for log output in console to verify logging configuration still works

Added:
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConsoleViewBot.java
  (with props)
Modified:
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDS2ConfigurationPluginConstants.java
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorUtils.java
    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/bots/ShowViewsBot.java
    directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDS2ConfigurationPluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDS2ConfigurationPluginConstants.java?rev=1718178&r1=1718177&r2=1718178&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDS2ConfigurationPluginConstants.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDS2ConfigurationPluginConstants.java
Sun Dec  6 14:03:01 2015
@@ -50,5 +50,6 @@ public interface ApacheDS2ConfigurationP
     String IMG_VERTICAL_ORIENTATION = "resources/icons/vertical_orientation.gif"; //$NON-NLS-1$
 
     String CONFIG_LDIF = "config.ldif"; //$NON-NLS-1$
+    String OU_CONFIG = "ou=config"; //$NON-NLS-1$
     String OU_CONFIG_LDIF = "ou=config.ldif"; //$NON-NLS-1$
 }

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorUtils.java?rev=1718178&r1=1718177&r2=1718178&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorUtils.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorUtils.java
Sun Dec  6 14:03:01 2015
@@ -407,16 +407,19 @@ public class ServerConfigurationEditorUt
         {
             // create partiton
             AbstractLdifPartition configPartition;
-            
+
             if ( file.getName().equals( ApacheDS2ConfigurationPluginConstants.OU_CONFIG_LDIF
) )
             {
                 File confDir = file.getParentFile();
-                
-                if ( file.exists() )
+                File ouConfigLdifFile = new File( confDir, ApacheDS2ConfigurationPluginConstants.OU_CONFIG_LDIF
);
+                File ouConfigDir = new File( confDir, ApacheDS2ConfigurationPluginConstants.OU_CONFIG
);
+
+                if ( ouConfigLdifFile.exists() && ouConfigDir.exists() )
                 {
-                    FileUtils.deleteDirectory( confDir );
+                    ouConfigLdifFile.delete();
+                    FileUtils.deleteDirectory( ouConfigDir );
                 }
-                
+
                 configPartition = createMultiFileConfiguration( confDir, schemaManager, dnFactory,
cacheService );
             }
             else

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=1718178&r1=1718177&r2=1718178&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
Sun Dec  6 14:03:01 2015
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.test.integration.ui;
 
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -35,6 +37,7 @@ import org.apache.directory.studio.test.
 import org.apache.directory.studio.test.integration.ui.bots.ApacheDSServersViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.ConnectionFromServerDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot;
+import org.apache.directory.studio.test.integration.ui.bots.ConsoleViewBot;
 import org.apache.directory.studio.test.integration.ui.bots.DeleteDialogBot;
 import org.apache.directory.studio.test.integration.ui.bots.NewApacheDSServerWizardBot;
 import org.apache.directory.studio.test.integration.ui.bots.StudioBot;
@@ -57,6 +60,7 @@ public class ApacheDSPluginTest
     private StudioBot studioBot;
     private ApacheDSServersViewBot serversViewBot;
     private ConnectionsViewBot connectionsViewBot;
+    private ConsoleViewBot consoleViewBot;
 
 
     @Before
@@ -66,6 +70,7 @@ public class ApacheDSPluginTest
         studioBot.resetLdapPerspective();
         serversViewBot = studioBot.getApacheDSServersViewBot();
         connectionsViewBot = studioBot.getConnectionView();
+        consoleViewBot = studioBot.getConsoleView();
     }
 
 
@@ -90,6 +95,10 @@ public class ApacheDSPluginTest
         serversViewBot.runServer( serverName );
         serversViewBot.waitForServerStart( serverName );
 
+        // DIRSTUDIO-1077: Check for log output in console to verify logging configuration
still works
+        String consoleText = consoleViewBot.getConsoleText();
+        assertThat( consoleText, containsString( "You didn't change the admin password" )
);
+
         // Verifying the connections count is 0
         assertEquals( 0, getBrowserConnectionsCount() );
 

Added: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConsoleViewBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConsoleViewBot.java?rev=1718178&view=auto
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConsoleViewBot.java
(added)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConsoleViewBot.java
Sun Dec  6 14:03:01 2015
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  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.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.studio.test.integration.ui.bots;
+
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+
+
+public class ConsoleViewBot
+{
+    private SWTWorkbenchBot bot;
+    private SWTBotView view;
+
+
+    public ConsoleViewBot()
+    {
+        bot = new SWTWorkbenchBot();
+        view = bot.viewByPartName( "Console" );
+    }
+
+
+    public String getConsoleText()
+    {
+        view.show();
+        return view.bot().styledText().getText();
+    }
+
+}

Propchange: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ConsoleViewBot.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ShowViewsBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ShowViewsBot.java?rev=1718178&r1=1718177&r2=1718178&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ShowViewsBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ShowViewsBot.java
Sun Dec  6 14:03:01 2015
@@ -32,6 +32,12 @@ public class ShowViewsBot extends Dialog
     }
 
 
+    public void clickOkButton()
+    {
+        super.clickButton( "OK" );
+    }
+
+
     public boolean existsCategory( String category )
     {
         TreeBot treeBot = new TreeBot( bot.tree() );
@@ -44,4 +50,11 @@ public class ShowViewsBot extends Dialog
         TreeBot treeBot = new TreeBot( bot.tree() );
         return treeBot.exists( category, view );
     }
+
+
+    public void openView( String category, String view )
+    {
+        bot.tree().expandNode( category ).select( view );
+        clickOkButton();
+    }
 }

Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java?rev=1718178&r1=1718177&r2=1718178&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
(original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java
Sun Dec  6 14:03:01 2015
@@ -86,6 +86,14 @@ public class StudioBot
     }
 
 
+    public ConsoleViewBot getConsoleView()
+    {
+        ShowViewsBot showViewsBot = openShowViews();
+        showViewsBot.openView( "General", "Console" );
+        return new ConsoleViewBot();
+    }
+
+
     public void resetLdapPerspective()
     {
         resetPerspective( "org.apache.directory.studio.ldapbrowser.ui.perspective.BrowserPerspective"
);



Mime
View raw message