Skip to content

Commit

Permalink
support more than one configurators
Browse files Browse the repository at this point in the history
Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com>
  • Loading branch information
iliyan-velichkov committed Feb 5, 2025
1 parent f49fc1f commit 9deec8d
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
*/
package org.eclipse.dirigible.components.base.home;

import java.io.IOException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.dirigible.commons.config.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
* The Home Redirect.
Expand All @@ -34,7 +35,7 @@ class HomeRedirectEndpoint {
*/
@RequestMapping(path = {"/home", "/", ""})
void goHome(HttpServletRequest request, HttpServletResponse response) throws IOException {
String homeUrl = Configuration.get(DIRIGIBLE_HOME_URL);
String homeUrl = Configuration.get(DIRIGIBLE_HOME_URL, "services/web/shell-ide/");
response.sendRedirect(homeUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.eclipse.dirigible.integration.tests.ui.tests.UserInterfaceIntegrationTest;
import org.eclipse.dirigible.tests.logging.LogsAsserter;
import org.eclipse.dirigible.tests.restassured.RestAssuredExecutor;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -26,15 +27,23 @@

class CamelDirigibleJavaScriptComponentIT extends UserInterfaceIntegrationTest {

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

@Autowired
private RestAssuredExecutor restAssuredExecutor;

private LogsAsserter logsAsserter;

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void tearDown() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@BeforeEach
void setUp() {
this.logsAsserter = new LogsAsserter("CustomComponentLogger", Level.INFO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.eclipse.dirigible.integration.tests.ui.tests.UserInterfaceIntegrationTest;
import org.eclipse.dirigible.tests.logging.LogsAsserter;
import org.eclipse.dirigible.tests.restassured.RestAssuredExecutor;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -26,15 +27,23 @@

class CamelDirigibleTwoStepsJSInvokerIT extends UserInterfaceIntegrationTest {

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

@Autowired
private RestAssuredExecutor restAssuredExecutor;

private LogsAsserter logsAsserter;

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void tearDown() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@BeforeEach
void setUp() {
this.logsAsserter = new LogsAsserter("TwoStepsLogger", Level.INFO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.dirigible.tests.Workbench;
import org.eclipse.dirigible.tests.framework.HtmlElementType;
import org.eclipse.dirigible.tests.logging.LogsAsserter;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand All @@ -43,12 +44,21 @@ class BPMStarterTemplateIT extends UserInterfaceIntegrationTest {
"Hello World! Process variables: {param1=" + PARAM_1_VALUE + ", param2=" + PARAM_2_VALUE + ".0}";
private static final String TRIGGER_BUTTON_TEXT = "Trigger";

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

private LogsAsserter consoleLogAsserter;

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void tearDown() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@BeforeEach
void setUp() {
this.consoleLogAsserter = new LogsAsserter("app.out", Level.INFO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@
package org.eclipse.dirigible.integration.tests.ui.tests;

import org.eclipse.dirigible.commons.config.Configuration;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;

class CreateNewProjectIT extends UserInterfaceIntegrationTest {

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void tearDown() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@Test
void testCreateNewBlankProject() {
ide.createNewBlankProject("create-project-ui-test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.dirigible.tests.framework.HtmlElementType;
import org.eclipse.dirigible.tests.util.SecurityUtil;
import org.eclipse.dirigible.tests.util.SleepUtil;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -30,19 +31,26 @@ class CustomSecurityIT extends UserInterfaceIntegrationTest {
private static final String PROTECTED_PAGE_PATH = "/services/web/dirigible-test-project/security/protected_page.html";
private static final String PROTECTED_PAGE_HEADER = "This is a protected page";

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

@Autowired
private TestProject testProject;

@Autowired
private IDEFactory ideFactory;

@Autowired
private SecurityUtil securityUtil;

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void tearDown() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@BeforeEach
void setUp() {
testProject.publish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ void testOpenHomepage() {

browser.assertElementExistsByTypeAndText(HtmlElementType.SPAN, ECLIPSE_DIRIGIBLE_HEADER);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.dirigible.integration.tests.ui.TestProject;
import org.eclipse.dirigible.tests.restassured.RestAssuredExecutor;
import org.eclipse.dirigible.tests.util.PortUtil;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -35,7 +36,10 @@ class MailIT extends UserInterfaceIntegrationTest {
private static final String PASSWORD = "password";
private static final int PORT = PortUtil.getFreeRandomPort();

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

Expand All @@ -50,12 +54,16 @@ class MailIT extends UserInterfaceIntegrationTest {

@Autowired
private TestProject testProject;

@Autowired
private RestAssuredExecutor restAssuredExecutor;

private GreenMail greenMail;

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void cleanup() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@BeforeEach
void setUp() {
ServerSetup serverSetup = new ServerSetup(PORT, "localhost", "smtp");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.dirigible.tests.framework.Browser;
import org.eclipse.dirigible.tests.framework.BrowserFactory;
import org.eclipse.dirigible.tests.framework.HtmlElementType;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -26,7 +27,10 @@

class MultitenancyIT extends UserInterfaceIntegrationTest {

private static final String initialDirigibleHomeUrl;

static {
initialDirigibleHomeUrl = Configuration.get("DIRIGIBLE_HOME_URL");
Configuration.set("DIRIGIBLE_HOME_URL", "services/web/ide/");
}

Expand All @@ -38,6 +42,12 @@ class MultitenancyIT extends UserInterfaceIntegrationTest {
@Autowired
private BrowserFactory browserFactory;

// TODO - method to be removed once the test is adapted to the new UI
@AfterAll
public static void tearDown() {
Configuration.set("DIRIGIBLE_HOME_URL", initialDirigibleHomeUrl);
}

@BeforeAll
public static void setUp() {
Configuration.set(DirigibleConfig.MULTI_TENANT_MODE_ENABLED.getKey(), "true");
Expand Down

0 comments on commit 9deec8d

Please sign in to comment.