unit test: more descriptive failure message

experimental^2^2
Kirill Vainer 9 years ago
parent c03e831f3c
commit 85ffb48efb
  1. 6
      common.gradle
  2. 7
      jme3-core/src/test/java/com/jme3/material/MaterialMatParamOverrideTest.java
  3. 1
      jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java

@ -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

@ -520,7 +520,7 @@ public class MaterialMatParamOverrideTest {
}
private void outUniforms(Uniform... uniforms) {
HashSet<Uniform> actualUniforms = new HashSet<Uniform>();
HashSet<Uniform> actualUniforms = new HashSet<>();
for (Uniform uniform : usedShader.getUniformMap().values()) {
if (uniform.getName().startsWith("m_")
@ -529,11 +529,10 @@ public class MaterialMatParamOverrideTest {
}
}
HashSet<Uniform> expectedUniforms = new HashSet<Uniform>(Arrays.asList(uniforms));
HashSet<Uniform> 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);
}
}
}

@ -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;

Loading…
Cancel
Save