View MessagePagingSource.java
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; | |
} |
View ErrorLogger-release.java
import com.crashlytics.android.Crashlytics; | |
public class ErrorLogger extends LoggerWrapper { | |
public ErrorLogger(Class clazz) { | |
super(clazz); | |
} | |
public ErrorLogger(String className) { | |
super(className); |
View ErrorReport.java
/** | |
* 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; |
View 01_RecyclerViewIdlingResourceTest.java
@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 |
View AndroidMockStaticMethod.java
// Example 1 - Test that fails | |
public class ClassUnderTest { | |
public String methodUnderTest(String str) | |
{ | |
if (PhoneNumberUtils.isGlobalPhoneNumber(str)) | |
{ | |
return "yes"; | |
} |
View Dockerfile for JRebel and Tomcat
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" |
View fig.yml
# Backup a data volume container for Jenkins | |
backup: | |
image: busybox | |
command: tar cvf /backup/jenkins-backup.tar /var/jenkins_home | |
volumes: | |
- .:/backup |
View Dockerfile for Jenkins data container
# Create a data volume container for Jenkins config and data | |
FROM jenkins | |
VOLUME /var/jenkins_home | |
# run a do-nothing command | |
CMD ["true"] |