-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring. From Singleton to Static Factory #3
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a04092d
Removing todo since PaperDbException is already throws
libraua 395adba
Refactoring. From Singleton to Static Factory
libraua 3f91fa9
Merge remote-tracking branch 'origin/master'
libraua a88911b
Refactoring. From Singleton to Static Factory
libraua e5b1b6c
Merge branch 'master' of https://github.com/libraua/Paper
libraua 85a9ca3
Setup Travis build
pilgr 849ca08
Use api 21 because Travis doesn't support api 22+
pilgr 51e82e8
Add build status
pilgr 81be7ea
Add Android Arsenal badge
pilgr be48ef7
Refactoring. From Singleton to Static Factory
libraua 6d429c4
Merge remote-tracking branch 'origin/master'
libraua ec87d68
Refactoring. From Singleton to Static Factory
libraua c6b9fd5
Refactoring. From Singleton to Static Factory
libraua File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: android | ||
jdk: oraclejdk7 | ||
env: | ||
matrix: | ||
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a | ||
|
||
android: | ||
components: | ||
- build-tools-21.1.1 | ||
- android-21 | ||
- extra-android-m2repository | ||
|
||
before_script: | ||
# Create and start emulator | ||
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI | ||
- emulator -avd test -no-skin -no-audio -no-window & | ||
- android-wait-for-emulator | ||
- adb shell input keyevent 82 & | ||
- echo > local.properties | ||
|
||
script: ./gradlew connectedAndroidTest |
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 |
---|---|---|
|
@@ -20,8 +20,8 @@ public class CompatibilityTest { | |
|
||
@Before | ||
public void setUp() throws Exception { | ||
Paper.clear(getTargetContext()); | ||
Paper.init(getTargetContext()); | ||
Paper.book().destroy(); | ||
} | ||
|
||
@Test | ||
|
@@ -34,10 +34,10 @@ public void testChangeClass() | |
testClass.timestamp = 123; | ||
|
||
// Save original class. Only class name is changed to TestClassNew | ||
Paper.put("test", testClass); | ||
Paper.book().write("test", testClass); | ||
|
||
// Read and instantiate a modified class TestClassNew based on saved data in TestClass | ||
TestClassNew newTestClass = Paper.get("test"); | ||
TestClassNew newTestClass = Paper.book().read("test"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please separate structural changes and rename api changes in separate commits for better traceability and more easy review. |
||
// Check original value is restored despite new default value in TestClassNew | ||
assertThat(newTestClass.name).isEqualTo("original"); | ||
// Check default value for new added field | ||
|
@@ -51,9 +51,9 @@ public void testNotCompatibleClassChanges() throws Exception { | |
TestClass testClass = getClassInstanceWithNewName(TestClass.class, | ||
TestClassNotCompatible.class.getName()); | ||
testClass.timestamp = 123; | ||
Paper.put("not-compatible", testClass); | ||
Paper.book().write("not-compatible", testClass); | ||
|
||
Paper.<TestClassNotCompatible>get("not-compatible"); | ||
Paper.book().<TestClassNotCompatible>read("not-compatible"); | ||
} | ||
|
||
@Test | ||
|
@@ -62,9 +62,9 @@ public void testTransientFields() throws Exception { | |
tc.timestamp = 123; | ||
tc.transientField = "changed"; | ||
|
||
Paper.put("transient-class", tc); | ||
Paper.book().write("transient-class", tc); | ||
|
||
TestClassTransient readTc = Paper.get("transient-class"); | ||
TestClassTransient readTc = Paper.book().read("transient-class"); | ||
assertThat(readTc.timestamp).isEqualTo(123); | ||
assertThat(readTc.transientField).isEqualTo("default"); | ||
} | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes to README shouldn't be visible till publish version 1.0. I'll create development branch. Then please move all your changes into development branch.