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\":\"http://facebook.com/\", \"urlShort\": \"fb.com/\"}",
            "{\"continentsClicks\":[], \"countriesClicks\":[], \"citiesClicks\":[], " +
                    "\"urlLong\":\"http://gm.com/\", \"urlShort\": \"https://mail.google.com/\"}",
            "{\"continentsClicks\":[], \"countriesClicks\":[], \"citiesClicks\":[], " +
                    "\"urlLong\":\"http://yt.com/\", \"urlShort\": \"https://www.youtube.com//\"}",
    };

    private String[] toFind = {
            "fb.com",
            "gm.com",
            "yt.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");
            }
        }
    }

}

@@ -356,25 +356,24 @@
 %5C%22: %5C%22fb.com
-/
 %5C%22%7D%22,%0A      
@@ -497,18 +497,27 @@
 http
+s
 ://
-g
 m
+ail.google
 .com
-/
 %5C%22, 
@@ -536,32 +536,14 @@
 : %5C%22
-https://mail.google
+gm
 .com
-/
 %5C%22%7D%22
@@ -675,18 +675,27 @@
 http
+s
 ://
-yt
+www.youtube
 .com
-/
 %5C%22, 
@@ -714,33 +714,14 @@
 : %5C%22
-https://www.youtube
+yt
 .com
-//
 %5C%22%7D%22

Update TestDAO.java