From 18f2ca322552de3ea533be7d7c97456212afb16a Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Mon, 28 Jun 2010 05:12:15 -0700 Subject: [PATCH] temporarily disabled twitter --- .../config/SpringServletConfig.java | 3 +- .../integration/TweetStoreLiveTest.java | 44 +++++++++---------- .../tweetstore/config/GuiceServletConfig.java | 13 +++--- .../integration/TweetStoreLiveTest.java | 9 ++-- 4 files changed, 30 insertions(+), 39 deletions(-) diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java b/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java index 70a35b88bf..42bd275025 100644 --- a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java +++ b/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java @@ -41,7 +41,6 @@ import org.jclouds.demo.tweetstore.controller.StoreTweetsController; import org.jclouds.demo.tweetstore.functions.ServiceToStoredTweetStatuses; import org.jclouds.gae.config.GoogleAppEngineConfigurationModule; import org.jclouds.twitter.TwitterClient; -import org.jclouds.twitter.TwitterContextFactory; import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -84,7 +83,7 @@ public class SpringServletConfig extends LoggingConfig implements ServletConfigA Module googleModule = new GoogleAppEngineConfigurationModule(); Set modules = ImmutableSet. of(googleModule); // shared across all blobstores and used to retrieve tweets - twitterClient = TwitterContextFactory.createContext(props, googleModule).getApi(); +//TODO twitterClient = TwitterContextFactory.createContext(props, googleModule).getApi(); // common namespace for storing tweets container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index 66ce27aba8..e0120220c7 100644 --- a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -20,8 +20,6 @@ package org.jclouds.demo.tweetstore.integration; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; -import static org.jclouds.twitter.reference.TwitterConstants.PROPERTY_TWITTER_PASSWORD; -import static org.jclouds.twitter.reference.TwitterConstants.PROPERTY_TWITTER_USER; import java.io.IOException; import java.io.InputStream; @@ -33,7 +31,6 @@ import java.util.concurrent.TimeoutException; import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.demo.tweetstore.config.SpringServletConfig; -import org.jclouds.twitter.TwitterPropertiesBuilder; import org.jclouds.util.Utils; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; @@ -64,12 +61,11 @@ public class TweetStoreLiveTest { .getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER)); // WATCH THIS.. when adding a new context, you must update the string - props.setProperty(SpringServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, - "cloudfiles,s3,azureblob"); - - props = new TwitterPropertiesBuilder(props).withCredentials( - checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER), - System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build(); + props.setProperty(SpringServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, "cloudfiles,s3,azureblob"); + // TODO + // props = new TwitterPropertiesBuilder(props).withCredentials( + // checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER), + // System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build(); // TODO FIX // props = new S3PropertiesBuilder(props) @@ -96,21 +92,21 @@ public class TweetStoreLiveTest { void clearAndCreateContainers() throws InterruptedException, ExecutionException, TimeoutException, IOException { container = checkNotNull(System.getProperty(PROPERTY_TWEETSTORE_CONTAINER)); - // TODO FIX -// BlobStoreContextFactory factory = new BlobStoreContextFactory(); -// BlobStoreContext s3Context = factory.createContext("s3", checkNotNull(System -// .getProperty(PROPERTY_AWS_ACCESSKEYID), PROPERTY_AWS_ACCESSKEYID), System -// .getProperty(PROPERTY_AWS_SECRETACCESSKEY, PROPERTY_AWS_SECRETACCESSKEY)); -// -// BlobStoreContext cfContext = factory.createContext("cloudfiles", checkNotNull(System -// .getProperty(PROPERTY_RACKSPACE_USER), PROPERTY_RACKSPACE_USER), System.getProperty( -// PROPERTY_RACKSPACE_KEY, PROPERTY_RACKSPACE_KEY)); -// -// BlobStoreContext azContext = factory.createContext("azureblob", checkNotNull(System -// .getProperty(PROPERTY_AZURESTORAGE_ACCOUNT), PROPERTY_AZURESTORAGE_ACCOUNT), System -// .getProperty(PROPERTY_AZURESTORAGE_KEY, PROPERTY_AZURESTORAGE_KEY)); -// -// this.contexts = ImmutableList.of(s3Context, cfContext, azContext); + // TODO FIX + // BlobStoreContextFactory factory = new BlobStoreContextFactory(); + // BlobStoreContext s3Context = factory.createContext("s3", checkNotNull(System + // .getProperty(PROPERTY_AWS_ACCESSKEYID), PROPERTY_AWS_ACCESSKEYID), System + // .getProperty(PROPERTY_AWS_SECRETACCESSKEY, PROPERTY_AWS_SECRETACCESSKEY)); + // + // BlobStoreContext cfContext = factory.createContext("cloudfiles", checkNotNull(System + // .getProperty(PROPERTY_RACKSPACE_USER), PROPERTY_RACKSPACE_USER), System.getProperty( + // PROPERTY_RACKSPACE_KEY, PROPERTY_RACKSPACE_KEY)); + // + // BlobStoreContext azContext = factory.createContext("azureblob", checkNotNull(System + // .getProperty(PROPERTY_AZURESTORAGE_ACCOUNT), PROPERTY_AZURESTORAGE_ACCOUNT), System + // .getProperty(PROPERTY_AZURESTORAGE_KEY, PROPERTY_AZURESTORAGE_KEY)); + // + // this.contexts = ImmutableList.of(s3Context, cfContext, azContext); boolean deleted = false; for (BlobStoreContext context : contexts) { if (context.getBlobStore().containerExists(container)) { diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java b/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java index 56f7da0144..b8bab4c583 100755 --- a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java +++ b/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java @@ -36,7 +36,6 @@ import org.jclouds.demo.tweetstore.controller.AddTweetsController; import org.jclouds.demo.tweetstore.controller.StoreTweetsController; import org.jclouds.gae.config.GoogleAppEngineConfigurationModule; import org.jclouds.twitter.TwitterClient; -import org.jclouds.twitter.TwitterContextFactory; import com.google.appengine.api.labs.taskqueue.Queue; import com.google.appengine.api.labs.taskqueue.QueueFactory; @@ -75,12 +74,12 @@ public class GuiceServletConfig extends GuiceServletContextListener { Module googleModule = new GoogleAppEngineConfigurationModule(); Set modules = ImmutableSet. of(googleModule); - // shared across all blobstores and used to retrieve tweets - twitterClient = TwitterContextFactory.createContext(props, googleModule).getApi(); - - // common namespace for storing tweets - container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), - PROPERTY_TWEETSTORE_CONTAINER); +// // shared across all blobstores and used to retrieve tweets +// twitterClient = TwitterContextFactory.createContext(props, googleModule).getApi(); +// +// // common namespace for storing tweets +// container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), +// PROPERTY_TWEETSTORE_CONTAINER); // instantiate and store references to all blobstores by provider name providerTypeToBlobStoreMap = Maps.newHashMap(); diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index c894eae020..ec46b8170a 100755 --- a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -20,8 +20,6 @@ package org.jclouds.demo.tweetstore.integration; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; -import static org.jclouds.twitter.reference.TwitterConstants.PROPERTY_TWITTER_PASSWORD; -import static org.jclouds.twitter.reference.TwitterConstants.PROPERTY_TWITTER_USER; import java.io.IOException; import java.io.InputStream; @@ -33,7 +31,6 @@ import java.util.concurrent.TimeoutException; import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.demo.tweetstore.config.GuiceServletConfig; -import org.jclouds.twitter.TwitterPropertiesBuilder; import org.jclouds.util.Utils; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; @@ -66,9 +63,9 @@ public class TweetStoreLiveTest { // WATCH THIS.. when adding a new context, you must update the string props.setProperty(GuiceServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, "cloudfiles,s3,azureblob"); - props = new TwitterPropertiesBuilder(props).withCredentials( - checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER), - System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build(); + // props = new TwitterPropertiesBuilder(props).withCredentials( + // checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER), + // System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build(); // TODO FIX // // props = new S3PropertiesBuilder(props)