import entity.ShortUrl;
import junit.framework.TestCase;

/**
 * Created by Roger on 01/08/2015.
 */
public class TestDAO extends TestCase {
    private DAO dao;

    private String[] shortUrls = {
            "{\"continentsClicks\":[], \"countriesClicks\":[], \"citiesClicks\":[], \"urlLong\":\"facebook.com\", " +
                    "\"urlShort\": \"fb.com\"}",
            "{\"continentsClicks\":[], \"countriesClicks\":[], \"citiesClicks\":[], " +
                    "\"urlLong\":\"http://facebook.com\", " + "\"urlShort\": \"http://fb.com\"}",
            "{\"continentsClicks\":[], \"countriesClicks\":[], \"citiesClicks\":[], " +
                    "\"urlLong\":\"http://facebook.com/\", \"urlShort\": \"fb.com/\"}",

    };

    private String[] toFind = {
            "fb.com",
            "fb.com",
            "fb.com"
    };

    protected void setUp() throws Exception {
        dao = new DAO();
        super.setUp();
    }
    protected void tearDown() throws Exception {
        dao = null;
        super.tearDown();
    }

    public void testCheckDAO() {
        for (int i = 0; i < shortUrls.length; i++) {
            dao.addShortUrl(shortUrls[i]);
            try{
                if(dao.find(toFind[i]) == null){

                }
            }catch (NullPointerException e){
                assertEquals("Test " + i + " failed", toFind[i], "Non aggiunta");
            }
        }
    }

}

@@ -720,16 +720,390 @@
 m/%5C%22%7D%22,%0A
+            %22%7B%5C%22continentsClicks%5C%22:%5B%5D, %5C%22countriesClicks%5C%22:%5B%5D, %5C%22citiesClicks%5C%22:%5B%5D, %22 +%0A                    %22%5C%22urlLong%5C%22:%5C%22http://gm.com/%5C%22, %5C%22urlShort%5C%22: %5C%22https://mail.google.com/%5C%22%7D%22,%0A            %22%7B%5C%22continentsClicks%5C%22:%5B%5D, %5C%22countriesClicks%5C%22:%5B%5D, %5C%22citiesClicks%5C%22:%5B%5D, %22 +%0A                    %22%5C%22urlLong%5C%22:%5C%22http://yt.com/%5C%22, %5C%22urlShort%5C%22: %5C%22https://www.youtube.com//%5C%22%7D%22,
 %0A    %7D;%0A

Update TestDAO.java