< prev index next >

test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java

Print this page




 133         }
 134 
 135         oa.shouldHaveExitValue(0);
 136         output = oa.getOutput();
 137         System.out.println(output);
 138 
 139         String[] parts = output.split("hsdb>");
 140         for (String cmd : commands) {
 141             int index = commands.indexOf(cmd) + 1;
 142             OutputAnalyzer out = new OutputAnalyzer(parts[index]);
 143 
 144             if (expectedStrMap != null) {
 145                 List<String> expectedStr = expectedStrMap.get(cmd);
 146                 if (expectedStr != null) {
 147                     for (String exp : expectedStr) {
 148                         out.shouldMatch(exp);
 149                     }
 150                 }
 151             }
 152 


 153             if (unExpectedStrMap != null) {
 154                 List<String> unExpectedStr = unExpectedStrMap.get(cmd);
 155                 if (unExpectedStr != null) {
 156                     for (String unExp : unExpectedStr) {
 157                         out.shouldNotMatch(unExp);
 158                     }
 159                 }
 160             }
 161         }
 162         return output;
 163     }
 164 
 165     /**
 166      *
 167      * Launches 'jhsdb clhsdb', attaches to the Lingered App, executes the commands,
 168      * checks for expected and unexpected strings.
 169      * @param lingeredAppPid  - pid of the Lingered App or one its sub-classes.
 170      * @param commands  - clhsdb commands to execute.
 171      * @param expectedStrMap - Map of expected strings per command which need to
 172      *                         be checked in the output of the command.




 133         }
 134 
 135         oa.shouldHaveExitValue(0);
 136         output = oa.getOutput();
 137         System.out.println(output);
 138 
 139         String[] parts = output.split("hsdb>");
 140         for (String cmd : commands) {
 141             int index = commands.indexOf(cmd) + 1;
 142             OutputAnalyzer out = new OutputAnalyzer(parts[index]);
 143 
 144             if (expectedStrMap != null) {
 145                 List<String> expectedStr = expectedStrMap.get(cmd);
 146                 if (expectedStr != null) {
 147                     for (String exp : expectedStr) {
 148                         out.shouldMatch(exp);
 149                     }
 150                 }
 151             }
 152 
 153             out.shouldNotMatch("Warning! JS Engine can't start, some commands will not be available.");
 154 
 155             if (unExpectedStrMap != null) {
 156                 List<String> unExpectedStr = unExpectedStrMap.get(cmd);
 157                 if (unExpectedStr != null) {
 158                     for (String unExp : unExpectedStr) {
 159                         out.shouldNotMatch(unExp);
 160                     }
 161                 }
 162             }
 163         }
 164         return output;
 165     }
 166 
 167     /**
 168      *
 169      * Launches 'jhsdb clhsdb', attaches to the Lingered App, executes the commands,
 170      * checks for expected and unexpected strings.
 171      * @param lingeredAppPid  - pid of the Lingered App or one its sub-classes.
 172      * @param commands  - clhsdb commands to execute.
 173      * @param expectedStrMap - Map of expected strings per command which need to
 174      *                         be checked in the output of the command.


< prev index next >