Java 类org.gradle.api.internal.tasks.testing.TestCompleteEvent 实例源码

项目:Reer    文件:CaptureTestOutputTestResultProcessor.java   
@Override
public void completed(Object testId, TestCompleteEvent event) {
    if (testId.equals(rootId)) {
        //when root suite is completed we stop redirecting
        try {
            outputRedirector.stopRedirecting();
        } finally {
            rootId = null;
        }
    } else {
        //when test is completed we should redirect output for the parent
        //so that log events emitted during @AfterSuite, @AfterClass are processed
        Object newOwner = parents.remove(testId);
        outputRedirector.setOutputOwner(newOwner);
    }
    processor.completed(testId, event);
}
项目:Reer    文件:TestListenerAdapter.java   
@Override
public void completed(TestDescriptorInternal test, TestResult result, TestCompleteEvent completeEvent) {
    if (test.isComposite()) {
        testListener.afterSuite(test, result);
    } else {
        testListener.afterTest(test, result);
    }
}
项目:Reer    文件:TestState.java   
public void completed(TestCompleteEvent event) {
    this.completeEvent = event;
    resultType = isFailed() ? TestResult.ResultType.FAILURE
            : event.getResultType() != null ? event.getResultType() : TestResult.ResultType.SUCCESS;

    if (!test.isComposite()) {
        testCount = 1;
        switch (resultType) {
            case SUCCESS:
                successfulCount = 1;
                break;
            case FAILURE:
                failedCount = 1;
                break;
        }
    }

    if (startEvent.getParentId() != null) {
        TestState parentState = executing.get(startEvent.getParentId());
        if (parentState != null) {
            if (isFailed()) {
                parentState.failedChild = true;
            }
            parentState.testCount += testCount;
            parentState.successfulCount += successfulCount;
            parentState.failedCount += failedCount;
        }
    }
}
项目:Reer    文件:TestExecutionResultEvaluator.java   
@Override
public void completed(TestDescriptorInternal testDescriptor, TestResult testResult, TestCompleteEvent completeEvent) {
    if (testDescriptor.getParent() == null) {
        resultCount = resultCount + testResult.getTestCount();
    }
    if (!testDescriptor.isComposite() && testResult.getFailedTestCount() != 0) {
        failedTests.add(new FailedTest(testDescriptor.getName(), testDescriptor.getClassName(), getTaskPath(testDescriptor)));
    }
}
项目:jovial    文件:JovialTestExecuter.java   
private void handleEvent(Map<String, Object> event) {
    // Gradle seems to only allow two tiers of tests, so drop the roots
    if (event.get("parentId") == null) {
        return;
    }

    JovialTestDescriptor descriptor = descriptors.computeIfAbsent((String) event.get("uniqueId"), uniqueId -> {
        boolean container = (boolean) event.get("container");
        JovialTestDescriptor parent = container ? null : descriptors.get((String) event.get("parentId"));
        return new JovialTestDescriptor(uniqueId, parent, (String) event.get("displayName"), container);
    });

    switch ((String) event.get("type")) {
        case "dynamicTestRegistered":
            // do nothing, for now
            break;
        case "executionSkipped":
            testResultProcessor.completed(descriptor.getId(), new TestCompleteEvent(Instant.now().toEpochMilli(), TestResult.ResultType.SKIPPED));
            break;
        case "executionStarted":
            testResultProcessor.started(descriptor, new TestStartEvent(Instant.now().toEpochMilli(), null));
            break;
        case "executionFinished":
            boolean success = (boolean) event.get("success");
            TestResult.ResultType result = success ? TestResult.ResultType.SUCCESS : TestResult.ResultType.FAILURE;
            Throwable cause = (Throwable) event.get("throwable");
            if (cause != null) {
                testResultProcessor.failure(descriptor.getId(), cause);
            }
            testResultProcessor.completed(descriptor.getId(), new TestCompleteEvent(Instant.now().toEpochMilli(), result));
            break;
    }
}
项目:Pushjet-Android    文件:TestState.java   
public void completed(TestCompleteEvent event) {
    this.completeEvent = event;
    resultType = isFailed() ? TestResult.ResultType.FAILURE
            : event.getResultType() != null ? event.getResultType() : TestResult.ResultType.SUCCESS;

    if (!test.isComposite()) {
        testCount = 1;
        switch (resultType) {
            case SUCCESS:
                successfulCount = 1;
                break;
            case FAILURE:
                failedCount = 1;
                break;
        }
    }

    if (startEvent.getParentId() != null) {
        TestState parentState = executing.get(startEvent.getParentId());
        if (parentState != null) {
            if (isFailed()) {
                parentState.failedChild = true;
            }
            parentState.testCount += testCount;
            parentState.successfulCount += successfulCount;
            parentState.failedCount += failedCount;
        }
    }
}
项目:Pushjet-Android    文件:TestState.java   
public void completed(TestCompleteEvent event) {
    this.completeEvent = event;
    resultType = isFailed() ? TestResult.ResultType.FAILURE
            : event.getResultType() != null ? event.getResultType() : TestResult.ResultType.SUCCESS;

    if (!test.isComposite()) {
        testCount = 1;
        switch (resultType) {
            case SUCCESS:
                successfulCount = 1;
                break;
            case FAILURE:
                failedCount = 1;
                break;
        }
    }

    if (startEvent.getParentId() != null) {
        TestState parentState = executing.get(startEvent.getParentId());
        if (parentState != null) {
            if (isFailed()) {
                parentState.failedChild = true;
            }
            parentState.testCount += testCount;
            parentState.successfulCount += successfulCount;
            parentState.failedCount += failedCount;
        }
    }
}
项目:Reer    文件:ClientForwardingTestListener.java   
@Override
public void completed(TestDescriptorInternal testDescriptor, TestResult testResult, TestCompleteEvent completeEvent) {
    eventConsumer.dispatch(new DefaultTestFinishedProgressEvent(completeEvent.getEndTime(), adapt(testDescriptor), adapt(testResult)));
}
项目:ide-plugins    文件:EclipseTestExecuter.java   
@Override
public void completed(Object o, TestCompleteEvent testCompleteEvent) {
}
项目:ide-plugins    文件:EclipseTestListener.java   
private static TestCompleteEvent completeEvent(ResultType resultType) {
    return new TestCompleteEvent(System.currentTimeMillis(), resultType);
}
项目:Reer    文件:TestListenerInternal.java   
void completed(TestDescriptorInternal testDescriptor, TestResult testResult, TestCompleteEvent completeEvent);