aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-16 11:28:17 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-16 11:28:17 -0400
commit250f5edc1ed502c74c398b5850a0bb7a7b01848c (patch)
tree56e41c692f5d1380eda69bc931e0d01feda0721b /src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
parent939f748b5f0914fe1558d571fdf13962c46b4537 (diff)
parentb75b23ff59a71c9a54be43525189b678124ae3a3 (diff)
Big merge to supress the printstram and update the frontend server.
Diffstat (limited to 'src/test/java/edu/brown/cs/student/SuspicionRankerTest.java')
-rw-r--r--src/test/java/edu/brown/cs/student/SuspicionRankerTest.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java b/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
new file mode 100644
index 0000000..d641507
--- /dev/null
+++ b/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
@@ -0,0 +1,52 @@
+package edu.brown.cs.student;
+
+import edu.brown.cs.student.term.DatabaseQuerier;
+import edu.brown.cs.student.term.hub.Holder;
+import edu.brown.cs.student.term.hub.HubSearch;
+import edu.brown.cs.student.term.hub.LinkMapper;
+import edu.brown.cs.student.term.hub.SuspicionRanker;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.time.Instant;
+import java.util.List;
+import java.util.Map;
+
+public class SuspicionRankerTest {
+
+ //12 am on 3/11 in UTC
+ //private Instant start = Instant.parse("2021-03-11T05:00:00.00Z");
+ private Instant start = Instant.ofEpochMilli(161800418000L);
+ //12 am on 3/28 in UTC
+ //private Instant end = Instant.parse("2021-03-28T05:00:00.00Z");
+ private Instant end = Instant.ofEpochMilli(1618019436000L);
+
+ private DatabaseQuerier db;
+
+ @Before
+ public void setUp() {
+ try{
+ db = new DatabaseQuerier("data/trades.sqlite3");
+ } catch(Exception e){
+ System.out.println("DBQuerier Test, couldn't connect to db???");
+ }
+ }
+
+ @After
+ public void tearDown() {
+ db = null;
+ }
+
+ @Test
+ public void testMapper(){
+ setUp();
+ SuspicionRanker r = new SuspicionRanker(db);
+ List<Holder> him = r.getSuspicionScoreList(start, end);
+ //System.out.println(him);
+ for(Holder guy: him){
+ System.out.println(guy.getName() + " " + guy.getSuspicionScore());
+ }
+ tearDown();
+ }
+}