Java 类org.gradle.api.tasks.testing.logging.TestLogEvent 实例源码

项目:Reer    文件:AbstractTestLogger.java   
protected void logEvent(TestDescriptor descriptor, TestLogEvent event, @Nullable String details) {
    StyledTextOutput output = textOutputFactory.create("TestEventLogger", logLevel);
    if (!descriptor.equals(lastSeenTestDescriptor) || event != lastSeenTestEvent) {
        output.println().append(getEventPath(descriptor));
        output.withStyle(getStyle(event)).println(event.toString());
    }
    lastSeenTestDescriptor = descriptor;
    lastSeenTestEvent = event;
    if (details != null) {
        output.append(TextUtil.toPlatformLineSeparators(details));
    }
}
项目:Reer    文件:AbstractTestLogger.java   
private StyledTextOutput.Style getStyle(TestLogEvent event) {
    switch (event) {
        case PASSED: return StyledTextOutput.Style.Identifier;
        case FAILED: return StyledTextOutput.Style.Failure;
        case SKIPPED: return StyledTextOutput.Style.Info;
        default: return StyledTextOutput.Style.Normal;
    }
}
项目:Reer    文件:TestEventLogger.java   
@Override
public void onOutput(TestDescriptor descriptor, TestOutputEvent outputEvent) {
    if (outputEvent.getDestination() == TestOutputEvent.Destination.StdOut
            && isLoggedEventType(TestLogEvent.STANDARD_OUT)) {
        logEvent(descriptor, TestLogEvent.STANDARD_OUT, TextUtil.indent(outputEvent.getMessage(), INDENT) + "\n");
    } else if (outputEvent.getDestination() == TestOutputEvent.Destination.StdErr
            && isLoggedEventType(TestLogEvent.STANDARD_ERROR)) {
        logEvent(descriptor, TestLogEvent.STANDARD_ERROR, TextUtil.indent(outputEvent.getMessage(), INDENT) + "\n");
    }
}
项目:Reer    文件:TestEventLogger.java   
private void after(TestDescriptor descriptor, TestResult result) {
    TestLogEvent event = getEvent(result);

    if (shouldLogEvent(descriptor, event)) {
        String details = shouldLogExceptions(result) ? exceptionFormatter.format(descriptor, result.getExceptions()) : null;
        logEvent(descriptor, event, details);
    }
}
项目:Reer    文件:TestEventLogger.java   
private TestLogEvent getEvent(TestResult result) {
    switch (result.getResultType()) {
        case SUCCESS: return TestLogEvent.PASSED;
        case FAILURE: return TestLogEvent.FAILED;
        case SKIPPED: return TestLogEvent.SKIPPED;
        default: throw new AssertionError();
    }
}
项目:Pushjet-Android    文件:AbstractTestLogger.java   
protected void logEvent(TestDescriptor descriptor, TestLogEvent event, @Nullable String details) {
    StyledTextOutput output = textOutputFactory.create("TestEventLogger", logLevel);
    if (!descriptor.equals(lastSeenTestDescriptor) || event != lastSeenTestEvent) {
        output.println().append(getEventPath(descriptor));
        output.withStyle(getStyle(event)).println(event.toString());
    }
    lastSeenTestDescriptor = descriptor;
    lastSeenTestEvent = event;
    if (details != null) {
        output.append(TextUtil.toPlatformLineSeparators(details));
    }
}
项目:Pushjet-Android    文件:AbstractTestLogger.java   
private StyledTextOutput.Style getStyle(TestLogEvent event) {
    switch (event) {
        case PASSED: return StyledTextOutput.Style.Identifier;
        case FAILED: return StyledTextOutput.Style.Failure;
        case SKIPPED: return StyledTextOutput.Style.Info;
        default: return StyledTextOutput.Style.Normal;
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
public void onOutput(TestDescriptor descriptor, TestOutputEvent outputEvent) {
    if (outputEvent.getDestination() == TestOutputEvent.Destination.StdOut
            && isLoggedEventType(TestLogEvent.STANDARD_OUT)) {
        logEvent(descriptor, TestLogEvent.STANDARD_OUT, TextUtil.indent(outputEvent.getMessage(), INDENT) + "\n");
    } else if (outputEvent.getDestination() == TestOutputEvent.Destination.StdErr
            && isLoggedEventType(TestLogEvent.STANDARD_ERROR)) {
        logEvent(descriptor, TestLogEvent.STANDARD_ERROR, TextUtil.indent(outputEvent.getMessage(), INDENT) + "\n");
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private void after(TestDescriptor descriptor, TestResult result) {
    TestLogEvent event = getEvent(result);

    if (shouldLogEvent(descriptor, event)) {
        String details = shouldLogExceptions(result) ? exceptionFormatter.format(descriptor, result.getExceptions()) : null;
        logEvent(descriptor, event, details);
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private TestLogEvent getEvent(TestResult result) {
    switch (result.getResultType()) {
        case SUCCESS: return TestLogEvent.PASSED;
        case FAILURE: return TestLogEvent.FAILED;
        case SKIPPED: return TestLogEvent.SKIPPED;
        default: throw new AssertionError();
    }
}
项目:Pushjet-Android    文件:AbstractTestLogger.java   
protected void logEvent(TestDescriptor descriptor, TestLogEvent event, @Nullable String details) {
    StyledTextOutput output = textOutputFactory.create("TestEventLogger", logLevel);
    if (!descriptor.equals(lastSeenTestDescriptor) || event != lastSeenTestEvent) {
        output.println().append(getEventPath(descriptor));
        output.withStyle(getStyle(event)).println(event.toString());
    }
    lastSeenTestDescriptor = descriptor;
    lastSeenTestEvent = event;
    if (details != null) {
        output.append(TextUtil.toPlatformLineSeparators(details));
    }
}
项目:Pushjet-Android    文件:AbstractTestLogger.java   
private StyledTextOutput.Style getStyle(TestLogEvent event) {
    switch (event) {
        case PASSED: return StyledTextOutput.Style.Identifier;
        case FAILED: return StyledTextOutput.Style.Failure;
        case SKIPPED: return StyledTextOutput.Style.Info;
        default: return StyledTextOutput.Style.Normal;
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
public void onOutput(TestDescriptor descriptor, TestOutputEvent outputEvent) {
    if (outputEvent.getDestination() == TestOutputEvent.Destination.StdOut
            && isLoggedEventType(TestLogEvent.STANDARD_OUT)) {
        logEvent(descriptor, TestLogEvent.STANDARD_OUT, TextUtil.indent(outputEvent.getMessage(), INDENT) + "\n");
    } else if (outputEvent.getDestination() == TestOutputEvent.Destination.StdErr
            && isLoggedEventType(TestLogEvent.STANDARD_ERROR)) {
        logEvent(descriptor, TestLogEvent.STANDARD_ERROR, TextUtil.indent(outputEvent.getMessage(), INDENT) + "\n");
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private void after(TestDescriptor descriptor, TestResult result) {
    TestLogEvent event = getEvent(result);

    if (shouldLogEvent(descriptor, event)) {
        String details = shouldLogExceptions(result) ? exceptionFormatter.format(descriptor, result.getExceptions()) : null;
        logEvent(descriptor, event, details);
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private TestLogEvent getEvent(TestResult result) {
    switch (result.getResultType()) {
        case SUCCESS: return TestLogEvent.PASSED;
        case FAILURE: return TestLogEvent.FAILED;
        case SKIPPED: return TestLogEvent.SKIPPED;
        default: throw new AssertionError();
    }
}
项目:Reer    文件:AbstractTestLogger.java   
protected void logEvent(TestDescriptor descriptor, TestLogEvent event) {
    logEvent(descriptor, event, null);
}
项目:Reer    文件:TestEventLogger.java   
private void before(TestDescriptor descriptor) {
    if (shouldLogEvent(descriptor, TestLogEvent.STARTED)) {
        logEvent(descriptor, TestLogEvent.STARTED);
    }
}
项目:Reer    文件:TestEventLogger.java   
private boolean shouldLogEvent(TestDescriptor descriptor, TestLogEvent event) {
    return isLoggedGranularity(descriptor) && isLoggedEventType(event);
}
项目:Reer    文件:TestEventLogger.java   
private boolean isLoggedEventType(TestLogEvent event) {
    return testLogging.getEvents().contains(event);
}
项目:Pushjet-Android    文件:AbstractTestLogger.java   
protected void logEvent(TestDescriptor descriptor, TestLogEvent event) {
    logEvent(descriptor, event, null);
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private void before(TestDescriptor descriptor) {
    if (shouldLogEvent(descriptor, TestLogEvent.STARTED)) {
        logEvent(descriptor, TestLogEvent.STARTED);
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private boolean shouldLogEvent(TestDescriptor descriptor, TestLogEvent event) {
    return isLoggedGranularity(descriptor) && isLoggedEventType(event);
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private boolean isLoggedEventType(TestLogEvent event) {
    return testLogging.getEvents().contains(event);
}
项目:Pushjet-Android    文件:AbstractTestLogger.java   
protected void logEvent(TestDescriptor descriptor, TestLogEvent event) {
    logEvent(descriptor, event, null);
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private void before(TestDescriptor descriptor) {
    if (shouldLogEvent(descriptor, TestLogEvent.STARTED)) {
        logEvent(descriptor, TestLogEvent.STARTED);
    }
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private boolean shouldLogEvent(TestDescriptor descriptor, TestLogEvent event) {
    return isLoggedGranularity(descriptor) && isLoggedEventType(event);
}
项目:Pushjet-Android    文件:TestEventLogger.java   
private boolean isLoggedEventType(TestLogEvent event) {
    return testLogging.getEvents().contains(event);
}