This repository has been archived by the owner on Nov 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added automated tests
- Loading branch information
Showing
5 changed files
with
117 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package test; | ||
|
||
import gmusic.api.impl.GoogleMusicAPI; | ||
import gmusic.api.impl.InvalidCredentialsException; | ||
import gmusic.api.interfaces.IGoogleMusicAPI; | ||
|
||
import java.io.IOException; | ||
import java.net.URISyntaxException; | ||
|
||
import javax.naming.directory.InvalidAttributesException; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class TestOfInterface | ||
{ | ||
|
||
private static final String username = ""; | ||
private static final String password = ""; | ||
private IGoogleMusicAPI api; | ||
|
||
@Before | ||
public void before() | ||
{ | ||
api = new GoogleMusicAPI(); | ||
} | ||
|
||
@Test | ||
public void testLogin() throws IOException, URISyntaxException, InvalidCredentialsException | ||
{ | ||
api.login(username, password); | ||
api.getAllSongs(); | ||
} | ||
|
||
@Test | ||
public void testGetAllSongs() throws IOException, URISyntaxException, InvalidCredentialsException | ||
{ | ||
api.login(username, password); | ||
api.getAllSongs(); | ||
} | ||
|
||
@Test | ||
public void testGetAllPlaylists() throws IOException, URISyntaxException, InvalidCredentialsException | ||
{ | ||
api.login(username, password); | ||
api.getAllPlaylists(); | ||
} | ||
|
||
@Test | ||
public void testGetSongUrl() throws IOException, URISyntaxException, InvalidCredentialsException | ||
{ | ||
api.login(username, password); | ||
api.getSongURL(api.getAllSongs().iterator().next()); | ||
} | ||
|
||
@Test | ||
public void testDownloadSong() throws IOException, URISyntaxException, InvalidCredentialsException, InvalidAttributesException | ||
{ | ||
api.login(username, password); | ||
api.downloadSong(api.getAllSongs().iterator().next()); | ||
} | ||
} |