Skip to content

Commit

Permalink
Finished implementing NIE for mutational
Browse files Browse the repository at this point in the history
  • Loading branch information
baubakg committed Aug 17, 2024
1 parent 6b6b30a commit eb7db2d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public void onTestStart(ITestResult result) {
//Continue
}

/*
//Managing events
//Cases 4 & 5
//TODO Move to PhasedParent
Expand All @@ -313,6 +314,8 @@ public void onTestStart(ITestResult result) {
PhasedEventManager.startEvent(lt_event, ClassPathParser.fetchFullName(result));
}
}
*/
}
}

Expand Down Expand Up @@ -343,6 +346,7 @@ public void onTestSkipped(ITestResult result) {
protected void standardPostTestActions(ITestResult result) {
final Method l_method = result.getMethod().getConstructorOrMethod().getMethod();

/*
if (PhasedTestManager.isPhasedTest(l_method)) {
//TRIM add property check
//appendShuffleGroupToName(result);
Expand All @@ -359,6 +363,8 @@ protected void standardPostTestActions(ITestResult result) {
}
}
}
*/
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,30 @@ public void shuffled(String phaseGroup) {

PhasedTestManager.storePhasedContext(ClassPathParser.fetchFullName(stepMethod), phaseGroup);

if (Phases.ASYNCHRONOUS.isSelected()) {

//Check if there is an event declared
String lt_event = PhasedEventManager.fetchEvent(stepMethod, phaseGroup);
if (lt_event != null) {
//TODO use PhasedTestManager for fetching full name instead
PhasedEventManager.startEvent(lt_event, l_thisScneario);
}
}

Object ourInstance = l_executingClass.getDeclaredConstructor().newInstance();
long l_start = System.currentTimeMillis();
stepMethod.invoke(ourInstance, phaseGroup);
long l_end = System.currentTimeMillis();

if (Phases.ASYNCHRONOUS.isSelected()) {
//Check if there is an event declared
String lt_event = PhasedEventManager.fetchEvent(stepMethod, phaseGroup);
if (lt_event != null) {
//TODO use PhasedTestManager for fetching full name instead
PhasedEventManager.finishEvent(lt_event, l_thisScneario);
}
}


PhasedTestManager.scenarioStateStore(PhasedTestManager.fetchScenarioName(stepMethod, phaseGroup),
ClassPathParser.fetchFullName(stepMethod), TestResult.SUCCESS,l_start,l_end);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void testPermutationalDemo() {
/**
* This is a test for non-intyerruptive events in shuffled classes
*/
@Test(enabled = false)
@Test(enabled = true)
public void testNonInterruptive_ParellelConfiguredAsExecutionVariable_Shuffled_Ordered() {

// Rampup
Expand All @@ -259,9 +259,9 @@ public void testNonInterruptive_ParellelConfiguredAsExecutionVariable_Shuffled_O

// assertThat("We should be in non-interruptive mode shuffled", PhasedTestManager.isPhasedTestShuffledMode(l_testClass));

assertThat("We should have 9 successful methods of phased Tests",
assertThat("We should have 3 successful executions of phased Tests",
(int) tla.getPassedTests().stream().filter(m -> m.getInstance().getClass().equals(l_testClass)).count(),
is(equalTo(9)));
is(equalTo(3)));

//Global
assertThat("We should have no failed tests", tla.getFailedTests().size(), equalTo(0));
Expand Down

0 comments on commit eb7db2d

Please sign in to comment.