/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/TestServlet.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/TestServlet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 739 by torben, Wed May 19 07:57:14 2010 UTC revision 740 by torben, Wed May 19 11:14:33 2010 UTC
# Line 49  public class TestServlet extends HttpSer Line 49  public class TestServlet extends HttpSer
49                                                    
50                          db.getByName(search);                          db.getByName(search);
51                  }                  }
52            }
53            
54            void testFindFavorites(int count)  throws SQLException {
55                    Random r = new Random();
56                    
57                    StationDAO db = new StationDAO();
58                    
59                    for (int i=0; i<count; i++) {
60                            final int MAX = 8;
61                            
62                            StringBuilder sb = new StringBuilder();
63                            sb.append('(');
64                            for (int j=0; j<MAX;j++) {
65                                    if (j>0)
66                                            sb.append(',');
67                                    sb.append(r.nextInt(400));
68                            }
69                            sb.append(')');
70    
71    
72                            db.getByList(sb.toString());
73                    }
74          }          }
75    
76          protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {          protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
# Line 69  public class TestServlet extends HttpSer Line 88  public class TestServlet extends HttpSer
88                                  testFindName(count);                                  testFindName(count);
89                          } else if ( test.equals("nearest") ) {                          } else if ( test.equals("nearest") ) {
90                                  testFindNearest(count);                                  testFindNearest(count);
91                            } else if ( test.equals("favorites") ) {
92                                    testFindFavorites(count);
93                          } else {                          } else {
94                                  throw new ServletException("No parameter test");                                  throw new ServletException("No parameter test");
95                          }                          }

Legend:
Removed from v.739  
changed lines
  Added in v.740

  ViewVC Help
Powered by ViewVC 1.1.20