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 { |
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 |
} |
} |