Skip to content

Commit

Permalink
Merge branch 'master' of github.com:yusuke/twitter4j
Browse files Browse the repository at this point in the history
Conflicts:
	twitter4j-core/src/test/java/twitter4j/AccountMethodsTest.java
  • Loading branch information
yusuke committed Jul 6, 2011
2 parents 19eec59 + 9fcbe87 commit 416969f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 42 deletions.
47 changes: 6 additions & 41 deletions twitter4j-async/src/test/java/twitter4j/AsyncTwitterTest.java
Expand Up @@ -35,6 +35,7 @@ public class AsyncTwitterTest extends TwitterTestBase implements TwitterListener

private AsyncTwitter async1 = null;
private AsyncTwitter async2 = null;
private AsyncTwitter async3 = null;
private AsyncTwitter bestFriend1Async = null;
private ResponseList<Location> locations;
private ResponseList<Place> places;
Expand All @@ -56,18 +57,15 @@ protected void setUp() throws Exception {
AsyncTwitterFactory factory = new AsyncTwitterFactory(conf1);
async1 = factory.getInstance();
async1.addListener(this);
// async1.setOAuthConsumer(desktopConsumerKey, desktopConsumerSecret);
// async1.setOAuthAccessToken(new AccessToken(id1.accessToken, id1.accessTokenSecret));

async2 = new AsyncTwitterFactory(conf2).getInstance();
async2.addListener(this);
// async2.setOAuthConsumer(desktopConsumerKey, desktopConsumerSecret);
// async2.setOAuthAccessToken(new AccessToken(id2.accessToken, id2.accessTokenSecret));

async3 = new AsyncTwitterFactory(conf3).getInstance();
async3.addListener(this);

bestFriend1Async = new AsyncTwitterFactory(bestFriend1Conf).getInstance();
bestFriend1Async.addListener(this);
// bestFriend1Async.setOAuthConsumer(desktopConsumerKey, desktopConsumerSecret);
// bestFriend1Async.setOAuthAccessToken(new AccessToken(bestFriend1.accessToken, bestFriend1.accessTokenSecret));

statuses = null;
users = null;
Expand All @@ -90,15 +88,6 @@ public void testGetPublicTimeline() throws Exception {
assertDeserializedFormIsEqual(statuses);
}

public void testGetFriendsTimeline() throws Exception {
async1.getFriendsTimeline();
waitForResponse();
Assert.assertNotNull(statuses);
Assert.assertTrue(statuses.size() > 0);

assertDeserializedFormIsEqual(statuses);
}

public void testShowUser() throws Exception {
async1.showUser(id1.screenName);
waitForResponse();
Expand Down Expand Up @@ -358,36 +347,12 @@ public void testUpdate() throws Exception {
assertDeserializedFormIsEqual(status);
}

public void testGetFriendsStatuses() throws Exception {
users = null;
async1.getFriendsStatuses(id2.screenName, -1);
waitForResponse();
Assert.assertNotNull(users);

users = null;
async2.getFriendsStatuses(-1);
waitForResponse();
Assert.assertNotNull(users);
assertDeserializedFormIsEqual(users);
}

public void testFollowers() throws Exception {
async1.getFollowersStatuses(-1);
waitForResponse();
Assert.assertTrue(users.size() > 0);

async2.getFollowersStatuses(-1);
waitForResponse();
Assert.assertTrue(users.size() > 0);
assertDeserializedFormIsEqual(users);
}

public void testDirectMessages() throws Exception {
String expectedReturn = new Date() + ":directmessage test";
async1.sendDirectMessage("twit4jnoupdate", expectedReturn);
async1.sendDirectMessage(id3.id, expectedReturn);
waitForResponse();
Assert.assertEquals(expectedReturn, message.getText());
async1.getDirectMessages();
async3.getDirectMessages();
waitForResponse();
Assert.assertTrue(1 <= messages.size());
}
Expand Down
2 changes: 1 addition & 1 deletion twitter4j-core/src/test/java/twitter4j/SearchAPITest.java
Expand Up @@ -178,7 +178,7 @@ public void testTrends() throws Exception {
private void assertTrends(List<Trends> trendsArray, int expectedSize) throws Exception {
Date trendAt = null;
for (Trends singleTrends : trendsArray) {
assertEquals(expectedSize, singleTrends.getTrends().length);
assertTrue((expectedSize-10) < singleTrends.getTrends().length);
if (trendAt != null) {
assertTrue(trendAt.before(singleTrends.getTrendAt()));
}
Expand Down

0 comments on commit 416969f

Please sign in to comment.