1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package br.com.ingenieux.mojo.beanstalk;
18
19 import com.amazonaws.services.s3.AmazonS3Client;
20 import com.amazonaws.services.s3.model.S3Object;
21
22 import org.junit.Ignore;
23 import org.junit.internal.runners.JUnit38ClassRunner;
24 import org.junit.runner.RunWith;
25
26 import java.io.File;
27
28 @Ignore
29 @RunWith(JUnit38ClassRunner.class)
30 public class BootstrapTest extends BeanstalkTestBase {
31
32 private String s3Key;
33 private String s3Bucket;
34 private File artifactFile;
35
36 @Override
37 protected void setUp() throws Exception {
38 super.setUp();
39
40 artifactFile = getWarFile();
41 s3Bucket = getS3Bucket();
42 s3Key = getS3Path();
43
44 setVariableValueToObject(uploadSourceBundleMojo, "artifactFile", artifactFile);
45 setVariableValueToObject(uploadSourceBundleMojo, "s3Bucket", s3Bucket);
46 setVariableValueToObject(uploadSourceBundleMojo, "s3Key", s3Key);
47
48 setVariableValueToObject(createAppVersionMojo, "versionLabel", this.versionLabel);
49 }
50
51 public void testUploadSourceBundle() throws Exception {
52 uploadSourceBundleMojo.execute();
53
54 AmazonS3Client s3Client = new AmazonS3Client(this.credentials);
55
56 S3Object object = s3Client.getObject(s3Bucket, s3Key);
57
58 assertNotNull(object);
59 assertEquals(object.getObjectMetadata().getContentLength(), artifactFile.length());
60 }
61
62 public void testCreateApplicationVersion() throws Exception {
63 createAppVersionMojo.execute();
64 }
65
66 public void testCreateConfigurationTemplate() throws Exception {
67 createConfigurationTemplateMojo.execute();
68 }
69
70 public void testDeployment() throws Exception {}
71 }