-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/issue 98/change package structure (#99)
Issue-98 - renamed package structure, ensured unit tests are passing and fixed bug with the onPrepare throwing an UnsupportedException. Excluded LoggingUtils.java from coverage calculations. Removed redundant classes and tests
- Loading branch information
Showing
293 changed files
with
1,292 additions
and
1,283 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
2 changes: 1 addition & 1 deletion
2
...xample/mike/mp3player/CustomMatchers.java → ...b/goldy1992/mp3player/CustomMatchers.java
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.example.mike.mp3player; | ||
package com.github.goldy1992.mp3player; | ||
|
||
import android.view.View; | ||
|
||
|
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
2 changes: 1 addition & 1 deletion
2
...e/mike/mp3player/RecyclerViewMatcher.java → ...dy1992/mp3player/RecyclerViewMatcher.java
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
2 changes: 1 addition & 1 deletion
2
...com/example/mike/mp3player/TestUtils.java → ...github/goldy1992/mp3player/TestUtils.java
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.example.mike.mp3player; | ||
package com.github.goldy1992.mp3player; | ||
|
||
import android.view.View; | ||
|
||
|
81 changes: 81 additions & 0 deletions
81
...b/goldy1992/mp3player/client/activities/SplashScreenEntryActivityAndroidTestImplTest.java
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,81 @@ | ||
package com.github.goldy1992.mp3player.client.activities; | ||
|
||
|
||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.view.ViewParent; | ||
|
||
import androidx.test.espresso.NoMatchingViewException; | ||
import androidx.test.espresso.ViewAssertion; | ||
import androidx.test.filters.LargeTest; | ||
import androidx.test.rule.ActivityTestRule; | ||
import androidx.test.rule.GrantPermissionRule; | ||
import androidx.test.runner.AndroidJUnit4; | ||
|
||
import com.github.goldy1992.mp3player.R; | ||
import com.google.android.material.tabs.TabLayout; | ||
|
||
import org.hamcrest.Description; | ||
import org.hamcrest.Matcher; | ||
import org.hamcrest.TypeSafeMatcher; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static androidx.test.espresso.Espresso.onView; | ||
import static androidx.test.espresso.matcher.ViewMatchers.withId; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
@LargeTest | ||
@RunWith(AndroidJUnit4.class) | ||
public class SplashScreenEntryActivityAndroidTestImplTest { | ||
|
||
@Rule | ||
public ActivityTestRule<SplashScreenEntryActivityAndroidTestImpl> mActivityTestRule = new ActivityTestRule<>(SplashScreenEntryActivityAndroidTestImpl.class); | ||
|
||
@Rule | ||
public GrantPermissionRule mGrantPermissionRule = | ||
GrantPermissionRule.grant( | ||
"android.permission.WRITE_EXTERNAL_STORAGE"); | ||
|
||
@Test | ||
public void splashScreenEntryActivityAndroidTestImplTest() { | ||
|
||
onView(withId(R.id.tabs)).check(new ViewAssertion() { | ||
@Override | ||
public void check(View view, NoMatchingViewException noViewFoundException) { | ||
if (view instanceof TabLayout) { | ||
TabLayout tabLayout = (TabLayout) view; | ||
TabLayout.Tab tab = tabLayout.getTabAt(0); | ||
assertTrue(tab.getText().equals("SONGS")); | ||
} | ||
else | ||
{ | ||
throw noViewFoundException; | ||
} | ||
} | ||
}); | ||
|
||
|
||
} | ||
|
||
private static Matcher<View> childAtPosition( | ||
final Matcher<View> parentMatcher, final int position) { | ||
|
||
return new TypeSafeMatcher<View>() { | ||
@Override | ||
public void describeTo(Description description) { | ||
description.appendText("Child at position " + position + " in parent "); | ||
parentMatcher.describeTo(description); | ||
} | ||
|
||
@Override | ||
public boolean matchesSafely(View view) { | ||
ViewParent parent = view.getParent(); | ||
return parent instanceof ViewGroup && parentMatcher.matches(parent) | ||
&& view.equals(((ViewGroup) parent).getChildAt(position)); | ||
} | ||
}; | ||
} | ||
|
||
} |
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
52 changes: 0 additions & 52 deletions
52
...mation/java/com/example/mike/mp3player/dagger/components/AndroidTestServiceComponent.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...example/mike/mp3player/TestConstants.java → ...ub/goldy1992/mp3player/TestConstants.java
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.example.mike.mp3player; | ||
package com.github.goldy1992.mp3player; | ||
|
||
public final class TestConstants { | ||
|
||
|
6 changes: 3 additions & 3 deletions
6
.../MainActivityInjectorAndroidTestImpl.java → .../MainActivityInjectorAndroidTestImpl.java
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
2 changes: 1 addition & 1 deletion
2
...shScreenEntryActivityAndroidTestImpl.java → ...shScreenEntryActivityAndroidTestImpl.java
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
22 changes: 11 additions & 11 deletions
22
...roidTestMediaActivityCompatComponent.java → ...roidTestMediaActivityCompatComponent.java
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
52 changes: 52 additions & 0 deletions
52
...on/java/com/github/goldy1992/mp3player/dagger/components/AndroidTestServiceComponent.java
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,52 @@ | ||
package com.github.goldy1992.mp3player.dagger.components; | ||
|
||
import android.content.Context; | ||
|
||
import com.github.goldy1992.mp3player.dagger.modules.AndroidTestContentRetrieverMapModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.PlaybackNotificationManagerModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.ContentManagerModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.ContentRetrieverModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.ContentSearcherModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.ExoPlayerModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.HandlerThreadModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.MediaItemBuilderModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.MediaItemTypeIdModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.MediaSessionCompatModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.MediaSessionConnectorModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.PlaybackManagerModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.SearchDatabaseModule; | ||
import com.github.goldy1992.mp3player.dagger.modules.service.ServiceModule; | ||
import com.github.goldy1992.mp3player.service.MediaPlaybackService; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.BindsInstance; | ||
import dagger.Component; | ||
|
||
@Singleton | ||
@Component(modules = { | ||
AndroidTestContentRetrieverMapModule.class, | ||
ContentManagerModule.class, | ||
ContentRetrieverModule.class, | ||
ContentSearcherModule.class, | ||
ExoPlayerModule.class, | ||
HandlerThreadModule.class, | ||
MediaItemBuilderModule.class, | ||
MediaItemTypeIdModule.class, | ||
MediaSessionCompatModule.class, | ||
MediaSessionConnectorModule.class, | ||
PlaybackManagerModule.class, | ||
PlaybackNotificationManagerModule.class, | ||
SearchDatabaseModule.class, | ||
ServiceModule.class | ||
}) | ||
public interface AndroidTestServiceComponent extends ServiceComponent { | ||
|
||
@Component.Factory | ||
interface Factory extends ServiceComponent.Factory { | ||
AndroidTestServiceComponent create(@BindsInstance Context context, | ||
@BindsInstance MediaPlaybackService mediaPlaybackService, | ||
@BindsInstance String workerId); | ||
} | ||
} | ||
|
4 changes: 2 additions & 2 deletions
4
...dules/AndroidTestComponentNameModule.java → ...dules/AndroidTestComponentNameModule.java
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
Oops, something went wrong.