/[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 852 by torben, Tue Jun 15 13:10:32 2010 UTC revision 958 by torben, Mon Jul 5 09:48:06 2010 UTC
# Line 5  import java.sql.SQLException; Line 5  import java.sql.SQLException;
5  import java.util.Random;  import java.util.Random;
6    
7  import javax.servlet.ServletException;  import javax.servlet.ServletException;
8    import javax.servlet.annotation.WebServlet;
9  import javax.servlet.http.HttpServlet;  import javax.servlet.http.HttpServlet;
10  import javax.servlet.http.HttpServletRequest;  import javax.servlet.http.HttpServletRequest;
11  import javax.servlet.http.HttpServletResponse;  import javax.servlet.http.HttpServletResponse;
12    
13    @WebServlet(urlPatterns={"/TestServlet"})
14  public class TestServlet extends HttpServlet {  public class TestServlet extends HttpServlet {
15          private static final long serialVersionUID = 1L;          private static final long serialVersionUID = 1L;
16                    
17          Random r = new Random();          Random r = new Random();
18    
19          //South-West corner= 54.5, 8.0          //South-West corner= 54.5, 8.0
20          //North-East corner= 58.0, 13.0          //North-East corner= 57.8, 12.7
21          //Latitude span=3.5          //Latitude span=3.3
22          //Longitude span=5.0          //Longitude span=4.7
23          void testFindNearest(int count) throws SQLException {                    void testFindNearest(int count) throws SQLException {          
24    
25                  StationDAO db = new StationDAO();                  StationDAO db = new StationDAO();
26    
27    
28                  for (int i=0; i<count; i++) {                  for (int i=0; i<count; i++) {
29                          float lat = (r.nextFloat()*3.5F) + 54.5F;                          float lat = (r.nextFloat()*3.3F) + 54.5F;
30                          float lng = (r.nextFloat()*5.0F) + 8.0F;                          float lng = (r.nextFloat()*4.7F) + 8.0F;
31                          db.getByLocation(lat, lng);                          db.getByLocation(lat, lng);
32                  }                  }
33    

Legend:
Removed from v.852  
changed lines
  Added in v.958

  ViewVC Help
Powered by ViewVC 1.1.20