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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [#226 Renamed PHASED.EVENTS.NONINTERRUPTIVE and PHASED.EVENTS.TARGET](https://github.com/adobe/phased-testing/issues/226) to `MUTATIONAL.EVENTS.NONINTERRUPTIVE` and `MUTATIONAL.EVENTS.TARGET` respectively, to be consistent with the MUTATIONAL naming used elsewhere. The old property names are still honored for backward compatibility (a deprecation warning is logged when they are used) and will be removed in a future major version.
* **(breaking change)** [#246 Changes to ConfigValueHandlerPhased](https://github.com/adobe/phased-testing/issues/246). The public field `ConfigValueHandlerPhased.deprecatedSystemName` has been renamed to `legacySystemName`, to reflect that these are old property names still fully supported, not deprecated ones. In addition, `MutationListener` now proactively checks all config values at suite start and logs a warning for any legacy property name that is in use, rather than only warning the first time the value is fetched.
* [#251 Add a boolean to ConfigValueHandler that is deprecation](https://github.com/adobe/phased-testing/issues/251). `ConfigValueHandlerPhased` now has a `description` field (populated for every config value) and a `deprecated` boolean, to distinguish a property whose usage itself is going away from one that has simply been renamed (see #246). `PHASED.TESTS.PHASE` and `PHASED.TESTS.NONPHASED.LEGACY` are marked deprecated. `MutationListener` now also warns at suite start if a deprecated property is set, using its description to explain why.
* [#227 NIE: rename waitTillFinished to a better wording](https://github.com/adobe/phased-testing/issues/227). `NonInterruptiveEvent.waitTillFinished()` has been renamed to `waitTillStarted()`, since it waits for the startUp stage to be finalized rather than for the event to finish. `waitTillFinished()` is now `@Deprecated` and still fully functional (it forwards to/from `waitTillStarted()`), so existing subclasses of `NonInterruptiveEvent` do not need to change. It will be removed in a future major version.

* **New Environment Variables**
* MUTATIONAL.EXECUTION.MODE : This property is used to set the execution mode of the Mutational Tests. The value can be one of the following: STANDARD, INTERRUPTIVE(PRODUCER), INTERRUPTIVE(CONSUMER), NON-INTERRUPTIVE, PERMUATIONAL. This will replace the PHASED.TESTS.PHASE property which will be removed in 9.X.3.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ We have a standard demo that can be accessed through the [Phased Test Demo](http
Events are an important topic, and have to be correctly covered. An event in Mutational Testing contains three parts:

- StartUp - the event is initiated.
- waitTillFinished - the event has finished executing
- waitTillStarted - the startUp stage has been finalized
- tearDown - the system is set to a stable state

These parts of an event allow us to pilot the event injection around the scenario.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
log.info("In WTF Setting synchronous value to {}", WTF_STEP_VALUE);
TestMutationalNIE_Synchroneous.testElement = WTF_STEP_VALUE;
return isFinished();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
log.info("In WTF Setting synchronous value to {}", WTF_STEP_VALUE);

if (exceptionPlace == 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@
*/
public abstract boolean isFinished();

/**
* Waits until the event has started (i.e. the startUp stage has been finalized).
* @return true if the event successfully started
*/
public boolean waitTillStarted() {
return waitTillFinished();

Check warning on line 36 in phased-testing-core/src/main/java/com/adobe/campaign/tests/integro/phased/NonInterruptiveEvent.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated method, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=adobe_phased-testing&issues=AaBY267-18vLaXvYewt5&open=AaBY267-18vLaXvYewt5&pullRequest=255
}

/**
* Waits until the event has concluded
* @return true if it successfully finished
* @deprecated Use {@link #waitTillStarted()} instead. This method will be removed in a future major version.
*/
public abstract boolean waitTillFinished();
@Deprecated(since = "9.0.0", forRemoval = true)
public boolean waitTillFinished() {
return true;
}

public enum states {DEFINED , STARTED, FAILURE, FINISHED};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected static NonInterruptiveEvent startEvent(String in_event, String in_onAc
//NON_INTERRUPTIVE 23
if (ExecutionMode.NON_INTERRUPTIVE.fetchBehavior().startsWith("2")) {
log.info("Forcing Event End {} BEFORE step {} has started.", in_event, in_onAccountOfStep);
performWaitTilFinish(in_event, in_onAccountOfStep, nie);
performWaitTillStarted(in_event, in_onAccountOfStep, nie);
}
return nie;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ protected static NonInterruptiveEvent finishEvent(String in_event, String in_onA

//if (Phases.NON_INTERRUPTIVE.fetchType().startsWith("3")) {
// log.info("Forcing Event End {} AFTER step {} has finished.", in_event, in_onAccountOfStep);
performWaitTilFinish(in_event, in_onAccountOfStep, l_activeEvent);
performWaitTillStarted(in_event, in_onAccountOfStep, l_activeEvent);
//}

if (!l_activeEvent.isFinished()) {
Expand All @@ -211,11 +211,11 @@ protected static NonInterruptiveEvent finishEvent(String in_event, String in_onA
return l_activeEvent;
}

private static void performWaitTilFinish(String in_event, String in_onAccountOfStep, NonInterruptiveEvent nie) {
private static void performWaitTillStarted(String in_event, String in_onAccountOfStep, NonInterruptiveEvent nie) {
try {
nie.waitTillFinished();
nie.waitTillStarted();
} catch (Exception e) {
log.error("The waitTillFinished method for event {} caused an exception in the context of step {}.",
log.error("The waitTillStarted method for event {} caused an exception in the context of step {}.",
in_event, in_onAccountOfStep, e);
nie.threadFuture.cancel(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

public MyNonInterruptiveEvent() {

eventThread = new Thread(new Runnable() {

Check warning on line 24 in phased-testing-test-fixtures/src/main/java/com/adobe/campaign/tests/integro/phased/data/events/MyNonInterruptiveEvent.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this anonymous inner class a lambda

See more on https://sonarcloud.io/project/issues?id=adobe_phased-testing&issues=AaBY1MfsQc9s8BFz8wfO&open=AaBY1MfsQc9s8BFz8wfO&pullRequest=255
@Override
public void run() {
try {
Expand All @@ -47,7 +47,7 @@
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
log.info("finishing");

try {
Expand Down
4 changes: 2 additions & 2 deletions phased-testing-testng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public class NonInterruptiveEventExample extends NonInterruptiveEvent {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
return false;
}
}
Expand All @@ -222,7 +222,7 @@ public class NonInterruptiveEventExample extends NonInterruptiveEvent {
As you can see we have to implement three methods:
* `startEvent` starts the event.
* `isFinished` allow the system to see if the event we declared has finished.
* `waitTillFinished` waits until the event has finished.
* `waitTillStarted` waits until the event has started, i.e. the startUp stage has been finalized.

In order to define these event you will need to implement these methods, as you who are defining the event have the best knowledge on how these event will work.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testNonInterruptiveEventHelloWorld() {
assertThat("The event should be currently on-going", !nie.isFinished());

//Stop event
assertThat("The event should no longer be on-going", nie.waitTillFinished());
assertThat("The event should no longer be on-going", nie.waitTillStarted());
Date finish = new Date();

//Make sure event is stopped
Expand Down Expand Up @@ -114,7 +114,7 @@ public void testNonInterruptiveEventHelloWorld_asString()
// assertThat("Make sure that this call is logged", nie.callList, Matchers.contains("testNonInterruptiveEventHelloWorld"));

//Stop event
assertThat("The event should no longer be on-going", nie.waitTillFinished());
assertThat("The event should no longer be on-going", nie.waitTillStarted());
Date finish = new Date();

long executionWait = (long) MyNonInterruptiveEvent.WAIT_TIME_MS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {

while (taskContainer != -1) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public MyNonInterruptiveEvent2() {

eventThread = new Thread(new Runnable() {

Check warning on line 22 in phased-testing-testng/src/test/java/com/adobe/campaign/tests/integro/phased/data/events/MyNonInterruptiveEvent2.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this anonymous inner class a lambda

See more on https://sonarcloud.io/project/issues?id=adobe_phased-testing&issues=AaBY1McuQc9s8BFz8we6&open=AaBY1McuQc9s8BFz8we6&pullRequest=255
@Override
public void run() {
try {
Expand All @@ -44,7 +44,7 @@
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {

try {
if (eventThread.isAlive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
log.info("In WTF Setting synchronous value to {}", WTF_STEP_VALUE);
TestNIE_Synchroneous.testElement = WTF_STEP_VALUE;
return isFinished();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
log.info("In WTF Setting synchronous value to {}", WTF_STEP_VALUE);

if (exceptionPlace == 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public boolean isFinished() {
}

@Override
public boolean waitTillFinished() {
public boolean waitTillStarted() {
return false;
}
}
Loading