fixing some code in the twitter adapter...
This commit is contained in:
@@ -26,15 +26,11 @@ import twitter4j.http.AccessToken;
|
||||
* @author Josh Long
|
||||
*/
|
||||
public interface AccessTokenInitialRequestProcessListener {
|
||||
|
||||
|
||||
String openUrlAndReturnPin(String urlToOpen) throws Exception;
|
||||
|
||||
void persistReturnedAccessToken(AccessToken accessToken)
|
||||
throws Exception;
|
||||
void persistReturnedAccessToken(AccessToken accessToken) throws Exception;
|
||||
|
||||
/**
|
||||
* Callback in case something goes wrong at any point in the process. Up to client to intervene
|
||||
*
|
||||
* @param t the exception thrown (if any). Could be null if none available
|
||||
*/
|
||||
void failure(Throwable t);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ public class ConsoleBasedAccessTokenInitialRequestProcessListener implements Acc
|
||||
String key = StringUtils.trim(props.getProperty("twitter.oauth.consumerKey"));
|
||||
String secret = StringUtils.trim( props.getProperty("twitter.oauth.consumerSecret") ) ;
|
||||
|
||||
ConsoleBasedAccessTokenInitialRequestProcessListener consoleBasedAccessTokenInitialRequestProcessListener = new ConsoleBasedAccessTokenInitialRequestProcessListener();
|
||||
ConsoleBasedAccessTokenInitialRequestProcessListener consoleBasedAccessTokenInitialRequestProcessListener =
|
||||
new ConsoleBasedAccessTokenInitialRequestProcessListener();
|
||||
|
||||
Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance( key, secret);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<context:property-placeholder
|
||||
location="file://${user.home}/Desktop/twitter.properties"
|
||||
ignore-unresolvable="true"/>
|
||||
|
||||
|
||||
<twitter:twitter-connection
|
||||
id="tc"
|
||||
access-token="${twitter.oauth.accessToken}"
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
public class OutboundXmppEndpointTests {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
//@Ignore
|
||||
public void run() throws Exception {
|
||||
Thread.sleep(10 * 1000);
|
||||
}
|
||||
|
||||
@@ -26,25 +26,27 @@
|
||||
|
||||
<context:component-scan base-package="org.springframework.integration.xmpp"/>
|
||||
|
||||
<context:property-placeholder location="file://${user.home}/Desktop/test.properties" ignore-unresolvable="true"/>
|
||||
<context:property-placeholder location="file://${user.home}/Desktop/xmpp.properties" ignore-unresolvable="true"/>
|
||||
|
||||
<beans:bean id="xmppProducer" class="org.springframework.integration.xmpp.messages.XmppMessageProducer" p:recipient="${user.2.login}"/>
|
||||
<beans:bean id="xmppProducer"
|
||||
class="org.springframework.integration.xmpp.messages.XmppMessageProducer"
|
||||
p:recipient="starbuxman@gmail.com"/>
|
||||
|
||||
<poller default="true">
|
||||
<interval-trigger fixed-rate="true" interval="10" time-unit="SECONDS"/>
|
||||
</poller>
|
||||
<xmpp:xmpp-connection
|
||||
id="testConnection"
|
||||
user="${user.2.login}"
|
||||
password="${user.2.password}"
|
||||
host="${user.2.host}"
|
||||
port="${user.2.port}"
|
||||
resource="${user.2.resource}"
|
||||
sasl-mechanism-supported="${user.2.sasl.mechanism}"
|
||||
sasl-mechanism-supported-index="0"
|
||||
service-name="${user.2.service}"
|
||||
/>
|
||||
|
||||
<xmpp:xmpp-connection
|
||||
id="testConnection"
|
||||
user="${user.1.login}"
|
||||
password="${user.1.password}"
|
||||
host="${user.1.host}"
|
||||
port="${user.1.port}"
|
||||
resource="${user.1.resource}"
|
||||
sasl-mechanism-supported="${user.1.sasl.mechanism}"
|
||||
sasl-mechanism-supported-index="${user.1.sasl.index}"
|
||||
service-name="${user.1.service}"
|
||||
/>
|
||||
|
||||
|
||||
<inbound-channel-adapter ref="xmppProducer" channel="outboundChannel"/>
|
||||
|
||||
Reference in New Issue
Block a user