kopia lustrzana https://github.com/gaul/s3proxy
				
				
				
			add jclouds test
							rodzic
							
								
									9b61608352
								
							
						
					
					
						commit
						8f60c1e076
					
				
							
								
								
									
										31
									
								
								pom.xml
								
								
								
								
							
							
						
						
									
										31
									
								
								pom.xml
								
								
								
								
							| 
						 | 
				
			
			@ -299,7 +299,8 @@
 | 
			
		|||
      <groupId>org.assertj</groupId>
 | 
			
		||||
      <artifactId>assertj-core</artifactId>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
      <version>2.0.0</version>
 | 
			
		||||
      <!-- we need to use the same version as in jclouds because we pull in their tests -->
 | 
			
		||||
      <version>1.7.0</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.eclipse.jetty</groupId>
 | 
			
		||||
| 
						 | 
				
			
			@ -311,5 +312,33 @@
 | 
			
		|||
      <artifactId>slf4j-api</artifactId>
 | 
			
		||||
      <version>1.7.12</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <!-- tests dependencies -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.apache.jclouds</groupId>
 | 
			
		||||
      <artifactId>jclouds-blobstore</artifactId>
 | 
			
		||||
      <version>${jclouds.version}</version>
 | 
			
		||||
      <type>test-jar</type>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.apache.jclouds.api</groupId>
 | 
			
		||||
      <artifactId>s3</artifactId>
 | 
			
		||||
      <version>${jclouds.version}</version>
 | 
			
		||||
      <type>test-jar</type>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.apache.jclouds</groupId>
 | 
			
		||||
      <artifactId>jclouds-core</artifactId>
 | 
			
		||||
      <version>${jclouds.version}</version>
 | 
			
		||||
      <type>test-jar</type>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.testng</groupId>
 | 
			
		||||
      <artifactId>testng</artifactId>
 | 
			
		||||
      <version>6.8.8</version>
 | 
			
		||||
      <scope>test</scope>
 | 
			
		||||
    </dependency>
 | 
			
		||||
  </dependencies>
 | 
			
		||||
</project>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,85 @@
 | 
			
		|||
/*
 | 
			
		||||
 * Copyright 2014-2015 Andrew Gaul <andrew@gaul.org>
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed 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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.gaul.s3proxy;
 | 
			
		||||
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.Properties;
 | 
			
		||||
import java.util.concurrent.ExecutionException;
 | 
			
		||||
import java.util.concurrent.TimeUnit;
 | 
			
		||||
 | 
			
		||||
import com.google.common.base.Throwables;
 | 
			
		||||
import com.google.common.util.concurrent.Uninterruptibles;
 | 
			
		||||
 | 
			
		||||
import org.jclouds.Constants;
 | 
			
		||||
import org.jclouds.blobstore.BlobStoreContext;
 | 
			
		||||
import org.jclouds.s3.blobstore.integration.S3BlobIntegrationLiveTest;
 | 
			
		||||
 | 
			
		||||
import org.junit.AfterClass;
 | 
			
		||||
 | 
			
		||||
import org.testng.SkipException;
 | 
			
		||||
 | 
			
		||||
public final class JcloudsIntegrationTest extends S3BlobIntegrationLiveTest {
 | 
			
		||||
    protected static final int AWAIT_CONSISTENCY_TIMEOUT_SECONDS =
 | 
			
		||||
            Integer.parseInt(
 | 
			
		||||
                    System.getProperty(
 | 
			
		||||
                            "test.blobstore.await-consistency-timeout-seconds",
 | 
			
		||||
                            "0"));
 | 
			
		||||
    private S3Proxy s3Proxy;
 | 
			
		||||
    private BlobStoreContext context;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void testPutObjectStream()
 | 
			
		||||
            throws InterruptedException, IOException, ExecutionException {
 | 
			
		||||
        throw new SkipException("not passing yet");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void testSetBlobAccess() throws Exception {
 | 
			
		||||
        throw new SkipException("not passing yet");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @AfterClass
 | 
			
		||||
    public void tearDown() throws Exception {
 | 
			
		||||
        s3Proxy.stop();
 | 
			
		||||
        context.close();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void awaitConsistency() {
 | 
			
		||||
        Uninterruptibles.sleepUninterruptibly(
 | 
			
		||||
                AWAIT_CONSISTENCY_TIMEOUT_SECONDS, TimeUnit.SECONDS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected Properties setupProperties() {
 | 
			
		||||
        TestUtils.S3ProxyLaunchInfo info;
 | 
			
		||||
        try {
 | 
			
		||||
            info = TestUtils.startS3Proxy();
 | 
			
		||||
            s3Proxy = info.getS3Proxy();
 | 
			
		||||
            context = info.getBlobStore().getContext();
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            throw Throwables.propagate(e);
 | 
			
		||||
        }
 | 
			
		||||
        Properties props = super.setupProperties();
 | 
			
		||||
        props.setProperty(Constants.PROPERTY_IDENTITY, info.getS3Identity());
 | 
			
		||||
        props.setProperty(Constants.PROPERTY_CREDENTIAL,
 | 
			
		||||
                info.getS3Credential());
 | 
			
		||||
        props.setProperty(Constants.PROPERTY_ENDPOINT,
 | 
			
		||||
                info.getEndpoint().toString());
 | 
			
		||||
        return props;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Ładowanie…
	
		Reference in New Issue