*/
@Test
@SuppressWarnings("nls")
public void testProtectedFeed() throws Exception {
ConnectionManager conManager = ConnectionManager.getDefault();
ICredentialsProvider credProvider = conManager.getCredentialsProvider();
URL feedUrl = new URL("http://www.rssowl.org/rssowl2dg/tests/connection/authrequired/feed_rss.xml");
IFeed feed = new Feed(feedUrl);
AuthenticationRequiredException e = null;
try {
conManager.load(feed.getLink());
} catch (AuthenticationRequiredException e1) {
e = e1;
}
assertNotNull(e);
ICredentials credentials = new ICredentials() {
public String getDomain() {
return null;
}
public String getPassword() {
return "admin";
}
public String getUsername() {
return "bpasero";
}
};
credProvider.setAuthCredentials(credentials, feedUrl);
InputStream inS = conManager.load(feed.getLink());
assertNotNull(inS);
Interpreter.getDefault().interpret(inS, feed);