/** * Gets the names for rating schemes currently in the system. * @return String[] */ public String[] getRatingSchemeNames() { Set<String> schemeNames = ratingService.getRatingSchemes().keySet(); String[] result = new String[0]; result = schemeNames.toArray(result); return result; }
/** * Gets the names for rating schemes currently in the system. * @return String[] */ public String[] getRatingSchemeNames() { Set<String> schemeNames = ratingService.getRatingSchemes().keySet(); String[] result = new String[0]; result = schemeNames.toArray(result); return result; }
/** * This method tests that the expected 'out of the box' rating schemes are available * and correctly initialised. */ @Test public void outOfTheBoxRatingSchemes() throws Exception { Map<String, RatingScheme> schemes = RATING_SERVICE.getRatingSchemes(); assertNotNull("rating scheme collection was null.", schemes); assertTrue("rating scheme collection was empty.", schemes.isEmpty() == false); RatingScheme likesRS = schemes.get(LIKES_SCHEME_NAME); assertNotNull("'likes' rating scheme was missing.", likesRS); assertEquals("'likes' rating scheme had wrong name.", LIKES_SCHEME_NAME, likesRS.getName()); assertEquals("'likes' rating scheme had wrong min.", 1, (int)likesRS.getMinRating()); assertEquals("'likes' rating scheme had wrong max.", 1, (int)likesRS.getMaxRating()); RatingScheme fiveStarRS = schemes.get(FIVE_STAR_SCHEME_NAME); assertNotNull("'5*' rating scheme was missing.", fiveStarRS); assertEquals("'5*' rating scheme had wrong name.", FIVE_STAR_SCHEME_NAME, fiveStarRS.getName()); assertEquals("'5*' rating scheme had wrong min.", 1, (int)fiveStarRS.getMinRating()); assertEquals("'5*' rating scheme had wrong max.", 5, (int)fiveStarRS.getMaxRating()); }