/[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 740 by torben, Wed May 19 11:14:33 2010 UTC revision 853 by torben, Tue Jun 15 13:16:29 2010 UTC
# Line 12  import javax.servlet.http.HttpServletRes Line 12  import javax.servlet.http.HttpServletRes
12    
13  public class TestServlet extends HttpServlet {  public class TestServlet extends HttpServlet {
14          private static final long serialVersionUID = 1L;          private static final long serialVersionUID = 1L;
15            
16            Random r = new Random();
17    
18          //South-West corner= 54.0, 7.0          //South-West corner= 54.5, 8.0
19          //North-East corner= 58.0, 13.0          //North-East corner= 57.8, 12.7
20          //Latitude span=4.0          //Latitude span=3.3
21          //Longitude span=6.0          //Longitude span=4.7
22          void testFindNearest(int count) throws SQLException {          void testFindNearest(int count) throws SQLException {          
                 Random r = new Random();  
23    
24                  StationDAO db = new StationDAO();                  StationDAO db = new StationDAO();
25    
26    
27                  for (int i=0; i<count; i++) {                  for (int i=0; i<count; i++) {
28                          float lat = (r.nextFloat()*4.0F) + 54.0F;                          float lat = (r.nextFloat()*3.3F) + 54.5F;
29                          float lng = (r.nextFloat()*6.0F) + 7.0F;                          float lng = (r.nextFloat()*4.7F) + 8.0F;
30                          db.getByLocation(lat, lng);                          db.getByLocation(lat, lng);
31                  }                  }
32    
# Line 34  public class TestServlet extends HttpSer Line 35  public class TestServlet extends HttpSer
35          }          }
36    
37          void testFindName(int count)  throws SQLException {          void testFindName(int count)  throws SQLException {
                 Random r = new Random();  
38                                    
39                  StationDAO db = new StationDAO();                  StationDAO db = new StationDAO();
40                                    
# Line 52  public class TestServlet extends HttpSer Line 52  public class TestServlet extends HttpSer
52          }          }
53                    
54          void testFindFavorites(int count)  throws SQLException {          void testFindFavorites(int count)  throws SQLException {
                 Random r = new Random();  
55                                    
56                  StationDAO db = new StationDAO();                  StationDAO db = new StationDAO();
57                                    

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

  ViewVC Help
Powered by ViewVC 1.1.20