/** * Test method for. * * <p>{@link ext.services.lastfm.LastFmCache#storeAlbumInfo(java.lang.String, java.lang.String, * ext.services.lastfm.AlbumInfo)} . */ public void testStoreAlbumInfo() { LastFmCache cache = new LastFmCache(); LastFmAlbum album = new LastFmAlbum(); album.setBigCoverURL("testurl"); cache.storeAlbumInfo("Red Hot Chili Peppers", "By the way", album); assertNotNull(cache.retrieveAlbumInfo("Red Hot Chili Peppers", "By the way")); }
/** * Test method for. * * <p>{@link ext.services.lastfm.LastFmCache#storeAlbumList(java.lang.String, * ext.services.lastfm.AlbumListInfo)} . */ public void testStoreAlbumList() { LastFmCache cache = new LastFmCache(); LastFmAlbumList list = new LastFmAlbumList(); LastFmAlbum album1 = new LastFmAlbum(); album1.setTitle("Test1"); LastFmAlbum album2 = new LastFmAlbum(); album2.setTitle("Test2"); List<AlbumInfo> alist = new ArrayList<AlbumInfo>(); alist.add(album1); alist.add(album2); list.setAlbums(alist); cache.storeAlbumList("Red Hot Chili Peppers", list); assertNotNull(cache.retrieveAlbumList("Red Hot Chili Peppers")); assertNotNull(cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums()); assertEquals( cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums().toString(), 2, cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums().size()); /* * assertTrue(cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums().toString * (), * cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums().contains( * album1)); * assertTrue(cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums * ().toString(), * cache.retrieveAlbumList("Red Hot Chili Peppers").getAlbums( * ).contains(album2)); */ }
/** * Test method for. * * <p>{@link ext.services.lastfm.LastFmCache#storeAlbumCover(ext.services.lastfm.AlbumInfo, * java.awt.Image)} . */ public void testStoreAlbumCover() { LastFmCache cache = new LastFmCache(); LastFmAlbum album = new LastFmAlbum(); album.setBigCoverURL("testurl"); Image cover = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB); cache.storeAlbumCover(album, cover); assertNotNull(cache.retrieveAlbumCover(album)); assertEquals(10, cache.retrieveAlbumCover(album).getHeight(null)); }
/** * Test method for. * * <p>{@link ext.services.lastfm.LastFmCache#retrieveAlbumCover(ext.services.lastfm.AlbumInfo)} . */ public void testRetrieveAlbumCover() { LastFmCache cache = new LastFmCache(); LastFmAlbum album = new LastFmAlbum(); album.setBigCoverURL("testurl"); assertNull(cache.retrieveAlbumCover(album)); }