Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Don't overwrite the resources/default-configs/log4j.properties file
Browse files Browse the repository at this point in the history
git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk/nexus@6395 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
vtatavu committed Apr 29, 2010
1 parent 10d4f5f commit 67390d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nexus-test-harness/nexus-test-harness-launcher/pom.xml
Expand Up @@ -26,7 +26,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-test-environment-maven-plugin</artifactId>
<version>1.4</version>
<version>1.5-SNAPSHOT</version>
<executions>
<execution>
<id>env</id>
Expand Down
Expand Up @@ -247,10 +247,10 @@ private void setupLog4j()
throws IOException
{
File defaultLog4j = new File( TestProperties.getFile( "default-configs" ), "log4j.properties" );
File confLog4j = new File( nexusWorkDir, "conf/log4j.properties" );
// File confLog4j = new File( nexusWorkDir, "conf/log4j.properties" );

updateLog4j( defaultLog4j );
updateLog4j( confLog4j );
// updateLog4j( confLog4j );
}

private void updateLog4j( File log4jFile )
Expand All @@ -266,10 +266,18 @@ private void updateLog4j( File log4jFile )

attachPropertiesToLog( properties );

log4jFile.getParentFile().mkdirs();
FileOutputStream output = new FileOutputStream( log4jFile );
properties.store( output );
IOUtil.close( output );
String newFileName = this.getTestId() + "/test-config/log4j.properties";
File newLog4JFile = new File( TestProperties.getString( "test.resources.folder" ), newFileName );
newLog4JFile.getParentFile().mkdirs();
FileOutputStream output = new FileOutputStream( newLog4JFile );
try
{
properties.store( output );
}
finally
{
IOUtil.close( output );
}
}

protected void attachPropertiesToLog( EnhancedProperties properties )
Expand Down

0 comments on commit 67390d8

Please sign in to comment.