From 85ffb48efb0b23d93b9d00181b94d205ec63134a Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sat, 2 Apr 2016 14:18:08 -0400 Subject: [PATCH] unit test: more descriptive failure message --- common.gradle | 6 ++++++ .../com/jme3/material/MaterialMatParamOverrideTest.java | 7 +++---- jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java | 1 - 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common.gradle b/common.gradle index 2cad48bf2..9a4aba272 100644 --- a/common.gradle +++ b/common.gradle @@ -51,6 +51,12 @@ javadoc { } } +test { + testLogging { + exceptionFormat = 'full' + } +} + task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { classifier = 'sources' from sourceSets*.allSource diff --git a/jme3-core/src/test/java/com/jme3/material/MaterialMatParamOverrideTest.java b/jme3-core/src/test/java/com/jme3/material/MaterialMatParamOverrideTest.java index 78671ca1c..8532b6c96 100644 --- a/jme3-core/src/test/java/com/jme3/material/MaterialMatParamOverrideTest.java +++ b/jme3-core/src/test/java/com/jme3/material/MaterialMatParamOverrideTest.java @@ -520,7 +520,7 @@ public class MaterialMatParamOverrideTest { } private void outUniforms(Uniform... uniforms) { - HashSet actualUniforms = new HashSet(); + HashSet actualUniforms = new HashSet<>(); for (Uniform uniform : usedShader.getUniformMap().values()) { if (uniform.getName().startsWith("m_") @@ -529,11 +529,10 @@ public class MaterialMatParamOverrideTest { } } - HashSet expectedUniforms = new HashSet(Arrays.asList(uniforms)); + HashSet expectedUniforms = new HashSet<>(Arrays.asList(uniforms)); if (!expectedUniforms.equals(actualUniforms)) { - System.out.println(expectedUniforms + " != " + actualUniforms); - Assert.fail("Uniform lists must match"); + Assert.fail("Uniform lists must match: " + expectedUniforms + " != " + actualUniforms); } } } diff --git a/jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java b/jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java index 349789e90..183dece70 100644 --- a/jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java +++ b/jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java @@ -35,7 +35,6 @@ import com.jme3.material.MatParamOverride; import com.jme3.math.Matrix4f; import com.jme3.renderer.Camera; import com.jme3.shader.VarType; -import static com.jme3.shader.VarType.Texture2D; import com.jme3.texture.Texture2D; import java.lang.reflect.Field; import java.util.HashSet;