maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r522654 - in /maven/wagon/trunk/wagon-providers/wagon-s3: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/wagon/ src/main/java/org/apache/maven/wag...
Date Mon, 26 Mar 2007 22:53:12 GMT
Author: jvanzyl
Date: Mon Mar 26 15:53:01 2007
New Revision: 522654

URL: http://svn.apache.org/viewvc?view=rev&rev=522654
Log:
o adding a wagon s3 provider for use with amazon's data provider service

Added:
    maven/wagon/trunk/wagon-providers/wagon-s3/
    maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml   (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/
    maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties   (with
props)

Added: maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml (added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml Mon Mar 26 15:53:01 2007
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>wagon-providers</artifactId>
+    <groupId>org.apache.maven.wagon</groupId>
+    <version>1.0-beta-2</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>wagon-s3</artifactId>
+  <name>Maven Wagon Amazon S3 Provider</name>
+  <description>Wagon that gets and puts artifacts using the Amazon S3 protocol</description>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/WAGON</url>
+  </issueManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <!--
+            Insert values in s3auth.properties file then set this to false...
+            must have valid s3 account, there is no way to synthesize one.
+          -->
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.amazonaws.s3</groupId>
+      <artifactId>jets3t</artifactId>
+      <version>0.5.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.0.1</version>
+    </dependency>
+  </dependencies>
+</project>
+

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java
Mon Mar 26 15:53:01 2007
@@ -0,0 +1,260 @@
+package org.apache.maven.wagon.providers.s3;
+
+/*
+ * 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 java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.maven.wagon.AbstractWagon;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.TransferFailedException;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.authorization.AuthorizationException;
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.resource.Resource;
+import org.jets3t.service.S3Service;
+import org.jets3t.service.S3ServiceException;
+import org.jets3t.service.model.S3Bucket;
+import org.jets3t.service.model.S3Object;
+import org.jets3t.service.security.AWSCredentials;
+
+/**
+ * Base jests3t impl of S3 Wagon.
+ * 
+ * @author Eric Redmond
+ * 
+ * @plexus.component role="org.apache.maven.wagon.Wagon" 
+ *   role-hint="s3rest"
+ *   instantiation-strategy="per-lookup"
+ */
+public abstract class AbstractS3Wagon
+    extends AbstractWagon
+{
+    // TODO: add multithread support - need to put the 
+    //S3ServiceSimpleMulti simpleMulti = new S3ServiceSimpleMulti(s3Service);
+
+    private S3Service s3Service;
+
+    private S3Bucket bucket;
+
+    public void openConnection()
+        throws ConnectionException, AuthenticationException
+    {
+        if( authenticationInfo == null )
+        {
+            throw new AuthenticationException( "Authentication info must be set prior to
opening S3 connection." );
+        }
+
+        String passphrase = authenticationInfo.getPassphrase();
+        String privateKey = authenticationInfo.getPrivateKey();
+
+        AWSCredentials awsCredentials = new AWSCredentials( privateKey, passphrase );
+
+        String host = getRepository().getHost();
+
+        try
+        {
+            s3Service = getService( awsCredentials );
+
+            // create bucket - or just get object
+            bucket = s3Service.createBucket( host );
+        }
+        catch( S3ServiceException e )
+        {
+            throw new ConnectionException( "Cannot create service", e );
+        }
+
+        // TODO: Add proxy to S3 connections...
+    }
+
+    protected void closeConnection() throws ConnectionException
+    {}
+
+    protected abstract S3Service getService( AWSCredentials awsCredentials )
+        throws S3ServiceException;
+
+    public void get( String resourceName, File destination )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        Resource resource = new Resource( resourceName );
+
+        fireGetInitiated( resource, destination );
+
+        S3Object s3Object = null;
+
+        // TODO: loop a few times?
+
+        try
+        {
+            s3Object = s3Service.getObject( bucket, resourceName );
+
+            BufferedInputStream bis = new BufferedInputStream( s3Object.getDataInputStream()
);
+
+            FileOutputStream fos = new FileOutputStream( destination );
+
+            byte[] readerBytes = new byte[ 1024*8 ];
+            int size = 0;
+            while( (size = bis.read( readerBytes )) > 0 )
+            {
+                fos.write( readerBytes, 0, size );
+            }
+        }
+        catch( S3ServiceException e )
+        {
+            throw new ResourceDoesNotExistException( "Cannot put object to S3", e );
+        }
+        catch( FileNotFoundException e )
+        {
+            throw new ResourceDoesNotExistException( "", e );
+        }
+        catch( IOException e )
+        {
+            throw new TransferFailedException( "", e );
+        }
+
+        fireGetCompleted( resource, destination );
+    }
+
+    public boolean getIfNewer( String resourceName, File destination, long timestamp )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        Resource resource = new Resource( resourceName );
+
+        S3Object s3Object = null;
+
+        try
+        {
+            s3Object = s3Service.getObjectDetails( bucket, resource.getName() );
+
+            Date lastModified = s3Object.getLastModifiedDate();
+
+            if( lastModified.getTime() > timestamp )
+            {
+                get( resourceName, destination );
+
+                return true;
+            }
+        }
+        catch( S3ServiceException e )
+        {
+            throw new TransferFailedException( "Cannot put object to S3", e );
+        }
+
+        return false;
+    }
+
+    public void put( File source, String destination )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        Resource resource = new Resource( destination );
+
+        InputStream is;
+        try
+        {
+            is = new FileInputStream( source );
+        }
+        catch( FileNotFoundException e )
+        {
+            fireTransferError( resource, e, TransferEvent.REQUEST_PUT );
+
+            throw new ResourceDoesNotExistException( "Cannot find source file", e );
+        }
+
+        firePutInitiated( resource, source );
+
+        S3Object s3Object = new S3Object( resource.getName() );
+
+        s3Object.setDataInputStream( is );
+        s3Object.setContentLength( source.length() );
+//        s3Object.setContentEncoding( "" );
+        s3Object.setContentType( "binary/octet-stream" );
+
+        try
+        {
+            s3Service.putObject( bucket, s3Object );
+        }
+        catch( S3ServiceException e )
+        {
+            throw new TransferFailedException( "Cannot put object to S3", e );
+        }
+
+        // TODO: loop a few times?
+
+        firePutCompleted( resource, source );
+    }
+
+    public List getFileList( String destinationDirectory )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        Resource resource = new Resource( destinationDirectory );
+
+        try
+        {
+            S3Object[] filteredObjects = s3Service.listObjects( bucket, resource.getName(),
null );
+
+            if ( filteredObjects == null || filteredObjects.length <= 0 )
+            {
+                throw new ResourceDoesNotExistException( "Could not find file: '" + resource
+ "'" );
+            }
+
+            List ret = new ArrayList();
+            for( int i=0; i<filteredObjects.length; i++ )
+            {
+                String key = filteredObjects[i].getKey();
+
+                // only need the end of the key
+
+                ret.add( key.substring( key.lastIndexOf( '/' ) + 1 ) );
+            }
+
+            return ret;
+        }
+        catch( S3ServiceException e)
+        {
+            throw new TransferFailedException( "Error getting file list via S3", e );
+        }
+    }
+    
+    public boolean resourceExists( String resourceName )
+        throws TransferFailedException, AuthorizationException
+    {
+        Resource resource = new Resource( resourceName );
+
+        try
+        {
+            S3Object s3Object = s3Service.getObjectDetails( bucket, resource.getName() );
+
+            return s3Object != null;
+        }
+        catch ( S3ServiceException e )
+        {
+            return false;
+        }
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/AbstractS3Wagon.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java
Mon Mar 26 15:53:01 2007
@@ -0,0 +1,49 @@
+package org.apache.maven.wagon.providers.s3;
+
+/*
+ * 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.jets3t.service.S3Service;
+import org.jets3t.service.S3ServiceException;
+import org.jets3t.service.impl.rest.httpclient.RestS3Service;
+import org.jets3t.service.security.AWSCredentials;
+
+/**
+ * A REST impl of S3 Wagon.
+ * 
+ * @author Eric Redmond
+ * 
+ * @plexus.component role="org.apache.maven.wagon.Wagon" 
+ *   role-hint="s3rest"
+ *   instantiation-strategy="per-lookup"
+ */
+public class S3RESTWagon
+    extends AbstractS3Wagon
+{
+    public String getProtocol()
+    {
+        return "s3rest";
+    }
+
+    protected S3Service getService( AWSCredentials awsCredentials )
+        throws S3ServiceException
+    {
+        return new RestS3Service( awsCredentials );
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3RESTWagon.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java
Mon Mar 26 15:53:01 2007
@@ -0,0 +1,49 @@
+package org.apache.maven.wagon.providers.s3;
+
+/*
+ * 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.jets3t.service.S3Service;
+import org.jets3t.service.S3ServiceException;
+import org.jets3t.service.impl.soap.axis.SoapS3Service;
+import org.jets3t.service.security.AWSCredentials;
+
+/**
+ * A SOAP impl of S3 Wagon.
+ * 
+ * @author Eric Redmond
+ * 
+ * @plexus.component role="org.apache.maven.wagon.Wagon" 
+ *   role-hint="s3soap"
+ *   instantiation-strategy="per-lookup"
+ */
+public class S3SOAPWagon
+    extends AbstractS3Wagon
+{
+    public String getProtocol()
+    {
+        return "s3soap";
+    }
+
+    protected S3Service getService( AWSCredentials awsCredentials )
+        throws S3ServiceException
+    {
+        return new SoapS3Service( awsCredentials );
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/main/java/org/apache/maven/wagon/providers/s3/S3SOAPWagon.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java
Mon Mar 26 15:53:01 2007
@@ -0,0 +1,86 @@
+package org.apache.maven.wagon.providers.s3;
+
+/*
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.maven.wagon.WagonTestCase;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+
+/**
+ * Base test class for S3 wagon tests. You must have a file named "s3auth.properties" in
the
+ * test classpath (i.e. src/test/resources) containing two properties: awsAccessKey and awsSecretKey
+ * set to a valid Amazon S3 account's information.
+ * 
+ * @author eredmond
+ */
+public abstract class AbstractS3WagonTest
+    extends WagonTestCase
+{
+    private AuthenticationInfo authInfo = new AuthenticationInfo();
+    
+    protected final String awsAccessKey;
+    protected final String awsSecretKey;
+
+    public AbstractS3WagonTest()
+    {
+        Properties testProperties = new Properties();
+        try
+        {
+            InputStream propertiesIS = getClassLoader().getResourceAsStream( "s3auth.properties"
);
+            testProperties.load( propertiesIS );
+        }
+        catch( Exception e )
+        {
+            fail( "Unable to load properties file from classpath: s3auth.properties. You
must have this file " +
+                "in the classpath to run tests." );
+        }
+
+        awsAccessKey = testProperties.getProperty( "awsAccessKey" );
+        awsSecretKey = testProperties.getProperty( "awsSecretKey" );
+
+        if( awsAccessKey == null || awsAccessKey.length() == 0 ||
+        	awsSecretKey == null || awsSecretKey.length() == 0 )
+        {
+            fail( "awsAccessKey or awsSecretKey is not set in s3auth.properties. You must
have these properties set to run tests." );
+        }
+    }
+
+    protected abstract String getProtocol();
+
+    protected abstract String getTestRepositoryUrl() throws IOException;
+
+    protected AuthenticationInfo getAuthInfo()
+    {
+        authInfo = new AuthenticationInfo();
+
+        authInfo.setPassphrase( awsSecretKey );
+        authInfo.setPrivateKey( awsAccessKey );
+
+        return authInfo;
+    }
+
+    public void testWagon()
+    {
+        // TODO: checksum failure... but why?
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/AbstractS3WagonTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java
Mon Mar 26 15:53:01 2007
@@ -0,0 +1,40 @@
+package org.apache.maven.wagon.providers.s3;
+
+/*
+ * 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 java.io.IOException;
+
+/**
+ * Test the REST S3 Impl
+ * @author eredmond
+ */
+public class S3RESTWagonTest
+    extends AbstractS3WagonTest
+{
+    protected String getProtocol()
+    {
+        return "s3rest";
+    }
+
+    protected String getTestRepositoryUrl() throws IOException
+    {
+        return "s3rest://" + awsAccessKey + "-test";
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3RESTWagonTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java
Mon Mar 26 15:53:01 2007
@@ -0,0 +1,40 @@
+package org.apache.maven.wagon.providers.s3;
+
+/*
+ * 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 java.io.IOException;
+
+/**
+ * Test the SOAP S3 Impl
+ * @author eredmond
+ */
+public class S3SOAPWagonTest
+    extends AbstractS3WagonTest
+{
+    protected String getProtocol()
+    {
+        return "s3soap";
+    }
+
+    protected String getTestRepositoryUrl() throws IOException
+    {
+        return "s3soap://" + awsAccessKey + "-test";
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/java/org/apache/maven/wagon/providers/s3/S3SOAPWagonTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties?view=auto&rev=522654
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties (added)
+++ maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties Mon Mar
26 15:53:01 2007
@@ -0,0 +1,18 @@
+#  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.
+awsAccessKey=
+awsSecretKey=

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-providers/wagon-s3/src/test/resources/s3auth.properties
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message