temporarily disabled twitter

This commit is contained in:
Adrian Cole 2010-06-28 05:12:15 -07:00
parent 27f4f69b4c
commit 18f2ca3225
4 changed files with 30 additions and 39 deletions

View File

@ -41,7 +41,6 @@ import org.jclouds.demo.tweetstore.controller.StoreTweetsController;
import org.jclouds.demo.tweetstore.functions.ServiceToStoredTweetStatuses; import org.jclouds.demo.tweetstore.functions.ServiceToStoredTweetStatuses;
import org.jclouds.gae.config.GoogleAppEngineConfigurationModule; import org.jclouds.gae.config.GoogleAppEngineConfigurationModule;
import org.jclouds.twitter.TwitterClient; import org.jclouds.twitter.TwitterClient;
import org.jclouds.twitter.TwitterContextFactory;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -84,7 +83,7 @@ public class SpringServletConfig extends LoggingConfig implements ServletConfigA
Module googleModule = new GoogleAppEngineConfigurationModule(); Module googleModule = new GoogleAppEngineConfigurationModule();
Set<Module> modules = ImmutableSet.<Module> of(googleModule); Set<Module> modules = ImmutableSet.<Module> of(googleModule);
// shared across all blobstores and used to retrieve tweets // 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 // common namespace for storing tweets
container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER),

View File

