INTEXT-34 - Convert AWS Module to Gradle
For reference see: https://jira.springsource.org/browse/INTEXT-34
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.integration.aws.common;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.integration.aws.core.AbstractAWSClientFactory;
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.springframework.integration.aws.core.AWSCredentials;
|
||||
@@ -92,8 +92,7 @@ public final class AWSTestUtils {
|
||||
|
||||
/**
|
||||
* The static helper method that would be used by other AWS tests to
|
||||
* get the implementation of the {@link AmazonWSCredentials} instance
|
||||
* @return
|
||||
* get the implementation of the {@link AWSCredentials} instance
|
||||
* @throws Exception
|
||||
*/
|
||||
public static AWSCredentials getCredentials() {
|
||||
@@ -114,7 +113,6 @@ public final class AWSTestUtils {
|
||||
* checked and the listing of the directories is retrieved.
|
||||
*
|
||||
* @param rootDirectory
|
||||
* @return
|
||||
*/
|
||||
public static List<File> getContentsRecursively(File rootDirectory) {
|
||||
if(!rootDirectory.isDirectory()) {
|
||||
@@ -150,7 +148,6 @@ public final class AWSTestUtils {
|
||||
* Helper method that will be used to generate the base64 encoded MD5 hash of the string
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static String md5Hash(String input) {
|
||||
try {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.integration.aws.config.xml;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
@@ -78,7 +78,6 @@ public abstract class AbstractAWSOutboundChannelAdapterParserTests<T extends Mes
|
||||
/**
|
||||
* Gets the Message handler implementation for the given bean id
|
||||
* @param beanId
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected T getMessageHandlerForBeanDefinition(String beanId) {
|
||||
@@ -92,15 +91,13 @@ public abstract class AbstractAWSOutboundChannelAdapterParserTests<T extends Mes
|
||||
* sub class should implement this method to return a value of the config to be used to create the
|
||||
* context
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected abstract String getConfigFilePath();
|
||||
|
||||
/**
|
||||
* The subclass should return the {@link AmazonWSCredentials} instance that is being used
|
||||
* The subclass should return the {@link AWSCredentials} instance that is being used
|
||||
* to configure the adapters
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected abstract AWSCredentials getCredentials();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.integration.aws.core;
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -44,26 +44,22 @@ public abstract class AbstractAWSClientFactoryTests<T extends AmazonWebServiceCl
|
||||
|
||||
/**
|
||||
* The subclass is responsible for returning the appropriate factory implementation
|
||||
* @return
|
||||
*/
|
||||
protected abstract AbstractAWSClientFactory<T> getFactory();
|
||||
|
||||
/**
|
||||
* Gets the endpoint for the service in US-EAST-1 region
|
||||
* @return
|
||||
*/
|
||||
protected abstract String getUSEast1Endpoint();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the endpoint for the service in US-EAST-1 region
|
||||
* @return
|
||||
*/
|
||||
protected abstract String getEUWest1Endpoint();
|
||||
|
||||
/**
|
||||
* Gets the Suffix for the endpoint URL which is service specific
|
||||
* @return
|
||||
*/
|
||||
protected abstract String getSuffix();
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package org.springframework.integration.aws.s3;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.springframework.integration.aws.common.AWSTestUtils.md5Hash;
|
||||
import static org.springframework.integration.aws.s3.AmazonS3OperationsMockingUtil.BUCKET;
|
||||
import static org.springframework.integration.aws.s3.AmazonS3OperationsMockingUtil.mockAmazonS3Operations;
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -21,6 +21,7 @@ import static org.springframework.integration.aws.s3.core.ObjectPermissions.WRIT
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -29,7 +30,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -53,7 +54,7 @@ import org.springframework.integration.test.util.TestUtils;
|
||||
public class AmazonS3ObjectBuilderTests {
|
||||
|
||||
@Rule
|
||||
public static TemporaryFolder temp = new TemporaryFolder();
|
||||
public TemporaryFolder temp = new TemporaryFolder();
|
||||
|
||||
private static final String GROUP_GRANTEE = "http://acs.amazonaws.com/groups/global/AllUsers";
|
||||
private static final String EMAIL_GRANTEE = "test@test.com";
|
||||
@@ -79,7 +80,7 @@ public class AmazonS3ObjectBuilderTests {
|
||||
* Tries to construct the file which is a directory
|
||||
*/
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void withADirectory() {
|
||||
public void withADirectory() throws IOException {
|
||||
File dir = temp.newFolder("tempdir");
|
||||
AmazonS3ObjectBuilder.getInstance().fromFile(dir);
|
||||
dir.delete();
|
||||
@@ -220,7 +221,6 @@ public class AmazonS3ObjectBuilderTests {
|
||||
|
||||
/**
|
||||
* Generate the object test ACLS
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Collection<String>> generateObjectACLS() {
|
||||
Map<String, Collection<String>> acls = new HashMap<String, Collection<String>>();
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.integration.aws.s3;
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.integration.aws.s3;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package org.springframework.integration.aws.s3;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertFalse;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.integration.aws.common.AWSTestUtils.assertFileContent;
|
||||
import static org.springframework.integration.aws.common.AWSTestUtils.getContentsRecursively;
|
||||
import static org.springframework.integration.aws.common.AWSTestUtils.md5Hash;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.Collections;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.integration.aws.s3.config.xml;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.integration.test.util.TestUtils.getPropertyValue;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package org.springframework.integration.aws.s3.config.xml;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.integration.test.util.TestUtils.getPropertyValue;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
@@ -27,9 +27,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
@@ -56,12 +57,13 @@ import com.amazonaws.services.s3.model.S3Object;
|
||||
* @since 0.5
|
||||
*
|
||||
*/
|
||||
@Ignore()
|
||||
public abstract class AbstractAmazonS3OperationsImplAWSTests {
|
||||
|
||||
private static final String VALID_CANONICAL_ID = "f854da004ee08cf4f8664334d288561c8512c508db9785388de7319ded85f8f3";
|
||||
|
||||
@Rule
|
||||
public static final TemporaryFolder temp = new TemporaryFolder();
|
||||
public final TemporaryFolder temp = new TemporaryFolder();
|
||||
|
||||
//private static final String UPLOAD_SOURCE_DIRECTORY = System.getProperty("java.io.tmpdir") + "upload";
|
||||
|
||||
@@ -572,7 +574,6 @@ public abstract class AbstractAmazonS3OperationsImplAWSTests {
|
||||
|
||||
/**
|
||||
* The private helper method that generates the test file to be uploaded
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
@@ -607,7 +608,6 @@ public abstract class AbstractAmazonS3OperationsImplAWSTests {
|
||||
*
|
||||
* @param bucket
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
protected AccessControlList getObjectACL(String bucket,String key) {
|
||||
return client.getObjectAcl(bucket, key);
|
||||
|
||||
@@ -18,9 +18,10 @@
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.integration.aws.core.PropertiesAWSCredentials;
|
||||
|
||||
@@ -43,6 +44,7 @@ import org.springframework.integration.aws.core.PropertiesAWSCredentials;
|
||||
* @since 0.5
|
||||
*
|
||||
*/
|
||||
@Ignore
|
||||
public class DefaultAmazonS3OperationsAWSTests extends AbstractAmazonS3OperationsImplAWSTests {
|
||||
|
||||
|
||||
@@ -60,6 +62,7 @@ public class DefaultAmazonS3OperationsAWSTests extends AbstractAmazonS3Operation
|
||||
* complete successfully
|
||||
*
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void withNonNullThreadPoolExecutor() {
|
||||
ThreadPoolExecutor executor = (ThreadPoolExecutor)Executors.newFixedThreadPool(10);
|
||||
@@ -71,6 +74,7 @@ public class DefaultAmazonS3OperationsAWSTests extends AbstractAmazonS3Operation
|
||||
* Sets the thread pool executor to a null value, should throw an
|
||||
* {@link IllegalArgumentException}
|
||||
*/
|
||||
@Ignore
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void withNullThreadPoolExecutor() {
|
||||
impl.setThreadPoolExecutor(null);
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.integration.aws.ses.config.xml;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.integration.aws.ses.core;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.integration.aws.core.PropertiesAWSCredentials;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
@@ -40,6 +41,7 @@ import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
* @since 0.5
|
||||
*
|
||||
*/
|
||||
@Ignore
|
||||
public class DefaultAmazonSESMailSenderAWSTests {
|
||||
|
||||
private static final String TO_EMAIL_ID = "amolnayak311@gmail.com";
|
||||
|
||||
Reference in New Issue
Block a user