Author: janb Date: Wed Aug 13 00:11:59 2008 New Revision: 685471 URL: http://svn.apache.org/viewvc?rev=685471&view=rev Log: Replace printlns with log.debug messages; uncomment commented-out tests for windows; comment out exception printouts for deployer test.
Modified: maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/retrieve/RetrievalTarget.java maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyDeployerTest.java maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyRetrieverTest.java Modified: maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/retrieve/RetrievalTarget.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/retrieve/RetrievalTarget.java?rev=685471&r1=685470&r2=685471&view=diff ============================================================================== --- maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/retrieve/RetrievalTarget.java (original) +++ maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/retrieve/RetrievalTarget.java Wed Aug 13 00:11:59 2008 @@ -41,6 +41,9 @@ import org.apache.maven.mercury.transport.api.Binding; import org.apache.maven.mercury.transport.api.Server; import org.mortbay.jetty.client.HttpExchange; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** @@ -53,6 +56,7 @@ */ public abstract class RetrievalTarget { + private static final Logger log = LoggerFactory.getLogger( RetrievalTarget.class ); public static final String __PREFIX = "JTY_"; public static final String __TEMP_SUFFIX = ".tmp"; public static final int __START_STATE = 1; @@ -166,7 +170,8 @@ if (_binding.isFile()) { boolean ok = _tempFile.renameTo( _binding.getLocalFile() ); - System.err.println("Renaming "+_tempFile.getAbsolutePath()+" to "+_binding.getLocalFile().getAbsolutePath()+": "+ok); + if (log.isDebugEnabled()) + log.debug("Renaming "+_tempFile.getAbsolutePath()+" to "+_binding.getLocalFile().getAbsolutePath()+": "+ok); return ok; } else @@ -461,8 +466,9 @@ { if ( _tempFile != null && _tempFile.exists() ) { - boolean ok = _tempFile.delete(); - System.err.println("Deleting "+_tempFile.getAbsolutePath()+" : "+ok); + boolean ok = _tempFile.delete(); + if (log.isDebugEnabled()) + log.debug("Deleting file "+_tempFile.getAbsolutePath()+" : "+ok); return ok; } return false; Modified: maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyDeployerTest.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyDeployerTest.java?rev=685471&r1=685470&r2=685471&view=diff ============================================================================== --- maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyDeployerTest.java (original) +++ maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyDeployerTest.java Wed Aug 13 00:11:59 2008 @@ -209,8 +209,8 @@ DeployResponse response = _deployer.deploy(request); - for (HttpClientException t:response.getExceptions()) - t.printStackTrace(); +/* for (HttpClientException t:response.getExceptions()) + t.printStackTrace();*/ assertEquals(0, response.getExceptions().size()); File f0 = new File(_putServer.getPutDir(), "file0.txt"); @@ -348,9 +348,9 @@ request.setBindings(bindings); DeployResponse response = _deployer.deploy(request); - for (HttpClientException t:response.getExceptions()) +/* for (HttpClientException t:response.getExceptions()) t.printStackTrace(); - +*/ //as the serverside is not running the mercury enhancements to the put filter, then //all the files except for the 2 which don't exists should have been uploaded assertEquals(2, response.getExceptions().size()); @@ -423,8 +423,8 @@ request.setFailFast(true); DeployResponse response = _deployer.deploy(request); - for (HttpClientException t:response.getExceptions()) - t.printStackTrace(); +/* for (HttpClientException t:response.getExceptions()) + t.printStackTrace();*/ //with failfast==true and the server side not running the mercury enhancements, we have no way to know //how many files actually did get uploaded, but the first exception should cause it to stop @@ -464,8 +464,8 @@ request.setFailFast(true); DeployResponse response = _deployer.deploy(request); - for (HttpClientException t:response.getExceptions()) - t.printStackTrace(); +/* for (HttpClientException t:response.getExceptions()) + t.printStackTrace();*/ assertEquals(0, response.getExceptions().size()); Modified: maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyRetrieverTest.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyRetrieverTest.java?rev=685471&r1=685470&r2=685471&view=diff ============================================================================== --- maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyRetrieverTest.java (original) +++ maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/test/java/org/apache/maven/mercury/spi/http/client/JettyRetrieverTest.java Wed Aug 13 00:11:59 2008 @@ -159,7 +159,7 @@ assert dir.canWrite(); return dir; } - /* + public void testSyncRetrievalAllGood() throws Exception { @@ -212,7 +212,7 @@ assertTrue(!file5.exists()); } -*/ + public void testSyncRetrievalPgpGood() throws Exception @@ -247,7 +247,7 @@ } -/* + public void testSyncRetrievalFailFast() throws Exception { @@ -307,8 +307,7 @@ Thread.sleep(100); } - */ -/* + public void testSyncRetrievalLenient0() throws Exception { @@ -362,7 +361,7 @@ assertTrue(!file4.exists()); assertTrue(!file5.exists()); } -*/ + public void testSyncRetrievalLenient1() throws Exception { @@ -412,7 +411,7 @@ assertTrue(file5.exists()); } - /* + public void testValidatorSuccess() throws Exception { factories.add(new SHA1VerifierFactory(true, true)); //lenient, sufficient @@ -466,8 +465,7 @@ assertTrue(file4.exists()); assertTrue(file5.exists()); } - */ - /* + public void testValidatorFailure () throws Exception { factories.add(new SHA1VerifierFactory(true, true)); //lenient, sufficient @@ -521,9 +519,7 @@ assertTrue(!file4.exists()); assertTrue(!file5.exists()); } - */ - /* - + public void testMemoryRetrieval () throws Exception { factories.add(new SHA1VerifierFactory(true, true)); //lenient, sufficient @@ -566,5 +562,5 @@ IO.copy(is,os); assertEquals(os.toByteArray().length, binding5.getInboundContent().length); } - */ + }