--- android/TrainInfoService/src/dk/thoerup/traininfoservice/TestServlet.java 2010/05/18 21:07:02 736 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/TestServlet.java 2010/06/15 12:54:25 851 @@ -12,20 +12,21 @@ public class TestServlet extends HttpServlet { private static final long serialVersionUID = 1L; + + Random r = new Random(); //South-West corner= 54.0, 7.0 - //North-East corner= 58.0, 16.0 + //North-East corner= 58.0, 13.0 //Latitude span=4.0 - //Longitude span=9.0 - void testFindNearest(int count) throws SQLException { - Random r = new Random(); + //Longitude span=6.0 + void testFindNearest(int count) throws SQLException { StationDAO db = new StationDAO(); for (int i=0; i0) + sb.append(','); + sb.append(r.nextInt(400)); + } + sb.append(')'); - + db.getByList(sb.toString()); + } } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -69,6 +87,8 @@ testFindName(count); } else if ( test.equals("nearest") ) { testFindNearest(count); + } else if ( test.equals("favorites") ) { + testFindFavorites(count); } else { throw new ServletException("No parameter test"); }