HomePageService implements ServerConstants { @GET @Produces({ MediaType.APPLICATION_JSON }) public List<VideoInfo> getHomePageVideo() throws PhrescoException, IOException { if (isDebugEnabled) { S_LOGGER.debug("Entering Method HomePageService.getHomePageVideo()"); } PhrescoServerFactory.initialize(); Gson gson = new Gson(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String videoInfoJSON = repoMgr.getArtifactAsString(repoMgr.getHomePageJsonFile()); Type type = new TypeToken<List<VideoInfo>>() { }.getType(); List<VideoInfo> videoInfoList = gson.fromJson(videoInfoJSON, type); return videoInfoList; }  @GET @Produces({ MediaType.APPLICATION_JSON }) List<VideoInfo> getHomePageVideo(); @GET @Path("/webm") @Produces({ "video/webm" }) StreamingOutput webmVideo(@QueryParam("file") String filename); @GET @Path("/mp4") @Produces({ "video/mp4" }) StreamingOutput mp4Video(@QueryParam("file") String filename); @GET @Path("/ogv") @Produces({ "video/webm" }) StreamingOutput ogvVideo(@QueryParam("file") String filename); @GET @Path("/ogg") @Produces({ "video/ogg" }) StreamingOutput oggVideo(@QueryParam("file") String filename);  }
@Test public void testGetHomePageVideo() throws PhrescoException { PhrescoServerFactory.initialize(); Gson gson = new Gson(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String videoInfoJSON = repoMgr.getArtifactAsString(repoMgr.getHomePageJsonFile()); Type type = new TypeToken<List<VideoInfo>>() { }.getType(); List<VideoInfo> videoInfoList = gson.fromJson(videoInfoJSON, type); assertNotNull(videoInfoList); }