Skip to content

Commit

Permalink
Merge pull request #44 from egozcl/master
Browse files Browse the repository at this point in the history
Add region South America (São Paulo)
  • Loading branch information
liry authored Sep 21, 2020
2 parents ae607cd + bae686b commit 3c4268f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Simple Amazon Glacier Uploader Changelog

### 2020/09/20 - Version 0.76.1

- Add new region: South America (São Paulo), Brasil.
- Fix class test for Windows.
- Update URL website to https://simpleamazonglacieruploader.github.io

### 2018/12/09 - Version 0.76.0

- Add new regions: EU (Frankfurt, EU (London), EU (Paris), Asia Pacific (Seoul), Asia Pacific (Osaka-Local),
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/brianmcmichael/sagu/Endpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public enum Endpoint {
CN_NORTHWEST_NINGXIA("cn-northwest-1", "China (Ningxia)"),
CA_CENTRAL("ca-central-1", "Canada (Central)"),
US_EAST_OHIO("us-east-2", "US East (Ohio)"),
US_GOV_WEST("us-gov-west-1", "AWS GovCloud (US)");
US_GOV_WEST("us-gov-west-1", "AWS GovCloud (US)"),
SA_SAO_PAULO("sa-east-1","South America (São Paulo)");

private final String id;
private final String title;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/brianmcmichael/sagu/SAGU.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class SAGU extends JFrame implements ActionListener {
TITLE + " is free software.\n" +
"Your feedback is appreciated.\n" +
"This program is not any way affiliated with Amazon Web Services or Amazon.com.";
private static final String URL_STRING = "http://simpleglacieruploader.brianmcmichael.com/";
private static final String URL_STRING = "https://simpleamazonglacieruploader.github.io/";
private static final String AWS_SITE_STRING = "Get AWS Credentials";

public static final String ACCESS_LABEL = "Access Key: ";
Expand Down
7 changes: 5 additions & 2 deletions src/test/java/com/brianmcmichael/sagu/AppPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ public class AppPropertiesTest {

private String propertiesResourcePath;
private String resourceDir;

private static final boolean IS_WINDOWS = System.getProperty( "os.name" ).contains( "indow" );

@BeforeClass
public void setUpClass() throws Exception {
propertiesResourcePath = AppPropertiesTest.class.getResource("/SAGU.properties").getPath();
propertiesResourcePath = IS_WINDOWS ? propertiesResourcePath.replace("/C:/","C:\\").replace("/","\\") : propertiesResourcePath;
resourceDir = Paths.get(propertiesResourcePath).getParent().toString();
resourceDir = IS_WINDOWS ? resourceDir.replace("/C:/","C:\\") : resourceDir;
}

@Test
Expand Down Expand Up @@ -158,4 +161,4 @@ public void savePropertiesShouldWriteThemToFile() throws Exception {
assertThat(savedProp.getProperty("logType"), is("4"));
}

}
}
10 changes: 8 additions & 2 deletions src/test/java/com/brianmcmichael/sagu/EndpointTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void shouldReturnCorrectInstanceByIndex() {
assertThat(Endpoint.getByIndex(15), is(CA_CENTRAL));
assertThat(Endpoint.getByIndex(16), is(US_EAST_OHIO));
assertThat(Endpoint.getByIndex(17), is(US_GOV_WEST));
assertThat(Endpoint.getByIndex(18), is(SA_SAO_PAULO));
}

@Test
Expand All @@ -60,6 +61,7 @@ public void getRegionTitleShouldReturnCorrectValues() {
assertThat(getTitleByIndex(15), is("Canada (Central)"));
assertThat(getTitleByIndex(16), is("US East (Ohio)"));
assertThat(getTitleByIndex(17), is("AWS GovCloud (US)"));
assertThat(getTitleByIndex(18), is("South America (São Paulo)"));
}

@Test
Expand All @@ -68,7 +70,7 @@ public void shouldPopulateComboBoxWithValuesInCorrectOrder() {
assertThat(comboBox.getItemCount(), is(0));

Endpoint.populateComboBox(comboBox);
assertThat(comboBox.getItemCount(), is(18));
assertThat(comboBox.getItemCount(), is(19));
assertThat(comboBox.getItemAt(0), is("US East (Northern Virginia)"));
assertThat(comboBox.getItemAt(1), is("US West (Oregon)"));
assertThat(comboBox.getItemAt(2), is("US West (Northern California)"));
Expand All @@ -87,6 +89,7 @@ public void shouldPopulateComboBoxWithValuesInCorrectOrder() {
assertThat(comboBox.getItemAt(15), is("Canada (Central)"));
assertThat(comboBox.getItemAt(16), is("US East (Ohio)"));
assertThat(comboBox.getItemAt(17), is("AWS GovCloud (US)"));
assertThat(comboBox.getItemAt(18), is("South America (São Paulo)"));
}

@Test
Expand All @@ -109,6 +112,7 @@ public void getGlacierEndpointShouldReturnCorrectAddress() {
assertThat(CA_CENTRAL.getGlacierEndpoint(), is("https://glacier.ca-central-1.amazonaws.com/"));
assertThat(US_EAST_OHIO.getGlacierEndpoint(), is("https://glacier.us-east-2.amazonaws.com/"));
assertThat(US_GOV_WEST.getGlacierEndpoint(), is("https://glacier.us-gov-west-1.amazonaws.com/"));
assertThat(SA_SAO_PAULO.getGlacierEndpoint(), is("https://glacier.sa-east-1.amazonaws.com/"));
}

@Test
Expand All @@ -131,6 +135,7 @@ public void getSQSEndpointShouldReturnCorrectAddress() {
assertThat(CA_CENTRAL.getSQSEndpoint(), is("https://sqs.ca-central-1.amazonaws.com/"));
assertThat(US_EAST_OHIO.getSQSEndpoint(), is("https://sqs.us-east-2.amazonaws.com/"));
assertThat(US_GOV_WEST.getSQSEndpoint(), is("https://sqs.us-gov-west-1.amazonaws.com/"));
assertThat(SA_SAO_PAULO.getSQSEndpoint(), is("https://sqs.sa-east-1.amazonaws.com/"));
}

@Test
Expand All @@ -153,5 +158,6 @@ public void getSNSEndpointShouldReturnCorrectAddress() {
assertThat(CA_CENTRAL.getSNSEndpoint(), is("https://sns.ca-central-1.amazonaws.com/"));
assertThat(US_EAST_OHIO.getSNSEndpoint(), is("https://sns.us-east-2.amazonaws.com/"));
assertThat(US_GOV_WEST.getSNSEndpoint(), is("https://sns.us-gov-west-1.amazonaws.com/"));
assertThat(SA_SAO_PAULO.getSNSEndpoint(), is("https://sns.sa-east-1.amazonaws.com/"));
}
}
}

0 comments on commit 3c4268f

Please sign in to comment.