Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* End-to-end test for {@code GET /services/core/artefacts}: publishes an artefact into the
* registry, synchronizes, and asserts the endpoint reports it with the lifecycle the synchronizer
* left behind.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class ArtefactStatusEndpointIT extends IntegrationTest {

private static final String ENDPOINT = "/services/core/artefacts";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import java.nio.charset.StandardCharsets;

Expand All @@ -38,6 +39,9 @@
* Files are written directly into the repository at the workspace path the endpoint resolves to for
* the {@code admin} user — no browser or synchronizer required.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class BpmnModelApiIT extends IntegrationTest {

private static final String USERNAME = "admin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.dirigible.tests.framework.restassured.RestAssuredExecutor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import io.restassured.http.ContentType;

Expand All @@ -36,6 +37,9 @@
* child payload carries the {@code type} / {@code path} / {@code readable} fields the interfaces
* render.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class DocumentsApiIT extends IntegrationTest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
package org.eclipse.dirigible.integration.tests.api;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.lessThan;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.nio.charset.StandardCharsets;
Expand All @@ -30,6 +32,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* Cross-model schedule SOURCE coverage: a schedule owned by the CONSUMER model iterates a source
Expand All @@ -51,6 +54,9 @@
* {@code .model} absent, and a mistyped {@code where} field - both drop the schedule with a warning
* in the generate response (never a job that cannot compile).
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class IntentCrossModelScheduleSourceIT extends IntegrationTest {

private static final String WORKSPACE = "workspace";
Expand Down Expand Up @@ -315,10 +321,14 @@ void cleanup() {
restAssuredExecutor.execute(() -> given().when()
.delete("/services/ide/publisher/" + WORKSPACE + "/" + project)
.then()
.statusCode(greaterThanOrEqualTo(200)));
.statusCode(both(greaterThanOrEqualTo(200)).and(lessThan(300))));
if (repository.hasCollection(projectPath(project))) {
repository.removeCollection(projectPath(project));
}
}
// The context (and its Quartz scheduler) now outlives the method: run the synchronizers so the
// JobSynchronizer's DELETE branch unschedules the published 5-second cron job - otherwise it
// keeps firing against unloaded gen classes for the rest of the class.
synchronizationProcessor.forceProcessSynchronizers();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import io.restassured.http.ContentType;

Expand All @@ -43,6 +44,9 @@
* Each delegate writes a process variable; the test asserts both variables made it into the
* historic record, proving end-to-end execution.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class JavaBpmnIT extends IntegrationTest {

private static final String PROJECT = "java-bpmn-it";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* End-to-end test for the Java Camel handler integration: drops a {@code .java} class implementing
Expand All @@ -35,6 +36,9 @@
* proves a recompiled handler is picked up without a server restart (the {@code .camel} route is
* untouched between runs). Counterpart of {@code JavaBpmnIT} for the Camel engine.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class JavaCamelIT extends IntegrationTest {

private static final String PROJECT = "java-camel-it";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* Verifies that a client-Java compile failure surfaces as a Problems-view entry (category
* {@code Compilation}, with the failing line) and that fixing or removing the source clears it.
* HTTP-only against the Problems endpoint - no Selenide.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class JavaCompilationProblemsIT extends IntegrationTest {

private static final String PROJECT = "java-problems-it";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* End-to-end test for the perspective aggregator
Expand All @@ -37,6 +38,9 @@
* now declare itself the default of its extension point and adopt both the un-matched and the
* un-grouped perspectives; the platform point keeps its 'undefined-group' catch-all.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class PerspectiveGroupAggregationIT extends IntegrationTest {

private static final String SERVICE = "/services/js/platform-core/extension-services/perspectives.js?extensionPoints=";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* End-to-end test for server-side print rendering ({@code sdk.print.Print} -> {@code PrintFacade}).
Expand All @@ -33,6 +34,9 @@
* SDK bean bridge + the render pipeline in the same tenant scope the generated snapshot delegate
* will use.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class PrintRenderIT extends IntegrationTest {

private static final String PROJECT = "print-render-it";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.test.annotation.DirtiesContext;

/**
* End-to-end test for the export representation of {@code GET /services/core/repository}: a
* collection downloads as a zip of its content including its subfolders, a resource downloads as
* the file itself, and the plain listing representation stays untouched.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or creates only
// collision-free state), so the per-method context reset inherited from IntegrationTest would only
// add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class RepositoryExportIT extends IntegrationTest {

private static final String ENDPOINT = "/services/core/repository";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* A publish replaces a registry collection by deleting it and copying it back milliseconds later. A
Expand All @@ -39,6 +40,9 @@
* The pass must therefore defer its cleanup while the registry is being written, and still
* reconcile a genuine deletion once the registry is quiet.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class SynchronizerCleanupRaceIT extends IntegrationTest {

private static final String LOCATION = "/cleanup-race-it/Sample.java";
Expand Down Expand Up @@ -177,16 +181,15 @@ private void runPassesWhilePublishIsInFlight() {

@AfterEach
void removeSourcesFromRegistry() {
boolean removed = false;
for (String path : List.of(REGISTRY_PATH, PROBE_REGISTRY_PATH,
IRepositoryStructure.PATH_REGISTRY_PUBLIC + "/" + PUBLISH_PROJECT + PUBLISH_SOURCE_PATH)) {
if (repository.hasResource(path)) {
repository.removeResource(path);
removed = true;
}
}
if (removed) {
synchronizationProcessor.forceProcessSynchronizers();
}
// Unconditionally: the publish-bypass test unpublishes through the service without a sync, so
// no resource is left for the loop above to notice - but the registered JavaFile artefact for
// the vanished source still needs the cleanup pass, or every later rebuild bails and defers.
synchronizationProcessor.forceProcessSynchronizers();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

/**
* End-to-end test for the tenant-aware configuration feature. Exercises the full chain in the
* running application (per-tenant DIRIGIBLE_CONFIGURATION table -> store -> cache -> key policy ->
* thread-scoped {@link Configuration} precedence) against the default tenant.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class TenantConfigurationIT extends IntegrationTest {

/** A white-listed key (branding is the only injectable namespace for now). */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.eclipse.dirigible.tests.base.IntegrationTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import java.sql.Connection;
import java.sql.ResultSet;
Expand All @@ -24,6 +25,10 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

// One Dirigible boot for the whole class: each method cleans up after itself (or creates only
// collision-free state), so the per-method context reset inherited from IntegrationTest would only
// add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class CsvProcessorIT extends IntegrationTest {

/** The default data source name. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import java.nio.charset.StandardCharsets;
import java.sql.Connection;
Expand All @@ -44,6 +45,10 @@
* Also covers the other half of the same finding: the re-import must be TRIGGERED when only the
* referenced CSV changes, since the .csvim itself is a stable pointer that stays byte-identical.
*/
// One Dirigible boot for the whole class: each method cleans up after itself (or creates only
// collision-free state), so the per-method context reset inherited from IntegrationTest would only
// add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
class CsvimReimportIT extends IntegrationTest {

/** The project holding the synchronizer-path fixture. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@
import org.eclipse.dirigible.components.api.messaging.TimeoutException;
import org.eclipse.dirigible.tests.base.IntegrationTest;
import org.eclipse.dirigible.tests.framework.util.SleepUtil;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import org.springframework.test.annotation.DirtiesContext;

// One Dirigible boot for the whole class: each method cleans up after itself (or is read-only), so
// the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class MessagingFacadeIT extends IntegrationTest {

private static final String TEST_MESSAGE = "Test message";
Expand All @@ -33,6 +38,21 @@ class QueueTest {
private static final String QUEUE = "my-test-queue";
private static final long TIMEOUT_MILLIS = 500L;

/**
* The broker's JDBC store now outlives a test method, so a message a prior method left behind would
* break the FIFO and receive-timeout assertions - drain until the queue answers empty.
*/
@BeforeEach
void drainQueue() {
while (true) {
try {
MessagingFacade.receiveFromQueue(QUEUE, 50);
} catch (TimeoutException emptyQueue) {
return;
}
}
}

@Test
void testSendReceiveOneMessage() {
MessagingFacade.sendToQueue(QUEUE, TEST_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
import org.eclipse.dirigible.tests.framework.tenant.DirigibleTestTenant;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.test.annotation.DirtiesContext;

/**
* Multitenant mode must be enabled by default
*/

// One Dirigible boot for the whole class: each method cleans up after itself (or creates only
// collision-free state), so the per-method context reset inherited from IntegrationTest would only
// add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class EnabledMultitenantModeIT extends TenantDeterminationIT {

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.eclipse.dirigible.tests.framework.browser.HtmlAttribute;
import org.eclipse.dirigible.tests.framework.browser.HtmlElementType;
import org.junit.jupiter.api.Test;
import org.springframework.test.annotation.DirtiesContext;

/**
* Smoke test for the Database shell. It asserts what only a real browser can: that the Harmonia +
Expand All @@ -25,6 +26,9 @@
* The page roots carry a stable id, so the assertions do not depend on what the instance happens to
* have deployed. The one thing that IS depended on is DefaultDB, which every instance has.
*/
// One Dirigible boot for the whole class: the methods are read-only or clean up after themselves,
// so the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class DatabaseShellIT extends UserInterfaceIntegrationTest {

private static final String DATABASE_PATH = "/services/web/database/index.html";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;

import com.codeborne.selenide.Condition;
import com.codeborne.selenide.Selenide;
Expand All @@ -53,6 +54,9 @@
* client-side re-validation, the auto-apply, the hidden persistence, and every step of the publish
* pipeline (generate models, generate code, publish, verify against the Problems feed).
*/
// One Dirigible boot for the whole class: the methods are read-only or clean up after themselves,
// so the per-method context reset inherited from IntegrationTest would only add boot time per test.
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class IntentBuilderShellIT extends UserInterfaceIntegrationTest {

private static final String BUILDER_PATH = "/services/web/builder/index.html";
Expand Down
Loading
Loading