Changeset 50 in tmcsimulator
- Timestamp:
- 07/02/2016 03:41:05 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/tmcsim/application.properties (modified) (1 diff)
-
test/tmcsim/paramicslog/ParamicsLogFileHandlerTest.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/application.properties
r49 r50 1 #Sat, 02 Jul 2016 09:45:14 -07001 #Sat, 02 Jul 2016 16:19:54 -0700 2 2 3 Application.revision=4 73 Application.revision=49 4 4 5 5 Application.buildnumber=19 -
trunk/test/tmcsim/paramicslog/ParamicsLogFileHandlerTest.java
r47 r50 10 10 import static junit.framework.Assert.assertEquals; 11 11 import static junit.framework.Assert.assertTrue; 12 import static junit.framework.Assert.fail; 12 13 import junit.framework.TestCase; 14 import tmcsim.cadsimulator.CADSimulator; 13 15 import tmcsim.common.ScriptException; 14 16 import tmcsim.common.SimulationException; … … 39 41 { 40 42 System.out.println("getInstance"); 43 try 44 { 45 new CADSimulator("config/testConfig/cad_simulator_console_config.properties"); 46 } catch (Exception e) 47 { 48 fail("Couldn't launch CADSimulator"); 49 } 41 50 //ParamicsLog plog = ParamicsLog.getInstance(); 42 51 Properties paramicsLogProp = new Properties(); 43 52 paramicsLogProp.load(new FileInputStream(propsfile)); 44 53 String logFilename = paramicsLogProp.getProperty("LogFile"); 45 // This test assumes there is NOCADSimulator running.54 // This test requires a CADSimulator running. 46 55 Logger logger = Logger.getLogger("tmcsim.parmicsLog"); 47 56 ParamicsLogFileHandler fh = ParamicsLogFileHandler.getInstance(); 48 57 logger.addHandler(fh); 58 // write a message to the log. 49 59 logger.info("Hello friendly log."); 60 // Read from the log file and see if the desired msg is there. 50 61 File logFile = new File(logFilename); 51 62 assertTrue("log file doesn't exist", logFile.exists()); 52 String expected = "\n<!-- Time written to file: ?-->\nHello friendly log.\n";63 String expected = "\n<!-- Time written to file: 00:00:00 -->\nHello friendly log.\n"; 53 64 String actual = fh.getLog(); 54 65 assertEquals("log written incorrectly", expected, actual);
Note: See TracChangeset
for help on using the changeset viewer.
