Merge pull request #1322 from jclouds/dynect-jdk7

corrected generic type failure in jdk7 in dynect
This commit is contained in:
Adrian Cole 2013-02-19 13:25:13 -08:00
commit d6e38116c3
6 changed files with 20 additions and 14 deletions

View File

@ -101,7 +101,7 @@ public class RecordId {
return toStringHelper(this).add("zone", zone).add("fqdn", fqdn).add("type", type).add("id", id);
}
public static Builder<?> builder() {
public static Builder<?> recordIdBuilder() {
return new ConcreteBuilder();
}

View File

@ -20,6 +20,7 @@ package org.jclouds.dynect.v3.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static org.jclouds.dynect.v3.domain.RecordId.recordIdBuilder;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -63,7 +64,7 @@ public final class ToRecordIds implements Function<HttpResponse, FluentIterable<
public RecordId apply(String in) {
Matcher matcher = DEFAULT_PATTERN.matcher(in);
checkState(matcher.find() && matcher.groupCount() == 4, "%s didn't match %s", in, DEFAULT_PATTERN);
return RecordId.builder().type(matcher.group(1)).zone(matcher.group(2)).fqdn(matcher.group(3))
return recordIdBuilder().type(matcher.group(1)).zone(matcher.group(2)).fqdn(matcher.group(3))
.id(Long.parseLong(matcher.group(4))).build();
}
}

View File

@ -19,6 +19,7 @@
package org.jclouds.dynect.v3.features;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.dynect.v3.domain.RecordId.recordIdBuilder;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
@ -54,7 +55,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse soaResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_soa.json", APPLICATION_JSON)).build();
RecordId soaId = RecordId.builder()
RecordId soaId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("SOA")
@ -80,7 +81,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse aaaaResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_aaaa.json", APPLICATION_JSON)).build();
RecordId aaaaId = RecordId.builder()
RecordId aaaaId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("AAAA")
@ -106,7 +107,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse aResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_a.json", APPLICATION_JSON)).build();
RecordId aId = RecordId.builder()
RecordId aId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("A")
@ -132,7 +133,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse cnameResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_cname.json", APPLICATION_JSON)).build();
RecordId cnameId = RecordId.builder()
RecordId cnameId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("CNAME")
@ -158,7 +159,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse mxResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_mx.json", APPLICATION_JSON)).build();
RecordId mxId = RecordId.builder()
RecordId mxId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("MX")
@ -184,7 +185,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse nsResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_ns.json", APPLICATION_JSON)).build();
RecordId nsId = RecordId.builder()
RecordId nsId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("NS")
@ -210,7 +211,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse ptrResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_ptr.json", APPLICATION_JSON)).build();
RecordId ptrId = RecordId.builder()
RecordId ptrId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("PTR")
@ -247,7 +248,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse srvResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_srv.json", APPLICATION_JSON)).build();
RecordId srvId = RecordId.builder()
RecordId srvId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("SRV")
@ -268,7 +269,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
HttpResponse txtResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/get_record_txt.json", APPLICATION_JSON)).build();
RecordId txtId = RecordId.builder()
RecordId txtId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("TXT")

View File

@ -19,6 +19,7 @@
package org.jclouds.dynect.v3.functions;
import static org.jclouds.dynect.v3.domain.RecordId.recordIdBuilder;
import static org.testng.Assert.assertEquals;
import org.jclouds.dynect.v3.domain.RecordId;
@ -34,7 +35,7 @@ import com.google.gson.Gson;
@Test(groups = "unit")
public class ToRecordIdsTest {
ToRecordIds fn = new ToRecordIds(new GsonWrapper(new Gson()));
RecordId recordId = RecordId.builder()
RecordId recordId = recordIdBuilder()
.id(50976583)
.type("NS")
.zone("adrianc.zone.dynecttest.jclouds.org")

View File

@ -19,6 +19,8 @@
package org.jclouds.dynect.v3.parse;
import static org.jclouds.dynect.v3.domain.RecordId.recordIdBuilder;
import org.jclouds.dynect.v3.domain.RecordId;
import org.jclouds.dynect.v3.domain.RecordId.Builder;
import org.jclouds.dynect.v3.functions.ToRecordIds;
@ -43,7 +45,7 @@ public class ListRecordsResponseTest extends BaseDynECTParseTest<FluentIterable<
@Override
@ResponseParser(ToRecordIds.class)
public FluentIterable<RecordId> expected() {
Builder<?> builder = RecordId.builder()
Builder<?> builder = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org");
return FluentIterable.from(ImmutableSet.<RecordId> builder()

View File

@ -1,5 +1,6 @@
package org.jclouds.dynect.v3.predicates;
import static org.jclouds.dynect.v3.domain.RecordId.recordIdBuilder;
import static org.jclouds.dynect.v3.predicates.RecordPredicates.typeEquals;
import org.jclouds.dynect.v3.domain.RecordId;
@ -11,7 +12,7 @@ import org.testng.annotations.Test;
*/
@Test(groups = "unit")
public class RecordPredicatesTest {
RecordId recordId = RecordId.builder()
RecordId recordId = recordIdBuilder()
.zone("adrianc.zone.dynecttest.jclouds.org")
.fqdn("adrianc.zone.dynecttest.jclouds.org")
.type("SOA")