mirror of
https://github.com/apache/jclouds.git
synced 2025-02-17 23:46:13 +00:00
Ported gae-tweetstore-spring to 1.4.2 appengine API and changes in Twitter4j
This commit is contained in:
parent
b07ca99372
commit
194cd528e7
@ -63,25 +63,6 @@
|
|||||||
<type>test-jar</type>
|
<type>test-jar</type>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>${project.groupId}</groupId>
|
|
||||||
<artifactId>jclouds-core</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<type>test-jar</type>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jclouds.driver</groupId>
|
|
||||||
<artifactId>jclouds-log4j</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>log4j</groupId>
|
|
||||||
<artifactId>log4j</artifactId>
|
|
||||||
<version>1.2.16</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jclouds.provider</groupId>
|
<groupId>org.jclouds.provider</groupId>
|
||||||
<artifactId>aws-s3</artifactId>
|
<artifactId>aws-s3</artifactId>
|
||||||
|
@ -51,6 +51,7 @@ import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
|
|||||||
|
|
||||||
import twitter4j.Twitter;
|
import twitter4j.Twitter;
|
||||||
import twitter4j.TwitterFactory;
|
import twitter4j.TwitterFactory;
|
||||||
|
import twitter4j.conf.ConfigurationBuilder;
|
||||||
|
|
||||||
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;
|
||||||
@ -88,8 +89,10 @@ public class SpringServletConfig extends LoggingConfig implements ServletConfigA
|
|||||||
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
|
||||||
try {
|
try {
|
||||||
twitterClient = new TwitterFactory().getInstance(props.getProperty("twitter.identity"),
|
twitter4j.conf.Configuration twitterConf = new ConfigurationBuilder()
|
||||||
props.getProperty("twitter.credential"));
|
.setUser(props.getProperty("twitter.identity"))
|
||||||
|
.setPassword(props.getProperty("twitter.credential")).build();
|
||||||
|
twitterClient = new TwitterFactory(twitterConf).getInstance();
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
throw new IllegalArgumentException("properties for twitter not configured properly in " + props.toString(), e);
|
throw new IllegalArgumentException("properties for twitter not configured properly in " + props.toString(), e);
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ import twitter4j.Status;
|
|||||||
import twitter4j.Twitter;
|
import twitter4j.Twitter;
|
||||||
import twitter4j.TwitterException;
|
import twitter4j.TwitterException;
|
||||||
import twitter4j.TwitterFactory;
|
import twitter4j.TwitterFactory;
|
||||||
|
import twitter4j.conf.Configuration;
|
||||||
|
import twitter4j.conf.ConfigurationBuilder;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
@ -98,8 +100,10 @@ public class TweetStoreLiveTest {
|
|||||||
contexts.put(provider, factory.createContext(provider, wiring, props));
|
contexts.put(provider, factory.createContext(provider, wiring, props));
|
||||||
}
|
}
|
||||||
|
|
||||||
Twitter client = new TwitterFactory().getInstance(props.getProperty("twitter.identity"),
|
Configuration twitterConf = new ConfigurationBuilder()
|
||||||
props.getProperty("twitter.credential"));
|
.setUser(props.getProperty("twitter.identity"))
|
||||||
|
.setPassword(props.getProperty("twitter.credential")).build();
|
||||||
|
Twitter client = new TwitterFactory(twitterConf).getInstance();
|
||||||
StoreTweetsController controller = new StoreTweetsController(contexts, container, client);
|
StoreTweetsController controller = new StoreTweetsController(contexts, container, client);
|
||||||
|
|
||||||
ResponseList<Status> statuses = client.getMentions();
|
ResponseList<Status> statuses = client.getMentions();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user