Author: struberg Date: Thu Jun 2 12:26:10 2011 New Revision: 1130514 URL: http://svn.apache.org/viewvc?rev=1130514&view=rev Log: WAGON-330 enable TCK tests for wagon-http-lightweight
Added: maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/TckTest.java Removed: maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/resources/ssl/ Modified: maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/HttpWagonTests.java maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java Added: maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/TckTest.java URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/TckTest.java?rev=1130514&view=auto ============================================================================== --- maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/TckTest.java (added) +++ maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/TckTest.java Thu Jun 2 12:26:10 2011 @@ -0,0 +1,33 @@ +package org.apache.maven.wagon.providers.http; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.wagon.tck.http.GetWagonTests; +import org.apache.maven.wagon.tck.http.HttpsGetWagonTests; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * This test will runn the TCK suite on wagon-http-lightweight + */ +@RunWith( Suite.class ) +@Suite.SuiteClasses( { GetWagonTests.class, HttpsGetWagonTests.class } ) +public class TckTest { +} Modified: maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java?rev=1130514&r1=1130513&r2=1130514&view=diff ============================================================================== --- maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java (original) +++ maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java Thu Jun 2 12:26:10 2011 @@ -19,10 +19,6 @@ package org.apache.maven.wagon.tck.http; * under the License. */ -import static junit.framework.Assert.assertTrue; -import static junit.framework.Assert.fail; -import static org.apache.maven.wagon.tck.http.Assertions.assertFileContentsFromResource; - import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.StreamWagon; @@ -42,11 +38,14 @@ import org.codehaus.plexus.component.con import org.junit.Ignore; import org.junit.Test; +import javax.servlet.Servlet; +import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; -import javax.servlet.Servlet; -import javax.servlet.http.HttpServletResponse; +import static junit.framework.Assert.assertTrue; +import static junit.framework.Assert.fail; +import static org.apache.maven.wagon.tck.http.Assertions.assertFileContentsFromResource; public class GetWagonTests extends HttpWagonTests @@ -193,7 +192,7 @@ public class GetWagonTests throws ConnectionException, AuthenticationException, ComponentConfigurationException, IOException, ResourceDoesNotExistException, AuthorizationException { - if ( !initTest( "http://dummy-host", null, null ) ) + if ( !initTest( "http://dummy-host.invalid", null, null ) ) { return; } Modified: maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/HttpWagonTests.java URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/HttpWagonTests.java?rev=1130514&r1=1130513&r2=1130514&view=diff ============================================================================== --- maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/HttpWagonTests.java (original) +++ maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/HttpWagonTests.java Thu Jun 2 12:26:10 2011 @@ -19,8 +19,6 @@ package org.apache.maven.wagon.tck.http; * under the License. */ -import static org.apache.maven.wagon.tck.http.util.TestUtil.getResource; - import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.authentication.AuthenticationException; @@ -43,6 +41,8 @@ import java.io.IOException; import java.util.HashSet; import java.util.Set; +import static org.apache.maven.wagon.tck.http.util.TestUtil.getResource; + public abstract class HttpWagonTests { Modified: maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java?rev=1130514&r1=1130513&r2=1130514&view=diff ============================================================================== --- maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java (original) +++ maven/wagon/trunk/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java Thu Jun 2 12:26:10 2011 @@ -19,8 +19,6 @@ package org.apache.maven.wagon.tck.http. * under the License. */ -import static org.apache.maven.wagon.tck.http.util.TestUtil.getResource; - import org.mortbay.jetty.Connector; import org.mortbay.jetty.Handler; import org.mortbay.jetty.Server; @@ -39,20 +37,23 @@ import org.mortbay.jetty.servlet.Servlet import org.mortbay.jetty.servlet.SessionHandler; import org.mortbay.jetty.webapp.WebAppContext; +import javax.servlet.Filter; +import javax.servlet.Servlet; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; +import java.util.logging.Logger; -import javax.servlet.Filter; -import javax.servlet.Servlet; +import static org.apache.maven.wagon.tck.http.util.TestUtil.getResource; public class ServerFixture { public static final String SERVER_ROOT_RESOURCE_PATH = "default-server-root"; + // it seems that some JDKs have a problem if you use different key stores + // so we gonna reuse the keystore which is is used in the wagon implementations already public static final String SERVER_SSL_KEYSTORE_RESOURCE_PATH = "ssl/keystore"; - - public static final String SERVER_SSL_KEYSTORE_PASSWORD = "password"; + public static final String SERVER_SSL_KEYSTORE_PASSWORD = "wagonhttp"; public static final String SERVER_HOST = "localhost"; @@ -75,6 +76,11 @@ public class ServerFixture SslSocketConnector connector = new SslSocketConnector(); String keystore = getResource( SERVER_SSL_KEYSTORE_RESOURCE_PATH ).getAbsolutePath(); + Logger.getLogger(ServerFixture.class.getName()).info("TCK Keystore path: " + keystore); + System.setProperty( "javax.net.ssl.keyStore", keystore ); + System.setProperty( "javax.net.ssl.trustStore", keystore ); + + // connector.setHost( SERVER_HOST ); connector.setPort( port ); connector.setKeystore( keystore );