package tests;

import engine.DataReader;
import engine.Recommender;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;
import java.util.TreeMap;

/**
* Recommender Tester.
*/
public class RecommenderTest {

@Before
public void before() throws Exception {
}

@After
public void after() throws Exception {
}

/**
*
* Method: collabFilter(int userID, TreeMap<Double, List<Node>> scores)
*
*/
@Test
public void testCollabFilter() throws Exception {
    int userID = 1;
    Recommender r = new Recommender(DataReader.readMovieLensData());
    TreeMap<Double, List<Node>> scores = r.getPearsonScores(userID);
    List<Integer> recommended = r.collabFilter(userID, scores, 10, 5);
    System.out.println(recommended);
    r.getMovieLensNames(userID, recommended);
}

    @Test
    public void testCollabFilterUser2() throws Exception {
        int userID = 2;
        Recommender r = new Recommender(DataReader.readMovieLensData());
        TreeMap<Double, List<Node>> scores = r.getPearsonScores(userID);
        List<Integer> recommended = r.collabFilter(userID, scores, 10, 5);
        System.out.println(recommended);
        r.getMovieLensNames(userID, recommended);
    }
/**
*
* Method: getPearsonScores(int userID)
*
*/
@Test
public void testGetPearsonScores() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getJaccardScores(int userID)
*
*/
@Test
public void testGetJaccardScores() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getNode()
*
*/
@Test
public void testGetNode() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getWeight()
*
*/
@Test
public void testGetWeight() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: setWeight(double weight)
*
*/
@Test
public void testSetWeight() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: compareTo(Entry other)
*
*/
@Test
public void testCompareTo() throws Exception {
//TODO: Test goes here...
}


/**
*
* Method: getTopMatches(TreeMap<Double, List<Node>> map, int limit)
*
*/
@Test
public void testGetTopMatches() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = Recommender.getClass().getMethod("getTopMatches", TreeMap<Double,.class, int.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: getPearsonCoeff(Node n1, Node n2)
*
*/
@Test
public void testGetPearsonCoeff() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = Recommender.getClass().getMethod("getPearsonCoeff", Node.class, Node.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: getJaccardCoeff(Node n1, Node n2)
*
*/
@Test
public void testGetJaccardCoeff() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = Recommender.getClass().getMethod("getJaccardCoeff", Node.class, Node.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

}

@@ -161,34 +161,8 @@
 ist;
-%0Aimport java.util.TreeMap;
 %0A%0A/*
@@ -551,77 +551,8 @@
 ));%0A
-    TreeMap%3CDouble, List%3CNode%3E%3E scores = r.getPearsonScores(userID);%0A
     
@@ -593,39 +593,71 @@
 abFilter(userID,
- scores
+%0A            r.getPearsonScores(userID)
 , 10, 5);%0A    Sy
@@ -906,81 +906,8 @@
 ));%0A
-        TreeMap%3CDouble, List%3CNode%3E%3E scores = r.getPearsonScores(userID);%0A
     
@@ -960,23 +960,59 @@
 (userID,
- scores
+%0A                r.getPearsonScores(userID)
 , 10, 5)

Fix RecommenderTest