@@ -0,0 +1,1727 @@
+package org.apache.cassandra.locator;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.io.IOException;%0Aimport java.net.InetAddress;%0Aimport java.util.Map;%0A%0Aimport org.apache.cassandra.config.ConfigurationException;%0Aimport org.apache.cassandra.gms.ApplicationState;%0Aimport org.apache.cassandra.gms.Gossiper;%0Aimport org.apache.cassandra.gms.VersionedValue;%0Aimport org.apache.cassandra.service.StorageService;%0Aimport org.junit.Test;%0A%0Apublic class EC2SnitchTest%0A%7B%0A%0A    private class TestEC2Snitch extends Ec2Snitch%0A    %7B%0A        public TestEC2Snitch() throws IOException, ConfigurationException%0A        %7B%0A            super();%0A        %7D%0A%0A        @Override%0A        String awsApiCall(String url) throws IOException, ConfigurationException%0A        %7B%0A            return %22us-east-1d%22;%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testRac() throws IOException, ConfigurationException%0A    %7B%0A        Ec2Snitch snitch = new TestEC2Snitch();%0A        InetAddress local = InetAddress.getByName(%22127.0.0.1%22);%0A        InetAddress nonlocal = InetAddress.getByName(%22127.0.0.7%22);%0A        %0A        Gossiper.instance.addSavedEndpoint(nonlocal);%0A        Map%3CApplicationState,VersionedValue%3E stateMap = Gossiper.instance.getEndpointStateForEndpoint(nonlocal).getApplicationStateMap();%0A        stateMap.put(ApplicationState.DC, StorageService.instance.valueFactory.datacenter(%22us-west%22));%0A        stateMap.put(ApplicationState.RACK, StorageService.instance.valueFactory.datacenter(%221a%22));%0A        %0A        assertEquals(%22us-west%22, snitch.getDatacenter(nonlocal));%0A        assertEquals(%221a%22, snitch.getRack(nonlocal));%0A        %0A        assertEquals(%22us-east%22, snitch.getDatacenter(local));%0A        assertEquals(%221d%22, snitch.getRack(local));%0A    %7D%0A%7D%0A

add EC2SnitchTest.java