-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…functions refactor
- Loading branch information
Showing
5 changed files
with
65 additions
and
7 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
17 changes: 17 additions & 0 deletions
17
library/src/androidTest/java/com/inaka/killertask/KillerTaskFunctionsTest.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,17 @@ | ||
package com.inaka.killertask; | ||
|
||
import android.test.AndroidTestCase; | ||
import android.test.UiThreadTest; | ||
|
||
|
||
/** | ||
* Created by inaka on 1/21/16. | ||
*/ | ||
public class KillerTaskFunctionsTest extends AndroidTestCase { | ||
|
||
@UiThreadTest | ||
public void testLibraryFunctionsRefactor() { | ||
new ExampleFunctionsRefactor(); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
library/src/main/java/com/inaka/killertask/ExampleAllTogether.kt
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,28 @@ | ||
package com.inaka.killertask | ||
|
||
import android.util.Log | ||
import java.util.concurrent.CountDownLatch | ||
|
||
/** | ||
* Created by inaka on 1/20/16. | ||
*/ | ||
private class ExampleAllTogether { | ||
val signal = CountDownLatch(1); | ||
|
||
init { | ||
KillerTask( | ||
"test", { | ||
result: String -> | ||
Log.wtf("result", result) | ||
signal.countDown() | ||
}, { | ||
e: Exception? -> | ||
Log.wtf("result", e.toString()) | ||
e?.printStackTrace() | ||
signal.countDown() | ||
}).go() | ||
|
||
signal.await() | ||
} | ||
|
||
} |
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