You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2017/08/16 12:27:49 UTC
svn commit: r1805184 - in /directory/studio/trunk:
plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/
tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/
tests/te...
Author: seelmann
Date: Wed Aug 16 12:27:49 2017
New Revision: 1805184
URL: http://svn.apache.org/viewvc?rev=1805184&view=rev
Log:
DIRSTUDIO-1120: Fix type. Use constants instead of repeating strings. Add test.
Modified:
directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/LdapLdapsServersPage.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/ApacheDSConfigurationEditorBot.java
Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/LdapLdapsServersPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/LdapLdapsServersPage.java?rev=1805184&r1=1805183&r2=1805184&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/LdapLdapsServersPage.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/LdapLdapsServersPage.java Wed Aug 16 12:27:49 2017
@@ -1010,7 +1010,7 @@ public class LdapLdapsServersPage extend
{
public void widgetSelected( SelectionEvent e )
{
- setProtocol( sslv3Checkbox.getSelection(), "SSLv3" );
+ setProtocol( sslv3Checkbox.getSelection(), SSL_V3 );
}
};
@@ -1022,7 +1022,7 @@ public class LdapLdapsServersPage extend
{
public void widgetSelected( SelectionEvent e )
{
- setProtocol( tlsv1_0Checkbox.getSelection(), "TLSv1" );
+ setProtocol( tlsv1_0Checkbox.getSelection(), TLS_V1_0 );
}
};
@@ -1034,7 +1034,7 @@ public class LdapLdapsServersPage extend
{
public void widgetSelected( SelectionEvent e )
{
- setProtocol( tlsv1_1Checkbox.getSelection(), "TLSv1.1" );
+ setProtocol( tlsv1_1Checkbox.getSelection(), TLS_V1_1 );
}
};
@@ -1046,7 +1046,7 @@ public class LdapLdapsServersPage extend
{
public void widgetSelected( SelectionEvent e )
{
- setProtocol( tlsv1_2Checkbox.getSelection(), "TLvV1.2" );
+ setProtocol( tlsv1_2Checkbox.getSelection(), TLS_V1_2 );
}
};
@@ -1359,19 +1359,19 @@ public class LdapLdapsServersPage extend
// Enabled Protocols
// SSL V3
- sslv3Checkbox = toolkit.createButton( composite, "SSLv3", SWT.CHECK ); //$NON-NLS-1$
+ sslv3Checkbox = toolkit.createButton( composite, SSL_V3, SWT.CHECK ); //$NON-NLS-1$
sslv3Checkbox.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
// TLS 1.0
- tlsv1_0Checkbox = toolkit.createButton( composite, "TLSv1", SWT.CHECK ); //$NON-NLS-1$
+ tlsv1_0Checkbox = toolkit.createButton( composite, TLS_V1_0, SWT.CHECK ); //$NON-NLS-1$
tlsv1_0Checkbox.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
// TLS 1.1
- tlsv1_1Checkbox = toolkit.createButton( composite, "TLSv1.1", SWT.CHECK ); //$NON-NLS-1$
+ tlsv1_1Checkbox = toolkit.createButton( composite, TLS_V1_1, SWT.CHECK ); //$NON-NLS-1$
tlsv1_1Checkbox.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
// TLS 1.2
- tlsv1_2Checkbox = toolkit.createButton( composite, "TLSv1.2", SWT.CHECK ); //$NON-NLS-1$
+ tlsv1_2Checkbox = toolkit.createButton( composite, TLS_V1_2, SWT.CHECK ); //$NON-NLS-1$
tlsv1_2Checkbox.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
}
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=1805184&r1=1805183&r2=1805184&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 Wed Aug 16 12:27:49 2017
@@ -424,4 +424,44 @@ public class ApacheDSPluginTest
DeleteDialogBot deleteDialogBot = serversViewBot.openDeleteServerDialog();
deleteDialogBot.clickOkButton();
}
+
+
+ /**
+ * Test for DIRSTUDIO-1120: Checkbox active protocols
+ */
+ @Test
+ public void testSetEnabledProtocols() throws Exception
+ {
+ String serverName = "SetEnabledProtocols";
+ createServer( serverName );
+
+ ApacheDSConfigurationEditorBot editorBot = serversViewBot.openConfigurationEditor( serverName );
+
+ // assert not enabled yet
+ assertFalse( editorBot.isSSLv3Enabled() );
+ assertFalse( editorBot.isTLSv1Enabled() );
+ assertFalse( editorBot.isTLSv1_1Enabled() );
+ assertFalse( editorBot.isTLSv1_2Enabled() );
+
+ // enable
+ editorBot.enableSSLv3();
+ editorBot.enableTLSv1();
+ editorBot.enableTLSv1_1();
+ editorBot.enableTLSv1_2();
+ editorBot.save();
+ editorBot.close();
+
+ // re-open and assert enabled
+ editorBot = serversViewBot.openConfigurationEditor( serverName );
+ assertTrue( editorBot.isSSLv3Enabled() );
+ assertTrue( editorBot.isTLSv1Enabled() );
+ assertTrue( editorBot.isTLSv1_1Enabled() );
+ assertTrue( editorBot.isTLSv1_2Enabled() );
+ editorBot.close();
+
+ // Deleting the server
+ DeleteDialogBot deleteDialogBot = serversViewBot.openDeleteServerDialog();
+ deleteDialogBot.clickOkButton();
+ }
+
}
Modified: directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.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/ApacheDSConfigurationEditorBot.java?rev=1805184&r1=1805183&r2=1805184&view=diff
==============================================================================
--- directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.java (original)
+++ directory/studio/trunk/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ApacheDSConfigurationEditorBot.java Wed Aug 16 12:27:49 2017
@@ -145,6 +145,62 @@ public class ApacheDSConfigurationEditor
}
+ public void enableSSLv3()
+ {
+ activateLdapLdapsServersPage();
+ editor.bot().checkBox( 5 ).select();
+ }
+
+
+ public boolean isSSLv3Enabled()
+ {
+ activateLdapLdapsServersPage();
+ return editor.bot().checkBox( 5 ).isChecked();
+ }
+
+
+ public void enableTLSv1()
+ {
+ activateLdapLdapsServersPage();
+ editor.bot().checkBox( 6 ).select();
+ }
+
+
+ public boolean isTLSv1Enabled()
+ {
+ activateLdapLdapsServersPage();
+ return editor.bot().checkBox( 6 ).isChecked();
+ }
+
+
+ public void enableTLSv1_1()
+ {
+ activateLdapLdapsServersPage();
+ editor.bot().checkBox( 7 ).select();
+ }
+
+
+ public boolean isTLSv1_1Enabled()
+ {
+ activateLdapLdapsServersPage();
+ return editor.bot().checkBox( 7 ).isChecked();
+ }
+
+
+ public void enableTLSv1_2()
+ {
+ activateLdapLdapsServersPage();
+ editor.bot().checkBox( 8 ).select();
+ }
+
+
+ public boolean isTLSv1_2Enabled()
+ {
+ activateLdapLdapsServersPage();
+ return editor.bot().checkBox( 8 ).isChecked();
+ }
+
+
public void setSaslHost( String saslHost )
{
activateLdapLdapsServersPage();