http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/AdminURLTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/AdminURLTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/AdminURLTest.java new file mode 100644 index 0000000..ed5280e --- /dev/null +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/AdminURLTest.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.openstack.keystone.catalog.functions; + +import static org.jclouds.openstack.keystone.catalog.ServiceEndpoint.Interface.ADMIN; +import static org.jclouds.openstack.keystone.catalog.ServiceEndpoint.Interface.PUBLIC; +import static org.testng.Assert.assertEquals; + +import java.net.URI; +import java.util.Collections; + +import org.jclouds.openstack.keystone.catalog.ServiceEndpoint; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "AdminURLTest") +public class AdminURLTest { + private final AdminURL fn = new AdminURL(); + + public void testAdminURL() { + assertEquals( + fn.apply( + Collections.singletonList(ServiceEndpoint + .builder() + .type("cdn") + .regionId("LON") + .version("1.0") + .url(URI + .create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) + .iface(ADMIN).build())).get(), + URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")); + } + + public void testReturnsNullIfNotAdminURI() { + assertEquals( + fn.apply( + Collections.singletonList(ServiceEndpoint.builder().type("cdn").regionId("LON").version("1.0") + .url(URI.create("https://192.168.1.1")).iface(PUBLIC).build())).get(), null); + } + +}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/InternalURLTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/InternalURLTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/InternalURLTest.java new file mode 100644 index 0000000..fec5dd8 --- /dev/null +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/InternalURLTest.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.openstack.keystone.catalog.functions; + +import static org.jclouds.openstack.keystone.catalog.ServiceEndpoint.Interface.INTERNAL; +import static org.testng.Assert.assertEquals; + +import java.net.URI; +import java.util.Collections; + +import org.jclouds.openstack.keystone.catalog.ServiceEndpoint; +import org.testng.annotations.Test; + +/** + */ +@Test(groups = "unit", testName = "InternalURLTest") +public class InternalURLTest { + private final InternalURL fn = new InternalURL(); + + public void testInternalURL() { + assertEquals( + fn.apply(Collections.singletonList(ServiceEndpoint.builder().type("cdn").regionId("regionOne") + .version("2.0") + .url(URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")) + .iface(INTERNAL).build())).get(), + URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")); + } +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/PublicURLOrInternalTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/PublicURLOrInternalTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/PublicURLOrInternalTest.java new file mode 100644 index 0000000..477236b --- /dev/null +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/PublicURLOrInternalTest.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.openstack.keystone.catalog.functions; + +import static org.jclouds.openstack.keystone.catalog.ServiceEndpoint.Interface.INTERNAL; +import static org.jclouds.openstack.keystone.catalog.ServiceEndpoint.Interface.PUBLIC; +import static org.testng.Assert.assertEquals; + +import java.net.URI; +import java.util.Collections; + +import org.jclouds.openstack.keystone.catalog.ServiceEndpoint; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "PublicURLOrInternalTest") +public class PublicURLOrInternalTest { + private final PublicURLOrInternal fn = new PublicURLOrInternal(); + + public void testPublicURLNotNullReturnsPublicURL() { + assertEquals( + fn.apply( + Collections.singletonList(ServiceEndpoint + .builder() + .type("cdn") + .regionId("LON") + .version("1.0") + .url(URI + .create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) + .iface(PUBLIC).build())).get(), + URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")); + } + + public void testPublicURLNullReturnsInternalURL() { + assertEquals( + fn.apply( + Collections.singletonList(ServiceEndpoint.builder().type("cdn").regionId("LON").version("1.0") + .url(URI.create("https://192.168.1.1")).iface(INTERNAL).build())).get(), + URI.create("https://192.168.1.1")); + } +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/ReturnRegionOrProviderTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/ReturnRegionOrProviderTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/ReturnRegionOrProviderTest.java new file mode 100644 index 0000000..bc25ad3 --- /dev/null +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/catalog/functions/ReturnRegionOrProviderTest.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.openstack.keystone.catalog.functions; + +import static org.jclouds.openstack.keystone.catalog.ServiceEndpoint.Interface.PUBLIC; +import static org.testng.Assert.assertEquals; + +import java.net.URI; + +import org.jclouds.openstack.keystone.catalog.ServiceEndpoint; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "ReturnRegionOrProviderTest") +public class ReturnRegionOrProviderTest { + private final ReturnRegionOrProvider fn = new ReturnRegionOrProvider("openstack-keystone"); + + public void testRegionNotNullReturnsRegion() { + assertEquals( + fn.apply(ServiceEndpoint.builder().type("cdn").regionId("LON").version("1.0") + .url(URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) + .iface(PUBLIC).build()), "LON"); + } + + public void testRegionNullReturnsProvider() { + assertEquals( + fn.apply(ServiceEndpoint.builder().type("cdn").version("1.0") + .url(URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) + .iface(PUBLIC).build()), "openstack-keystone"); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/CredentialTypesTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/CredentialTypesTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/CredentialTypesTest.java deleted file mode 100644 index a609630..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/CredentialTypesTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.config; - -import static org.testng.Assert.assertEquals; - -import org.jclouds.openstack.keystone.v2_0.domain.PasswordCredentials; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableSet; - -@Test(groups = "unit", testName = "CredentialTypesTest") -public class CredentialTypesTest { - - public void testCredentialTypeOfWhenValid() { - assertEquals(CredentialTypes.credentialTypeOf(PasswordCredentials.createWithUsernameAndPassword("username", - "password")), CredentialTypes.PASSWORD_CREDENTIALS); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCredentialTypeOfWithoutAnnotation() { - CredentialTypes.credentialTypeOf(""); - } - - public void testIndexByCredentialTypeWhenValid() { - assertEquals(CredentialTypes.indexByCredentialType( - ImmutableSet.of(PasswordCredentials.createWithUsernameAndPassword("username", "password"))).keySet(), - ImmutableSet.of(CredentialTypes.PASSWORD_CREDENTIALS)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testIndexByCredentialTypeWithoutAnnotation() { - CredentialTypes.indexByCredentialType(ImmutableSet.of("")); - } -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/ProviderModuleExpectTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/ProviderModuleExpectTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/ProviderModuleExpectTest.java deleted file mode 100644 index b40fcbf..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/config/ProviderModuleExpectTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.config; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; -import static org.jclouds.util.Suppliers2.getLastValueInMap; -import static org.testng.Assert.assertTrue; - -import java.io.Closeable; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import java.net.URI; -import java.util.Properties; - -import javax.inject.Qualifier; -import javax.inject.Singleton; -import javax.ws.rs.HEAD; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; - -import org.jclouds.Fallbacks.FalseOnNotFoundOr404; -import org.jclouds.apis.ApiMetadata; -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.json.config.GsonModule.DateAdapter; -import org.jclouds.json.config.GsonModule.Iso8601DateAdapter; -import org.jclouds.location.suppliers.RegionIdToURISupplier; -import org.jclouds.openstack.keystone.v2_0.KeystoneApi; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; -import org.jclouds.openstack.keystone.v2_0.internal.BaseKeystoneRestApiExpectTest; -import org.jclouds.rest.ConfiguresHttpApi; -import org.jclouds.rest.annotations.ApiVersion; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.config.HttpApiModule; -import org.jclouds.rest.internal.BaseHttpApiMetadata; -import org.jclouds.rest.internal.BaseRestApiExpectTest; -import org.testng.annotations.Test; - -import com.google.common.base.Supplier; -import com.google.common.collect.ImmutableSet; -import com.google.inject.Module; -import com.google.inject.Provides; - -/** - * Tests configuration via {@link ProviderModule} - */ -@Test(groups = "unit", testName = "ProviderModuleExpectTest") -public class ProviderModuleExpectTest extends BaseRestApiExpectTest<ProviderModuleExpectTest.DNSApi> { - - @Retention(RUNTIME) - @Target(METHOD) - @Qualifier - static @interface DNS { - } - - @ConfiguresHttpApi - public static class DNSHttpApiModule extends HttpApiModule<DNSApi> { - - @Override - public void configure() { - bind(DateAdapter.class).to(Iso8601DateAdapter.class); - super.configure(); - } - - @Provides - @Singleton - @DNS - protected final Supplier<URI> provideCDNUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion) { - return getLastValueInMap(factory.createForApiTypeAndVersion("dns", apiVersion)); - } - } - - @org.jclouds.rest.annotations.Endpoint(DNS.class) - interface DNSApi extends Closeable { - @HEAD - @Path("/zones/{zoneName}") - @Fallback(FalseOnNotFoundOr404.class) - boolean zoneExists(@PathParam("zoneName") String zoneName); - } - - public void testDNSEndpointApplied() { - KeystoneAuth keystoneAuth = new KeystoneAuth(); - - DNSApi api = requestsSendResponses( - keystoneAuth.getKeystoneAuthWithUsernameAndPassword(), - keystoneAuth.getResponseWithKeystoneAccess(), - HttpRequest.builder().method("HEAD").endpoint("http://172.16.0.1:8776/v1/3456/zones/foo.com").build(), - HttpResponse.builder().statusCode(200).build()); - assertTrue(api.zoneExists("foo.com")); - } - - private static class DNSApiMetadata extends BaseHttpApiMetadata<DNSApi> { - - @Override - public Builder toBuilder() { - return new Builder().fromApiMetadata(this); - } - - public DNSApiMetadata() { - this(new Builder()); - } - - protected DNSApiMetadata(Builder builder) { - super(builder); - } - - public static Properties defaultProperties() { - Properties properties = BaseHttpApiMetadata.defaultProperties(); - properties.setProperty(SERVICE_TYPE, "dns"); - properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS); - return properties; - } - - public static class Builder extends BaseHttpApiMetadata.Builder<DNSApi, Builder> { - - protected Builder() { - id("dns") - .name("DNS API") - .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant") - .credentialName("${password}") - .endpointName("Keystone base url ending in /v2.0/") - .documentation(URI.create("http://dns")) - .version("1.0") - .defaultEndpoint("http://localhost:5000/v2.0/") - .defaultProperties(DNSApiMetadata.defaultProperties()) - .defaultModules(ImmutableSet.<Class<? extends Module>>builder() - .add(AuthenticationApiModule.class) - .add(KeystoneAuthenticationModule.class) - .add(RegionModule.class) - .add(DNSHttpApiModule.class).build()); - } - - @Override - public DNSApiMetadata build() { - return new DNSApiMetadata(this); - } - - @Override - protected Builder self() { - return this; - } - } - } - - @Override - public ApiMetadata createApiMetadata() { - return new DNSApiMetadata(); - } - - public static class KeystoneAuth extends BaseKeystoneRestApiExpectTest<KeystoneApi> { - public HttpRequest getKeystoneAuthWithUsernameAndPassword() { - return keystoneAuthWithUsernameAndPassword; - } - - public HttpResponse getResponseWithKeystoneAccess() { - return responseWithKeystoneAccess; - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java index af9e2d5..8cc3c69 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java @@ -26,11 +26,11 @@ import java.util.Properties; import java.util.Set; import org.jclouds.http.HttpRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.keystone.v2_0.KeystoneApi; import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; import org.jclouds.openstack.keystone.v2_0.domain.Token; import org.jclouds.openstack.keystone.v2_0.domain.User; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; import org.jclouds.openstack.keystone.v2_0.internal.BaseKeystoneApiLiveTest; import org.testng.annotations.Test; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/AdminURLTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/AdminURLTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/AdminURLTest.java deleted file mode 100644 index 310d41b..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/AdminURLTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.functions; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; - -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; -import org.testng.annotations.Test; - -@Test(groups = "unit", testName = "AdminURLTest") -public class AdminURLTest { - private final AdminURL fn = new AdminURL(); - - public void testAdminURL() { - assertEquals(fn.apply( - Endpoint.builder().region("LON").versionId("1.0").adminURL( - URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) - .build()).get(), URI - .create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")); - } - - public void testPublicURLNullReturnsInternalURL() { - assertEquals(fn - .apply( - Endpoint.builder().region("lon").versionId("1.0") - .internalURL(URI.create("https://192.168.1.1")).build()).get(), null); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java deleted file mode 100644 index 3f37825..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.functions; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; - -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; -import org.testng.annotations.Test; - -/** - */ -@Test(groups = "unit", testName = "InternalURLTest") -public class InternalURLTest { - private final InternalURL fn = new InternalURL(); - - public void testInternalURL() { - assertEquals( - fn.apply( - Endpoint.builder().region("regionOne").versionId("2.0") - .internalURL(URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")) - .build()).get(), URI.create("https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0")); - } -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/PublicURLOrInternalIfNullTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/PublicURLOrInternalIfNullTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/PublicURLOrInternalIfNullTest.java deleted file mode 100644 index 7e169ac..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/PublicURLOrInternalIfNullTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.functions; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; - -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; -import org.testng.annotations.Test; - -@Test(groups = "unit", testName = "PublicURLOrInternalIfNullTest") -public class PublicURLOrInternalIfNullTest { - private final PublicURLOrInternalIfNull fn = new PublicURLOrInternalIfNull(); - - public void testPublicURLNotNullReturnsPublicURL() { - assertEquals(fn.apply( - Endpoint.builder().region("LON").versionId("1.0").publicURL( - URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) - .build()).get(), URI - .create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")); - } - - public void testPublicURLNullReturnsInternalURL() { - assertEquals(fn - .apply( - Endpoint.builder().region("lon").versionId("1.0") - .internalURL(URI.create("https://192.168.1.1")).build()).get(), URI - .create("https://192.168.1.1")); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/ReturnRegionOrProviderTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/ReturnRegionOrProviderTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/ReturnRegionOrProviderTest.java deleted file mode 100644 index c606edd..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/ReturnRegionOrProviderTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.functions; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; - -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; -import org.testng.annotations.Test; - -@Test(groups = "unit", testName = "ReturnRegionOrProviderTest") -public class ReturnRegionOrProviderTest { - private final ReturnRegionOrProvider fn = new ReturnRegionOrProvider("openstack-keystone"); - - public void testRegionNotNullReturnsRegion() { - assertEquals( - fn.apply(Endpoint.builder().region("LON").versionId("1.0").publicURL( - URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) - .build()), "LON"); - } - - public void testRegionNullReturnsProvider() { - assertEquals( - fn.apply(Endpoint.builder().versionId("1.0").publicURL( - URI.create("https://cdn3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953")) - .build()), "openstack-keystone"); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/handlers/RetryOnRenewTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/handlers/RetryOnRenewTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/handlers/RetryOnRenewTest.java deleted file mode 100644 index 840cda3..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/handlers/RetryOnRenewTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.handlers; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.expectLastCall; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import org.jclouds.domain.Credentials; -import org.jclouds.http.HttpCommand; -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.jclouds.http.handlers.BackoffLimitedRetryHandler; -import org.jclouds.io.Payloads; -import org.jclouds.openstack.keystone.v2_0.domain.Access; -import org.testng.annotations.Test; - -import com.google.common.cache.LoadingCache; - -/** - * Tests behavior of {@code RetryOnRenew} handler - */ -@Test(groups = "unit", testName = "RetryOnRenewTest") -public class RetryOnRenewTest { - @Test - public void test401ShouldRetry() { - HttpCommand command = createMock(HttpCommand.class); - HttpRequest request = createMock(HttpRequest.class); - HttpResponse response = createMock(HttpResponse.class); - @SuppressWarnings("unchecked") - LoadingCache<Credentials, Access> cache = createMock(LoadingCache.class); - BackoffLimitedRetryHandler backoffHandler = createMock(BackoffLimitedRetryHandler.class); - - expect(command.getCurrentRequest()).andReturn(request); - - cache.invalidateAll(); - expectLastCall(); - - expect(response.getPayload()).andReturn(Payloads.newStringPayload("")).anyTimes(); - expect(response.getStatusCode()).andReturn(401).atLeastOnce(); - - replay(command); - replay(response); - replay(cache); - replay(backoffHandler); - - RetryOnRenew retry = new RetryOnRenew(cache, backoffHandler); - - assertTrue(retry.shouldRetryRequest(command, response)); - - verify(command); - verify(response); - verify(cache); - } - - @Test - public void test401ShouldRetry4Times() { - HttpCommand command = createMock(HttpCommand.class); - HttpRequest request = createMock(HttpRequest.class); - HttpResponse response = createMock(HttpResponse.class); - - @SuppressWarnings("unchecked") - LoadingCache<Credentials, Access> cache = createMock(LoadingCache.class); - BackoffLimitedRetryHandler backoffHandler = createMock(BackoffLimitedRetryHandler.class); - - expect(command.getCurrentRequest()).andReturn(request).anyTimes(); - expect(request.getHeaders()).andStubReturn(null); - - cache.invalidateAll(); - expectLastCall().anyTimes(); - - expect(response.getPayload()).andReturn(Payloads.newStringPayload("")).anyTimes(); - expect(response.getStatusCode()).andReturn(401).anyTimes(); - - replay(command, request, response, cache); - - RetryOnRenew retry = new RetryOnRenew(cache, backoffHandler); - - for (int i = 0; i < RetryOnRenew.NUM_RETRIES - 1; ++i) { - assertTrue(retry.shouldRetryRequest(command, response), "Expected retry to succeed"); - } - - assertFalse(retry.shouldRetryRequest(command, response), "Expected retry to fail on attempt " + RetryOnRenew.NUM_RETRIES); - - verify(command, response, cache); - } - - @Test - public void test408ShouldRetry() { - HttpCommand command = createMock(HttpCommand.class); - HttpResponse response = createMock(HttpResponse.class); - @SuppressWarnings("unchecked") - LoadingCache<Credentials, Access> cache = createMock(LoadingCache.class); - BackoffLimitedRetryHandler backoffHandler = createMock(BackoffLimitedRetryHandler.class); - - expect(backoffHandler.shouldRetryRequest(command, response)).andReturn(true).once(); - expect(response.getStatusCode()).andReturn(408).once(); - - replay(command); - replay(response); - replay(cache); - replay(backoffHandler); - - RetryOnRenew retry = new RetryOnRenew(cache, backoffHandler); - - assertTrue(retry.shouldRetryRequest(command, response)); - - verify(command); - verify(response); - verify(cache); - verify(backoffHandler); - } -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneApiLiveTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneApiLiveTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneApiLiveTest.java index ee85a5e..004d813 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneApiLiveTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneApiLiveTest.java @@ -19,8 +19,8 @@ package org.jclouds.openstack.keystone.v2_0.internal; import java.util.Properties; import org.jclouds.apis.BaseApiLiveTest; +import org.jclouds.openstack.keystone.config.KeystoneProperties; import org.jclouds.openstack.keystone.v2_0.KeystoneApi; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties; import org.testng.annotations.Test; /** http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneRestApiExpectTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneRestApiExpectTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneRestApiExpectTest.java index 01fc644..1f19d96 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneRestApiExpectTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/internal/BaseKeystoneRestApiExpectTest.java @@ -16,7 +16,7 @@ */ package org.jclouds.openstack.keystone.v2_0.internal; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.SERVICE_TYPE; import java.util.Properties; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/LocationIdToURIFromAccessForTypeAndVersionTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/LocationIdToURIFromAccessForTypeAndVersionTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/LocationIdToURIFromAccessForTypeAndVersionTest.java deleted file mode 100644 index f530329..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/LocationIdToURIFromAccessForTypeAndVersionTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.suppliers; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; -import java.util.Map; -import java.util.NoSuchElementException; - -import javax.inject.Singleton; - -import org.jclouds.location.Provider; -import org.jclouds.openstack.keystone.v2_0.domain.Access; -import org.jclouds.openstack.keystone.v2_0.domain.Endpoint; -import org.jclouds.openstack.keystone.v2_0.functions.EndpointToRegion; -import org.jclouds.openstack.keystone.v2_0.parse.ParseAccessTest; -import org.jclouds.openstack.keystone.v2_0.parse.ParseRackspaceAccessTest; -import org.testng.annotations.Test; - -import com.google.common.base.Function; -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import com.google.inject.AbstractModule; -import com.google.inject.Guice; -import com.google.inject.Provides; -import com.google.inject.TypeLiteral; -import com.google.inject.assistedinject.FactoryModuleBuilder; - -@Test(groups = "unit", testName = "LocationIdToURIFromAccessForTypeAndVersionTest") -public class LocationIdToURIFromAccessForTypeAndVersionTest { - private final LocationIdToURIFromAccessForTypeAndVersion.Factory factory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("openstack-keystone"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - bind(new TypeLiteral<Function<Endpoint, String>>(){}).to(EndpointToRegion.class); - install(new FactoryModuleBuilder().implement(LocationIdToURIFromAccessForTypeAndVersion.class, - LocationIdToURIFromAccessForTypeAndVersion.class).build( - LocationIdToURIFromAccessForTypeAndVersion.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseAccessTest().expected()); - } - - }).getInstance(LocationIdToURIFromAccessForTypeAndVersion.Factory.class); - - public void testRegionUnmatchesOkWhenNoVersionIdSet() { - assertEquals(Maps.transformValues(factory.createForApiTypeAndVersion("compute", "2").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("az-1.region-a.geo-1", URI - .create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), "az-2.region-a.geo-1", URI - .create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), "az-3.region-a.geo-1", URI - .create("https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"))); - } - - public void testRegionMatches() { - assertEquals(Maps.transformValues(factory.createForApiTypeAndVersion("compute", "2").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("az-1.region-a.geo-1", URI - .create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), "az-2.region-a.geo-1", URI - .create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), "az-3.region-a.geo-1", URI - .create("https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"))); - } - - private final LocationIdToURIFromAccessForTypeAndVersion.Factory raxFactory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("rackspace"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - bind(new TypeLiteral<Function<Endpoint, String>>(){}).to(EndpointToRegion.class); - install(new FactoryModuleBuilder().implement(LocationIdToURIFromAccessForTypeAndVersion.class, - LocationIdToURIFromAccessForTypeAndVersion.class).build( - LocationIdToURIFromAccessForTypeAndVersion.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseRackspaceAccessTest().expected()); - } - }).getInstance(LocationIdToURIFromAccessForTypeAndVersion.Factory.class); - - @Test(expectedExceptions = NoSuchElementException.class) - public void testWhenNotInList() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("goo", "1.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("rackspace", URI - .create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testProviderWhenNoRegions() { - Map<String, URI> withNoRegions = Maps.transformValues(raxFactory.createForApiTypeAndVersion("compute", "1.0") - .get(), Suppliers.<URI> supplierFunction()); - assertEquals(withNoRegions, ImmutableMap.of("rackspace", URI - .create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testOkWithNoVersions() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("rax:database", null).get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("DFW", URI - .create("https://dfw.databases.api.rackspacecloud.com/v1.0/40806637803162"), "ORD", URI - .create("https://ord.databases.api.rackspacecloud.com/v1.0/40806637803162"))); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToAdminURIFromAccessForTypeAndVersionTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToAdminURIFromAccessForTypeAndVersionTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToAdminURIFromAccessForTypeAndVersionTest.java deleted file mode 100644 index 91ebb61..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToAdminURIFromAccessForTypeAndVersionTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.suppliers; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; -import java.util.Map; -import java.util.NoSuchElementException; - -import javax.inject.Singleton; - -import org.jclouds.location.Provider; -import org.jclouds.openstack.keystone.v2_0.domain.Access; -import org.jclouds.openstack.keystone.v2_0.parse.ParseAccessTest; -import org.jclouds.openstack.keystone.v2_0.parse.ParseRackspaceAccessTest; -import org.testng.annotations.Test; - -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import com.google.inject.AbstractModule; -import com.google.inject.Guice; -import com.google.inject.Provides; -import com.google.inject.TypeLiteral; -import com.google.inject.assistedinject.FactoryModuleBuilder; - -@Test(groups = "unit", testName = "RegionIdToAdminURIFromAccessForTypeAndVersionTest") -public class RegionIdToAdminURIFromAccessForTypeAndVersionTest { - private final RegionIdToAdminURISupplier.Factory factory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("openstack-keystone"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - install(new FactoryModuleBuilder().implement(RegionIdToAdminURISupplier.class, - RegionIdToAdminURIFromAccessForTypeAndVersion.class).build(RegionIdToAdminURISupplier.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseAccessTest().expected()); - } - }).getInstance(RegionIdToAdminURISupplier.Factory.class); - - public void testRegionMatches() { - assertEquals(Maps.transformValues(factory.createForApiTypeAndVersion("identity", "2.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("region-a.geo-1", URI.create("https://csnode.jclouds.org:35357/v2.0/"))); - Map<String, URI> map = Maps.newLinkedHashMap(); - map.put("region-a.geo-1", null); - map.put("region-b.geo-1", null); - map.put("region-c.geo-1", null); - assertEquals(Maps.transformValues(factory.createForApiTypeAndVersion("compute", "2").get(), Suppliers - .<URI> supplierFunction()), map); - } - - private final RegionIdToAdminURISupplier.Factory raxFactory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("rackspace"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - install(new FactoryModuleBuilder().implement(RegionIdToAdminURISupplier.class, - RegionIdToAdminURIFromAccessForTypeAndVersion.class).build(RegionIdToAdminURISupplier.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseRackspaceAccessTest().expected()); - } - }).getInstance(RegionIdToAdminURISupplier.Factory.class); - - @Test(expectedExceptions = NoSuchElementException.class) - public void testWhenNotInList() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("goo", "1.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("rackspace", URI - .create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testProviderWhenNoRegions() { - Map<String, URI> map = Maps.newLinkedHashMap(); - map.put("rackspace", null); - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("compute", "1.0").get(), Suppliers - .<URI> supplierFunction()), map); - } - - public void testOkWithNoVersions() { - Map<String, URI> map = Maps.newLinkedHashMap(); - map.put("DFW", null); - map.put("ORD", null); - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("rax:database", null).get(), Suppliers - .<URI> supplierFunction()), map); - } -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToURIFromAccessForTypeAndVersionTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToURIFromAccessForTypeAndVersionTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToURIFromAccessForTypeAndVersionTest.java deleted file mode 100644 index 0b48360..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/RegionIdToURIFromAccessForTypeAndVersionTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.suppliers; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; -import java.util.NoSuchElementException; - -import javax.inject.Singleton; - -import org.jclouds.location.Provider; -import org.jclouds.location.suppliers.RegionIdToURISupplier; -import org.jclouds.openstack.keystone.v2_0.domain.Access; -import org.jclouds.openstack.keystone.v2_0.parse.ParseAccessTest; -import org.jclouds.openstack.keystone.v2_0.parse.ParseRackspaceAccessTest; -import org.testng.annotations.Test; - -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import com.google.inject.AbstractModule; -import com.google.inject.Guice; -import com.google.inject.Provides; -import com.google.inject.TypeLiteral; -import com.google.inject.assistedinject.FactoryModuleBuilder; - -@Test(groups = "unit", testName = "RegionIdToURIFromAccessForTypeAndVersionTest") -public class RegionIdToURIFromAccessForTypeAndVersionTest { - private final RegionIdToURISupplier.Factory factory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("openstack-keystone"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - install(new FactoryModuleBuilder().implement(RegionIdToURISupplier.class, - RegionIdToURIFromAccessForTypeAndVersion.class).build( - RegionIdToURISupplier.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseAccessTest().expected()); - } - }).getInstance(RegionIdToURISupplier.Factory.class); - - @SuppressWarnings("CheckReturnValue") - @Test(expectedExceptions = NoSuchElementException.class) - public void testRegionUnmatches() { - Maps.transformValues(factory.createForApiTypeAndVersion("compute", "1.0").get(), - Suppliers.<URI> supplierFunction()); - } - - public void testRegionMatches() { - assertEquals(Maps.transformValues(factory.createForApiTypeAndVersion("compute", "2").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("az-1.region-a.geo-1", URI - .create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), "az-2.region-a.geo-1", URI - .create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), "az-3.region-a.geo-1", URI - .create("https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"))); - } - - private final RegionIdToURISupplier.Factory raxFactory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("rackspace"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - install(new FactoryModuleBuilder().implement(RegionIdToURISupplier.class, - RegionIdToURIFromAccessForTypeAndVersion.class).build( - RegionIdToURISupplier.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseRackspaceAccessTest().expected()); - } - }).getInstance(RegionIdToURISupplier.Factory.class); - - @Test(expectedExceptions = NoSuchElementException.class) - public void testWhenNotInList() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("goo", "1.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("rackspace", URI - .create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testProviderWhenNoRegions() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("compute", "1.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("rackspace", URI - .create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testOkWithNoVersions() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("rax:database", null).get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("DFW", URI - .create("https://dfw.databases.api.rackspacecloud.com/v1.0/40806637803162"), "ORD", URI - .create("https://ord.databases.api.rackspacecloud.com/v1.0/40806637803162"))); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/ZoneIdToURIFromAccessForTypeAndVersionTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/ZoneIdToURIFromAccessForTypeAndVersionTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/ZoneIdToURIFromAccessForTypeAndVersionTest.java deleted file mode 100644 index b716bbc..0000000 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/suppliers/ZoneIdToURIFromAccessForTypeAndVersionTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.openstack.keystone.v2_0.suppliers; - -import static org.testng.Assert.assertEquals; - -import java.net.URI; -import java.util.NoSuchElementException; - -import javax.inject.Singleton; - -import org.jclouds.location.Provider; -import org.jclouds.location.suppliers.ZoneIdToURISupplier; -import org.jclouds.openstack.keystone.v2_0.domain.Access; -import org.jclouds.openstack.keystone.v2_0.parse.ParseAccessTest; -import org.jclouds.openstack.keystone.v2_0.parse.ParseRackspaceAccessTest; -import org.testng.annotations.Test; - -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import com.google.inject.AbstractModule; -import com.google.inject.Guice; -import com.google.inject.Provides; -import com.google.inject.TypeLiteral; -import com.google.inject.assistedinject.FactoryModuleBuilder; - -@Test(groups = "unit", testName = "ZoneIdToURIFromAccessForTypeAndVersionSupplierTest") -public class ZoneIdToURIFromAccessForTypeAndVersionTest { - private final ZoneIdToURISupplier.Factory factory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("rackspace"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - install(new FactoryModuleBuilder().implement(ZoneIdToURISupplier.class, - ZoneIdToURIFromAccessForTypeAndVersion.class).build(ZoneIdToURISupplier.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseAccessTest().expected()); - } - }).getInstance(ZoneIdToURISupplier.Factory.class); - - - @SuppressWarnings("CheckReturnValue") - @Test(expectedExceptions = NoSuchElementException.class) - public void testZoneUnmatches() { - Maps.transformValues(factory.createForApiTypeAndVersion("compute", "1.0").get(), - Suppliers.<URI> supplierFunction()); - } - - public void testZoneMatches() { - assertEquals(Maps.transformValues(factory.createForApiTypeAndVersion("compute", "2").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("az-1.region-a.geo-1", URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), - "az-2.region-a.geo-1", URI.create("https://az-2.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"), - "az-3.region-a.geo-1", URI.create("https://az-3.region-a.geo-1.compute.hpcloudsvc.com/v2/3456"))); - } - - private final ZoneIdToURISupplier.Factory raxFactory = Guice.createInjector(new AbstractModule() { - - @Override - protected void configure() { - bindConstant().annotatedWith(Provider.class).to("rackspace"); - bind(new TypeLiteral<Supplier<URI>>() { - }).annotatedWith(Provider.class).toInstance(Suppliers.ofInstance(URI.create("https://identity"))); - install(new FactoryModuleBuilder().implement(ZoneIdToURISupplier.class, - ZoneIdToURIFromAccessForTypeAndVersion.class).build(ZoneIdToURISupplier.Factory.class)); - } - - @Provides - @Singleton - public Supplier<Access> provide() { - return Suppliers.ofInstance(new ParseRackspaceAccessTest().expected()); - } - }).getInstance(ZoneIdToURISupplier.Factory.class); - - @Test(expectedExceptions = NoSuchElementException.class) - public void testWhenNotInList() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("goo", "1.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("rackspace", URI - .create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testProviderWhenNoZones() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("compute", "1.0").get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("rackspace", URI.create("https://servers.api.rackspacecloud.com/v1.0/40806637803162"))); - } - - public void testOkWithNoVersions() { - assertEquals(Maps.transformValues(raxFactory.createForApiTypeAndVersion("rax:database", null).get(), Suppliers - .<URI> supplierFunction()), ImmutableMap.of("DFW", URI.create("https://dfw.databases.api.rackspacecloud.com/v1.0/40806637803162"), - "ORD", URI.create("https://ord.databases.api.rackspacecloud.com/v1.0/40806637803162"))); - } -} http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java index d73a1da..a330afa 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java @@ -17,8 +17,9 @@ package org.jclouds.openstack.nova.v2_0; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.CREDENTIAL_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.KEYSTONE_VERSION; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.SERVICE_TYPE; import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_ALLOCATE_FLOATING_IPS; import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS; import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.TIMEOUT_SECURITYGROUP_PRESENT; @@ -29,10 +30,10 @@ import java.util.Properties; import org.jclouds.apis.ApiMetadata; import org.jclouds.compute.ComputeServiceContext; -import org.jclouds.openstack.keystone.v2_0.config.AuthenticationApiModule; -import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; +import org.jclouds.openstack.keystone.auth.config.AuthenticationModule; +import org.jclouds.openstack.keystone.auth.config.CredentialTypes; +import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule; +import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule.RegionModule; import org.jclouds.openstack.nova.v2_0.compute.config.NovaComputeServiceContextModule; import org.jclouds.openstack.nova.v2_0.config.NovaHttpApiModule; import org.jclouds.openstack.nova.v2_0.config.NovaParserModule; @@ -69,6 +70,7 @@ public class NovaApiMetadata extends BaseHttpApiMetadata<NovaApi> { properties.setProperty("jclouds.ssh.retry-auth", "true"); properties.setProperty(SERVICE_TYPE, ServiceType.COMPUTE); properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS); + properties.setProperty(KEYSTONE_VERSION, "2"); properties.setProperty(AUTO_ALLOCATE_FLOATING_IPS, "false"); properties.setProperty(AUTO_GENERATE_KEYPAIRS, "false"); properties.setProperty(TIMEOUT_SECURITYGROUP_PRESENT, "500"); @@ -93,8 +95,8 @@ public class NovaApiMetadata extends BaseHttpApiMetadata<NovaApi> { .defaultProperties(NovaApiMetadata.defaultProperties()) .view(typeToken(ComputeServiceContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>builder() - .add(AuthenticationApiModule.class) - .add(KeystoneAuthenticationModule.class) + .add(AuthenticationModule.class) + .add(ServiceCatalogModule.class) .add(RegionModule.class) .add(NovaParserModule.class) .add(NovaHttpApiModule.class) http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java index 65bd198..119b08a 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AttachInterfaceApi.java @@ -29,7 +29,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.InterfaceAttachment; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java index 9aa9b21..e3abe74 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java @@ -23,7 +23,7 @@ import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.regionscoped.AvailabilityZone; import org.jclouds.openstack.nova.v2_0.domain.regionscoped.AvailabilityZoneDetails; import org.jclouds.openstack.v2_0.ServiceType; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java index 7aa1f60..a4d4127 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ConsolesApi.java @@ -25,7 +25,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.binders.BindConsoleToJsonPayload; import org.jclouds.openstack.nova.v2_0.domain.Console; import org.jclouds.openstack.v2_0.ServiceType; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java index 0db8cee..d935763 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java @@ -33,7 +33,7 @@ import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404; import org.jclouds.Fallbacks.FalseOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; import org.jclouds.rest.annotations.Fallback; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java index 626ee2d..003e66b 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java @@ -29,7 +29,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.FloatingIP; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java index ead37ab..5bf5625 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPPoolApi.java @@ -22,7 +22,7 @@ import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.FloatingIPPool; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java index 8a07d3f..5eadc48 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAdministrationApi.java @@ -26,7 +26,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.Host; import org.jclouds.openstack.nova.v2_0.domain.HostResourceUsage; import org.jclouds.openstack.nova.v2_0.functions.FieldValueResponseParsers.MaintenanceModeDisabledResponseParser; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java index 889bb4f..18ad082 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HostAggregateApi.java @@ -32,7 +32,7 @@ import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.Fallbacks.FalseOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.HostAggregate; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java index 8da914c..9e443f6 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/HypervisorApi.java @@ -23,7 +23,7 @@ import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.regionscoped.Hypervisor; import org.jclouds.openstack.nova.v2_0.domain.regionscoped.HypervisorDetails; import org.jclouds.openstack.v2_0.ServiceType; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java index d9f87d3..34074d1 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApi.java @@ -30,7 +30,7 @@ import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.Fallbacks.FalseOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.binders.BindKeyPairToJsonPayload; import org.jclouds.openstack.nova.v2_0.domain.KeyPair; import org.jclouds.openstack.nova.v2_0.functions.internal.ParseKeyPairs; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java index 5790620..59a5dd5 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/QuotaApi.java @@ -27,7 +27,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.Quota; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java index 7e2b503..9d3ed0f 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java @@ -30,7 +30,7 @@ import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.Fallbacks.FalseOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.binders.BindSecurityGroupRuleToJsonPayload; import org.jclouds.openstack.nova.v2_0.domain.Ingress; import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java index e054bd9..b489b2a 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java @@ -25,7 +25,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.BackupType; import org.jclouds.openstack.nova.v2_0.functions.ParseImageIdFromLocationHeader; import org.jclouds.openstack.nova.v2_0.options.CreateBackupOfServerOptions; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApi.java index 3d1ecba..e17ca69 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerWithSecurityGroupsApi.java @@ -25,7 +25,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.ServerWithSecurityGroups; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java index 269059b..f88b480 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SimpleTenantUsageApi.java @@ -26,7 +26,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.javax.annotation.Nullable; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.SimpleTenantUsage; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension; http://git-wip-us.apache.org/repos/asf/jclouds/blob/7def8169/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java ---------------------------------------------------------------------- diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java index eff19a0..f484cff 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VirtualInterfaceApi.java @@ -24,7 +24,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404; -import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; +import org.jclouds.openstack.keystone.auth.filters.AuthenticateRequest; import org.jclouds.openstack.nova.v2_0.domain.VirtualInterface; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.services.Extension;
