"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreeNode.java" between
junit5-r5.3.2.tar.gz and junit5-r5.4.0.tar.gz

About: JUnit 5 is a unit testing framework for the Java programming language.

TreeNode.java  (junit5-r5.3.2):TreeNode.java  (junit5-r5.4.0)
/* /*
* Copyright 2015-2018 the original author or authors. * Copyright 2015-2019 the original author or authors.
* *
* All rights reserved. This program and the accompanying materials are * All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which * made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at * accompanies this distribution and is available at
* *
* http://www.eclipse.org/legal/epl-v20.html * http://www.eclipse.org/legal/epl-v20.html
*/ */
package org.junit.platform.console.tasks; package org.junit.platform.console.tasks;
import java.util.Optional; import java.util.Optional;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
import org.junit.platform.commons.util.StringUtils;
import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.TestExecutionResult;
import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.engine.reporting.ReportEntry;
import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestIdentifier;
/** /**
* @since 1.0 * @since 1.0
*/ */
class TreeNode { class TreeNode {
private final String caption; private final String caption;
skipping to change at line 43 skipping to change at line 44
final Queue<TreeNode> children = new ConcurrentLinkedQueue<>(); final Queue<TreeNode> children = new ConcurrentLinkedQueue<>();
boolean visible; boolean visible;
TreeNode(String caption) { TreeNode(String caption) {
this.caption = caption; this.caption = caption;
this.creation = System.currentTimeMillis(); this.creation = System.currentTimeMillis();
this.visible = false; this.visible = false;
} }
TreeNode(TestIdentifier identifier) { TreeNode(TestIdentifier identifier) {
this(identifier.getDisplayName()); this(createCaption(identifier.getDisplayName()));
this.identifier = identifier; this.identifier = identifier;
this.visible = true; this.visible = true;
} }
TreeNode(TestIdentifier identifier, String reason) { TreeNode(TestIdentifier identifier, String reason) {
this(identifier); this(identifier);
this.reason = reason; this.reason = reason;
} }
TreeNode addChild(TreeNode node) { TreeNode addChild(TreeNode node) {
skipping to change at line 84 skipping to change at line 85
return Optional.ofNullable(reason); return Optional.ofNullable(reason);
} }
Optional<TestExecutionResult> result() { Optional<TestExecutionResult> result() {
return Optional.ofNullable(result); return Optional.ofNullable(result);
} }
Optional<TestIdentifier> identifier() { Optional<TestIdentifier> identifier() {
return Optional.ofNullable(identifier); return Optional.ofNullable(identifier);
} }
static String createCaption(String displayName) {
boolean normal = displayName.length() <= 80;
String caption = normal ? displayName : displayName.substring(0,
80) + "...";
String whites = StringUtils.replaceWhitespaceCharacters(caption,
" ");
return StringUtils.replaceIsoControlCharacters(whites, ".");
}
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)