src_fm_fc_ms_ff
stringlengths 43
86.8k
| target
stringlengths 20
276k
|
---|---|
Utils { public static boolean isEmptyMap(Map map) { return map == null || map.isEmpty(); } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testIsEmptyMapShouldReturnCorrectStatus() { Map<String, String> map = new HashMap<>(); map.put("key", "string"); assertFalse(Utils.isEmptyMap(map)); map.clear(); assertTrue(Utils.isEmptyMap(map)); } |
Utils { public static String getName(@NonNull String firstName, @NonNull String lastName) { return (firstName.trim() + " " + lastName.trim()).trim(); } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testGetNameShouldGetCorrectlyFormattedName() { assertEquals("John Doe", Utils.getName("John", "Doe")); assertEquals("John", Utils.getName("John", "")); assertEquals("Doe", Utils.getName("", "Doe")); } |
Utils { public static int getAgeFromDate(String dateOfBirth) { DateTime date = DateTime.parse(dateOfBirth); Years age = Years.yearsBetween(date.toLocalDate(), LocalDate.now()); return age.getYears(); } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testGetAgeFromDateShouldGetCorrectAge() { String date = "2000-12-12"; DateTime dateTime = DateTime.parse(date); assertEquals(Utils.getAgeFromDate(date), Years.yearsBetween(dateTime.toLocalDate(), LocalDate.now()).getYears()); } |
Utils { public static String getDob(int age) { return getDob(age, DateUtil.DATE_FORMAT_FOR_TIMELINE_EVENT); } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testGetDobShouldGetCorrectDob() { int age = 10; String datePattern = "YYYY-MM-dd"; Calendar cal = Calendar.getInstance(); cal.add(Calendar.YEAR, -age); assertEquals(cal.getWeekYear() + "-" + "01" + "-" + "01", Utils.getDob(age, datePattern)); assertEquals("01" + "-" + "01" + "-" + cal.getWeekYear(), Utils.getDob(age)); } |
Utils { public static AllSharedPreferences getAllSharedPreferences() { return CoreLibrary.getInstance().context().allSharedPreferences(); } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testGetAllSharedPreferencesShouldGetPreferences() { assertNotNull(Utils.getAllSharedPreferences()); } |
Utils { @Nullable public static String getAppId(@NonNull Context context) { PackageInfo packageInfo = getPackageInfo(context); return packageInfo != null ? packageInfo.packageName : null; } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testGetAppIdShouldReturnAppId() { assertEquals("org.smartregister.test", Utils.getAppId(RuntimeEnvironment.application)); } |
Utils { @Nullable public static String getAppVersion(@NonNull Context context) { PackageInfo packageInfo = getPackageInfo(context); return packageInfo != null ? packageInfo.versionName : null; } static String convertDateFormat(String date, boolean suppressException); static Date toDate(String date, boolean suppressException); static String convertDateFormat(String date, String defaultV, boolean suppressException); static String convertDateFormat(DateTime date); static String convertDateTimeFormat(String date, boolean suppressException); static void fillValue(TextView v, Map<String, String> cm, String field, boolean humanize); static void fillValue(TextView v, Map<String, String> cm, String field, String defaultV, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, boolean humanize); static void fillValue(TextView v, CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static void addToList(Map<String, String> locations, Map<String, TreeNode<String, Location>> locationMap,
String locationTag); static void fillValue(TextView v, String value); static String formatValue(String value, boolean humanize); static String formatValue(Object value, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, boolean humanize); static String getValue(CommonPersonObjectClient pc, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, String defaultV, boolean humanize); static String getValue(Map<String, String> cm, String field, boolean humanize); static String nonEmptyValue(Map<String, String> cm, boolean asc, boolean humanize, String... fields); static boolean hasAnyEmptyValue(Map<String, String> cm, String postFix, String... fields); static int addAsInts(boolean ignoreEmpty, String... vals); static TableRow addToRow(Context context, String value, TableRow row); static TableRow addToRow(Context context, String value, TableRow row, int weight); static TableRow addToRow(Context context, String value, TableRow row, boolean compact); static TableRow addToRow(Context context, String value, TableRow row, boolean compact, int weight); static TableRow addToRow(Context context, Spanned value, TableRow row, boolean compact, int weight); static Gson getLongDateAwareGson(); static boolean isConnectedToNetwork(Context context); static boolean hasFroyo(); static boolean hasGingerbread(); static boolean hasHoneycomb(); static boolean hasHoneycombMR1(); static boolean hasJellyBean(); static String getName(@NonNull String firstName, @NonNull String lastName); static String readAssetContents(Context context, String path); static InputStream getAssetFileInputStream(Context context, String path); @TargetApi(VERSION_CODES.HONEYCOMB) static void startAsyncTask(AsyncTask<T, ?, ?> asyncTask, T[] params); static DateTime dobToDateTime(CommonPersonObjectClient childDetails); static List<Map<String, String>> populateTableFromCSV(Context context, String csvFileName,
Map<Integer, String> columns); static String kgStringSuffix(Float weight); static String kgStringSuffix(String weight); static String cmStringSuffix(Float height); static String cmStringSuffix(String height); static CommonPersonObjectClient convert(CommonPersonObject commonPersonObject); static boolean getBooleanProperty(String key); static void showToast(Context context, String message); static void showShortToast(Context context, String message); static void showToastCore(Context context, String message, int duration); static void hideKeyboard(Context context, View view); static void hideKeyboard(Activity activity); static boolean isEmptyCollection(Collection collection); static boolean isEmptyMap(Map map); static String getVersion(Context context); static long getVersionCode(Context context); static String getBuildDate(Boolean isShortMonth); static String getUserDefaultTeamId(LoginResponseData userInfo); static String getPrefferedName(); String getName(); static String getUserInitials(); static AllSharedPreferences getAllSharedPreferences(); static String getDuration(String date); static String getDob(int age); static String getDob(int age, String dateFormatPattern); static int getAgeFromDate(String dateOfBirth); static Date dobStringToDate(String dobString); static DateTime dobStringToDateTime(String dobString); static Intent completeSync(FetchStatus fetchStatus); static boolean is2xxSuccessful(int httpStatus); static String getFilterValue(LoginResponse loginResponse, SyncFilter syncFilterParam); static AppProperties getProperties(Context context); static String getTranslatedIdentifier(String key); static void copyDatabase(String dbName, String copyDbName, Context context); static Locale getDefaultLocale(); static boolean deleteRoomDb(@NonNull Context context, @NonNull String databaseName); @Nullable static String getAppId(@NonNull Context context); @Nullable static String getAppVersion(@NonNull Context context); static Long tryParseLong(String value, long defaultValue); static int calculatePercentage(long totalCount, long partialCount); static AccountAuthenticatorXml parseAuthenticatorXMLConfigData(Context context); static void logoutUser(org.smartregister.Context context, String message); static final String APP_PROPERTIES_FILE; } | @Test public void testGetAppVersionShouldReturnAppVersion() { assertNull(Utils.getAppVersion(RuntimeEnvironment.application)); } |
Context { public UserService userService() { if (userService == null) { userService = new UserService(allSettings(), allSharedPreferences(), httpAgent(), session(), configuration(), saveANMLocationTask(), saveUserInfoTask(), saveANMTeamTask()); } return userService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testUserService() { UserService userService = context.userService(); Assert.assertNotNull(userService); } |
Context { public ImageRepository imageRepository() { if (imageRepository == null) { imageRepository = new ImageRepository(); } return imageRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testImageRepository() { ImageRepository imageRepository = context.imageRepository(); Assert.assertNotNull(imageRepository); } |
DisplayUtils { public static int getDisplayWidth(Activity activity) { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.widthPixels; } static ScreenDpi getScreenDpi(Context context); static int getDisplayWidth(Activity activity); static int getDisplayHeight(Activity activity); static double getScreenSize(Activity activity); } | @Test public void testGetDisplayWidthReturnsCorrectWidthPixelsValue() { Mockito.doReturn(resources).when(context).getResources(); Mockito.doReturn(windowManager).when(context).getWindowManager(); DisplayManager displayManager = (DisplayManager) RuntimeEnvironment.application.getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplays()[0]; Mockito.doReturn(display).when(windowManager).getDefaultDisplay(); int defaultMetrics = display.getWidth(); int displayWidth = DisplayUtils.getDisplayWidth(context); Assert.assertTrue(displayWidth > 0); Assert.assertEquals(defaultMetrics, displayWidth); } |
Context { public AllAlerts allAlerts() { if (allAlerts == null) { allAlerts = new AllAlerts(alertRepository()); } return allAlerts; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAllAlerts() { AllAlerts allAlerts = context.allAlerts(); Assert.assertNotNull(allAlerts); } |
Context { public HTTPAgent httpAgent() { if (httpAgent == null) { httpAgent = new HTTPAgent(applicationContext, allSharedPreferences(), configuration()); } return httpAgent; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testHttpAgent() { HTTPAgent httpAgent = context.httpAgent(); Assert.assertNotNull(httpAgent); } |
Context { public ANMService anmService() { if (anmService == null) { anmService = new ANMService(allSharedPreferences(), allBeneficiaries(), allEligibleCouples()); } return anmService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAnmService() { ANMService anmService = context.anmService(); Assert.assertNotNull(anmService); } |
Context { public DristhiConfiguration configuration() { if (configuration == null) { configuration = new DristhiConfiguration(); } return configuration; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testConfiguration() { DristhiConfiguration dristhiConfiguration = context.configuration(); Assert.assertNotNull(dristhiConfiguration); } |
Context { public ANMController anmController() { if (anmController == null) { anmController = new ANMController(anmService(), listCache(), homeContextCache()); } return anmController; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAnmController() { ANMController anmController = context.anmController(); Assert.assertNotNull(anmController); } |
Context { public ANMLocationController anmLocationController() { if (anmLocationController == null) { anmLocationController = new ANMLocationController(allSettings(), listCache()); } return anmLocationController; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAnmLocationController() { ANMLocationController anmLocationController = context.anmLocationController(); Assert.assertNotNull(anmLocationController); } |
Context { public HTTPAgent getHttpAgent() { return httpAgent(); } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetHttpAgent() { HTTPAgent httpAgent = context.getHttpAgent(); Assert.assertNotNull(httpAgent); } |
Context { public EventClientRepository getEventClientRepository() { if (eventClientRepository == null) { eventClientRepository = new EventClientRepository(); } return eventClientRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetEventClientRepository() { EventClientRepository eventClientRepository = context.getEventClientRepository(); Assert.assertNotNull(eventClientRepository); } |
Context { public UniqueIdRepository getUniqueIdRepository() { if (uniqueIdRepository == null) { uniqueIdRepository = new UniqueIdRepository(); } return uniqueIdRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetUniqueIdRepository() { UniqueIdRepository uniqueIdRepository = context.getUniqueIdRepository(); Assert.assertNotNull(uniqueIdRepository); } |
Context { public CampaignRepository getCampaignRepository() { if (campaignRepository == null) { campaignRepository = new CampaignRepository(); } return campaignRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetCampaignRepository() { CampaignRepository campaignRepository = context.getCampaignRepository(); Assert.assertNotNull(campaignRepository); } |
DisplayUtils { public static int getDisplayHeight(Activity activity) { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.heightPixels; } static ScreenDpi getScreenDpi(Context context); static int getDisplayWidth(Activity activity); static int getDisplayHeight(Activity activity); static double getScreenSize(Activity activity); } | @Test public void testGetDisplayHeightReturnsCorrectHeightPixelsValue() { Mockito.doReturn(resources).when(context).getResources(); Mockito.doReturn(windowManager).when(context).getWindowManager(); DisplayManager displayManager = (DisplayManager) RuntimeEnvironment.application.getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplays()[0]; Mockito.doReturn(display).when(windowManager).getDefaultDisplay(); int defaultMetrics = display.getHeight(); int displayHeight = DisplayUtils.getDisplayHeight(context); Assert.assertTrue(displayHeight > 0); Assert.assertEquals(defaultMetrics, displayHeight); } |
Context { public TaskRepository getTaskRepository() { if (taskRepository == null) { taskNotesRepository = new TaskNotesRepository(); taskRepository = new TaskRepository(taskNotesRepository); } return taskRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testgetTaskRepository() { TaskRepository taskRepository = context.getTaskRepository(); Assert.assertNotNull(taskRepository); } |
Context { public BeneficiaryService beneficiaryService() { if (beneficiaryService == null) { beneficiaryService = new BeneficiaryService(allEligibleCouples(), allBeneficiaries()); } return beneficiaryService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testBeneficiaryService() { BeneficiaryService beneficiaryService = context.beneficiaryService(); Assert.assertNotNull(beneficiaryService); } |
Context { protected DrishtiService drishtiService() { if (drishtiService == null) { drishtiService = new DrishtiService(httpAgent(), configuration().dristhiBaseURL()); } return drishtiService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testDrishtiService() { DrishtiService drishtiService = context.drishtiService(); Assert.assertNotNull(drishtiService); } |
Context { public ActionService actionService() { if (actionService == null) { actionService = new ActionService(drishtiService(), allSettings(), allSharedPreferences(), allReports()); } return actionService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testActionService() { ActionService actionService = context.actionService(); Assert.assertNotNull(actionService); } |
Context { public FormSubmissionService formSubmissionService() { if (formSubmissionService == null) { if (commonFtsObject != null) { formSubmissionService = new FormSubmissionService(ziggyService(), formDataRepository(), allSettings(), allCommonsRepositoryMap()); } else { formSubmissionService = new FormSubmissionService(ziggyService(), formDataRepository(), allSettings()); } } return formSubmissionService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testFormSubmissionService() { context.assignbindtypes(); FormSubmissionService formSubmissionService = context.formSubmissionService(); Assert.assertNotNull(formSubmissionService); } |
Context { public AllFormVersionSyncService allFormVersionSyncService() { if (allFormVersionSyncService == null) { allFormVersionSyncService = new AllFormVersionSyncService(httpAgent(), configuration(), formsVersionRepository()); } return allFormVersionSyncService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAllFormVersionSyncService() { AllFormVersionSyncService allFormVersionSyncService = context.allFormVersionSyncService(); Assert.assertNotNull(allFormVersionSyncService); } |
Context { public FormSubmissionRouter formSubmissionRouter() { if (formSubmissionRouter == null) { formSubmissionRouter = new FormSubmissionRouter(formDataRepository(), ecRegistrationHandler(), fpComplicationsHandler(), fpChangeHandler(), renewFPProductHandler(), ecCloseHandler(), ancRegistrationHandler(), ancRegistrationOAHandler(), ancVisitHandler(), ancCloseHandler(), ttHandler(), ifaHandler(), hbTestHandler(), deliveryOutcomeHandler(), pncRegistrationOAHandler(), pncCloseHandler(), pncVisitHandler(), childImmunizationsHandler(), childRegistrationECHandler(), childRegistrationOAHandler(), childCloseHandler(), childIllnessHandler(), vitaminAHandler(), deliveryPlanHandler(), ecEditHandler(), ancInvestigationsHandler()); } return formSubmissionRouter; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testFormSubmissionRouter() { FormSubmissionRouter formSubmissionRouter = context.formSubmissionRouter(); Assert.assertNotNull(formSubmissionRouter); } |
Context { public ZiggyService ziggyService() { if (ziggyService == null) { ziggyService = new ZiggyService(ziggyFileLoader(), formDataRepository(), formSubmissionRouter()); } return ziggyService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testZiggyService() { context.assignbindtypes(); ZiggyService ziggyService = context.ziggyService(); Assert.assertNotNull(ziggyService); } |
Context { public ZiggyFileLoader ziggyFileLoader() { if (ziggyFileLoader == null) { ziggyFileLoader = new ZiggyFileLoader("www/ziggy", "www/form", applicationContext().getAssets()); } return ziggyFileLoader; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testZiggyFileLoader() { ZiggyFileLoader ziggyFileLoader = context.ziggyFileLoader(); Assert.assertNotNull(ziggyFileLoader); } |
Context { public FormSubmissionSyncService formSubmissionSyncService() { if (formSubmissionSyncService == null) { formSubmissionSyncService = new FormSubmissionSyncService(formSubmissionService(), httpAgent(), formDataRepository(), allSettings(), allSharedPreferences(), configuration()); } return formSubmissionSyncService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testFormSubmissionSyncService() { FormSubmissionSyncService formSubmissionSyncService = context.formSubmissionSyncService(); Assert.assertNotNull(formSubmissionSyncService); } |
DisplayUtils { public static double getScreenSize(Activity activity) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; int height = dm.heightPixels; double wi = (double) width / (double) dm.xdpi; double hi = (double) height / (double) dm.ydpi; double x = Math.pow(wi, 2); double y = Math.pow(hi, 2); return Math.sqrt(x + y); } static ScreenDpi getScreenDpi(Context context); static int getDisplayWidth(Activity activity); static int getDisplayHeight(Activity activity); static double getScreenSize(Activity activity); } | @Test public void testGetScreenSizeReturnsCorrectValues() { Mockito.doReturn(resources).when(context).getResources(); Mockito.doReturn(windowManager).when(context).getWindowManager(); DisplayManager displayManager = (DisplayManager) RuntimeEnvironment.application.getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplays()[0]; Mockito.doReturn(display).when(windowManager).getDefaultDisplay(); double screenSize = DisplayUtils.getScreenSize(context); Assert.assertEquals(3.5, screenSize, 0.1); } |
Context { public ArrayList<DrishtiRepository> sharedRepositories() { assignbindtypes(); ArrayList<DrishtiRepository> drishtireposotorylist = new ArrayList<DrishtiRepository>(); drishtireposotorylist.add(settingsRepository()); drishtireposotorylist.add(alertRepository()); drishtireposotorylist.add(eligibleCoupleRepository()); drishtireposotorylist.add(childRepository()); drishtireposotorylist.add(timelineEventRepository()); drishtireposotorylist.add(motherRepository()); drishtireposotorylist.add(reportRepository()); drishtireposotorylist.add(formDataRepository()); drishtireposotorylist.add(serviceProvidedRepository()); drishtireposotorylist.add(formsVersionRepository()); drishtireposotorylist.add(imageRepository()); drishtireposotorylist.add(detailsRepository()); for (int i = 0; i < bindtypes.size(); i++) { drishtireposotorylist.add(commonrepository(bindtypes.get(i).getBindtypename())); } return drishtireposotorylist; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testSharedRepositories() { ArrayList<DrishtiRepository> sharedRepositories = context.sharedRepositories(); Assert.assertEquals(sharedRepositories.size(), 12); } |
Context { public DrishtiRepository[] sharedRepositoriesArray() { ArrayList<DrishtiRepository> drishtiRepositories = sharedRepositories(); DrishtiRepository[] drishtireposotoryarray = drishtiRepositories .toArray(new DrishtiRepository[drishtiRepositories.size()]); return drishtireposotoryarray; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testSharedRepositoriesArray() { DrishtiRepository[] sharedRepositoriesArray = context.sharedRepositoriesArray(); Assert.assertEquals(sharedRepositoriesArray.length, 12); } |
Context { public AllTimelineEvents allTimelineEvents() { if (allTimelineEvents == null) { allTimelineEvents = new AllTimelineEvents(timelineEventRepository()); } return allTimelineEvents; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAllTimelineEvents() { AllTimelineEvents allTimelineEvents = context.allTimelineEvents(); Assert.assertNotNull(allTimelineEvents); } |
Context { public AllReports allReports() { if (allReports == null) { allReports = new AllReports(reportRepository()); } return allReports; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAllReports() { AllReports allReports = context.allReports(); Assert.assertNotNull(allReports); } |
Context { public AllServicesProvided allServicesProvided() { if (allServicesProvided == null) { allServicesProvided = new AllServicesProvided(serviceProvidedRepository()); } return allServicesProvided; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAllServicesProvided() { AllServicesProvided allServicesProvided = context.allServicesProvided(); Assert.assertNotNull(allServicesProvided); } |
Context { public DetailsRepository detailsRepository() { if (detailsRepository == null) { detailsRepository = new DetailsRepository(); } return detailsRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testDetailsRepository() { DetailsRepository detailsRepository = context.detailsRepository(); Assert.assertNotNull(detailsRepository); } |
Context { public FormDataRepository formDataRepository() { if (formDataRepository == null) { formDataRepository = new FormDataRepository(); } return formDataRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testFormDataRepository() { context.assignbindtypes(); FormDataRepository formDataRepository = context.formDataRepository(); Assert.assertNotNull(formDataRepository); } |
Context { public AlertService alertService() { if (alertService == null) { if (commonFtsObject() != null) { alertService = new AlertService(alertRepository(), commonFtsObject(), allCommonsRepositoryMap()); } else { alertService = new AlertService(alertRepository()); } } return alertService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testAlertService() { AlertService alertService = context.alertService(); Assert.assertNotNull(alertService); } |
Context { public ServiceProvidedService serviceProvidedService() { if (serviceProvidedService == null) { serviceProvidedService = new ServiceProvidedService(allServicesProvided()); } return serviceProvidedService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testServiceProvidedService() { ServiceProvidedService serviceProvidedService = context.serviceProvidedService(); Assert.assertNotNull(serviceProvidedService); } |
Context { public EligibleCoupleService eligibleCoupleService() { if (eligibleCoupleService == null) { eligibleCoupleService = new EligibleCoupleService(allEligibleCouples(), allTimelineEvents(), allBeneficiaries()); } return eligibleCoupleService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testEligibleCoupleService() { EligibleCoupleService eligibleCoupleService = context.eligibleCoupleService(); Assert.assertNotNull(eligibleCoupleService); } |
CredentialsHelper { public static boolean shouldMigrate() { return CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion() == 0 || (CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion() > 0 && BuildConfig.DB_ENCRYPTION_VERSION > CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion()); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); } | @Test public void testShouldMigrateReturnsTrueForDBEncryptionVersionZero() { boolean shouldMigrate = CredentialsHelper.shouldMigrate(); Assert.assertTrue(shouldMigrate); } |
ClientFormResponse { public ClientFormDTO getClientForm() { return clientForm; } ClientFormResponse(ClientFormDTO clientForm, ClientFormMetadataDTO clientFormMetadata); ClientFormDTO getClientForm(); void setClientForm(ClientFormDTO clientForm); ClientFormMetadataDTO getClientFormMetadata(); void setClientFormMetadata(ClientFormMetadataDTO clientFormMetadata); } | @Test public void getClientForm() { ClientFormDTO clientFormDTO = new ClientFormDTO(); clientFormDTO.setId(1); clientFormDTO.setJson("[\"test json\"]"); ClientFormMetadataDTO clientFormMetadataDTO = new ClientFormMetadataDTO(); Date now = Calendar.getInstance().getTime(); clientFormMetadataDTO.setCreatedAt(now); clientFormMetadataDTO.setId(1L); clientFormMetadataDTO.setIdentifier("referral/anc_form"); clientFormMetadataDTO.setJurisdiction("test jurisdiction"); clientFormMetadataDTO.setLabel("ANC Referral form"); clientFormMetadataDTO.setModule("ANC"); clientFormMetadataDTO.setVersion("0.0.1"); ClientFormResponse clientFormResponse = new ClientFormResponse(clientFormDTO, clientFormMetadataDTO); Assert.assertEquals("referral/anc_form", clientFormResponse.getClientFormMetadata().getIdentifier()); Assert.assertEquals("test jurisdiction", clientFormResponse.getClientFormMetadata().getJurisdiction()); Assert.assertEquals("ANC Referral form", clientFormResponse.getClientFormMetadata().getLabel()); Assert.assertEquals("ANC", clientFormResponse.getClientFormMetadata().getModule()); Assert.assertEquals("0.0.1", clientFormResponse.getClientFormMetadata().getVersion()); Assert.assertEquals(now, clientFormResponse.getClientFormMetadata().getCreatedAt()); Assert.assertEquals(1, clientFormResponse.getClientForm().getId()); Assert.assertEquals("[\"test json\"]", clientFormResponse.getClientForm().getJson()); } |
Context { public MotherService motherService() { if (motherService == null) { motherService = new MotherService(allBeneficiaries(), allEligibleCouples(), allTimelineEvents(), serviceProvidedService()); } return motherService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testmotherService() { MotherService motherService = context.motherService(); Assert.assertNotNull(motherService); } |
Context { public ChildService childService() { if (childService == null) { childService = new ChildService(allBeneficiaries(), motherRepository(), childRepository(), allTimelineEvents(), serviceProvidedService(), allAlerts()); } return childService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testChildService() { ChildService childService = context.childService(); Assert.assertNotNull(childService); } |
Context { public PendingFormSubmissionService pendingFormSubmissionService() { if (pendingFormSubmissionService == null) { pendingFormSubmissionService = new PendingFormSubmissionService(formDataRepository()); } return pendingFormSubmissionService; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testPendingFormSubmissionService() { context.assignbindtypes(); PendingFormSubmissionService pendingFormSubmissionService = context.pendingFormSubmissionService(); Assert.assertNotNull(pendingFormSubmissionService); } |
Context { public LocationRepository getLocationRepository() { if (locationRepository == null) { locationRepository = new LocationRepository(); } return locationRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testLocationRepository() { LocationRepository locationRepository = context.getLocationRepository(); Assert.assertNotNull(locationRepository); } |
Context { public LocationTagRepository getLocationTagRepository() { if (locationTagRepository == null) { locationTagRepository = new LocationTagRepository(); } return locationTagRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetLocationTagRepository() { LocationTagRepository locationTagRepository = context.getLocationTagRepository(); Assert.assertNotNull(locationTagRepository); } |
Context { public StructureRepository getStructureRepository() { if (structureRepository == null) { structureRepository = new StructureRepository(); } return structureRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetStructureRepository() { StructureRepository structureRepository = context.getStructureRepository(); Assert.assertNotNull(structureRepository); } |
Context { public PlanDefinitionRepository getPlanDefinitionRepository() { if (planDefinitionRepository == null) { planDefinitionRepository = new PlanDefinitionRepository(); } return planDefinitionRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetPlanDefinitionRepository() { PlanDefinitionRepository planDefinitionRepository = context.getPlanDefinitionRepository(); Assert.assertNotNull(planDefinitionRepository); } |
Context { public ManifestRepository getManifestRepository() { if (manifestRepository == null) { manifestRepository = new ManifestRepository(); } return manifestRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetManifestRepository() { ManifestRepository manifestRepository = context.getManifestRepository(); Assert.assertNotNull(manifestRepository); } |
Context { public ClientFormRepository getClientFormRepository() { if (clientFormRepository == null) { clientFormRepository = new ClientFormRepository(); } return clientFormRepository; } protected Context(); static Context getInstance(); static Context setInstance(Context mContext); android.content.Context applicationContext(); BeneficiaryService beneficiaryService(); Context updateApplicationContext(android.content.Context applicationContext); ActionService actionService(); FormSubmissionService formSubmissionService(); AllFormVersionSyncService allFormVersionSyncService(); FormSubmissionRouter formSubmissionRouter(); ZiggyService ziggyService(); ZiggyFileLoader ziggyFileLoader(); FormSubmissionSyncService formSubmissionSyncService(); HTTPAgent httpAgent(); ArrayList<DrishtiRepository> sharedRepositories(); DrishtiRepository[] sharedRepositoriesArray(); AllEligibleCouples allEligibleCouples(); AllAlerts allAlerts(); AllSettings allSettings(); AllSharedPreferences allSharedPreferences(); AllBeneficiaries allBeneficiaries(); AllTimelineEvents allTimelineEvents(); AllReports allReports(); AllServicesProvided allServicesProvided(); DetailsRepository detailsRepository(); FormDataRepository formDataRepository(); ImageRepository imageRepository(); UserService userService(); AlertService alertService(); ServiceProvidedService serviceProvidedService(); EligibleCoupleService eligibleCoupleService(); MotherService motherService(); ChildService childService(); Session session(); ANMService anmService(); Cache<String> listCache(); Cache<SmartRegisterClients> smartRegisterClientsCache(); Cache<HomeContext> homeContextCache(); Boolean IsUserLoggedOut(); DristhiConfiguration configuration(); PendingFormSubmissionService pendingFormSubmissionService(); ANMController anmController(); ANMLocationController anmLocationController(); Cache<ECClients> ecClientsCache(); Cache<FPClients> fpClientsCache(); Cache<ANCClients> ancClientsCache(); Cache<PNCClients> pncClientsCache(); Cache<Villages> villagesCache(); Cache<Typeface> typefaceCache(); String getStringResource(int id); int getColorResource(int id); Drawable getDrawable(int id); Drawable getDrawableResource(int id); Cache<CommonPersonObjectClients> personObjectClientsCache(); AllCommonsRepository allCommonsRepositoryobjects(String tablename); long countofcommonrepositroy(String tablename); CommonRepository commonrepository(String tablename); void assignbindtypes(); void getEcBindtypes(); String ReadFromfile(String fileName, android.content.Context context); HTTPAgent getHttpAgent(); Context updateCommonFtsObject(CommonFtsObject commonFtsObject); CommonFtsObject commonFtsObject(); Context updateCustomHumanReadableConceptResponse(Map<String, String>
customHumanReadableConceptResponse); Map<String, String> customHumanReadableConceptResponse(); Map<String, AllCommonsRepository> allCommonsRepositoryMap(); void setDetailsRepository(DetailsRepository _detailsRepository); EventClientRepository getEventClientRepository(); UniqueIdRepository getUniqueIdRepository(); CampaignRepository getCampaignRepository(); TaskRepository getTaskRepository(); EventClientRepository getForeignEventClientRepository(); boolean hasForeignEvents(); LocationRepository getLocationRepository(); LocationTagRepository getLocationTagRepository(); StructureRepository getStructureRepository(); PlanDefinitionRepository getPlanDefinitionRepository(); AppProperties getAppProperties(); ManifestRepository getManifestRepository(); ClientFormRepository getClientFormRepository(); ClientRelationshipRepository getClientRelationshipRepository(); static ArrayList<CommonRepositoryInformationHolder> bindtypes; } | @Test public void testGetClientFormRepository() { ClientFormRepository clientFormRepository = context.getClientFormRepository(); Assert.assertNotNull(clientFormRepository); } |
AllCommonsRepository { public long count() { return personRepository.count(); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void ShouldShowcount() throws Exception { when(personRepository.count()).thenReturn((long) 8); assertEquals(personRepository.count(), (long) 8); }
@Test public void testCount() { allCommonsRepository.count(); verify(personRepository).count(); } |
CredentialsHelper { public byte[] getCredentials(String username, String type) { if (CREDENTIALS_TYPE.DB_AUTH.equals(type)) { return context.userService().getDecryptedPassphraseValue(username); } else if (CREDENTIALS_TYPE.LOCAL_AUTH.equals(type)) { return context.userService().getDecryptedAccountValue(username, AccountHelper.INTENT_KEY.ACCOUNT_LOCAL_PASSWORD); } return null; } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); } | @Test public void testGetCredentialsInvokesGetDecryptedPassphraseValueWithCorrectValuesForDBAuth() { credentialsHelper.getCredentials(TEST_USERNAME, CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH); ArgumentCaptor<String> usernameArgCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(userService, Mockito.times(1)).getDecryptedPassphraseValue(usernameArgCaptor.capture()); Assert.assertEquals(TEST_USERNAME, usernameArgCaptor.getValue()); }
@Test public void testGetCredentialsInvokesGetDecryptedPassphraseValueWithCorrectValuesForLocalAuth() { credentialsHelper.getCredentials(TEST_USERNAME, CredentialsHelper.CREDENTIALS_TYPE.LOCAL_AUTH); ArgumentCaptor<String> usernameArgCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> keyArgCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(userService, Mockito.times(1)).getDecryptedAccountValue(usernameArgCaptor.capture(), keyArgCaptor.capture()); Assert.assertEquals(TEST_USERNAME, usernameArgCaptor.getValue()); Assert.assertEquals(AccountHelper.INTENT_KEY.ACCOUNT_LOCAL_PASSWORD, keyArgCaptor.getValue()); } |
AllCommonsRepository { public List<CommonPersonObject> all() { return personRepository.allcommon(); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testAll() { allCommonsRepository.all(); verify(personRepository).allcommon(); } |
AllCommonsRepository { public CommonPersonObject findByCaseID(String caseId) { return personRepository.findByCaseID(caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testFindByCaseId() { allCommonsRepository.findByCaseID("case 1"); verify(personRepository).findByCaseID("case 1"); } |
AllCommonsRepository { public CommonPersonObject findHHByGOBHHID(String gobhhid) { return personRepository.findHHByGOBHHID(gobhhid); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testFindHHByGOBHHID() { allCommonsRepository.findHHByGOBHHID("gobhhid 1"); verify(personRepository).findHHByGOBHHID("gobhhid 1"); } |
AllCommonsRepository { public List<CommonPersonObject> findByCaseIDs(List<String> caseIds) { return personRepository.findByCaseIDs(caseIds.toArray(new String[caseIds.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testFindByCaseIds() { List<String> expectedCaseIds = new ArrayList<>(); expectedCaseIds.add("case 1"); expectedCaseIds.add("case 2"); allCommonsRepository.findByCaseIDs(expectedCaseIds); verify(personRepository).findByCaseIDs(new String[] {expectedCaseIds.get(0), expectedCaseIds.get(1)}); } |
AllCommonsRepository { public List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID) { return personRepository .findByRelationalIDs(RelationalID.toArray(new String[RelationalID.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testFindByRelationIds() { List<String> expectedRelationIds = new ArrayList<>(); expectedRelationIds.add("relation id 1"); expectedRelationIds.add("relation id 2"); allCommonsRepository.findByRelationalIDs(expectedRelationIds); verify(personRepository).findByRelationalIDs(new String[] {expectedRelationIds.get(0), expectedRelationIds.get(1)}); } |
AllCommonsRepository { public List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID) { return personRepository .findByRelational_IDs(RelationalID.toArray(new String[RelationalID.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testFindByRelationIds2() { List<String> expectedRelationIds = new ArrayList<>(); expectedRelationIds.add("relation id 1"); expectedRelationIds.add("relation id 2"); allCommonsRepository.findByRelational_IDs(expectedRelationIds); verify(personRepository).findByRelational_IDs(new String[] {expectedRelationIds.get(0), expectedRelationIds.get(1)}); } |
AllCommonsRepository { public void close(String entityId) { alertRepository.deleteAllAlertsForEntity(entityId); timelineEventRepository.deleteAllTimelineEventsForEntity(entityId); personRepository.close(entityId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testClose() { String entityId = "Entity 1"; allCommonsRepository.close(entityId); verify(alertRepository).deleteAllAlertsForEntity(entityId); verify(timelineEventRepository).deleteAllTimelineEventsForEntity(entityId); verify(personRepository).close(entityId); } |
AllCommonsRepository { public void mergeDetails(String entityId, Map<String, String> details) { personRepository.mergeDetails(entityId, details); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testMergeDetails() { String entityId = "Entity 1"; Map<String, String> details = new HashMap<>(); details.put("case id", "Case 1"); allCommonsRepository.mergeDetails(entityId, details); verify(personRepository).mergeDetails(entityId, details); } |
AllCommonsRepository { public void update(String tableName, ContentValues contentValues, String caseId) { personRepository.updateColumn(tableName, contentValues, caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testUpdate() { String tableName = "sprayed_structures"; String caseId = "Case 1"; ContentValues contentValues = new ContentValues(); contentValues.put("status", "Ready"); allCommonsRepository.update(tableName, contentValues, caseId); verify(personRepository).updateColumn(tableName,contentValues,caseId); } |
AllCommonsRepository { public List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName) { return personRepository.customQuery(sql, selections, tableName); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testCustomQuery() { String tableName = "sprayed_structures"; String sql = "SELECT count(*) FROM sprayed_structures WHERE status = ?"; String[] selectionArgs = {"Complete"}; allCommonsRepository.customQuery(sql, selectionArgs, tableName); verify(personRepository).customQuery(sql, selectionArgs, tableName); } |
AllCommonsRepository { public List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections, String tableName) { return personRepository.customQueryForCompleteRow(sql, selections, tableName); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testCustomQueryForCompleteRow() { String tableName = "sprayed_structures"; String sql = "SELECT count(*) FROM sprayed_structures WHERE status = ?"; String[] selectionArgs = {"Complete"}; allCommonsRepository.customQueryForCompleteRow(sql, selectionArgs, tableName); verify(personRepository).customQueryForCompleteRow(sql, selectionArgs, tableName); } |
AllCommonsRepository { public List<String> updateSearch(List<String> caseIds) { List<String> remainingIds = new ArrayList<>(); if (caseIds == null || caseIds.isEmpty()) { return remainingIds; } Map<String, ContentValues> searchMap = new HashMap<String, ContentValues>(); for (String caseId : caseIds) { ContentValues contentValues = personRepository.populateSearchValues(caseId); if (contentValues != null) { searchMap.put(caseId, contentValues); } else { remainingIds.add(caseId); } } if (!searchMap.isEmpty()) { personRepository.searchBatchInserts(searchMap); } return remainingIds; } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testUpdateSearchWithListToRemove() { String caseId = "Case id 1"; String field = "status"; String value = "synced"; String[] listToremove = {"created", "deleted"}; allCommonsRepository.updateSearch(caseId,field,value,listToremove); verify(personRepository).populateSearchValues(caseId,field,value,listToremove); }
@Test public void testUpdateSearchWithListToRemoveMissingCaseId() { allCommonsRepository.updateSearch(null,"status","synced",new String[]{"created", "deleted"}); verifyZeroInteractions(personRepository); }
@Test public void testUpdateSearchWithNoCaseId() { allCommonsRepository.updateSearch(""); verifyZeroInteractions(personRepository); }
@Test public void testUpdateSearchWithCaseId() { String caseId = "Case id 1"; ContentValues contentValues = new ContentValues(); contentValues.put("status", "Ready"); when(personRepository.populateSearchValues(caseId)).thenReturn(contentValues); allCommonsRepository.updateSearch(caseId); verify(personRepository).searchBatchInserts(mapArgumentCaptor.capture()); HashMap actualsearchMap = mapArgumentCaptor.getValue(); assertNotNull(actualsearchMap); ContentValues actualContentValues = (ContentValues) actualsearchMap.get(caseId); assertNotNull(actualContentValues); assertEquals(1, actualContentValues.size()); assertEquals("Ready", actualContentValues.getAsString("status")); }
@Test public void testUpdateSearchWithNoCaseIdList() { allCommonsRepository.updateSearch(new ArrayList<>()); verifyZeroInteractions(personRepository); }
@Test public void testUpdateSearchWithCaseIdList() { String caseId1 = "Case id 1"; String caseId2 = "Case id 2"; List<String> caseIdList = new ArrayList<>(); caseIdList.add(caseId1); caseIdList.add(caseId2); ContentValues contentValues1 = new ContentValues(); contentValues1.put("status", "Ready"); doReturn(contentValues1).when(personRepository).populateSearchValues(caseId1); ContentValues contentValues2 = new ContentValues(); contentValues2.put("status", "Complete"); doReturn(contentValues2).when(personRepository).populateSearchValues(caseId2); allCommonsRepository.updateSearch(caseIdList); verify(personRepository).searchBatchInserts(mapArgumentCaptor.capture()); HashMap actualsearchMap = mapArgumentCaptor.getValue(); assertNotNull(actualsearchMap); assertEquals(2, actualsearchMap.size()); ContentValues actualContentValues1 = (ContentValues) actualsearchMap.get(caseId1); assertNotNull(actualContentValues1); assertEquals(1, actualContentValues1.size()); assertEquals("Ready", actualContentValues1.getAsString("status")); ContentValues actualContentValues2 = (ContentValues) actualsearchMap.get(caseId2); assertNotNull(actualContentValues2); assertEquals(1, actualContentValues2.size()); assertEquals("Complete", actualContentValues2.getAsString("status")); } |
AllCommonsRepository { public boolean deleteSearchRecord(String caseId) { if (StringUtils.isBlank(caseId)) { return false; } return personRepository.deleteSearchRecord(caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository
alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findHHByGOBHHID(String gobhhid); long count(); List<CommonPersonObject> findByCaseIDs(List<String> caseIds); List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID); List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details); void update(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); List<String> updateSearch(List<String> caseIds); boolean updateSearch(String caseId); boolean updateSearch(String caseId, String field, String value, String[] listToRemove); boolean deleteSearchRecord(String caseId); } | @Test public void testDeleteSearchRecord() { String caseId = "Case id 1"; allCommonsRepository.deleteSearchRecord(caseId); verify(personRepository).deleteSearchRecord(caseId); } |
CommonRepository extends DrishtiRepository { public void add(CommonPersonObject common) { SQLiteDatabase database = masterRepository.getWritableDatabase(); database.insert(TABLE_NAME, null, createValuesFor(common)); } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void addCallsDatabaseInsert1times() throws Exception { String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); commonRepository.add(new CommonPersonObject("", "", new HashMap<String, String>(), "")); Mockito.verify(sqliteDatabase, Mockito.times(1)).insert(Mockito.anyString(), Mockito.isNull(String.class), Mockito.any(ContentValues.class)); } |
CredentialsHelper { public void saveCredentials(String type, String encryptedPassphrase) { if (CREDENTIALS_TYPE.DB_AUTH.equals(type)) { allSharedPreferences.savePassphrase(encryptedPassphrase, CoreLibrary.getInstance().getSyncConfiguration().getEncryptionParam().name()); allSharedPreferences.setDBEncryptionVersion(BuildConfig.DB_ENCRYPTION_VERSION); } } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); } | @Test public void testSaveCredentialsUpdatesSharedPreferencesWithEncryptedPassphrase() { Mockito.doReturn(syncConfiguration).when(coreLibrary).getSyncConfiguration(); Mockito.doReturn(SyncFilter.TEAM_ID).when(syncConfiguration).getEncryptionParam(); credentialsHelper.saveCredentials(CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH, TEST_ENCRYPTED_PWD); ArgumentCaptor<String> encryptionValueArgCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> encryptionParamArgCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(allSharedPreferences, Mockito.times(1)).savePassphrase(encryptionValueArgCaptor.capture(), encryptionParamArgCaptor.capture()); Assert.assertEquals(TEST_ENCRYPTED_PWD, encryptionValueArgCaptor.getValue()); Assert.assertEquals(SyncFilter.TEAM_ID.name(), encryptionParamArgCaptor.getValue()); }
@Test public void testSaveCredentialsUpdatesSharedPreferencesWithNewDBEncryptionVersion() { Mockito.doReturn(SyncFilter.LOCATION_ID).when(syncConfiguration).getEncryptionParam(); credentialsHelper.saveCredentials(CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH, TEST_ENCRYPTED_PWD); ArgumentCaptor<Integer> encryptionValueArgCaptor = ArgumentCaptor.forClass(Integer.class); Mockito.verify(allSharedPreferences, Mockito.times(1)).setDBEncryptionVersion(encryptionValueArgCaptor.capture()); Assert.assertEquals((Integer) BuildConfig.DB_ENCRYPTION_VERSION, encryptionValueArgCaptor.getValue()); } |
CommonRepository extends DrishtiRepository { public CommonPersonObject findByCaseID(String caseId) { SQLiteDatabase database = masterRepository.getReadableDatabase(); Cursor cursor = null; try { cursor = database .query(TABLE_NAME, common_TABLE_COLUMNS, ID_COLUMN + " = ?", new String[]{caseId}, null, null, null, null); List<CommonPersonObject> commons = readAllcommon(cursor); if (commons.isEmpty()) { return null; } return commons.get(0); } finally { if (cursor != null) { cursor.close(); } } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void findByCaseIDCallsDatabaseQuery1times() throws Exception { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); Mockito.when(sqliteDatabase.query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class))).thenReturn(matrixCursor); Assert.assertNotNull(commonRepository.findByCaseID("")); Mockito.verify(sqliteDatabase, Mockito.times(1)).query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class)); } |
CommonRepository extends DrishtiRepository { public CommonPersonObject findByBaseEntityId(String baseEntityId) { Cursor cursor = null; try { cursor = masterRepository.getReadableDatabase().query(TABLE_NAME, common_TABLE_COLUMNS, BASE_ENTITY_ID_COLUMN + " = ? " + "COLLATE NOCASE ", new String[]{baseEntityId}, null, null, null, null); List<CommonPersonObject> commons = readAllcommon(cursor); if (commons.isEmpty()) { return null; } return commons.get(0); } catch (Exception e) { Timber.e(e); } finally { if (cursor != null) { cursor.close(); } } return null; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void findByBaseEntityIdCallsDatabaseQuery1times() throws Exception { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); Mockito.when(sqliteDatabase.query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class))).thenReturn(matrixCursor); Assert.assertNotNull(commonRepository.findByBaseEntityId("")); Mockito.verify(sqliteDatabase, Mockito.times(1)).query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class)); } |
CommonRepository extends DrishtiRepository { public CommonPersonObject findHHByGOBHHID(String caseId) { SQLiteDatabase database = masterRepository.getReadableDatabase(); Cursor cursor = null; try { cursor = database .query(TABLE_NAME, common_TABLE_COLUMNS, "FWGOBHHID" + " = ?", new String[]{caseId}, null, null, null, null); List<CommonPersonObject> commons = readAllcommon(cursor); if (commons.isEmpty()) { return null; } return commons.get(0); } finally { if (cursor != null) { cursor.close(); } } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void findByGOBHHIDCallsDatabaseQuery1times() throws Exception { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); Mockito.when(sqliteDatabase.query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class))).thenReturn(matrixCursor); Assert.assertNotNull(commonRepository.findHHByGOBHHID("")); Mockito.verify(sqliteDatabase, Mockito.times(1)).query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class)); } |
CommonRepository extends DrishtiRepository { public List<CommonPersonObject> allcommon() { SQLiteDatabase database = masterRepository.getReadableDatabase(); Cursor cursor = null; try { cursor = database .query(TABLE_NAME, common_TABLE_COLUMNS, null, null, null, null, null, null); return readAllcommon(cursor); } finally { if (cursor != null) { cursor.close(); } } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void allcommonCallsDatabaseQuery1times() throws Exception { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); Mockito.when(sqliteDatabase.query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class))).thenReturn(matrixCursor); Assert.assertNotNull(commonRepository.allcommon()); Mockito.verify(sqliteDatabase, Mockito.times(1)).query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class)); } |
CommonRepository extends DrishtiRepository { public CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor) { int columncount = cursor.getColumnCount(); HashMap<String, String> columns = new HashMap<String, String>(); for (int i = 0; i < columncount; i++) { String columnName = cursor.getColumnName(i); String value = cursor.getString(cursor.getColumnIndex(columnName)); columns.put(columnName, value); } CommonPersonObject common = getCommonPersonObjectFromCursor(cursor); common.setColumnmaps(columns); return common; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void readAllcommonforCursorAdapterReturnsNotNUll() throws Exception { String[] columns = new String[]{"_id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); matrixCursor.addRow(new Object[]{"caseID2", "relationalID2", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); matrixCursor.moveToFirst(); Assert.assertNotNull(commonRepository.readAllcommonforCursorAdapter(matrixCursor)); } |
CommonRepository extends DrishtiRepository { public List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName) { List<CommonPersonObject> commons = new ArrayList<CommonPersonObject>(); try { cursor.moveToFirst(); while (!cursor.isAfterLast()) { int columncount = cursor.getColumnCount(); HashMap<String, String> columns = new HashMap<String, String>(); for (int i = 0; i < columncount; i++) { columns.put(cursor.getColumnName(i), String.valueOf(cursor.getInt(i))); } CommonPersonObject common = new CommonPersonObject("1", "0", null, tableName); common.setClosed((short) 0); common.setColumnmaps(columns); commons.add(common); cursor.moveToNext(); } } catch (Exception e) { Timber.e(e); } finally { cursor.close(); } return commons; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void readAllcommonforFieldReturnsNotNUll() throws Exception { String[] columns = new String[]{"_id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{0, 0, 0, 0}); matrixCursor.addRow(new Object[]{1, 1, 1, 1}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); matrixCursor.moveToFirst(); Assert.assertNotNull(commonRepository.readAllcommonForField(matrixCursor, "")); } |
CommonRepository extends DrishtiRepository { public void updateDetails(String caseId, Map<String, String> details) { SQLiteDatabase database = masterRepository.getWritableDatabase(); CommonPersonObject common = findByCaseID(caseId); if (common == null) { return; } ContentValues valuesToUpdate = new ContentValues(); valuesToUpdate.put(DETAILS_COLUMN, new Gson().toJson(details)); database.update(TABLE_NAME, valuesToUpdate, ID_COLUMN + " = ?", new String[]{caseId}); } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void updateDetailsCallsDatabaseUpdate1Times() throws Exception { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); matrixCursor.addRow(new Object[]{"caseID2", "relationalID2", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); Mockito.when(sqliteDatabase.query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class))).thenReturn(matrixCursor); commonRepository.updateDetails("caseID", new HashMap<String, String>()); Mockito.verify(sqliteDatabase, Mockito.times(1)).update(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(ContentValues.class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class)); } |
CommonRepository extends DrishtiRepository { public void mergeDetails(String caseId, Map<String, String> details) { SQLiteDatabase database = masterRepository.getWritableDatabase(); CommonPersonObject common = findByCaseID(caseId); if (common == null) { return; } Map<String, String> mergedDetails = new HashMap<String, String>(common.getDetails()); mergedDetails.putAll(details); ContentValues valuesToUpdate = new ContentValues(); valuesToUpdate.put(DETAILS_COLUMN, new Gson().toJson(mergedDetails)); database.update(TABLE_NAME, valuesToUpdate, ID_COLUMN + " = ?", new String[]{caseId}); } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void mergeDetailsCallsDatabaseUpdate1Times() throws Exception { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor matrixCursor = new MatrixCursor(columns); matrixCursor.addRow(new Object[]{"caseID", "relationalID", new HashMap<String, String>(), 0}); matrixCursor.addRow(new Object[]{"caseID2", "relationalID2", new HashMap<String, String>(), 0}); String tablename = ""; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); Mockito.when(sqliteDatabase.query(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class), org.mockito.ArgumentMatchers.isNull(String.class))).thenReturn(matrixCursor); commonRepository.mergeDetails("caseID", new HashMap<String, String>()); Mockito.verify(sqliteDatabase, Mockito.times(1)).update(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(ContentValues.class), org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(String[].class)); } |
CommonRepository extends DrishtiRepository { @Override public void onCreate(SQLiteDatabase database) { database.execSQL(common_SQL); if (StringUtils.isNotBlank(common_ID_INDEX_SQL)) { database.execSQL(common_ID_INDEX_SQL); } if (StringUtils.isNotBlank(common_Relational_ID_INDEX_SQL)) { database.execSQL(common_Relational_ID_INDEX_SQL); } if (StringUtils.isNotBlank(common_Relational_Underscore_ID_INDEX_SQL)) { database.execSQL(common_Relational_Underscore_ID_INDEX_SQL); } if (StringUtils.isNotBlank(common_Base_Entity_ID_INDEX_SQL)) { database.execSQL(common_Base_Entity_ID_INDEX_SQL); } if (StringUtils.isNotBlank(common_Custom_Relational_ID_INDEX_SQL)) { database.execSQL(common_Custom_Relational_ID_INDEX_SQL); } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void assertOnCreateCallsDatabaseExec() { String tablename = ""; String[] tableColumns = new String[]{CommonRepository.Relational_Underscore_ID, CommonRepository.BASE_ENTITY_ID_COLUMN, ADDITIONALCOLUMN, CUSTOMRELATIONALID}; commonFtsObject = Mockito.mock(CommonFtsObject.class); Mockito.when(commonFtsObject.getCustomRelationalId(Mockito.anyString())).thenReturn(CUSTOMRELATIONALID); CommonRepository commonRepository = new CommonRepository(commonFtsObject, tablename, tableColumns); Assert.assertNotNull(commonRepository); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); repository = Mockito.mock(Repository.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.onCreate(sqliteDatabase); Mockito.verify(sqliteDatabase, Mockito.times(6)).execSQL(Mockito.anyString()); } |
CommonRepository extends DrishtiRepository { public void closeCase(String baseEntityId, String tableName) { try { SQLiteDatabase db = masterRepository.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(IS_CLOSED_COLUMN, 1); db.update(tableName, cv, BASE_ENTITY_ID_COLUMN + "=?", new String[]{baseEntityId}); } catch (Exception e) { Timber.e(e); } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void assertCloseCaseCallsDatabaseExec() { String tablename = "table"; String baseEntityId = "1"; String[] tableColumns = new String[]{CommonRepository.Relational_Underscore_ID, CommonRepository.BASE_ENTITY_ID_COLUMN, ADDITIONALCOLUMN, CUSTOMRELATIONALID}; commonFtsObject = Mockito.mock(CommonFtsObject.class); CommonRepository commonRepository = new CommonRepository(commonFtsObject, tablename, tableColumns); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); repository = Mockito.mock(Repository.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.closeCase(baseEntityId, tablename); commonRepository.updateMasterRepository(repository); commonRepository.closeCase(baseEntityId, tablename); Mockito.verify(sqliteDatabase,Mockito.times(1)).update(Mockito.anyString(), Mockito.any(ContentValues.class), Mockito.anyString(),Mockito.any(String[].class)); } |
CommonRepository extends DrishtiRepository { public boolean deleteCase(String baseEntityId, String tableName) { try { SQLiteDatabase db = masterRepository.getWritableDatabase(); int afftectedRows = db .delete(tableName, BASE_ENTITY_ID_COLUMN + " = ? COLLATE NOCASE" + " ", new String[]{baseEntityId}); if (afftectedRows > 0) { return true; } } catch (Exception e) { Timber.e(e); } return false; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void assertDeleteCaseCallsDatabaseExec() { String tablename = "table"; String baseEntityId = "1"; String[] tableColumns = new String[]{CommonRepository.Relational_Underscore_ID, CommonRepository.BASE_ENTITY_ID_COLUMN, ADDITIONALCOLUMN, CUSTOMRELATIONALID}; commonFtsObject = Mockito.mock(CommonFtsObject.class); CommonRepository commonRepository = new CommonRepository(commonFtsObject, tablename, tableColumns); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); repository = Mockito.mock(Repository.class); Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); Assert.assertEquals(commonRepository.deleteCase(baseEntityId, tablename), false); Mockito.when(sqliteDatabase.delete(Mockito.anyString(), Mockito.anyString(), Mockito.any(String[].class))).thenReturn(1); commonRepository.updateMasterRepository(repository); Assert.assertEquals(commonRepository.deleteCase(baseEntityId, tablename), true); } |
CommonRepository extends DrishtiRepository { public ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs) { ArrayList<HashMap<String, String>> maplist = new ArrayList<HashMap<String, String>>(); Cursor cursor = null; try { SQLiteDatabase database = masterRepository.getReadableDatabase(); cursor = database.rawQuery(sql, selectionArgs); if (cursor != null && cursor.getCount() > 0 && cursor.moveToFirst()) { do { HashMap<String, String> map = new HashMap<String, String>(); for (int i = 0; i < cursor.getColumnCount(); i++) { map.put(cursor.getColumnName(i), cursor.getString(i)); } maplist.add(map); } while (cursor.moveToNext()); } } catch (Exception e) { Timber.e(e); } finally { if (cursor != null) { cursor.close(); } } return maplist; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void assertRawQueryReturnsMap() { String[] columns = new String[]{"id", "relationalid", "details", "is_closed"}; MatrixCursor cursor = new MatrixCursor(columns); cursor.addRow(new Object[]{"caseID", "relationalID", "dd1", "0"}); cursor.addRow(new Object[]{"caseID2", "relationalID2", "dd2", "0"}); String tablename = "table"; String[] tableColumns = new String[]{CommonRepository.Relational_Underscore_ID, CommonRepository.BASE_ENTITY_ID_COLUMN, ADDITIONALCOLUMN, CUSTOMRELATIONALID}; commonFtsObject = Mockito.mock(CommonFtsObject.class); Mockito.when(commonFtsObject.getCustomRelationalId(Mockito.anyString())).thenReturn(CUSTOMRELATIONALID); CommonRepository commonRepository = new CommonRepository(commonFtsObject, tablename, tableColumns); Assert.assertNotNull(commonRepository); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); repository = Mockito.mock(Repository.class); String baseEntityId = "1"; String query = "SELECT * FROM " + tablename + " WHERE base_entity_id = ?"; Mockito.when(repository.getReadableDatabase()).thenReturn(sqliteDatabase); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); Mockito.when(sqliteDatabase.rawQuery(query, null)).thenReturn(cursor); commonRepository.updateMasterRepository(repository); Assert.assertNotNull(commonRepository.rawQuery(query, new String[]{baseEntityId})); } |
CommonRepository extends DrishtiRepository { public boolean deleteSearchRecord(String caseId) { SQLiteDatabase database = masterRepository.getWritableDatabase(); database.beginTransaction(); String ftsSearchTable = CommonFtsObject.searchTableName(TABLE_NAME); try { int afftectedRows = database .delete(ftsSearchTable, CommonFtsObject.idColumn + " = " + "?", new String[]{caseId}); database.setTransactionSuccessful(); database.endTransaction(); if (afftectedRows > 0) { return true; } } catch (Exception e) { Timber.e(e, "Update Search Error"); database.endTransaction(); } return false; } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void deleteSearchRecordShouldReturnTrueAndCommitTransaction() { String tablename = "ec_client"; String[] tableColumns = new String[]{}; commonRepository = new CommonRepository(tablename, tableColumns); repository = Mockito.mock(Repository.class); sqliteDatabase = Mockito.mock(SQLiteDatabase.class); Mockito.when(repository.getWritableDatabase()).thenReturn(sqliteDatabase); commonRepository.updateMasterRepository(repository); ArgumentCaptor<String[]> caseIdCaptor = ArgumentCaptor.forClass(String[].class); Mockito.doReturn(2).when(sqliteDatabase).delete(Mockito.eq("ec_client_search"), Mockito.eq("object_id = ?"), caseIdCaptor.capture()); String caseId = "my-case-id"; Assert.assertTrue(commonRepository.deleteSearchRecord(caseId)); Assert.assertEquals(caseId, caseIdCaptor.getValue()[0]); Mockito.verify(sqliteDatabase).beginTransaction(); Mockito.verify(sqliteDatabase).setTransactionSuccessful(); Mockito.verify(sqliteDatabase).endTransaction(); }
@Test public void deleteSearchRecordShouldReturnFalseAndEndTransactionWhenExceptionOccurs() { ArgumentCaptor<String[]> caseIdCaptor = ArgumentCaptor.forClass(String[].class); Mockito.doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { throw new Exception("An error occurred"); } }).when(sqliteDatabase).delete(Mockito.eq("ec_client_search"), Mockito.eq("object_id = ?"), caseIdCaptor.capture()); String caseId = "my-case-id"; Assert.assertFalse(commonRepository.deleteSearchRecord(caseId)); Assert.assertEquals(caseId, caseIdCaptor.getValue()[0]); Mockito.verify(sqliteDatabase).beginTransaction(); Mockito.verify(sqliteDatabase, Mockito.times(0)).setTransactionSuccessful(); Mockito.verify(sqliteDatabase).endTransaction(); } |
CommonRepository extends DrishtiRepository { public boolean searchBatchInserts(Map<String, ContentValues> searchMap) { SQLiteDatabase database = masterRepository.getWritableDatabase(); database.beginTransaction(); String ftsSearchTable = CommonFtsObject.searchTableName(TABLE_NAME); try { for (String caseId : searchMap.keySet()) { ContentValues searchValues = searchMap.get(caseId); ArrayList<HashMap<String, String>> mapList = rawQuery( "SELECT " + CommonFtsObject.idColumn + " FROM " + ftsSearchTable + " WHERE " + CommonFtsObject.idColumn + " = ?", new String[]{caseId}); if (!mapList.isEmpty()) { int updated = database.update(ftsSearchTable, searchValues, CommonFtsObject.idColumn + " = " + "" + "?", new String[]{caseId}); Timber.i("Fts Row Updated: %s", String.valueOf(updated)); } else { long rowId = database.insert(ftsSearchTable, null, searchValues); Timber.i("Details Row Inserted : %s", String.valueOf(rowId)); } } database.setTransactionSuccessful(); database.endTransaction(); return true; } catch (Exception e) { Timber.e(e, "Update Search Error"); database.endTransaction(); return false; } } CommonRepository(String tablename, String[] columns); CommonRepository(CommonFtsObject commonFtsObject, String tablename, String[] columns); @Override void onCreate(SQLiteDatabase database); void add(CommonPersonObject common); void updateDetails(String caseId, Map<String, String> details); void mergeDetails(String caseId, Map<String, String> details); List<CommonPersonObject> allcommon(); List<CommonPersonObject> findByCaseIDs(String... caseIds); List<CommonPersonObject> findByRelationalIDs(String... caseIds); List<CommonPersonObject> findByRelational_IDs(String... caseIds); CommonPersonObject findByCaseID(String caseId); CommonPersonObject findByBaseEntityId(String baseEntityId); CommonPersonObject findHHByGOBHHID(String caseId); long count(); void close(String caseId); void updateColumn(String tableName, ContentValues contentValues, String caseId); List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName); List<CommonPersonObject> readAllcommonForField(Cursor cursor, String tableName); List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections,
String tableName); Cursor rawCustomQueryForAdapter(String query); CommonPersonObject readAllcommonforCursorAdapter(Cursor cursor); CommonPersonObject getCommonPersonObjectFromCursor(Cursor cursor); Long executeInsertStatement(ContentValues values, String tableName); Map<String, String> sqliteRowToMap(Cursor cursor); Cursor queryTable(String query); void closeCase(String baseEntityId, String tableName); boolean deleteCase(String baseEntityId, String tableName); ArrayList<HashMap<String, String>> rawQuery(String sql, String[] selectionArgs); ContentValues populateSearchValues(String caseId); boolean populateSearchValues(String caseId, String field, String value, String[]
listToRemove); boolean searchBatchInserts(Map<String, ContentValues> searchMap); boolean deleteSearchRecord(String caseId); List<String> findSearchIds(String query); int countSearchIds(String query); boolean isFts(); static final String ID_COLUMN; static final String Relational_ID; static final String Relational_Underscore_ID; static final String DETAILS_COLUMN; static final String IS_CLOSED_COLUMN; static final String BASE_ENTITY_ID_COLUMN; public String TABLE_NAME; public String[] common_TABLE_COLUMNS; final int initialColumnCount; public String[] additionalcolumns; } | @Test public void searchBatchInsertsShouldReturnFalse() { HashMap<String, ContentValues> searchMap = new HashMap<>(); ContentValues contentValues = new ContentValues(); searchMap.put("sample-case-id", contentValues); Mockito.doThrow(new SQLException("Some exception")).when(sqliteDatabase).insert(Mockito.eq(tablename + "_search"), Mockito.nullable(String.class), Mockito.eq(contentValues)); Assert.assertFalse(commonRepository.searchBatchInserts(searchMap)); Mockito.verify(sqliteDatabase).endTransaction(); Mockito.verify(sqliteDatabase, Mockito.times(0)).setTransactionSuccessful(); }
@Test public void searchBatchInsertsShouldReturnTrueAndCallSqliteDbInsert() { HashMap<String, ContentValues> searchMap = new HashMap<>(); ContentValues contentValues = new ContentValues(); searchMap.put("sample-case-id", contentValues); Assert.assertTrue(commonRepository.searchBatchInserts(searchMap)); Mockito.verify(sqliteDatabase).insert(Mockito.eq(tablename + "_search"), Mockito.nullable(String.class), Mockito.eq(contentValues)); Mockito.verify(sqliteDatabase).endTransaction(); Mockito.verify(sqliteDatabase).setTransactionSuccessful(); } |
CommonFtsObject { public static String searchTableName(String table) { return table + "_search"; } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void updateMainConditions(String table, String[] mainConditions); void updateCustomRelationalId(String table, String customRelationalId); void updateAlertScheduleMap(Map<String, Pair<String, Boolean>> alertsScheduleMap); void updateAlertFilterVisitCodes(String[] alertFilterVisitCodes); String[] getTables(); String[] getSearchFields(String table); String[] getSortFields(String table); String[] getMainConditions(String table); String getCustomRelationalId(String table); String getAlertBindType(String schedule); Boolean alertUpdateVisitCode(String schedule); String getAlertScheduleName(String vaccineName); String[] getAlertFilterVisitCodes(); boolean containsTable(String table); static final String idColumn; static final String relationalIdColumn; static final String phraseColumn; static final String isClosedColumn; static final String isClosedColumnName; } | @Test public void testSearchTableNameShouldReturnCorrectSearchTableName() { assertEquals("table1_search", commonFtsObject.searchTableName("table1")); } |
CommonFtsObject { public boolean containsTable(String table) { if (tables == null || StringUtils.isBlank(table)) { return false; } List<String> tableList = Arrays.asList(tables); return tableList.contains(table); } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void updateMainConditions(String table, String[] mainConditions); void updateCustomRelationalId(String table, String customRelationalId); void updateAlertScheduleMap(Map<String, Pair<String, Boolean>> alertsScheduleMap); void updateAlertFilterVisitCodes(String[] alertFilterVisitCodes); String[] getTables(); String[] getSearchFields(String table); String[] getSortFields(String table); String[] getMainConditions(String table); String getCustomRelationalId(String table); String getAlertBindType(String schedule); Boolean alertUpdateVisitCode(String schedule); String getAlertScheduleName(String vaccineName); String[] getAlertFilterVisitCodes(); boolean containsTable(String table); static final String idColumn; static final String relationalIdColumn; static final String phraseColumn; static final String isClosedColumn; static final String isClosedColumnName; } | @Test public void testContainsTableShouldReturnCorrectStatus() { assertTrue(commonFtsObject.containsTable("table1")); assertFalse(commonFtsObject.containsTable("table100")); } |
CommonFtsObject { public String[] getTables() { if (tables == null) { tables = ArrayUtils.EMPTY_STRING_ARRAY; } return tables; } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void updateMainConditions(String table, String[] mainConditions); void updateCustomRelationalId(String table, String customRelationalId); void updateAlertScheduleMap(Map<String, Pair<String, Boolean>> alertsScheduleMap); void updateAlertFilterVisitCodes(String[] alertFilterVisitCodes); String[] getTables(); String[] getSearchFields(String table); String[] getSortFields(String table); String[] getMainConditions(String table); String getCustomRelationalId(String table); String getAlertBindType(String schedule); Boolean alertUpdateVisitCode(String schedule); String getAlertScheduleName(String vaccineName); String[] getAlertFilterVisitCodes(); boolean containsTable(String table); static final String idColumn; static final String relationalIdColumn; static final String phraseColumn; static final String isClosedColumn; static final String isClosedColumnName; } | @Test public void testGetTablesShouldGetAllTables() { assertEquals(tables, commonFtsObject.getTables()); } |
CommonObjectFilterOption implements FilterOption { @Override public boolean filter(SmartRegisterClient client) { switch (byColumnAndByDetails) { case byColumn: return ((CommonPersonObjectClient) client).getColumnmaps().get(fieldname). contains(criteria); case byDetails: return (((CommonPersonObjectClient) client).getDetails().get(fieldname) != null ? ((CommonPersonObjectClient) client).getDetails().get(fieldname) : ""). toLowerCase().contains(criteria.toLowerCase()); } return false; } CommonObjectFilterOption(String criteriaArg, String fieldnameArg, ByColumnAndByDetails
byColumnAndByDetailsArg, String filteroptionnameArg); @Override String name(); @Override boolean filter(SmartRegisterClient client); final String fieldname; } | @Test public void testFilterByColumn() { Map<String, String> column1 = EasyMap.create("name", "Woman A").map(); CommonPersonObjectClient expectedClient = new CommonPersonObjectClient("entity id 1", emptyMap, "Woman A"); expectedClient.setColumnmaps(column1); boolean filter = commonObjectFilterOption.filter(expectedClient); assertTrue(filter); }
@Test public void testFilterByDetails() { commonObjectFilterOption = new CommonObjectFilterOption(criteria, fieldname, byDetails, filterOptionName); Map<String, String> detail = EasyMap.create("name", "Woman A").map(); CommonPersonObjectClient expectedClient = new CommonPersonObjectClient("entity id 1", detail, "Woman A"); expectedClient.setColumnmaps(emptyMap); boolean filter = commonObjectFilterOption.filter(expectedClient); assertTrue(filter); } |
CredentialsHelper { public PasswordHash generateLocalAuthCredentials(char[] password) throws InvalidKeySpecException, NoSuchAlgorithmException { if (password == null) return null; return SecurityHelper.getPasswordHash(password); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); } | @Test public void generateLocalAuthCredentials() throws Exception { Assert.assertNotNull(credentialsHelper); PowerMockito.mockStatic(SecurityHelper.class); PowerMockito.when(SecurityHelper.getPasswordHash(TEST_DUMMY_PASSWORD)).thenReturn(null); credentialsHelper.generateLocalAuthCredentials(TEST_DUMMY_PASSWORD); PowerMockito.verifyStatic(SecurityHelper.class); SecurityHelper.getPasswordHash(TEST_DUMMY_PASSWORD); } |
CommonObjectFilterOption implements FilterOption { @Override public String name() { return filterOptionName; } CommonObjectFilterOption(String criteriaArg, String fieldnameArg, ByColumnAndByDetails
byColumnAndByDetailsArg, String filteroptionnameArg); @Override String name(); @Override boolean filter(SmartRegisterClient client); final String fieldname; } | @Test public void testFilterOptionName() { assertEquals(filterOptionName, commonObjectFilterOption.name()); } |
CommonPersonObjectController { public String get() { return cache.get(person_CLIENTS_LIST, new CacheableData<String>() { @Override public String fetch() { List<CommonPersonObject> p = allpersonobjects.all(); updateDetails(p); CommonPersonObjectClients pClients = new CommonPersonObjectClients(); if (filtermap != null) { for (CommonPersonObject personinlist : p) { boolean filter = false; Log.v("is filtermap ", "" + filtermap.size()); for (int k = 0; k < filtermap.size(); k++) { filter = filtermap.get(k).filtermapLogic(personinlist); } if (!isnull(personinlist) && filter) { CommonPersonObjectClient pClient = new CommonPersonObjectClient( personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get(nameString)); pClient.setColumnmaps(personinlist.getColumnmaps()); pClients.add(pClient); } } } else if (filterkey == null) { for (CommonPersonObject personinlist : p) { Log.v("is filtermap ", "wrong place"); if (!isnull(personinlist)) { CommonPersonObjectClient pClient = new CommonPersonObjectClient( personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get(nameString)); pClient.setColumnmaps(personinlist.getColumnmaps()); pClients.add(pClient); } } } else { switch (byColumnAndByDetails) { case byColumn: for (CommonPersonObject personinlist : p) { if (!isnull(personinlist)) { if (personinlist.getColumnmaps().get(filterkey) != null) { if (personinlist.getColumnmaps().get(filterkey) .equalsIgnoreCase(filtervalue) == filtercase) { CommonPersonObjectClient pClient = new CommonPersonObjectClient( personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get(nameString)); pClient.setColumnmaps(personinlist.getColumnmaps()); pClients.add(pClient); } } } } break; case byDetails: for (CommonPersonObject personinlist : p) { if (!isnull(personinlist)) { if (personinlist.getDetails().get(filterkey) != null) { if (personinlist.getDetails().get(filterkey) .equalsIgnoreCase(filtervalue) == filtercase) { CommonPersonObjectClient pClient = new CommonPersonObjectClient( personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get(nameString)); pClient.setColumnmaps(personinlist.getColumnmaps()); pClients.add(pClient); } } } } break; case byrelationalid: for (CommonPersonObject personinlist : p) { if (!isnull(personinlist)) { if (personinlist.getRelationalId().equalsIgnoreCase(filtervalue) == filtercase) { CommonPersonObjectClient pClient = new CommonPersonObjectClient( personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get(nameString)); pClient.setColumnmaps(personinlist.getColumnmaps()); pClients.add(pClient); } } } break; case byrelational_id: for (CommonPersonObject personinlist : p) { if (!isnull(personinlist)) { if (personinlist.getColumnmaps().get("relational_id") .equalsIgnoreCase(filtervalue) == filtercase) { CommonPersonObjectClient pClient = new CommonPersonObjectClient( personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get(nameString)); pClient.setColumnmaps(personinlist.getColumnmaps()); pClients.add(pClient); } } } break; } } if (sortOption == null) { sortByName(pClients); } else { sortOption.sort(pClients); } return new Gson().toJson(pClients); } }); } CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype, String null_check_key,
ByColumnAndByDetails byColumnAndByDetailsNullcheck); CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype, String filterkey, String
filtervalue, ByColumnAndByDetails byColumnAndByDetails, String null_check_key,
ByColumnAndByDetails byColumnAndByDetailsNullcheck); CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype, String null_check_key,
ByColumnAndByDetails byColumnAndByDetailsNullcheck,
SortOption sortOption); CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype, String filterkey, String
filtervalue, ByColumnAndByDetails byColumnAndByDetails, String null_check_key,
ByColumnAndByDetails byColumnAndByDetailsNullcheck,
SortOption sortOption); CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype, String filterkey, String
filtervalue, boolean filterCase, ByColumnAndByDetails byColumnAndByDetails, String
null_check_key, ByColumnAndByDetails byColumnAndByDetailsNullcheck, SortOption
sortOption); CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype,
ArrayList<ControllerFilterMap> filtermap,
ByColumnAndByDetails byColumnAndByDetails, String
null_check_key, ByColumnAndByDetails
byColumnAndByDetailsNullcheck, SortOption
sortOption); CommonPersonObjectController(AllCommonsRepository allpersons, AllBeneficiaries
allBeneficiaries, Cache<String> cache, Cache<CommonPersonObjectClients>
personClientsCache, String nameString, String bindtype,
ArrayList<ControllerFilterMap> filtermap,
ByColumnAndByDetails byColumnAndByDetails, String
null_check_key, ByColumnAndByDetails
byColumnAndByDetailsNullcheck); String get(); CommonPersonObjectClients getClients(); boolean isnull(CommonPersonObject personinlist); final String nameString; public String filterkey; public String filtervalue; public String null_check_key; public boolean filtercase; } | @Test public void shouldSortECsByName() throws Exception { Map<String, String> personDetails1 = EasyMap.create("name", "Woman A").map(); Map<String, String> personDetails2 = EasyMap.create("name", "Woman B").map(); Map<String, String> personDetails3 = EasyMap.create("name", "Woman C").map(); CommonPersonObject cpo2 = new CommonPersonObject("entity id 2", "relational id 2", personDetails2, "bindtype"); cpo2.setColumnmaps(emptyDetails); CommonPersonObject cpo3 = new CommonPersonObject("entity id 3", "relational id 3", personDetails3, "bindtype"); cpo3.setColumnmaps(emptyDetails); CommonPersonObject cpo1 = new CommonPersonObject("entity id 1", "relational id 1", personDetails1, "bindtype"); cpo1.setColumnmaps(emptyDetails); Mockito.when(allCommonsRepository.all()).thenReturn(Arrays.asList(cpo2, cpo3, cpo1)); CommonPersonObjectClient expectedClient1 = new CommonPersonObjectClient("entity id 1", personDetails1, "Woman A"); expectedClient1.setColumnmaps(emptyDetails); CommonPersonObjectClient expectedClient2 = new CommonPersonObjectClient("entity id 2", personDetails2, "Woman B"); expectedClient2.setColumnmaps(emptyDetails); CommonPersonObjectClient expectedClient3 = new CommonPersonObjectClient("entity id 3", personDetails3, "Woman C"); expectedClient3.setColumnmaps(emptyDetails); String clients = controller.get(); Gson gson = new Gson(); String objectlist = gson.toJson(Arrays.asList(expectedClient1, expectedClient2, expectedClient3)); Assert.assertEquals(objectlist, clients); }
@Test public void shouldMapCommonObjectToCommonObjectClient() throws Exception { Map<String, String> details = EasyMap.create("name", "Woman A").map(); CommonPersonObject commonpersonobject = new CommonPersonObject("entity id 1", "relational id 1", details, "bindtype"); commonpersonobject.setColumnmaps(emptyDetails); Mockito.when(allCommonsRepository.all()).thenReturn(Arrays.asList(commonpersonobject)); CommonPersonObjectClient expectedCommonObjectClient = new CommonPersonObjectClient( "entity id 1", details, "Woman A"); expectedCommonObjectClient.setColumnmaps(emptyDetails); String clients = controller.get(); Gson gson = new Gson(); String objectlist = gson.toJson(Arrays.asList(expectedCommonObjectClient)); Assert.assertEquals(objectlist, clients); }
@Test public void shouldfilterNullsAccordingToFilterKey() throws Exception { Map<String, String> personDetails1 = EasyMap.create("name", "Woman A").map(); Map<String, String> personDetails2 = EasyMap.create("name", "Woman B").map(); Map<String, String> personDetails3 = emptyDetails; CommonPersonObject cpo2 = new CommonPersonObject("entity id 2", "relational id 2", personDetails2, "bindtype"); cpo2.setColumnmaps(emptyDetails); CommonPersonObject cpo3 = new CommonPersonObject("entity id 3", "relational id 3", personDetails3, "bindtype"); cpo3.setColumnmaps(emptyDetails); CommonPersonObject cpo1 = new CommonPersonObject("entity id 1", "relational id 1", personDetails1, "bindtype"); cpo1.setColumnmaps(emptyDetails); Mockito.when(allCommonsRepository.all()).thenReturn(Arrays.asList(cpo2, cpo3, cpo1)); CommonPersonObjectClient expectedClient1 = new CommonPersonObjectClient("entity id 1", personDetails1, "Woman A"); expectedClient1.setColumnmaps(emptyDetails); CommonPersonObjectClient expectedClient2 = new CommonPersonObjectClient("entity id 2", personDetails2, "Woman B"); expectedClient2.setColumnmaps(emptyDetails); CommonPersonObjectClient expectedClient3 = new CommonPersonObjectClient("entity id 3", personDetails3, "Woman C"); expectedClient3.setColumnmaps(emptyDetails); String clients = controller.get(); Gson gson = new Gson(); String objectlist = gson.toJson(Arrays.asList(expectedClient1, expectedClient2)); Assert.assertEquals(objectlist, clients); } |
AccountHelper { public static Account getOauthAccountByNameAndType(String accountName, String accountType) { Account[] accounts = accountManager.getAccountsByType(accountType); return accounts.length > 0 ? selectAccount(accounts, accountName) : null; } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; } | @Test public void testGetOauthAccountByType() { Account account = AccountHelper.getOauthAccountByNameAndType(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Assert.assertNotNull(account); Assert.assertEquals(CORE_ACCOUNT_NAME, account.name); } |
AccountHelper { public static String getAccountManagerValue(String key, String accountName, String accountType) { Account account = AccountHelper.getOauthAccountByNameAndType(accountName, accountType); if (account != null) { return accountManager.getUserData(account, key); } return null; } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; } | @Test public void testGetAccountManagerValue() { Whitebox.setInternalState(AccountHelper.class, "accountManager", accountManager); Mockito.doReturn(TEST_VALUE).when(accountManager).getUserData(ArgumentMatchers.any(Account.class), ArgumentMatchers.eq(TEST_KEY)); String value = AccountHelper.getAccountManagerValue(TEST_KEY, CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Assert.assertNotNull(value); Assert.assertEquals(TEST_VALUE, value); } |
AccountHelper { public static String getOAuthToken(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); try { return accountManager.blockingGetAuthToken(account, authTokenType, true); } catch (Exception ex) { Timber.e(ex, "EXCEPTION: %s", ex.toString()); return null; } } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; } | @Test public void testGetOAuthToken() throws AuthenticatorException, OperationCanceledException, IOException { Mockito.doReturn(TEST_TOKEN_VALUE).when(accountManager).blockingGetAuthToken(new Account(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE), AUTH_TOKEN_TYPE, true); String myToken = AccountHelper.getOAuthToken(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE, AUTH_TOKEN_TYPE); Assert.assertNotNull(myToken); Assert.assertEquals(TEST_TOKEN_VALUE, myToken); } |
AccountHelper { public static void invalidateAuthToken(String accountType, String authToken) { if (authToken != null) accountManager.invalidateAuthToken(accountType, authToken); } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; } | @Test public void testInvalidateAuthToken() { AccountHelper.invalidateAuthToken(CORE_ACCOUNT_TYPE, TEST_TOKEN_VALUE); Mockito.verify(accountManager).invalidateAuthToken(CORE_ACCOUNT_TYPE, TEST_TOKEN_VALUE); } |
AccountHelper { public static String getCachedOAuthToken(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); return account != null ? accountManager.peekAuthToken(account, authTokenType) : null; } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; } | @Test public void testGetCachedOAuthToken() { Account account = new Account(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Mockito.doReturn(TEST_TOKEN_VALUE).when(accountManager).peekAuthToken(account, AUTH_TOKEN_TYPE); String cachedAuthToken = AccountHelper.getCachedOAuthToken(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE, AUTH_TOKEN_TYPE); Mockito.verify(accountManager).peekAuthToken(account, AUTH_TOKEN_TYPE); Assert.assertEquals(TEST_TOKEN_VALUE, cachedAuthToken); } |
CredentialsHelper { public byte[] generateDBCredentials(char[] password, LoginResponseData userInfo) { char[] encryptionParamValue = null; SyncConfiguration syncConfiguration = CoreLibrary.getInstance().getSyncConfiguration(); if (syncConfiguration.getEncryptionParam() != null) { SyncFilter syncFilter = syncConfiguration.getEncryptionParam(); if (SyncFilter.TEAM.equals(syncFilter) || SyncFilter.TEAM_ID.equals(syncFilter)) { encryptionParamValue = context.userService().getUserDefaultTeamId(userInfo).toCharArray(); } else if (SyncFilter.LOCATION.equals(syncFilter) || SyncFilter.LOCATION_ID.equals(syncFilter)) { encryptionParamValue = context.userService().getUserLocationId(userInfo).toCharArray(); } else if (SyncFilter.PROVIDER.equals(syncFilter)) { encryptionParamValue = password; } } if (encryptionParamValue == null || encryptionParamValue.length < 1) { return null; } return SecurityHelper.toBytes(encryptionParamValue); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] getCredentials(String username, String type); void saveCredentials(String type, String encryptedPassphrase); PasswordHash generateLocalAuthCredentials(char[] password); byte[] generateDBCredentials(char[] password, LoginResponseData userInfo); } | @Test public void testGenerateDBCredentialsReturnsCorrectBytesForSyncByProvider() { Mockito.doReturn(SyncFilter.PROVIDER).when(syncConfiguration).getEncryptionParam(); byte[] bytes = credentialsHelper.generateDBCredentials(TEST_DUMMY_PASSWORD, userInfo); Assert.assertTrue(Arrays.equals(SecurityHelper.toBytes(TEST_DUMMY_PASSWORD), bytes)); }
@Test public void testGenerateDBCredentialsReturnsCorrectBytesForSyncByTeam() { Mockito.doReturn(SyncFilter.TEAM_ID).when(syncConfiguration).getEncryptionParam(); Mockito.doReturn(TEST_TEAM_ID).when(userService).getUserDefaultTeamId(userInfo); byte[] bytes = credentialsHelper.generateDBCredentials(TEST_DUMMY_PASSWORD, userInfo); Assert.assertTrue(Arrays.equals(SecurityHelper.toBytes(TEST_TEAM_ID.toCharArray()), bytes)); }
@Test public void testGenerateDBCredentialsReturnsCorrectBytesForSyncByLocation() { Mockito.doReturn(SyncFilter.LOCATION_ID).when(syncConfiguration).getEncryptionParam(); Mockito.doReturn(TEST_LOCATION_ID).when(userService).getUserLocationId(userInfo); byte[] bytes = credentialsHelper.generateDBCredentials(TEST_DUMMY_PASSWORD, userInfo); Assert.assertTrue(Arrays.equals(SecurityHelper.toBytes(TEST_LOCATION_ID.toCharArray()), bytes)); } |
AccountHelper { public static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); return accountManager.updateCredentials(account, authTokenType, null, null, null, null); } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] accounts, String accountName); static String getAccountManagerValue(String key, String accountName, String accountType); static String getOAuthToken(String accountName, String accountType, String authTokenType); static void invalidateAuthToken(String accountType, String authToken); static String getCachedOAuthToken(String accountName, String accountType, String authTokenType); static AccountManagerFuture<Bundle> reAuthenticateUserAfterSessionExpired(String accountName, String accountType, String authTokenType); final static int MAX_AUTH_RETRIES; } | @Test public void testReAuthenticateUserAfterSessionExpired() { Account account = new Account(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE); Mockito.doReturn(Mockito.mock(AccountManagerFuture.class)).when(accountManager).updateCredentials(account, AUTH_TOKEN_TYPE, null, null, null, null); AccountManagerFuture<Bundle> reAuthenticationFuture = AccountHelper.reAuthenticateUserAfterSessionExpired(CORE_ACCOUNT_NAME, CORE_ACCOUNT_TYPE, AUTH_TOKEN_TYPE); Assert.assertNotNull(reAuthenticationFuture); Mockito.verify(accountManager).updateCredentials(account, AUTH_TOKEN_TYPE, null, null, null, null); } |
RecyclerViewPaginatedAdapter extends RecyclerViewCursorAdapter { @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == RecyclerViewCursorAdapter.Type.FOOTER.ordinal()) { return listItemProvider.createFooterHolder(parent); } else { return listItemProvider.createViewHolder(parent); } } RecyclerViewPaginatedAdapter(Cursor cursor,
RecyclerViewProvider<RecyclerView.ViewHolder>
listItemProvider, CommonRepository
commonRepository); @NonNull @Override RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType); @Override void onBindViewHolder(RecyclerView.ViewHolder viewHolder, Cursor cursor); boolean hasNextPage(); boolean hasPreviousPage(); void nextPageOffset(); void previousPageOffset(); void setTotalcount(int totalcount); int getTotalcount(); void setCurrentoffset(int currentoffset); int getCurrentoffset(); void setCurrentlimit(int currentlimit); int getCurrentlimit(); public int totalcount; public int currentlimit; public int currentoffset; } | @Test public void testOnCreateViewHolder() { LinearLayout vg = new LinearLayout(context); when(listItemProvider.createViewHolder(any())).thenReturn(mockViewHolder); RecyclerView.ViewHolder actualViewHolder = adapter.onCreateViewHolder(vg, RecyclerViewCursorAdapter.Type.ITEM.ordinal()); assertNotNull(actualViewHolder); verify(listItemProvider).createViewHolder(any()); }
@Test public void testOnCreateFooterHolder() { LinearLayout vg = new LinearLayout(context); when(listItemProvider.createFooterHolder(any())).thenReturn(mockViewHolder); RecyclerView.ViewHolder actualViewHolder = adapter.onCreateViewHolder(vg, RecyclerViewCursorAdapter.Type.FOOTER.ordinal()); assertNotNull(actualViewHolder); verify(listItemProvider).createFooterHolder(any()); } |
RecyclerViewPaginatedAdapter extends RecyclerViewCursorAdapter { @Override public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, Cursor cursor) { if (listItemProvider.isFooterViewHolder(viewHolder)) { listItemProvider.getFooterView(viewHolder, getCurrentPageCount(), getTotalPageCount(), hasNextPage(), hasPreviousPage()); } else { CommonPersonObject personinlist = commonRepository.readAllcommonforCursorAdapter(cursor); CommonPersonObjectClient pClient = new CommonPersonObjectClient(personinlist.getCaseId(), personinlist.getDetails(), personinlist.getDetails().get("FWHOHFNAME")); pClient.setColumnmaps(personinlist.getColumnmaps()); listItemProvider.getView(cursor, pClient, viewHolder); } } RecyclerViewPaginatedAdapter(Cursor cursor,
RecyclerViewProvider<RecyclerView.ViewHolder>
listItemProvider, CommonRepository
commonRepository); @NonNull @Override RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType); @Override void onBindViewHolder(RecyclerView.ViewHolder viewHolder, Cursor cursor); boolean hasNextPage(); boolean hasPreviousPage(); void nextPageOffset(); void previousPageOffset(); void setTotalcount(int totalcount); int getTotalcount(); void setCurrentoffset(int currentoffset); int getCurrentoffset(); void setCurrentlimit(int currentlimit); int getCurrentlimit(); public int totalcount; public int currentlimit; public int currentoffset; } | @Test public void testOnBindViewHolder() { String name = "John"; Map<String, String> details = new HashMap<>(); details.put("FWHOHFNAME", name); Map<String, String> columnmaps = new HashMap<>(); String idColumn = "baseEntityId"; columnmaps.put("id", idColumn); String caseId = "case 1"; String relationId = "identifier 123"; String type = "bindtype"; CommonPersonObject personInList = new CommonPersonObject(caseId, relationId, details,type); personInList.setColumnmaps(columnmaps); when(commonRepository.readAllcommonforCursorAdapter(mCursor)).thenReturn(personInList); adapter.onBindViewHolder(mockViewHolder, mCursor); verify(listItemProvider).getView(cursorArgumentCaptor.capture(), personObjectClientArgumentCaptor.capture(), viewHolderArgumentCaptor.capture()); assertEquals(mockViewHolder, viewHolderArgumentCaptor.getValue()); assertEquals(mCursor, cursorArgumentCaptor.getValue()); assertEquals(name, personObjectClientArgumentCaptor.getValue().getName()); assertEquals(caseId, personObjectClientArgumentCaptor.getValue().getCaseId()); assertEquals(idColumn, personObjectClientArgumentCaptor.getValue().getColumnmaps().get("id")); } |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.