Restructured tests and samples

This commit is contained in:
Patrick Gotthard 2015-02-16 21:44:23 +01:00
parent 9378ff1a7e
commit 1d766344c6
10 changed files with 23 additions and 8 deletions

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.rometools.test; package com.rometools.fetcher;
import java.net.URL; import java.net.URL;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.rometools.test; package com.rometools.fetcher;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.rometools.test; package com.rometools.fetcher;
import java.net.Authenticator; import java.net.Authenticator;
import java.net.PasswordAuthentication; import java.net.PasswordAuthentication;

View file

@ -1,4 +1,4 @@
package com.rometools.test; package com.rometools.fetcher.impl;
import java.io.File; import java.io.File;
import java.net.URL; import java.net.URL;

View file

@ -1,4 +1,4 @@
package com.rometools.test; package com.rometools.fetcher.impl;
import java.net.URL; import java.net.URL;

View file

@ -14,11 +14,12 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.rometools.test; package com.rometools.fetcher.impl;
import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.UsernamePasswordCredentials; import org.apache.commons.httpclient.UsernamePasswordCredentials;
import com.rometools.fetcher.AbstractJettyTest;
import com.rometools.fetcher.FeedFetcher; import com.rometools.fetcher.FeedFetcher;
import com.rometools.fetcher.impl.FeedFetcherCache; import com.rometools.fetcher.impl.FeedFetcherCache;
import com.rometools.fetcher.impl.HttpClientFeedFetcher; import com.rometools.fetcher.impl.HttpClientFeedFetcher;

View file

@ -14,9 +14,11 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.rometools.test; package com.rometools.fetcher.impl;
import com.rometools.fetcher.AbstractJettyTest;
import com.rometools.fetcher.FeedFetcher; import com.rometools.fetcher.FeedFetcher;
import com.rometools.fetcher.TestBasicAuthenticator;
import com.rometools.fetcher.impl.FeedFetcherCache; import com.rometools.fetcher.impl.FeedFetcherCache;
import com.rometools.fetcher.impl.HttpURLFeedFetcher; import com.rometools.fetcher.impl.HttpURLFeedFetcher;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.rometools.test; package com.rometools.fetcher.impl;
import junit.framework.TestCase; import junit.framework.TestCase;

View file

@ -47,9 +47,13 @@ import com.rometools.rome.io.SyndFeedOutput;
public class FeedAggregator { public class FeedAggregator {
public static void main(final String[] args) { public static void main(final String[] args) {
boolean ok = false; boolean ok = false;
if (args.length >= 2) { if (args.length >= 2) {
try { try {
final String outputType = args[0]; final String outputType = args[0];
final SyndFeed feed = new SyndFeedImpl(); final SyndFeed feed = new SyndFeedImpl();
@ -76,10 +80,12 @@ public class FeedAggregator {
output.output(feed, new PrintWriter(System.out)); output.output(feed, new PrintWriter(System.out));
ok = true; ok = true;
} catch (final Exception ex) { } catch (final Exception ex) {
System.out.println("ERROR: " + ex.getMessage()); System.out.println("ERROR: " + ex.getMessage());
ex.printStackTrace(); ex.printStackTrace();
} }
} }
if (!ok) { if (!ok) {

View file

@ -36,9 +36,13 @@ import com.rometools.rome.feed.synd.SyndFeed;
* *
*/ */
public class FeedReader { public class FeedReader {
public static void main(final String[] args) { public static void main(final String[] args) {
boolean ok = false; boolean ok = false;
if (args.length == 1) { if (args.length == 1) {
try { try {
final URL feedUrl = new URL(args[0]); final URL feedUrl = new URL(args[0]);
final FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance(); final FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
@ -64,10 +68,12 @@ public class FeedReader {
System.err.println("If a \"Feed Unchanged\" event fired then the server supports conditional gets."); System.err.println("If a \"Feed Unchanged\" event fired then the server supports conditional gets.");
ok = true; ok = true;
} catch (final Exception ex) { } catch (final Exception ex) {
System.out.println("ERROR: " + ex.getMessage()); System.out.println("ERROR: " + ex.getMessage());
ex.printStackTrace(); ex.printStackTrace();
} }
} }
if (!ok) { if (!ok) {