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 2018/08/23 05:55:26 UTC

[GitHub] junichi11 commented on a change in pull request #751: [NETBEANS-1151] Fix unit test files of php.editor

junichi11 commented on a change in pull request #751: [NETBEANS-1151] Fix unit test files of php.editor
URL: https://github.com/apache/incubator-netbeans/pull/751#discussion_r212189553
 
 

 ##########
 File path: php.editor/test/unit/src/org/netbeans/modules/php/editor/parser/ParserPerformanceTest.java
 ##########
 @@ -47,17 +47,17 @@ protected void tearDown() throws Exception {
     }
 
     // the current time is around 1200 ms
-//    public void testBigFile() throws Exception {
-//        File testFile = new File(getDataDir(), "testfiles/parser/performance/performance.php");
-//        assertTrue(testFile.exists());
-//        String testSource = TestUtilities.copyFileToString(testFile);
-//        ASTPHP5Scanner scanner = new ASTPHP5Scanner(new StringReader(testSource));
-//        ASTPHP5Parser parser = new ASTPHP5Parser(scanner);
-//        Date start = new Date();
-//        Symbol root = parser.parse();
-//        Date end = new Date();
-//        long time = end.getTime() - start.getTime();
-//        System.out.println("Parsing of big files takes: " + time);
-//        assertTrue(time < 2500);
-//    }
+    public void testBigFile() throws Exception {
+        File testFile = new File(getDataDir(), "testfiles/parser/performance/performance.php");
+        assertTrue(testFile.exists());
+        String testSource = TestUtilities.copyFileToString(testFile);
+        ASTPHP5Scanner scanner = new ASTPHP5Scanner(new StringReader(testSource));
+        ASTPHP5Parser parser = new ASTPHP5Parser(scanner);
+        Date start = new Date();
+        Symbol root = parser.parse();
+        Date end = new Date();
+        long time = end.getTime() - start.getTime();
+        System.out.println("Parsing of big files takes: " + time);
+        assertTrue(time < 2500);
+    }
 
 Review comment:
   @tmysik Thanks for you answer! OK, we should test both nette.min.php and Mpdf :)
   I'm going to change to the following:
   ```java
       public void testBigFile_01() throws Exception {
           testBigFile("testfiles/parser/performance/Mpdf.php"); // 1.01MB
       }
   
       public void testBigFile_02() throws Exception {
           testBigFile("testfiles/actions/testImportData/libs/nette.min.php"); // 537KB
       }
   
       private void testBigFile(String filePath) throws Exception {
           File testFile = new File(getDataDir(), filePath);
           assertTrue(testFile.exists());
           String testSource = TestUtilities.copyFileToString(testFile);
           ASTPHP5Scanner scanner = new ASTPHP5Scanner(new StringReader(testSource));
           ASTPHP5Parser parser = new ASTPHP5Parser(scanner);
           Date start = new Date();
           Symbol root = parser.parse();
           Date end = new Date();
           long time = end.getTime() - start.getTime();
           System.out.println("Parsing of big files takes: " + time);
           assertTrue(time < 2500);
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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