Thread: [Ginp-developers] My first changes
Brought to you by:
burchbri,
dougculnane
From: Brian B. <br...@Pi...> - 2007-01-05 14:02:01
|
Hi, Doug. Thanks for putting me onto the developers list. I've just committed three related changes and have fixed the "is a directory" exception in TestSetup. 1. I changed the already-successful TestGinpModel.setup() method to use the platform-independent file path separator. This minor refactoring allowed me to debug and understand the behaviour of the java.io.File class, which was not intuitively obvious and isn't well explained in ether the jdk5 javadoc, or my older java books. I added a couple of helpful comments. The Test class continued to run OK, so I committed the change. 2. I then debugged and refactored SetupManagerImpl and Configuration to implement the same logic. It tested successfully a) with /tmp/TestSetup/ missing, b) with /tmp/TestSetup/ present but ginp.xml missing, and c) with /tmp/TestSetup/ginp.xml already present. (We probably need 3 tests for these different cases, but I don't think it is important enough to do now - especially as I tested the cases manually and all 3 cases turn up randomly when running the tests). 3. I then changed the test configuration file path constants in both test classes to be os-independent. Maven now builds the war, but before I deploy it I'm going to try fixing the log4j failures in the unit tests. Regards, Brian |
From: Doug C. <do...@cu...> - 2007-01-05 14:31:20
|
Sounds good Brian, The log4j is not really a failure it is good behavior. You do not need to supply a log4j configuration file it is optional. Maybe some users have their own logging set up for the web app and do not what log4j configured. I use commons logging so this will be compatible with most other logging frameworks. However most users will want log4j so they need to set the environment variable or drop a log4j.properties file in the class path. Maybe this needs better explanation rather than a fix. See the logging section of http://ginp.sourceforge.net/manual.html All the best, Doug Brian Burch wrote: > Hi, Doug. Thanks for putting me onto the developers list. > > I've just committed three related changes and have fixed the "is a > directory" exception in TestSetup. > > 1. I changed the already-successful TestGinpModel.setup() method to use > the platform-independent file path separator. This minor refactoring > allowed me to debug and understand the behaviour of the java.io.File > class, which was not intuitively obvious and isn't well explained in > ether the jdk5 javadoc, or my older java books. I added a couple of > helpful comments. The Test class continued to run OK, so I committed the > change. > > 2. I then debugged and refactored SetupManagerImpl and Configuration to > implement the same logic. It tested successfully a) with /tmp/TestSetup/ > missing, b) with /tmp/TestSetup/ present but ginp.xml missing, and c) > with /tmp/TestSetup/ginp.xml already present. (We probably need 3 tests > for these different cases, but I don't think it is important enough to > do now - especially as I tested the cases manually and all 3 cases turn > up randomly when running the tests). > > 3. I then changed the test configuration file path constants in both > test classes to be os-independent. > > Maven now builds the war, but before I deploy it I'm going to try fixing > the log4j failures in the unit tests. > > Regards, > > Brian > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ginp-developers mailing list > Gin...@li... > https://lists.sourceforge.net/lists/listinfo/ginp-developers > |
From: Brian B. <br...@Pi...> - 2007-01-05 19:59:38
|
Doug Culnane wrote: > > The log4j is not really a failure it is good behavior. You do not need > to supply a log4j configuration file it is optional. Maybe some users > have their own logging set up for the web app and do not what log4j > configured. I use commons logging so this will be compatible with most > other logging frameworks. I looked into the commons logging documentation and decided to replace the default LoggerFactory discovery process. I have committed two new properties files to associate SimpleLog with our jUnit tests and suppress messages less severe than "error". This looks good to me, because it makes no assumptions about the deployment logging framework. Also, no misleading messages are generated during the test goal of the maven life-cycle. > However most users will want log4j so they need to set the environment > variable or drop a log4j.properties file in the class path. > > Maybe this needs better explanation rather than a fix. See the logging > section of http://ginp.sourceforge.net/manual.html I haven't finished with logging yet, but I need to read your manual and think a bit more. BTW... I've found a couple of org.dom4j.io.SAXReader format errors in TestSetup. They don't prevent the war from being built, but something is wrong. I wonder whether I broke these tests with my earlier changes, so I'll investigate them before I do anything more. Brian |
From: Doug C. <do...@cu...> - 2007-01-06 14:06:28
|
Cool Brian, Please update the documentation for logging if you change it. The file is: src/site/xdoc/manual.xml I am afraid i do not know anything about the SAX warnings so your gess is as good as mine. All the best, Doug Brian Burch wrote: > Doug Culnane wrote: > >> The log4j is not really a failure it is good behavior. You do not need >> to supply a log4j configuration file it is optional. Maybe some users >> have their own logging set up for the web app and do not what log4j >> configured. I use commons logging so this will be compatible with most >> other logging frameworks. >> > > I looked into the commons logging documentation and decided to replace > the default LoggerFactory discovery process. I have committed two new > properties files to associate SimpleLog with our jUnit tests and > suppress messages less severe than "error". This looks good to me, > because it makes no assumptions about the deployment logging framework. > Also, no misleading messages are generated during the test goal of the > maven life-cycle. > > >> However most users will want log4j so they need to set the environment >> variable or drop a log4j.properties file in the class path. >> >> Maybe this needs better explanation rather than a fix. See the logging >> section of http://ginp.sourceforge.net/manual.html >> > > I haven't finished with logging yet, but I need to read your manual and > think a bit more. > > BTW... I've found a couple of org.dom4j.io.SAXReader format errors in > TestSetup. They don't prevent the war from being built, but something is > wrong. I wonder whether I broke these tests with my earlier changes, so > I'll investigate them before I do anything more. > > Brian > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ginp-developers mailing list > Gin...@li... > https://lists.sourceforge.net/lists/listinfo/ginp-developers > |