aboutsummaryrefslogtreecommitdiff
path: root/app/src/androidTest
diff options
context:
space:
mode:
authorCamil Staps2015-06-10 18:15:24 +0200
committerCamil Staps2015-06-10 18:15:24 +0200
commit757aea73c705824acb7dea0e12fa72809098efd7 (patch)
tree5703dbf09a100b2ca8f796d77853e5644b2e2ab1 /app/src/androidTest
parentLicense (diff)
Cleanup; license
Diffstat (limited to 'app/src/androidTest')
-rw-r--r--[-rwxr-xr-x]app/src/androidTest/java/org/rssin/neurons/FeedSorterTest.java33
-rw-r--r--[-rwxr-xr-x]app/src/androidTest/java/org/rssin/neurons/NeuralNetworkTest.java18
-rw-r--r--app/src/androidTest/java/org/rssin/rss/FeedLoaderTest.java26
-rw-r--r--app/src/androidTest/java/org/rssin/rssin/ApplicationTest.java13
4 files changed, 45 insertions, 45 deletions
diff --git a/app/src/androidTest/java/org/rssin/neurons/FeedSorterTest.java b/app/src/androidTest/java/org/rssin/neurons/FeedSorterTest.java
index a6e3581..ba76dea 100755..100644
--- a/app/src/androidTest/java/org/rssin/neurons/FeedSorterTest.java
+++ b/app/src/androidTest/java/org/rssin/neurons/FeedSorterTest.java
@@ -1,3 +1,21 @@
+/**
+ * RSSin - Clever RSS reader for Android
+ * Copyright (C) 2015 Randy Wanga, Jos Craaijo, Joep Bernards, Camil Staps
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
package org.rssin.neurons;
import android.util.Log;
@@ -6,6 +24,7 @@ import junit.framework.Assert;
import junit.framework.TestCase;
import org.rssin.rss.FeedItem;
+import org.rssin.rssin.SortedFeedItemContainer;
import java.net.URL;
import java.util.ArrayList;
@@ -105,13 +124,15 @@ public class FeedSorterTest extends TestCase {
}
private void testSortingOrder(FeedSorter s, FeedItem dislikedItem, FeedItem likedItem) {
- List<FeedItem> testItems = new LinkedList<>();
- testItems.add(dislikedItem);
- testItems.add(likedItem);
+ List<SortedFeedItemContainer> testItems = new LinkedList<>();
- List<FeedItem> sortedItems = s.sortItems(testItems);
- Assert.assertEquals(sortedItems.get(0), likedItem);
- Assert.assertEquals(sortedItems.get(1), dislikedItem);
+ testItems.add(new SortedFeedItemContainer(dislikedItem));
+ testItems.add(new SortedFeedItemContainer(likedItem));
+
+ s.sortItems(testItems);
+
+ Assert.assertEquals(testItems.get(0), likedItem);
+ Assert.assertEquals(testItems.get(1), dislikedItem);
}
private void trainNetwork(FeedItem[] likedItems, FeedItem[] dislikedItems, FeedSorter s) {
diff --git a/app/src/androidTest/java/org/rssin/neurons/NeuralNetworkTest.java b/app/src/androidTest/java/org/rssin/neurons/NeuralNetworkTest.java
index 57776f3..2c05e8a 100755..100644
--- a/app/src/androidTest/java/org/rssin/neurons/NeuralNetworkTest.java
+++ b/app/src/androidTest/java/org/rssin/neurons/NeuralNetworkTest.java
@@ -1,3 +1,21 @@
+/**
+ * RSSin - Clever RSS reader for Android
+ * Copyright (C) 2015 Randy Wanga, Jos Craaijo, Joep Bernards, Camil Staps
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
package org.rssin.neurons;
import junit.framework.Assert;
diff --git a/app/src/androidTest/java/org/rssin/rss/FeedLoaderTest.java b/app/src/androidTest/java/org/rssin/rss/FeedLoaderTest.java
deleted file mode 100644
index 58e9467..0000000
--- a/app/src/androidTest/java/org/rssin/rss/FeedLoaderTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.rssin.rss;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.rssin.http.SimpleFetcher;
-import org.rssin.listener.SimpleFallibleListener;
-
-import java.net.URL;
-
-/**
- * Created by Randy on 21-5-2015.
- */
-public class FeedLoaderTest extends TestCase {
-
-
- public void testFetchXML() throws Exception {
- String urlstring = "http://www.pcworld.com/index.rss";
- URL url = new URL(urlstring);
- FeedLoader loader = new FeedLoader(url);
- loader.fetchXML(new SimpleFetcher(), new SimpleFallibleListener());
- FeedItem f = loader.getFeed().getPosts().get(0);
- Assert.assertEquals(f.getTitle(), "Amazon adds local groceries and meals to one-hour Prime Now delivery service");
- }
-
-} \ No newline at end of file
diff --git a/app/src/androidTest/java/org/rssin/rssin/ApplicationTest.java b/app/src/androidTest/java/org/rssin/rssin/ApplicationTest.java
deleted file mode 100644
index 0c5e470..0000000
--- a/app/src/androidTest/java/org/rssin/rssin/ApplicationTest.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.rssin.rssin;
-
-import android.app.Application;
-import android.test.ApplicationTestCase;
-
-/**
- * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
- */
-public class ApplicationTest extends ApplicationTestCase<Application> {
- public ApplicationTest() {
- super(Application.class);
- }
-} \ No newline at end of file