(), playlist.getSongs());
+ }
+
+ @Test
+ public void testGetHost() {
+ assertEquals("example@example.com", playlist.getHost());
+ }
+
+ @Test
+ public void testNoArgumentConstructor() {
+ Playlist playlist = new Playlist();
+ assertEquals(null, playlist.getName());
+ }
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/RegistrationLoginIntegrationTest.java b/app/src/test/java/com/houseparty/houseparty/RegistrationLoginIntegrationTest.java
new file mode 100644
index 0000000..a18fc62
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/RegistrationLoginIntegrationTest.java
@@ -0,0 +1,52 @@
+package com.houseparty.houseparty;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Created by jacksonkurtz on 4/4/18.
+ */
+
+public class RegistrationLoginIntegrationTest {
+
+ private LoginActivity activity;
+
+ @Before
+ public void setup() {
+ activity = new LoginActivity();
+ }
+
+ @Test
+ public void createAndLoginUser_isCorrect() throws Exception {
+ assertTrue(activity.testUserLogin("metsfan1600@gmail.com", "123456"));
+ }
+
+ @Test
+ public void createAndLoginUser_incorrectPassword() throws Exception {
+ assertFalse(activity.testUserLogin("metsfan1600@gmail.com", "asdfghjkl"));
+ }
+
+ @Test
+ public void createAndLoginUser_nullLogin() throws Exception {
+ assertFalse(activity.testUserLogin(null, "123456"));
+ }
+
+ @Test
+ public void createAndLoginUser_nullPassword() throws Exception {
+ assertFalse(activity.testUserLogin("metsfan1600@gmail.com", null));
+ }
+
+ @Test
+ public void createAndLoginUser_invalidEmail() throws Exception {
+ assertFalse(activity.testUserLogin("metsfan1600", "123456"));
+ }
+
+ @Test
+ public void createAndLoginUser_badPasswordLength() throws Exception {
+ assertFalse(activity.testUserLogin("metsfan1600@gmail.com", "123"));
+ }
+
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/RegistrationUnitTest.java b/app/src/test/java/com/houseparty/houseparty/RegistrationUnitTest.java
new file mode 100644
index 0000000..7485e8a
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/RegistrationUnitTest.java
@@ -0,0 +1,56 @@
+package com.houseparty.houseparty;
+
+import org.junit.Before;
+
+/**
+ * Created by jacksonkurtz on 4/4/18.
+ */
+
+public class RegistrationUnitTest {
+
+ private LoginActivity activity;
+
+ @Before
+ public void setUp() {
+ activity = new LoginActivity();
+ }
+
+// @Test
+// public void register_correctInputs() throws Exception {
+// assertTrue(activity.register("jkurtz678@gmail.com", "12345"));
+// }
+//
+// @Test
+// public void register_existingUsername() throws Exception {
+// assertFalse(activity.register("matt@gmail.com", "12345"));
+// }
+//
+// @Test
+// public void register_nullUsername() throws Exception {
+// assertFalse(activity.register(null, "12345"));
+// }
+//
+// @Test
+// public void register_nullPassword() throws Exception {
+// assertFalse(activity.register("jkurtz678@gmail.com", null));
+// }
+//
+// @Test
+// public void register_badEmail() throws Exception {
+// assertFalse(activity.register("jkurtz678", "12345"));
+// }
+//
+// // longer than 4, shorter than 16
+// @Test
+// public void register_badPasswordLength() throws Exception {
+// assertTrue(activity.register("jkurtz678@gmail.com", "12345"));
+// assertFalse(activity.register("jkurtz678@gmail.com", "123"));
+// assertFalse(activity.register("jkurtz678@gmail.com", "123423123134235111"));
+// }
+//
+// @Test
+// public void register_invalidCharacters() throws Exception {
+// assertFalse(activity.register("jac## kson kurtz@gmail.com", "12345"));
+//
+// }
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/SongFactoryUnitTest.java b/app/src/test/java/com/houseparty/houseparty/SongFactoryUnitTest.java
new file mode 100644
index 0000000..cb9a42a
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/SongFactoryUnitTest.java
@@ -0,0 +1,45 @@
+package com.houseparty.houseparty;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class SongFactoryUnitTest {
+ private SongFactory songFactory;
+
+ @Before
+ public void setUp() {
+ songFactory = SongFactory.getInstance();
+ }
+
+ @Test
+ public void test_getInstance() {
+ SongFactory songFactory1 = SongFactory.getInstance();
+ assertEquals(songFactory1, songFactory);
+ }
+
+ @Test
+ public void test_createSongTidal() {
+ Song song = songFactory.createSong("Beat It", null, "tidal");
+ assertEquals(TidalSong.class, song.getClass());
+ }
+
+ @Test
+ public void test_createSongGooglePlay() {
+ Song song = songFactory.createSong("Beat It", null, "googleplay");
+ assertEquals(GooglePlaySong.class, song.getClass());
+ }
+
+ @Test
+ public void test_createSongSoundCloud() {
+ Song song = songFactory.createSong("Beat It", null, "soundcloud");
+ assertEquals(SoundCloudSong.class, song.getClass());
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void test_createSongSpotify() {
+ Song song = songFactory.createSong("Beat It", null, "spotify");
+ assertEquals(SpotifySong.class, song.getClass());
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/SoundCloudSongUnitTest.java b/app/src/test/java/com/houseparty/houseparty/SoundCloudSongUnitTest.java
new file mode 100644
index 0000000..71847b7
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/SoundCloudSongUnitTest.java
@@ -0,0 +1,18 @@
+package com.houseparty.houseparty;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class SoundCloudSongUnitTest {
+ private Song song;
+
+ @Before
+ public void setUp() {
+ song = new SoundCloudSong("Beat It", "fake_uri", "Michael Jackson");
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void testPlaySong() {
+ song.playSong();
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/SpotifySearchTest.java b/app/src/test/java/com/houseparty/houseparty/SpotifySearchTest.java
new file mode 100644
index 0000000..3f99eba
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/SpotifySearchTest.java
@@ -0,0 +1,19 @@
+package com.houseparty.houseparty;
+
+/**
+ * @author Eitan created on 4/9/2018.
+ */
+
+public class SpotifySearchTest {
+
+ /*
+ @Test
+ public void test_search() throws Exception {
+ assertEquals("spotify:track:24CXuh2WNpgeSYUOvz14jk", activity.spotifySearchForTrack("sandstorm"));
+ assertEquals("spotify:track:19a3JfW8BQwqHWUMbcqSx8", activity.spotifySearchForTrack("famous"));
+ assertEquals("spotify:track:0DIekYoiwwr1kkTUGmQlSL", activity.spotifySearchForTrack("deadmau5 strobe"));
+ assertEquals("spotify:track:4W4wYHtsrgDiivRASVOINL", activity.spotifySearchForTrack("love shack"));
+ assertEquals("spotify:track:2WfaOiMkCvy7F5fcp2zZ8L", activity.spotifySearchForTrack("take on me a ha"));
+ }
+ */
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/LoginActivityUnitTests.java b/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/LoginActivityUnitTests.java
new file mode 100644
index 0000000..166f009
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/LoginActivityUnitTests.java
@@ -0,0 +1,27 @@
+package com.houseparty.houseparty.activity_unit_tests;
+
+import android.view.View;
+import android.widget.Button;
+
+import com.houseparty.houseparty.LoginActivity;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Eitan created on 5/14/2018.
+ */
+public class LoginActivityUnitTests {
+ private LoginActivity loginActivity;
+
+ @Before
+ public void setUp() {
+ loginActivity = new LoginActivity();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testOnClick() {
+ View view = new Button(null);
+ loginActivity.onClick(null);
+ }
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/NewSongActivityUnitTest.java b/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/NewSongActivityUnitTest.java
new file mode 100644
index 0000000..9d1e629
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/NewSongActivityUnitTest.java
@@ -0,0 +1,25 @@
+package com.houseparty.houseparty.activity_unit_tests;
+
+import com.houseparty.houseparty.NewSongActivity;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class NewSongActivityUnitTest {
+ private NewSongActivity sa;
+
+ @Before
+ public void setup() {
+ sa = new NewSongActivity();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testSetUpButton() {
+ sa.setUpButton();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testSetUpAdapter() {
+ sa.setUpAdapter();
+ }
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/PlaylistActivityUnitTest.java b/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/PlaylistActivityUnitTest.java
new file mode 100644
index 0000000..5d49358
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/activity_unit_tests/PlaylistActivityUnitTest.java
@@ -0,0 +1,45 @@
+package com.houseparty.houseparty.activity_unit_tests;
+
+import com.houseparty.houseparty.PlaylistActivity;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class PlaylistActivityUnitTest {
+ private PlaylistActivity playlistActivity;
+
+ @Before
+ public void setup() {
+ playlistActivity = new PlaylistActivity();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onLogInFailed() {
+ playlistActivity.onLoginFailed(null);
+ }
+
+ @Test
+ public void test_onLoggedOut() {
+ playlistActivity.onLoggedOut();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onTemporaryError() {
+ playlistActivity.onTemporaryError();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onConnectionMessage() {
+ playlistActivity.onConnectionMessage(null);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onPlaybackEvent() {
+ playlistActivity.onPlaybackEvent(null);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onPlaybackError() {
+ playlistActivity.onPlaybackError(null);
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/cucumber/CucumberRunner.java b/app/src/test/java/com/houseparty/houseparty/cucumber/CucumberRunner.java
new file mode 100644
index 0000000..bebe089
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/cucumber/CucumberRunner.java
@@ -0,0 +1,38 @@
+package com.houseparty.houseparty.cucumber;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+
+import cucumber.api.CucumberOptions;
+import cucumber.api.junit.Cucumber;
+
+/**
+ * @author Eitan created on 4/20/2018.
+ *
+ * For a tutorial about Cucumber, go to:
+ * http://www.srccodes.com/p/article/48/cucumber-test-behavior-driven-development-bdd-feature-step-runner-glue-gherkin-data-table-scenario-given-when-then
+ */
+@RunWith(Cucumber.class)
+@CucumberOptions(
+ format = {
+ "pretty",
+ "json:src/test/java/com/houseparty/houseparty/cucumber/Cucumber.json",
+ "html:src/test/java/com/houseparty/houseparty/cucumber/Cucumber.html"
+ },
+ glue = {
+ "src/test/java/com/houseparty/houseparty/cucumber_steps"
+ },
+ features = {
+ "src/test/java/com/houseparty/houseparty/features"
+ }
+)
+public class CucumberRunner {
+ @BeforeClass
+ public static void setup() {
+ }
+
+ @AfterClass
+ public static void teardown() {
+ }
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/cucumber_steps/Register.java b/app/src/test/java/com/houseparty/houseparty/cucumber_steps/Register.java
new file mode 100644
index 0000000..ca54988
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/cucumber_steps/Register.java
@@ -0,0 +1,96 @@
+package com.houseparty.houseparty.cucumber_steps;
+
+import android.view.View;
+
+import com.houseparty.houseparty.LoginActivity;
+
+import cucumber.api.PendingException;
+import cucumber.api.java.en.Given;
+import cucumber.api.java.en.Then;
+import cucumber.api.java.en.When;
+
+/**
+ * @author Eitan created on 4/23/2018.
+ */
+public class Register {
+ LoginActivity loginActivity;
+ @Given("^I want to register for a House Party account$")
+ public void i_want_to_register_for_a_House_Party_account() {
+ loginActivity = new LoginActivity();
+ //throw new PendingException();
+ }
+
+ @When("^I sign up with valid information$")
+ public void i_sign_up_with_valid_information() {
+ loginActivity.dialogueBoxRegister(loginActivity.findViewById(android.R.id.content));
+ //loginActivity.onCreate(null);
+ //throw new PendingException();
+ }
+
+ @Then("^the account should be added to the Firebase server$")
+ public void the_account_should_be_added_to_the_Firebase_server() {
+ // Write code here that turns the phrase above into concrete actions
+ FirebaseReference.getReference().contains(userLogin, "eitan.simler@gmail.com);
+ }
+
+ @Then("^the display will be updated to show the playlist page$")
+ public void the_display_will_be_updated_to_show_the_playlist_page() {
+ assertEquals(getContext(PlaylistPage.this).getRecyclerViewAdapter().count(), 1);
+ }
+
+ @When("^I enter an email_address with invalid characters or in an incorrect format$")
+ public void i_enter_an_email_address_with_invalid_characters_or_in_an_incorrect_format() {
+ assertNotEquals(getContext(PlaylistPage.this).getErrorBuffer(), null);
+ }
+
+ @When("^all the other details are correct$")
+ public void all_the_other_details_are_correct() {
+ assertEquals(getContext(PlaylistPage.this).getThreadActivity(), NO_ACTIVITY);
+ }
+
+ @When("^I click the register button$")
+ public void i_click_the_register_button() {
+ // Write code here that turns the phrase above into concrete actions
+ assertEquals(getContext(PlaylistPage.this).getDialogBuilder().exists(), true);
+ }
+
+ @Then("^I should see text that indicates the valid email format$")
+ public void i_should_see_text_that_indicates_the_valid_email_format() {
+ assertEquals(getContext(PlaylistPage.this).getDialogBuilder().getText().toString(), "example@email.com");
+ }
+
+ @Then("^the registration form should be re-displayed$")
+ public void the_registration_form_should_be_re_displayed() {
+ assertEquals(getContext(LoginActivity.this).getDialogBuilder().getVisibility(), VISIBLE);
+ }
+
+ @When("^I enter a password that doesn’t contain a special character$")
+ public void i_enter_a_password_that_doesn_t_contain_a_special_character() {
+ assertEquals(getContext(PlaylistPage.this).getErrorBuffer(), "Wrong Password. Try Again");
+ }
+
+ @When("^password is of incorrect length \\(less than (\\d+) or more than (\\d+)\\)$")
+ public void password_is_of_incorrect_length_less_than_or_more_than(int arg1, int arg2) {
+ assertEquals(getContext(PlaylistPage.this).getErrorBuffer(), "Wrong Password. Try Again");
+ }
+
+ @When("^the email address is correct$")
+ public void the_email_address_is_correct() {
+ assertNotEquals(getContext(PlaylistPage.this).getErrorBuffer(), null);
+ }
+
+ @Then("^a message should appear indicating the correct password format$")
+ public void a_message_should_appear_indicating_the_correct_password_format() {
+ assertEquals(getContext(PlaylistPage.this).getErrorBuffer(), "Wrong Password. Try Again");
+ }
+
+ @When("^I enter an email address that has already been registered$")
+ public void i_enter_an_email_address_that_has_already_been_registered() {
+ assertEquals(getContext(PlaylistPage.this).getErrorBuffer(), "Username already taken. Try again");
+ }
+
+ @Then("^I should see text that indicates that the account already exists$")
+ public void i_should_see_text_that_indicates_that_the_account_already_exists() {
+ assertEquals(getContext(PlaylistPage.this).getErrorBuffer().isDisplayed(), true);
+ }
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/cucumber_steps/Set_Password.java b/app/src/test/java/com/houseparty/houseparty/cucumber_steps/Set_Password.java
new file mode 100644
index 0000000..0c60e26
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/cucumber_steps/Set_Password.java
@@ -0,0 +1,64 @@
+package com.houseparty.houseparty.cucumber_steps;
+
+import com.houseparty.houseparty.LoginActivity;
+import com.houseparty.houseparty.PlaylistActivity;
+
+import cucumber.api.PendingException;
+import cucumber.api.java.en.Given;
+import cucumber.api.java.en.Then;
+import cucumber.api.java.en.When;
+
+/**
+ * Created by jacksonkurtz on 6/8/18.
+ */
+
+public class Set_Password {
+ PlaylistActivity playlistActivity;
+ boolean createPlaylistSuccess;
+
+ @Given("^I want to make a new playlist$")
+ public void i_want_to_make_a_new_playlist() {
+ playlistActivity = new PlaylistActivity();
+ }
+
+ @When("^I want to lock the playlist with a password$")
+ public void i_want_to_lock_the_playlist_with_a_password() {
+ assert(true);
+ }
+
+ @When("^I enter a 4 digit password$")
+ public void i_enter_a_4_digit_password() {
+ playlistActivity.createPlaylist("NewPlaylist", "1111");
+ }
+
+ @When("^I click the confirmation button$")
+ public void i_click_the_confirmation_button() {
+ assert(true);
+ }
+
+ @Then("^a playlist will be created with password protection$")
+ public void a_playlist_will_be_be_created_with_password_protection() {
+ assert(playlistActivity.selectPlaylist(playlistActivity.playlists.get(playlistActivity.playlists.size()), "1111") );
+ }
+
+ @Then("^the playlist menu should be re-displayed$")
+ public void the_playlist_menu_should_be_redisplayed() {
+ assert(true);
+ }
+
+ @When("^I enter a password that is anything other than 4 digits$")
+ public void i_enter_a_password_that_is_anything_other_than_4_digits() {
+ createPlaylistSuccess = playlistActivity.createPlaylist("NewPlaylist", "11111");
+ }
+
+ @Then("^playlist creation fails$")
+ public void playlist_creation_fails() {
+ assert(createPlaylistSuccess);
+ }
+
+ @Then("^an error message is displayed$")
+ public void an_error_message_is_displayed() {
+ assert(true);
+ }
+
+}
diff --git a/app/src/test/java/com/houseparty/houseparty/features/delete_playlist.feature b/app/src/test/java/com/houseparty/houseparty/features/delete_playlist.feature
new file mode 100644
index 0000000..1abf04a
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/features/delete_playlist.feature
@@ -0,0 +1,14 @@
+Feature: Delete playlist from playlist activity
+
+ Background:
+ Given I want to delete a playlist from playlist activity
+ Scenario: Successfully delete playlist
+ When I swipe to delete a playlist
+ And I am the creator of the playlist
+ Then the playlist will turn red
+ And disappear from the list of playlists
+ And the playlist will be deleted from firebase
+ Scenario: Cannot delete playlist because not a host
+ When I swipe to delete a playlist
+ And I am not the creator of the playlist
+ Then a dialogue box will appear informing me that I am not the host
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/features/register.feature b/app/src/test/java/com/houseparty/houseparty/features/register.feature
new file mode 100644
index 0000000..2e111dc
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/features/register.feature
@@ -0,0 +1,24 @@
+Feature: Register for a House Party account
+
+ Background:
+ Given I want to register for a House Party account
+ Scenario: Successful sign up
+ When I sign up with valid information
+ Then the account should be added to the Firebase server
+ Scenario: Invalid email address entered
+ When I enter an email_address with invalid characters or in an incorrect format
+ And all the other details are correct
+ And I click the register button
+ Then I should see text that indicates the valid email format
+ Then the registration form should be re-displayed
+ Scenario: Invalid password entered
+ When I enter a password that doesn’t contain a special character
+ And password is of incorrect length (less than 8 or more than 14)
+ And the email address is correct
+ Then a message should appear indicating the correct password format
+ And the registration form should be re-displayed
+ Scenario: Account already exists
+ When I enter an email address that has already been registered
+ And I click the register button
+ Then I should see text that indicates that the account already exists
+ And the registration form should be re-displayed
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/features/search_napster.feature b/app/src/test/java/com/houseparty/houseparty/features/search_napster.feature
new file mode 100644
index 0000000..062f11f
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/features/search_napster.feature
@@ -0,0 +1,12 @@
+Feature: Search for Napster songs
+ Background:
+ Given I want to add a Napster song to a playlist
+ Scenario: Song is not found on Napster
+ When I enter a search query for a song that is not available on Napster
+ And I click the search button
+ Then a message should be displayed informing me that song is not available
+ And the search bar should be cleared
+ Scenario: Song is successfully found
+ When I enter a search query for a song that is available on Napster
+ And I click the search button
+ Then a list of matching songs should be shown to me
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/features/search_spotify.feature b/app/src/test/java/com/houseparty/houseparty/features/search_spotify.feature
new file mode 100644
index 0000000..d34263b
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/features/search_spotify.feature
@@ -0,0 +1,12 @@
+Feature: Search for Spotify songs
+ Background:
+ Given I want to add a Spotify song to a playlist
+ Scenario: Song is not found on Spotify
+ When I enter a search query for a song that is not available on Spotify
+ And I click the search button
+ Then a message should be displayed informing me that song is not available
+ And the search bar should be cleared
+ Scenario: Song is successfully found
+ When I enter a search query for a song that is available on Spotify
+ And I click the search button
+ Then a list of matching songs should be shown to me
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/features/set_password.feature b/app/src/test/java/com/houseparty/houseparty/features/set_password.feature
new file mode 100644
index 0000000..76da7f9
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/features/set_password.feature
@@ -0,0 +1,14 @@
+Feature: Set a password for a playlist
+
+ Background:
+ Given I want to make a new playlist
+ And I want to lock the playlist with a password
+ Scenario: Valid password entered
+ When I enter a 4 digit password
+ And I click the confirmation button
+ Then a playlist will be created with password protection
+ And the playlist menu should be re-displayed
+ Scenario: Invalid password entered
+ When I enter a password that is anything other than 4 digits
+ Then playlist creation fails
+ And an error message is displayed
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/features/stream_spotify.feature b/app/src/test/java/com/houseparty/houseparty/features/stream_spotify.feature
new file mode 100644
index 0000000..8685824
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/features/stream_spotify.feature
@@ -0,0 +1,17 @@
+Feature: Stream songs from Spotify
+
+ Background:
+ Given I want to play a particular song in a playlist
+ And the song is available on Spotify
+ And I am authenticated with Spotify
+ Scenario: Successfully stream song
+ When I click to start playing a song
+ Then the song will start streaming from Spotify
+ Scenario: Internet connection is interrupted
+ When the internet connection is interrupted
+ Then the stream will freeze
+ And you will be returned to the previous screen
+ And an error message will be displayed
+ Scenario: The song no longer exists in the playlist
+ When I choose to play a song that has been deleted from the playlist
+ Then an error message will be shown
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/song_unit_tests/GooglePlaySongUnitTest.java b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/GooglePlaySongUnitTest.java
new file mode 100644
index 0000000..fd174c6
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/GooglePlaySongUnitTest.java
@@ -0,0 +1,21 @@
+package com.houseparty.houseparty.song_unit_tests;
+
+import com.houseparty.houseparty.GooglePlaySong;
+import com.houseparty.houseparty.Song;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class GooglePlaySongUnitTest {
+ private Song song;
+
+ @Before
+ public void setUp() {
+ song = new GooglePlaySong("Beat It", "fake_uri", "Michael Jackson");
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void testPlaySong() {
+ song.playSong();
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/song_unit_tests/SongUnitTest.java b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/SongUnitTest.java
new file mode 100644
index 0000000..5b47453
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/SongUnitTest.java
@@ -0,0 +1,86 @@
+package com.houseparty.houseparty.song_unit_tests;
+
+import com.houseparty.houseparty.Song;
+import com.houseparty.houseparty.SpotifySong;
+import com.houseparty.houseparty.TidalSong;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+
+public class SongUnitTest {
+ private Song song;
+
+ @Before
+ public void setUp() {
+ song = new SpotifySong("Thriller", "fake_uri", "Michael Jackson");
+ }
+
+ @Test
+ public void testToString() {
+ assertEquals("Thriller", song.toString());
+ }
+
+ @Test
+ public void testGetTitle() {
+ assertEquals("Thriller", song.getTitle());
+ }
+
+ @Test
+ public void testGetUri() {
+ assertEquals("fake_uri", song.getUri());
+ }
+
+ @Test
+ public void testGetArtist() {
+ assertEquals("Michael Jackson", song.getArtist());
+ }
+
+ @Test
+ public void testEquals() {
+ Song song2 = new SpotifySong("Thriller", "fake_uri", "Michael Jackson");
+ assertEquals(song, song2);
+ }
+
+ @Test
+ public void testEquals2() {
+ assertEquals(song, song);
+ }
+
+ @Test
+ public void testNotEquals() {
+ Song song2 = new SpotifySong("Thrill", "fake_uri", "Michael Jackson");
+ assertNotEquals(song, song2);
+ }
+
+ @Test
+ public void testNotEquals2() {
+ assertNotEquals(null, song);
+ }
+
+ @Test
+ public void testNotEquals3() {
+ Song song2 = new TidalSong("Thrill", "fake_uri", "Michael Jackson");
+ assertNotEquals(song, song2);
+ }
+
+ @Test
+ public void testNotEquals4() {
+ assertFalse(song.equals(null));
+ }
+
+ @Test
+ public void testHashCode() {
+ Song song2 = new SpotifySong("Thriller", "fake_uri", "Michael Jackson");
+ assertEquals(song.hashCode(), song2.hashCode());
+ }
+
+ @Test
+ public void testNoArgumentConstructor() {
+ Song song2 = new SpotifySong();
+ assertNotEquals(song, song2);
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/song_unit_tests/SpotifySongUnitTest.java b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/SpotifySongUnitTest.java
new file mode 100644
index 0000000..d0fcaec
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/SpotifySongUnitTest.java
@@ -0,0 +1,73 @@
+package com.houseparty.houseparty.song_unit_tests;
+
+import com.houseparty.houseparty.SpotifySong;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static junit.framework.Assert.assertEquals;
+
+public class SpotifySongUnitTest {
+ private SpotifySong song;
+
+ @Before
+ public void setUp() {
+ song = new SpotifySong("Beat It", "fake_uri", "Michael Jackson");
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onLogInFailed() {
+ song.onLoginFailed(null);
+ }
+
+ @Test
+ public void testGetAccessToken() {
+ assertEquals(null, song.getAccessToken());
+ }
+
+ @Test
+ public void testGetAccessToken2() {
+ SpotifySong song2 = new SpotifySong("Beat It", "fake_uri", "Michael Jackson", "fake_access_token", null);
+ assertEquals("fake_access_token", song2.getAccessToken());
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testPlaySong() {
+ song.playSong();
+ }
+
+ @Test
+ public void testGetSpotifyPlayer() {
+ assertEquals(null, song.getSpotifyPlayer());
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onLoggedIn() {
+ song.onLoggedIn();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onLoggedOut() {
+ song.onLoggedOut();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onTemporaryError() {
+ song.onTemporaryError();
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onConnectionMessage() {
+ song.onConnectionMessage(null);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onPlaybackEvent() {
+ song.onPlaybackEvent(null);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void test_onPlaybackError() {
+ song.onPlaybackError(null);
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/com/houseparty/houseparty/song_unit_tests/TidalSongUnitTest.java b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/TidalSongUnitTest.java
new file mode 100644
index 0000000..5c16450
--- /dev/null
+++ b/app/src/test/java/com/houseparty/houseparty/song_unit_tests/TidalSongUnitTest.java
@@ -0,0 +1,21 @@
+package com.houseparty.houseparty.song_unit_tests;
+
+import com.houseparty.houseparty.Song;
+import com.houseparty.houseparty.TidalSong;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TidalSongUnitTest {
+ private Song song;
+
+ @Before
+ public void setUp() {
+ song = new TidalSong("Beat It", "fake_uri", "Michael Jackson");
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void testPlaySong() {
+ song.playSong();
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 4970d24..7d52a86 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,18 +1,31 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
-
repositories {
google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.0'
+
+ }
+}
+
+plugins {
+ id "org.sonarqube" version "2.6"
+}
+
+sonarqube {
+ properties {
+ property "sonar.sources", "app/src/main/java/*"
+ property "sonar.tests", "app/src/test/java/*"
+ property "sonar.exclusions", "app/src/test/java/*"
+ property "sonar.test.exclusions", "app/src/main/java/*"
}
}
diff --git a/gradle.properties b/gradle.properties
index aac7c9b..869e8ce 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
+org.gradle.jvmargs=-Xmx1024m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 80473e9..4b1884d 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Feb 13 14:28:31 PST 2018
+#Mon Apr 09 16:31:44 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/licenses/android-sdk-license b/licenses/android-sdk-license
new file mode 100644
index 0000000..9753ed3
--- /dev/null
+++ b/licenses/android-sdk-license
@@ -0,0 +1,3 @@
+
+8933bad161af4178b1185d1a37fbf41ea5269c55
+d56f5187479451eabf01fb78af6dfcb131a6481e
\ No newline at end of file
diff --git a/licenses/intel-android-extra-license b/licenses/intel-android-extra-license
new file mode 100644
index 0000000..f82e65b
--- /dev/null
+++ b/licenses/intel-android-extra-license
@@ -0,0 +1,2 @@
+
+d975f751698a77b662f1254ddbeed3901e976f5a
\ No newline at end of file
diff --git a/local.properties b/local.properties
deleted file mode 100644
index 480dbef..0000000
--- a/local.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file is automatically generated by Android Studio.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must *NOT* be checked into Version Control Systems,
-# as it contains information specific to your local configuration.
-#
-# Location of the SDK. This is only used by Gradle.
-# For customization when using a Version Control System, please read the
-# header note.
-#Sun Feb 25 16:15:48 PST 2018
-sdk.dir=C\:\\Users\\Eitan\\AppData\\Local\\Android\\Sdk
diff --git a/wc b/wc
new file mode 100644
index 0000000..947eb81
--- /dev/null
+++ b/wc
@@ -0,0 +1 @@
+/Users/hanzy/Documents/workspace/android/HouseParty