Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
TFJ-441 added twitter4j.examples.help.Test.java
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke committed Nov 18, 2010
1 parent 1122e35 commit c042e80
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 9 deletions.
9 changes: 9 additions & 0 deletions twitter4j-examples/bin/help/test.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo off
SETLOCAL enabledelayedexpansion
cd ..
call setEnv.cmd

echo on
"%JAVA%" %MEM_ARGS% -classpath "%CLASSPATH%" twitter4j.examples.help.Test %*

ENDLOCAL
6 changes: 6 additions & 0 deletions twitter4j-examples/bin/help/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#/bin/sh
cd ..
. ./setEnv.sh
RUN_CMD="$JAVA_HOME/bin/java $MEM_ARGS -cp $CLASSPATH twitter4j.examples.help.Test $@"
echo $RUN_CMD
exec $RUN_CMD
3 changes: 2 additions & 1 deletion twitter4j-examples/bin/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ timeline/ - Timeline resources examples
tweets/ -Tweets Resources examples
directmessage/ - Direct Message resources examples
stream/ - Streamed Tweets resources examples
help/ - Help resources examples
async/ - Async API examples
misc/ - miscellaneous examples
getAccessToken.sh/cmd
logback.xml
readme.txt - this file
setEnv.sh/cmd - script configures JAVA_HOME end classpath system variables
twitter4j.properties
twitter4j.properties - Twitter4J configuration
53 changes: 53 additions & 0 deletions twitter4j-examples/src/main/java/twitter4j/examples/help/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
Copyright (c) 2007-2010, Yusuke Yamamoto
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Yusuke Yamamoto nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package twitter4j.examples.help;

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;

/**
* @author Yusuke Yamamoto - yusuke at mac.com
* @since Twitter4J 2.1.7
*/
public class Test{
/**
* Usage: java twitter4j.examples.help.Test
*
* @param args String[]
*/
public static void main(String[] args) {
try {
Twitter twitter = new TwitterFactory().getInstance();
System.out.println(twitter.test() ? "Ok" : "something went wrong");
} catch (TwitterException te) {
te.printStackTrace();
System.out.println("Failed to call test method: " + te.getMessage());
System.exit(-1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetFriendsTimeline {
/**
* Usage: java twitter4j.examples.GetFriendsTimeline
* Usage: java twitter4j.examples.timeline.GetFriendsTimeline
*
* @param args String[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetHomeTimeline {
/**
* Usage: java twitter4j.examples.GetHomeTimeline
* Usage: java twitter4j.examples.timeline.GetHomeTimeline
*
* @param args String[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetMentions {
/**
* Usage: java twitter4j.examples.GetMentions
* Usage: java twitter4j.examples.timeline.GetMentions
*
* @param args String[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public final class GetPublicTimeline {
/**
* Usage: java twitter4j.examples.GetPublicTimeline
* Usage: java twitter4j.examples.timeline.GetPublicTimeline
* @param args String[]
*/
public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetRetweetedByMe {
/**
* Usage: java twitter4j.examples.GetMentions
* Usage: java twitter4j.examples.timeline.GetMentions
*
* @param args String[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetRetweetedToMe {
/**
* Usage: java twitter4j.examples.GetRetweetedToMe
* Usage: java twitter4j.examples.timeline.GetRetweetedToMe
*
* @param args String[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetRetweetsOfMe {
/**
* Usage: java twitter4j.examples.GetRetweetsOfMe
* Usage: java twitter4j.examples.timeline.GetRetweetsOfMe
*
* @param args String[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class GetUserTimeline {
/**
* Usage: java twitter4j.examples.GetUserTimeline
* Usage: java twitter4j.examples.timeline.GetUserTimeline
*
* @param args String[]
*/
Expand Down

0 comments on commit c042e80

Please sign in to comment.