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
public class MessagePagingSource extends RxPagingSource<Integer, Message> { | |
private MessageRepository messageRepository; | |
// the initial load size for the first page may be different from the requested size | |
private int initialLoadSize; | |
public MessagePagingSource(MessageRepository messageRepository) { | |
this.messageRepository = messageRepository; | |
} |
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
import com.crashlytics.android.Crashlytics; | |
public class ErrorLogger extends LoggerWrapper { | |
public ErrorLogger(Class clazz) { | |
super(clazz); | |
} | |
public ErrorLogger(String className) { | |
super(className); |
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
/** | |
* Attempt at generic non-fatal error report, modelled on Crashlytics error reporting methods. | |
*/ | |
public class ErrorReport { | |
private String id; // could be user ID, for instance | |
private final Map<String, String> stateString; | |
private final Map<String, Boolean> stateBool; | |
private final Map<String, Integer> stateInt; | |
private final Map<String, Double> stateDouble; |
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
@RunWith(AndroidJUnit4.class) | |
public class RecyclerViewIdlingResourceTest { | |
@Rule | |
public ActivityRule<MainActivity> activityRule = new ActivityRule<MainActivity>(MainActivity.class); | |
// number of items in the original list | |
int allItemsCount = ...; | |
// number of items after the list has been filtered |
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
// Example 1 - Test that fails | |
public class ClassUnderTest { | |
public String methodUnderTest(String str) | |
{ | |
if (PhoneNumberUtils.isGlobalPhoneNumber(str)) | |
{ | |
return "yes"; | |
} |
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
FROM tomcat:8-jre8 | |
MAINTAINER "David Wong" | |
RUN mkdir /jrebel | |
ADD jrebel.jar /jrebel/ | |
ENV CATALINA_OPTS="-javaagent:/jrebel/jrebel.jar -Drebel.remoting_plugin=true" |
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
# Backup a data volume container for Jenkins | |
backup: | |
image: busybox | |
command: tar cvf /backup/jenkins-backup.tar /var/jenkins_home | |
volumes: | |
- .:/backup |
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
# Create a data volume container for Jenkins config and data | |
FROM jenkins | |
VOLUME /var/jenkins_home | |
# run a do-nothing command | |
CMD ["true"] |