diff options
Diffstat (limited to 'tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SchemaEditorTest.java')
-rw-r--r-- | tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SchemaEditorTest.java | 105 |
1 files changed, 68 insertions, 37 deletions
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SchemaEditorTest.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SchemaEditorTest.java index c83e14a5c..e672ffa8b 100644 --- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SchemaEditorTest.java +++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/SchemaEditorTest.java @@ -24,32 +24,26 @@ package org.apache.directory.studio.test.integration.ui; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; -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.studio.connection.core.Connection; +import org.apache.directory.studio.test.integration.junit5.LdapServerType; +import org.apache.directory.studio.test.integration.junit5.LdapServersSource; +import org.apache.directory.studio.test.integration.junit5.TestLdapServer; import org.apache.directory.studio.test.integration.ui.bots.AttributeTypeEditorBot; -import org.apache.directory.studio.test.integration.ui.bots.ConnectionsViewBot; import org.apache.directory.studio.test.integration.ui.bots.NewSchemaProjectWizardBot; import org.apache.directory.studio.test.integration.ui.bots.ObjectClassEditorBot; import org.apache.directory.studio.test.integration.ui.bots.SchemaEditorBot; import org.apache.directory.studio.test.integration.ui.bots.SchemaProjectsViewBot; import org.apache.directory.studio.test.integration.ui.bots.SchemaSearchViewBot; import org.apache.directory.studio.test.integration.ui.bots.SchemaViewBot; -import org.apache.directory.studio.test.integration.ui.bots.StudioBot; -import org.apache.directory.studio.test.integration.ui.bots.utils.Assertions; -import org.apache.directory.studio.test.integration.ui.bots.utils.FrameworkRunnerWithScreenshotCaptureListener; -import org.apache.directory.studio.test.integration.ui.bots.utils.StudioSystemUtils; -import org.junit.After; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; /** @@ -58,35 +52,24 @@ import org.junit.runner.RunWith; * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> * @version $Rev$, $Date$ */ -@RunWith(FrameworkRunnerWithScreenshotCaptureListener.class) -@CreateLdapServer(transports = - { @CreateTransport(protocol = "LDAP") }) -public class SchemaEditorTest extends AbstractLdapTestUnit +public class SchemaEditorTest extends AbstractTestBase { - private StudioBot studioBot; private SchemaProjectsViewBot projectsView; private SchemaViewBot schemaView; - private ConnectionsViewBot connectionsViewBot; - private Connection connection; - - @Before + @BeforeEach public void setUp() throws Exception { - studioBot = new StudioBot(); studioBot.resetSchemaPerspective(); projectsView = studioBot.getSchemaProjectsView(); schemaView = studioBot.getSchemaView(); - connectionsViewBot = studioBot.getConnectionView(); } - @After + @AfterEach public void tearDown() throws Exception { - connectionsViewBot.deleteTestConnections(); projectsView.deleteAllProjects(); - Assertions.genericTearDownAssertions(); } @@ -96,11 +79,6 @@ public class SchemaEditorTest extends AbstractLdapTestUnit @Test public void testSearchForAliases() throws Exception { - /* - * This test fails on Jenkins Windows Server, to be investigated... - */ - // Assume.assumeFalse( StudioSystemUtils.IS_OS_WINDOWS_SERVER ); - createProject( "Project Search For Aliases" ); SchemaSearchViewBot searchView = studioBot.getSchemaSearchView(); @@ -182,11 +160,12 @@ public class SchemaEditorTest extends AbstractLdapTestUnit } - @Test - public void testCreateSchemaOnlineApacheDS() throws Exception + @ParameterizedTest + @LdapServersSource(only = LdapServerType.ApacheDS, reason = "ApacheDS specific test") + public void testCreateSchemaOnlineApacheDS( TestLdapServer server ) throws Exception { studioBot.resetLdapPerspective(); - connection = connectionsViewBot.createTestConnection( "SchemaEditorTest", ldapServer.getPort() ); + Connection connection = connectionsViewBot.createTestConnection( server ); studioBot.resetSchemaPerspective(); SchemaProjectsViewBot projectsView = studioBot.getSchemaProjectsView(); @@ -213,6 +192,58 @@ public class SchemaEditorTest extends AbstractLdapTestUnit } + @ParameterizedTest + @LdapServersSource(only = LdapServerType.OpenLdap, reason = "OpenLDAP specific test") + public void testCreateSchemaOnlineOpenLDAP( TestLdapServer server ) throws Exception + { + studioBot.resetLdapPerspective(); + Connection connection = connectionsViewBot.createTestConnection( server ); + studioBot.resetSchemaPerspective(); + + SchemaProjectsViewBot projectsView = studioBot.getSchemaProjectsView(); + NewSchemaProjectWizardBot wizard = projectsView.openNewSchemaProjectWizard(); + wizard.typeProjectName( "Project Online OpenLDAP" ); + wizard.selectOnlineSchema(); + wizard.clickNextButton(); + wizard.selectConnection( connection.getName() ); + wizard.clickFinishButton(); + + assertTrue( schemaView.existsSchema( "schema" ) ); + + assertTrue( schemaView.existsObjectClass( "schema", "top" ) ); + assertTrue( schemaView.existsObjectClass( "schema", "olcGlobal" ) ); + + assertTrue( schemaView.existsAttributeType( "schema", "objectClass" ) ); + assertTrue( schemaView.existsAttributeType( "schema", "olcBackend" ) ); + } + + + @ParameterizedTest + @LdapServersSource(only = LdapServerType.Fedora389ds, reason = "389ds specific test") + public void testCreateSchemaOnline389ds( TestLdapServer server ) throws Exception + { + studioBot.resetLdapPerspective(); + Connection connection = connectionsViewBot.createTestConnection( server ); + studioBot.resetSchemaPerspective(); + + SchemaProjectsViewBot projectsView = studioBot.getSchemaProjectsView(); + NewSchemaProjectWizardBot wizard = projectsView.openNewSchemaProjectWizard(); + wizard.typeProjectName( "Project Online 389ds" ); + wizard.selectOnlineSchema(); + wizard.clickNextButton(); + wizard.selectConnection( connection.getName() ); + wizard.clickFinishButton(); + + assertTrue( schemaView.existsSchema( "schema" ) ); + + assertTrue( schemaView.existsObjectClass( "schema", "top" ) ); + assertTrue( schemaView.existsObjectClass( "schema", "nsConfig" ) ); + + assertTrue( schemaView.existsAttributeType( "schema", "objectClass" ) ); + assertTrue( schemaView.existsAttributeType( "schema", "nsBaseDN" ) ); + } + + @Test public void testOpenObjectClassEditor() throws Exception { |