You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/04/02 19:10:32 UTC

[GitHub] [incubator-netbeans-jackpot30] jlahoda commented on a change in pull request #6: Adding support for parameter files.

jlahoda commented on a change in pull request #6: Adding support for parameter files.
URL: https://github.com/apache/incubator-netbeans-jackpot30/pull/6#discussion_r271455438
 
 

 ##########
 File path: cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/MainTest.java
 ##########
 @@ -861,6 +861,33 @@ private void runSourceLevelMatches(String sourceLevel, String expectedOutput) th
                       sourceLevel);
     }
 
+    public void testParameterFile() throws Exception {
+        String golden =
+            "package test;\n" +
+            "public class Test {\n" +
+            "    private void test(java.util.Collection c) {\n" +
+            "        boolean b = c.isEmpty();\n" +
+            "    }\n" +
+            "}\n";
+
+        doRunCompiler(golden,
+                      null,
+                      null,
+                      "src/test/Test.java",
+                      "package test;\n" +
+                      "public class Test {\n" +
+                      "    private void test(java.util.Collection c) {\n" +
+                      "        boolean b = c.size() == 0;\n" +
+                      "    }\n" +
+                      "}\n",
+                      "parameters.txt",
+                      "--apply\n" +
+                      "--hint\n" +
+                      "Usage of .size() == 0\n",
+                      null,
+                      "@" + getWorkDirPath() + "/parameters.txt");
 
 Review comment:
   The tests here are a little ugly here - the file is created on the fly using the lines above:
                         "parameters.txt",
                         "--apply\n" +
                         "--hint\n" +
                         "Usage of .size() == 0\n"
   
   (the parameters are basically:
   -expected file context
   -expected stdout
   -expected stderr
   -filename and file context
   -null
   -parameters sent to the tool
   )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists