Changeset 51
- Timestamp:
- 02/21/12 11:07:59 (13 years ago)
- Location:
- trunk/t3q/src/org/etsi/t3q
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/t3q/src/org/etsi/t3q/T3Q.java
r43 r51 17 17 import org.etsi.t3q.config.T3QConfig; 18 18 import org.etsi.t3q.config.T3QOptionsHandler; 19 import org.etsi.t3q.exceptions.TTCN3BehaviorException;20 import org.etsi.t3q.exceptions.TTCN3ParserException;21 19 import org.etsi.t3q.visitor.T3QVisitor; 22 20 import org.etsi.common.InputInterface; … … 35 33 import de.ugoe.cs.swe.trex.core.analyzer.rfparser.TTCN3Parser; 36 34 import de.ugoe.cs.swe.trex.core.formatter.TTCN3Formatter; 35 import de.ugoe.cs.swe.trex.core.visitor.TTCN3BehaviorException; 36 import de.ugoe.cs.swe.trex.core.visitor.TTCN3ParserException; 37 37 38 38 public class T3Q { 39 39 40 private static String versionNumber = "v1.0. 2";40 private static String versionNumber = "v1.0.3"; 41 41 //set during automated server builds 42 42 private static String buildStamp = "---BUILD_STAMP---"; … … 169 169 String className = analyzer.getExceptions().get(i1).getStackTrace()[0].getClassName(); 170 170 String methodName = analyzer.getExceptions().get(i1).getStackTrace()[0].getMethodName(); 171 exceptionMessage+="\n "+className.substring(className.lastIndexOf(".")+1)+" : "+methodName; 171 //moved from below, migrate to t3d as well 172 String lineMessage = "Line " 173 + analyzer.getExceptions().get(i1).getLine() 174 + ": " 175 + analyzer.getExceptions().get(i1).getMessage(); 176 ; 177 // if (className.substring(className.lastIndexOf(".")+1).equals("TTCN3Parser")){ 178 exceptionMessage+="\n "+className.substring(className.lastIndexOf(".")+1)+" : "+methodName +"\n "+lineMessage; 179 // } 172 180 } 173 181 //TODO: adapt to T3D as well … … 186 194 } catch (TTCN3ParserException e) { 187 195 System.err.println(e.getLocalizedMessage()); 188 for (int i1 = 0; i1 < analyzer.getExceptions()189 .size(); i1++) {190 System.err.println("Line "191 + analyzer.getExceptions().get(i1)192 .getLine()193 + ": "194 + analyzer.getExceptions().get(i1)195 .getMessage());196 }197 196 // e.printStackTrace(); 198 197 } … … 267 266 // parsing error 268 267 System.err.println(e.getLocalizedMessage()); 269 for (int i = 0; i < analyzer.getExceptions().size(); i++) {270 System.err.println("Line "271 + analyzer.getExceptions().get(i).getLine() + ": "272 + analyzer.getExceptions().get(i).getMessage());273 }274 268 // TODO: Isolate different steps and implement a recovery mechanism: 275 269 276 270 } 277 271 //TODO: move to common, use in T3D as well 272 if (getLogLevel().equals(LogLevel.DEBUG)) { 273 int mb = 1024*1024; 274 Runtime.getRuntime().maxMemory(); 275 Runtime runtime = Runtime.getRuntime(); 276 System.out.println(); 277 System.out.println("============Memory statistics:==========="); 278 // Print used memory 279 System.out.println("Used Memory:\t" 280 + (runtime.totalMemory() - runtime.freeMemory()) / mb+" MB"); 281 // Print free memory 282 System.out.println("Free Memory:\t" + runtime.freeMemory() / mb+" MB"); 283 // Print total available memory 284 System.out.println("Total Memory:\t" + runtime.totalMemory() / mb+" MB"); 285 // Print maximum available memory 286 System.out.println("Max Memory:\t" + runtime.maxMemory() / mb+" MB"); 287 } 278 288 } 279 289 … … 305 315 System.out.println(" Formatting file: " 306 316 + analyzer.getFilename()); 317 307 318 try { 308 319 … … 310 321 311 322 String source = MiscTools.readFile(resourcePath); 312 323 313 324 String formatted = formatter.formatTTCN3Source(source, 314 325 T3Q.activeProfile.getFormattingParameters()); … … 359 370 360 371 } catch (RecognitionException e1) { 361 System.err.println("Recognition exception:"); 362 System.err.println(e1.getLocalizedMessage()); 372 373 String exceptionMessage = "Error while formatting file (recognition) " 374 + analyzer.getFilename(); 375 String className = e1.getStackTrace()[0].getClassName(); 376 String methodName = e1.getStackTrace()[0].getMethodName(); 377 String lineMessage = "Line " 378 + e1.getLine() 379 + ": " 380 + e1.getMessage(); 381 382 exceptionMessage+="\n "+className.substring(className.lastIndexOf(".")+1)+" : "+methodName +"\n "+lineMessage; 383 //TODO: adapt to T3D as well? 384 385 System.err.println(exceptionMessage); 386 387 363 388 } catch (TokenStreamException e) { 364 389 System.err.println("Token stream exception:"); 365 390 e.printStackTrace(); 366 391 } catch (Exception e) { 367 System.err.println("Exception :");392 System.err.println("Exception while processing "+ttcn3Resources.get(i)+" :"); 368 393 e.printStackTrace(); 369 394 } -
trunk/t3q/src/org/etsi/t3q/T3QMT.java
r7 r51 11 11 12 12 import org.etsi.t3q.config.T3QConfig; 13 import org.etsi.t3q.exceptions.TTCN3BehaviorException;14 import org.etsi.t3q.exceptions.TTCN3ParserException;15 13 import org.etsi.t3q.visitor.T3QVisitor; 16 14 import org.etsi.common.MiscTools; … … 29 27 import de.ugoe.cs.swe.trex.core.formatter.TTCN3Formatter; 30 28 import de.ugoe.cs.swe.trex.core.formatter.TTCN3FormatterParameters; 29 import de.ugoe.cs.swe.trex.core.visitor.TTCN3BehaviorException; 30 import de.ugoe.cs.swe.trex.core.visitor.TTCN3ParserException; 31 31 32 32 public class T3QMT { -
trunk/t3q/src/org/etsi/t3q/visitor/QualityChecker.java
r47 r51 1900 1900 do { 1901 1901 if (logItem.getFirstChild().getType()!=TTCN3ParserTokenTypes.TemplateInstance){ 1902 //get actual log item text 1902 1903 logStatementText += logItem.getFirstChild().getText(); 1903 1904 } else { 1904 // TODO: attempt to perform resolution1905 //substitute other elements with empty string 1905 1906 logStatementText += ""; 1906 1907 //TODO: consider fixing the parser, this is an ugly workaround -
trunk/t3q/src/org/etsi/t3q/visitor/T3QVisitor.java
r7 r51 4 4 5 5 import org.etsi.t3q.T3Q; 6 import org.etsi.t3q.exceptions.TTCN3BehaviorException;7 6 8 7 import de.ugoe.cs.swe.trex.core.analyzer.rfparser.LocationAST; 9 8 import de.ugoe.cs.swe.trex.core.visitor.AbstractVisitor; 9 import de.ugoe.cs.swe.trex.core.visitor.TTCN3BehaviorException; 10 11 //TODO: substitute with upstream abstract visitor 10 12 public class T3QVisitor extends AbstractVisitor { 11 13
Note: See TracChangeset
for help on using the changeset viewer.