@ -20,8 +20,6 @@ package org.jclouds.demo.tweetstore.integration;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; 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.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -33,7 +31,6 @@ import java.util.concurrent.TimeoutException;
import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.demo.tweetstore.config.SpringServletConfig; import org.jclouds.demo.tweetstore.config.SpringServletConfig;
import org.jclouds.twitter.TwitterPropertiesBuilder;
import org.jclouds.util.Utils; import org.jclouds.util.Utils;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
@ -64,12 +61,11 @@ public class TweetStoreLiveTest {
.getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER)); .getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER));
// WATCH THIS.. when adding a new context, you must update the string // WATCH THIS.. when adding a new context, you must update the string
props.setProperty(SpringServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, props.setProperty(SpringServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, "cloudfiles,s3,azureblob");
"cloudfiles,s3,azureblob"); // TODO
// props = new TwitterPropertiesBuilder(props).withCredentials(
props = new TwitterPropertiesBuilder(props).withCredentials( // checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER),
checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER), // System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build();
System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build();
// TODO FIX // TODO FIX
// props = new S3PropertiesBuilder(props) // props = new S3PropertiesBuilder(props)
@ -96,21 +92,21 @@ public class TweetStoreLiveTest {
void clearAndCreateContainers() throws InterruptedException, ExecutionException, void clearAndCreateContainers() throws InterruptedException, ExecutionException,
TimeoutException, IOException { TimeoutException, IOException {
container = checkNotNull(System.getProperty(PROPERTY_TWEETSTORE_CONTAINER)); container = checkNotNull(System.getProperty(PROPERTY_TWEETSTORE_CONTAINER));
// TODO FIX // TODO FIX
// BlobStoreContextFactory factory = new BlobStoreContextFactory(); // BlobStoreContextFactory factory = new BlobStoreContextFactory();
// BlobStoreContext s3Context = factory.createContext("s3", checkNotNull(System // BlobStoreContext s3Context = factory.createContext("s3", checkNotNull(System
// .getProperty(PROPERTY_AWS_ACCESSKEYID), PROPERTY_AWS_ACCESSKEYID), System // .getProperty(PROPERTY_AWS_ACCESSKEYID), PROPERTY_AWS_ACCESSKEYID), System
// .getProperty(PROPERTY_AWS_SECRETACCESSKEY, PROPERTY_AWS_SECRETACCESSKEY)); // .getProperty(PROPERTY_AWS_SECRETACCESSKEY, PROPERTY_AWS_SECRETACCESSKEY));
// //
// BlobStoreContext cfContext = factory.createContext("cloudfiles", checkNotNull(System // BlobStoreContext cfContext = factory.createContext("cloudfiles", checkNotNull(System
// .getProperty(PROPERTY_RACKSPACE_USER), PROPERTY_RACKSPACE_USER), System.getProperty( // .getProperty(PROPERTY_RACKSPACE_USER), PROPERTY_RACKSPACE_USER), System.getProperty(
// PROPERTY_RACKSPACE_KEY, PROPERTY_RACKSPACE_KEY)); // PROPERTY_RACKSPACE_KEY, PROPERTY_RACKSPACE_KEY));
// //
// BlobStoreContext azContext = factory.createContext("azureblob", checkNotNull(System // BlobStoreContext azContext = factory.createContext("azureblob", checkNotNull(System
// .getProperty(PROPERTY_AZURESTORAGE_ACCOUNT), PROPERTY_AZURESTORAGE_ACCOUNT), System // .getProperty(PROPERTY_AZURESTORAGE_ACCOUNT), PROPERTY_AZURESTORAGE_ACCOUNT), System
// .getProperty(PROPERTY_AZURESTORAGE_KEY, PROPERTY_AZURESTORAGE_KEY)); // .getProperty(PROPERTY_AZURESTORAGE_KEY, PROPERTY_AZURESTORAGE_KEY));
// //
// this.contexts = ImmutableList.of(s3Context, cfContext, azContext); // this.contexts = ImmutableList.of(s3Context, cfContext, azContext);
boolean deleted = false; boolean deleted = false;
for (BlobStoreContext context : contexts) { for (BlobStoreContext context : contexts) {
if (context.getBlobStore().containerExists(container)) { if (context.getBlobStore().containerExists(container)) {

View File

@ -36,7 +36,6 @@ import org.jclouds.demo.tweetstore.controller.AddTweetsController;
import org.jclouds.demo.tweetstore.controller.StoreTweetsController; import org.jclouds.demo.tweetstore.controller.StoreTweetsController;
import org.jclouds.gae.config.GoogleAppEngineConfigurationModule; import org.jclouds.gae.config.GoogleAppEngineConfigurationModule;
import org.jclouds.twitter.TwitterClient; 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.Queue;
import com.google.appengine.api.labs.taskqueue.QueueFactory; import com.google.appengine.api.labs.taskqueue.QueueFactory;
@ -75,12 +74,12 @@ public class GuiceServletConfig extends GuiceServletContextListener {
Module googleModule = new GoogleAppEngineConfigurationModule(); Module googleModule = new GoogleAppEngineConfigurationModule();
Set<Module> modules = ImmutableSet.<Module> of(googleModule); Set<Module> modules = ImmutableSet.<Module> of(googleModule);
// shared across all blobstores and used to retrieve tweets // // shared across all blobstores and used to retrieve tweets
twitterClient = TwitterContextFactory.createContext(props, googleModule).getApi(); // twitterClient = TwitterContextFactory.createContext(props, googleModule).getApi();
//
// common namespace for storing tweets // // common namespace for storing tweets
container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), // container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER),
PROPERTY_TWEETSTORE_CONTAINER); // PROPERTY_TWEETSTORE_CONTAINER);
// instantiate and store references to all blobstores by provider name // instantiate and store references to all blobstores by provider name
providerTypeToBlobStoreMap = Maps.newHashMap(); providerTypeToBlobStoreMap = Maps.newHashMap();

View File

@ -20,8 +20,6 @@ package org.jclouds.demo.tweetstore.integration;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; 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.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -33,7 +31,6 @@ import java.util.concurrent.TimeoutException;
import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.demo.tweetstore.config.GuiceServletConfig; import org.jclouds.demo.tweetstore.config.GuiceServletConfig;
import org.jclouds.twitter.TwitterPropertiesBuilder;
import org.jclouds.util.Utils; import org.jclouds.util.Utils;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
@ -66,9 +63,9 @@ public class TweetStoreLiveTest {
// WATCH THIS.. when adding a new context, you must update the string // WATCH THIS.. when adding a new context, you must update the string
props.setProperty(GuiceServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, "cloudfiles,s3,azureblob"); props.setProperty(GuiceServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, "cloudfiles,s3,azureblob");
props = new TwitterPropertiesBuilder(props).withCredentials( // props = new TwitterPropertiesBuilder(props).withCredentials(
checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER), // checkNotNull(System.getProperty(PROPERTY_TWITTER_USER), PROPERTY_TWITTER_USER),
System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build(); // System.getProperty(PROPERTY_TWITTER_PASSWORD, PROPERTY_TWITTER_PASSWORD)).build();
// TODO FIX // TODO FIX
// //
// props = new S3PropertiesBuilder(props) // props = new S3PropertiesBuilder(props)