diff --git a/jnigen/java/src/test/java/com/github/dart_lang/jnigen/apisummarizer/JSONComparisonTest.java b/jnigen/java/src/test/java/com/github/dart_lang/jnigen/apisummarizer/JSONComparisonTest.java index 4d15ad2e..b02ee15e 100644 --- a/jnigen/java/src/test/java/com/github/dart_lang/jnigen/apisummarizer/JSONComparisonTest.java +++ b/jnigen/java/src/test/java/com/github/dart_lang/jnigen/apisummarizer/JSONComparisonTest.java @@ -1,5 +1,6 @@ package com.github.dart_lang.jnigen.apisummarizer; +import com.github.dart_lang.jnigen.apisummarizer.util.Log; import java.io.File; import java.io.IOException; import org.junit.Assert; @@ -31,11 +32,22 @@ private int gitDiff(String a, String b) throws IOException, InterruptedException @Test public void testExampleSummary() throws IOException, InterruptedException { var tempFile = File.createTempFile("summarizer_test", ".json"); + Log.info("Temporary file: %s", tempFile.getPath()); Main.main( new String[] { "-s", "src/test/resources", "com.example.Example", "-o", tempFile.getPath(), }); int comparison = gitDiff(exampleClassJsonOutput, tempFile); + if (comparison != 0) { + Log.warning("New output (%s) is different than reference output.", tempFile.getPath()); + } + + // Fail test if git diff exited with 1 Assert.assertEquals(0, comparison); + + var deleted = tempFile.delete(); + if (!deleted) { + Log.warning("Cannot delete temp file %s", tempFile.getPath()); + } } } diff --git a/jnigen/java/src/test/resources/exampleClassSummary.json b/jnigen/java/src/test/resources/exampleClassSummary.json index 90a08e41..208e7ae1 100644 --- a/jnigen/java/src/test/resources/exampleClassSummary.json +++ b/jnigen/java/src/test/resources/exampleClassSummary.json @@ -1,9 +1,7 @@ [ { "declKind" : "CLASS", "modifiers" : [ "public" ], - "simpleName" : "Example", "binaryName" : "com.example.Example", - "packageName" : "com.example", "methods" : [ { "modifiers" : [ "public" ], "name" : "", @@ -140,10 +138,8 @@ }, { "declKind" : "CLASS", "modifiers" : [ "static", "public" ], - "simpleName" : "Aux", "binaryName" : "com.example.Example$Aux", "parentName" : "com.example.Example", - "packageName" : "com.example", "methods" : [ { "modifiers" : [ "public" ], "name" : "",