I can't get codereview to work -- it's giving a 500 error on publish (which the issue tracker suggests it a misconfigured SVN link, but that clearly worked for the original post) -- so commenting here. The HttpServer.java needs to add an import for java.io.UnsupportedEncodingException for this to compile, but otherwise looks good to me. -- Jeremy Wadsack On Mon, Feb 7, 2011 at 5:06 PM, <justinfriberg@gmail.com> wrote: > Reviewers: Michael Frederick, jeremy.wadsack, > > Description: > Updating the test project to fix changes introduced to the application. > > Please review this at http://codereview.appspot.com/4130049/ > > Affected files: > NPR_Test/src/org/npr/android/news/PlaybackServiceTest.java > NPR_Test/src/org/npr/android/test/HttpServer.java > > > Index: NPR_Test/src/org/npr/android/test/HttpServer.java > =================================================================== > --- NPR_Test/src/org/npr/android/test/HttpServer.java (revision 120) > +++ NPR_Test/src/org/npr/android/test/HttpServer.java (working copy) > @@ -198,9 +198,15 @@ > return null; > } > > - StringTokenizer st = new StringTokenizer(firstLine); > - st.nextToken(); // Skip method > - return URLDecoder.decode(st.nextToken()); > + try > + { > + StringTokenizer st = new StringTokenizer(firstLine); > + st.nextToken(); // Skip method > + return URLDecoder.decode(st.nextToken(), "x-www-form-urlencoded"); > + } > + catch (UnsupportedEncodingException e) { > + return null; > + } > } > > /* > Index: NPR_Test/src/org/npr/android/news/PlaybackServiceTest.java > =================================================================== > --- NPR_Test/src/org/npr/android/news/PlaybackServiceTest.java (revision > 120) > +++ NPR_Test/src/org/npr/android/news/PlaybackServiceTest.java (working > copy) > @@ -60,7 +60,9 @@ > // listen to our file > PlaylistEntry entry = new PlaylistEntry(-1L, "http://127.0.0.1:" > + server.getPort() + "/one_second_silence_mp3", "Silence", false, > -1); > - PlaybackService.setCurrent(entry); > + > + PlaybackService service = new PlaybackService(); > + service.setCurrent(entry); > tester.listen(entry); > > final int maxWait = 30 * 1000; // Wait 30 seconds to finish playing > @@ -140,7 +142,8 @@ > PlaylistEntry entry = new PlaylistEntry(-1L, "http://127.0.0.1:" > + server.getPort() + "/one_second_silence_mp3", "Silent Stream > test", > true, -1); > - PlaybackService.setCurrent(entry); > + PlaybackService service = new PlaybackService(); > + service.setCurrent(entry); > tester.listen(entry); > > final int maxWait = 3 * 1000; // Play stream for 3 seconds > @@ -184,7 +187,8 @@ > // listen to our file > final PlaylistEntry entry = new PlaylistEntry(-1L, "/dev/null", > "not-existent file", false, -1); > - PlaybackService.setCurrent(entry); > + PlaybackService service = new PlaybackService(); > + service.setCurrent(entry); > Thread t = new Thread(new Runnable() { > @Override > public void run() { > @@ -239,7 +243,8 @@ > "Invalid stream test", > true, // Don't bother using the StreamProxy > -1); > - PlaybackService.setCurrent(entry); > + PlaybackService service = new PlaybackService(); > + service.setCurrent(entry); > Thread t = new Thread(new Runnable() { > @Override > public void run() { > @@ -286,7 +291,8 @@ > // listen to our file > final PlaylistEntry entry = new PlaylistEntry(-1L, "http://127.0.0.1 > :" > + server.getPort() + "/", "Invalid stream test", false, -1); > - PlaybackService.setCurrent(entry); > + PlaybackService service = new PlaybackService(); > + service.setCurrent(entry); > Thread t = new Thread(new Runnable() { > @Override > public void run() { > > >
LGTM The review might be screwed up for paths outside of Npr/, but I'm not sure why. The setting looks fine to me.