- Timestamp:
- 12/07/17 17:08:59 (7 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-generic-event-monitor-test/src/test/java/de/ugoe/cs/autoquest/genericeventmonitor/GenericEventMonitorTest.java
r2164 r2232 652 652 if (file.exists()) { 653 653 if (file.isDirectory()) { 654 for (File child : file.listFiles()) { 655 deleteFiles(child); 654 File[] files = file.listFiles(); 655 if (files != null) { 656 for (File child : files) { 657 deleteFiles(child); 658 } 656 659 } 657 660 } -
trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java
r1911 r2232 825 825 if (file.exists()) { 826 826 if (file.isDirectory()) { 827 for (File child : file.listFiles()) { 828 deleteFiles(child); 827 File[] files = file.listFiles(); 828 if (files != null) { 829 for (File child : files) { 830 deleteFiles(child); 831 } 829 832 } 830 833 } -
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
r1822 r2232 535 535 */ 536 536 private void handleOldLogFiles(File oldLogDir, File newLogDir) { 537 if (oldLogDir.exists() && oldLogDir.isDirectory() ) {537 if (oldLogDir.exists() && oldLogDir.isDirectory() && (oldLogDir.listFiles() != null)) { 538 538 boolean allFilesRenamed = true; 539 539 for (File oldLogFile : oldLogDir.listFiles()) { -
trunk/autoquest-httpmonitor-test/src/test/java/de/ugoe/cs/autoquest/httpmonitor/AbstractTC.java
r2116 r2232 83 83 84 84 /** */ 85 private staticTomcat tomcat = new Tomcat();85 private Tomcat tomcat = new Tomcat(); 86 86 87 87 /** … … 295 295 if (file.exists()) { 296 296 if (file.isDirectory()) { 297 for (File child : file.listFiles()) { 298 deleteFiles(child); 297 File[] files = file.listFiles(); 298 if (files != null) { 299 for (File child : files) { 300 deleteFiles(child); 301 } 299 302 } 300 303 } -
trunk/autoquest-plugin-android/src/main/java/de/ugoe/cs/autoquest/plugin/android/commands/CMDparseDirAndroid.java
r1819 r2232 69 69 70 70 String absolutPath = folder.getAbsolutePath(); 71 for (String filename : folder.list()) { 72 String source = absolutPath + File.separator + filename; 73 Console.traceln(Level.INFO, "Processing file: " + source); 71 String[] filenames = folder.list(); 72 73 if (filenames != null) { 74 for (String filename : filenames) { 75 String source = absolutPath + File.separator + filename; 76 Console.traceln(Level.INFO, "Processing file: " + source); 74 77 75 try { 76 parser.parseFile(source); 77 } 78 catch (Exception e) { 79 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 80 } 78 try { 79 parser.parseFile(source); 80 } 81 catch (Exception e) { 82 Console.printerrln("Could not parse " + source + ": " + e.getMessage()); 83 } 84 } 81 85 } 82 86 -
trunk/autoquest-plugin-core-test/src/test/java/de/ugoe/cs/autoquest/plugin/PluginLoaderTest.java
r1098 r2232 198 198 loader.load(); 199 199 } catch(PluginLoaderException e) { 200 e.getMessage().endsWith("not instance of AutoQUESTPlugin");200 assertTrue(e.getMessage().endsWith("not instance of AutoQUESTPlugin")); 201 201 } 202 202 } … … 209 209 loader.load(); 210 210 } catch(PluginLoaderException e) { 211 e.getMessage().startsWith("No class");211 assertTrue(e.getMessage().startsWith("No class")); 212 212 } 213 213 } … … 220 220 loader.load(); 221 221 } catch(PluginLoaderException e) { 222 e.getMessage().endsWith("Could not access");222 assertTrue(e.getMessage().endsWith("Could not access")); 223 223 } 224 224 } -
trunk/autoquest-plugin-core/src/main/java/de/ugoe/cs/autoquest/plugin/PluginLoader.java
r2230 r2232 97 97 }); 98 98 99 for (File jarFile : jarFiles) { 100 updateClassLoader(jarFile); 101 102 String pluginName = jarFile.getName().split("-")[2]; 103 String pluginClassName = "de.ugoe.cs.autoquest.plugin." + pluginName 104 + "." + pluginName.toUpperCase() + "Plugin"; 105 106 Class<?> pluginClass = null; 107 try { 108 pluginClass = Class.forName(pluginClassName); 109 } catch (ClassNotFoundException e) { 110 throw new PluginLoaderException("No class '" + pluginClassName 111 + "' found in " + pluginDir + "/" + jarFile.getName()); 112 } 113 try { 114 AutoQUESTPlugin pluginObject = (AutoQUESTPlugin) pluginClass 115 .newInstance(); 116 plugins.add(pluginObject); 117 } catch (InstantiationException e) { 118 throw new PluginLoaderException("Could not instantiate " 119 + pluginClassName); 120 } catch (IllegalAccessException e) { 121 throw new PluginLoaderException("Could not access " 122 + pluginClassName); 123 } catch (ClassCastException e) { 124 throw new PluginLoaderException("Class " + pluginClassName 125 + " not instance of AutoQUESTPlugin"); 99 if (jarFiles != null) { 100 for (File jarFile : jarFiles) { 101 updateClassLoader(jarFile); 102 103 String pluginName = jarFile.getName().split("-")[2]; 104 String pluginClassName = "de.ugoe.cs.autoquest.plugin." + pluginName 105 + "." + pluginName.toUpperCase() + "Plugin"; 106 107 Class<?> pluginClass = null; 108 try { 109 pluginClass = Class.forName(pluginClassName); 110 } catch (ClassNotFoundException e) { 111 throw new PluginLoaderException("No class '" + pluginClassName 112 + "' found in " + pluginDir + "/" + jarFile.getName()); 113 } 114 try { 115 AutoQUESTPlugin pluginObject = (AutoQUESTPlugin) pluginClass 116 .newInstance(); 117 plugins.add(pluginObject); 118 } catch (InstantiationException e) { 119 throw new PluginLoaderException("Could not instantiate " 120 + pluginClassName); 121 } catch (IllegalAccessException e) { 122 throw new PluginLoaderException("Could not access " 123 + pluginClassName); 124 } catch (ClassCastException e) { 125 throw new PluginLoaderException("Class " + pluginClassName 126 + " not instance of AutoQUESTPlugin"); 127 } 126 128 } 127 129 } -
trunk/autoquest-plugin-genericevents/src/main/java/de/ugoe/cs/autoquest/plugin/genericevents/commands/CMDparseDirGenericEvents.java
r2165 r2232 112 112 if (file.isDirectory()) { 113 113 String[] children = file.list(); 114 Arrays.sort(children);115 114 116 for (String child : children) { 117 File childFile = new File(file, child); 118 parseFile(childFile, parser); 115 if (children != null) { 116 Arrays.sort(children); 117 118 for (String child : children) { 119 File childFile = new File(file, child); 120 parseFile(childFile, parser); 121 } 119 122 } 120 123 } -
trunk/autoquest-plugin-genericevents/src/main/java/de/ugoe/cs/autoquest/plugin/genericevents/commands/CMDsplitDirGenericEvents.java
r2165 r2232 95 95 if (source.isDirectory()) { 96 96 String[] children = source.list(); 97 Arrays.sort(children);98 97 99 for (String child : children) { 100 File childFile = new File(source, child); 101 File childDestination = new File(dest, child); 102 splitFile(childFile, childDestination, timediff); 98 if (children != null) { 99 Arrays.sort(children); 100 101 for (String child : children) { 102 File childFile = new File(source, child); 103 File childDestination = new File(dest, child); 104 splitFile(childFile, childDestination, timediff); 105 } 103 106 } 104 107 } -
trunk/autoquest-plugin-guitar/src/main/java/de/ugoe/cs/autoquest/plugin/guitar/commands/CMDefgTestCasesToSequences.java
r927 r2232 74 74 parser = new GUITARTestCaseParser(efgFileName); 75 75 } 76 for (File testcaseFile : testcaseFiles) { 77 Console.traceln(Level.INFO, "Loading from file " 78 + testcaseFile.getAbsolutePath()); 79 sequences.add(parser.parseTestCaseFile(testcaseFile)); 76 77 if (testcaseFiles != null) { 78 for (File testcaseFile : testcaseFiles) { 79 Console.traceln(Level.INFO, "Loading from file " 80 + testcaseFile.getAbsolutePath()); 81 sequences.add(parser.parseTestCaseFile(testcaseFile)); 82 } 80 83 } 84 81 85 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) { 82 86 CommandHelpers.dataOverwritten(sequencesName); -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcompressHTMLLogFiles.java
r1276 r2232 72 72 if (directory.isDirectory()) { 73 73 File[] children = directory.listFiles(); 74 Arrays.sort(children);75 74 76 boolean containsAtLeastOneFile = false; 77 for (File child : children) { 78 compressDirectory(child); 79 80 containsAtLeastOneFile |= child.isFile(); 75 boolean containsAtLeastOneFile = false; 76 if (children != null) { 77 Arrays.sort(children); 78 79 for (File child : children) { 80 compressDirectory(child); 81 82 containsAtLeastOneFile |= child.isFile(); 83 } 81 84 } 82 85 -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcorrectHTMLLogDirs.java
r1496 r2232 78 78 if (file.isDirectory()) { 79 79 String[] children = file.list(); 80 Arrays.sort(children);81 80 82 for (String child : children) { 83 File childFile = new File(file, child); 84 correctDirectory(childFile, mainFolder); 81 if (children != null) { 82 Arrays.sort(children); 83 84 for (String child : children) { 85 File childFile = new File(file, child); 86 correctDirectory(childFile, mainFolder); 87 } 85 88 } 86 89 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDdeleteHTMLQueries.java
r2125 r2232 71 71 File[] children = directory.listFiles(); 72 72 73 for (File child : children) { 74 deleteHTMLQueriesInDirectory(child); 73 if (children != null) { 74 for (File child : children) { 75 deleteHTMLQueriesInDirectory(child); 76 } 75 77 } 76 78 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDparseDirHTML.java
r1496 r2232 130 130 if (file.isDirectory()) { 131 131 String[] children = file.list(); 132 Arrays.sort(children);133 132 134 for (String child : children) { 135 File childFile = new File(file, child); 136 parseFile(childFile, parser); 133 if (children != null) { 134 Arrays.sort(children); 135 136 for (String child : children) { 137 File childFile = new File(file, child); 138 parseFile(childFile, parser); 139 } 137 140 } 138 141 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDpseudomizeHTMLTextInputs.java
r1352 r2232 88 88 File[] children = directory.listFiles(); 89 89 90 for (File child : children) { 91 pseudomizeTextInputsInDirectory 92 (child, pseudomizeSearchInputs, pseudomizeFileInputs); 90 if (children != null) { 91 for (File child : children) { 92 pseudomizeTextInputsInDirectory 93 (child, pseudomizeSearchInputs, pseudomizeFileInputs); 94 } 93 95 } 94 96 }
Note: See TracChangeset
for help on using the changeset viewer.