mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Fix Android tests
This commit is contained in:
14
build.sh
14
build.sh
@@ -19,7 +19,7 @@ ADB="${ANDROID_HOME}/platform-tools/adb"
|
|||||||
EMULATOR="${ANDROID_HOME}/tools/emulator"
|
EMULATOR="${ANDROID_HOME}/tools/emulator"
|
||||||
GRADLE="./gradlew --stacktrace"
|
GRADLE="./gradlew --stacktrace"
|
||||||
PACKAGE_NAME=org.isoron.uhabits
|
PACKAGE_NAME=org.isoron.uhabits
|
||||||
OUTPUTS_DIR=app/build/outputs
|
OUTPUTS_DIR=uhabits-android/build/outputs
|
||||||
|
|
||||||
KEYFILE="TestKeystore.jks"
|
KEYFILE="TestKeystore.jks"
|
||||||
KEY_ALIAS="default"
|
KEY_ALIAS="default"
|
||||||
@@ -128,14 +128,14 @@ install_apk() {
|
|||||||
log_info "Installing APK"
|
log_info "Installing APK"
|
||||||
|
|
||||||
if [ ! -z $RELEASE ]; then
|
if [ ! -z $RELEASE ]; then
|
||||||
$ADB install -r ${OUTPUTS_DIR}/apk/release/app-release.apk || fail
|
$ADB install -r ${OUTPUTS_DIR}/apk/release/uhabits-android-release.apk || fail
|
||||||
else
|
else
|
||||||
$ADB install -r ${OUTPUTS_DIR}/apk/debug/app-debug.apk || fail
|
$ADB install -r ${OUTPUTS_DIR}/apk/debug/uhabits-android-debug.apk || fail
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install_test_apk() {
|
install_test_apk() {
|
||||||
$ADB install -r ${OUTPUTS_DIR}/apk/androidTest/debug/app-debug-androidTest.apk || fail
|
$ADB install -r ${OUTPUTS_DIR}/apk/androidTest/debug/uhabits-android-debug-androidTest.apk || fail
|
||||||
}
|
}
|
||||||
|
|
||||||
run_instrumented_tests() {
|
run_instrumented_tests() {
|
||||||
@@ -158,7 +158,7 @@ parse_instrumentation_results() {
|
|||||||
|
|
||||||
generate_coverage_badge() {
|
generate_coverage_badge() {
|
||||||
log_info "Generating code coverage badge"
|
log_info "Generating code coverage badge"
|
||||||
python tools/coverage-badge/badge.py -i app/build/reports/jacoco/coverageReport/coverageReport.xml -o ${OUTPUTS_DIR}/coverage-badge
|
python tools/coverage-badge/badge.py -i uhabits-android/build/reports/jacoco/coverageReport/coverageReport.xml -o ${OUTPUTS_DIR}/coverage-badge
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_artifacts() {
|
fetch_artifacts() {
|
||||||
@@ -199,8 +199,8 @@ run_local_tests() {
|
|||||||
parse_instrumentation_results
|
parse_instrumentation_results
|
||||||
fetch_artifacts
|
fetch_artifacts
|
||||||
fetch_logcat
|
fetch_logcat
|
||||||
run_jvm_tests
|
#run_jvm_tests
|
||||||
generate_coverage_badge
|
#generate_coverage_badge
|
||||||
uninstall_test_apk
|
uninstall_test_apk
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,6 @@ dependencies {
|
|||||||
androidTestImplementation 'com.android.support:support-annotations:25.3.1'
|
androidTestImplementation 'com.android.support:support-annotations:25.3.1'
|
||||||
androidTestImplementation 'com.android.support.test:rules:0.5'
|
androidTestImplementation 'com.android.support.test:rules:0.5'
|
||||||
androidTestImplementation 'com.android.support.test:runner:0.5'
|
androidTestImplementation 'com.android.support.test:runner:0.5'
|
||||||
androidTestImplementation "com.google.dexmaker:dexmaker:1.2"
|
|
||||||
androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0'
|
|
||||||
androidTestImplementation 'org.mockito:mockito-core:2.8.9'
|
|
||||||
androidTestImplementation 'com.google.guava:guava:20.0'
|
androidTestImplementation 'com.google.guava:guava:20.0'
|
||||||
androidTestCompileOnly 'com.google.auto.factory:auto-factory:1.0-beta3'
|
androidTestCompileOnly 'com.google.auto.factory:auto-factory:1.0-beta3'
|
||||||
androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:2.11-rc2'
|
androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:2.11-rc2'
|
||||||
@@ -86,6 +83,11 @@ dependencies {
|
|||||||
testAnnotationProcessor 'com.google.auto.factory:auto-factory:1.0-beta3'
|
testAnnotationProcessor 'com.google.auto.factory:auto-factory:1.0-beta3'
|
||||||
testAnnotationProcessor 'com.jakewharton:butterknife-compiler:8.6.1-SNAPSHOT'
|
testAnnotationProcessor 'com.jakewharton:butterknife-compiler:8.6.1-SNAPSHOT'
|
||||||
|
|
||||||
|
testCompile "org.mockito:mockito-core:2.8.9"
|
||||||
|
testCompile "org.mockito:mockito-inline:2.8.9"
|
||||||
|
androidTestCompile "org.mockito:mockito-android:2.8.9"
|
||||||
|
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
|
||||||
|
|
||||||
implementation('com.opencsv:opencsv:3.9') {
|
implementation('com.opencsv:opencsv:3.9') {
|
||||||
exclude group: 'commons-logging', module: 'commons-logging'
|
exclude group: 'commons-logging', module: 'commons-logging'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class FrequencyCardTest extends BaseViewTest
|
|||||||
public void setUp()
|
public void setUp()
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
habit = fixtures.createLongHabit();
|
habit = fixtures.createLongHabit();
|
||||||
|
|
||||||
view = (FrequencyCard) LayoutInflater
|
view = (FrequencyCard) LayoutInflater
|
||||||
.from(targetContext)
|
.from(targetContext)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.io;
|
package org.isoron.uhabits.io;
|
||||||
|
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.support.test.*;
|
import android.support.test.*;
|
||||||
@@ -26,6 +26,7 @@ import android.test.suitebuilder.annotation.*;
|
|||||||
|
|
||||||
import org.isoron.androidbase.utils.*;
|
import org.isoron.androidbase.utils.*;
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
|
import org.isoron.uhabits.core.io.*;
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.io;
|
package org.isoron.uhabits.io;
|
||||||
|
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.support.test.*;
|
import android.support.test.*;
|
||||||
@@ -28,7 +28,6 @@ import org.isoron.androidbase.utils.*;
|
|||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.isoron.uhabits.core.utils.*;
|
import org.isoron.uhabits.core.utils.*;
|
||||||
import org.isoron.uhabits.io.*;
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
|
|
||||||
@@ -17,13 +17,14 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models;
|
package org.isoron.uhabits.models;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
|
|
||||||
import org.hamcrest.*;
|
import org.hamcrest.*;
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models.sqlite;
|
package org.isoron.uhabits.models.sqlite;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models.sqlite;
|
package org.isoron.uhabits.models.sqlite;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models.sqlite;
|
package org.isoron.uhabits.models.sqlite;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models.sqlite;
|
package org.isoron.uhabits.models.sqlite;
|
||||||
|
|
||||||
import android.support.annotation.*;
|
import android.support.annotation.*;
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models.sqlite;
|
package org.isoron.uhabits.models.sqlite;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
@@ -42,7 +42,6 @@ import static org.hamcrest.core.IsEqual.*;
|
|||||||
@MediumTest
|
@MediumTest
|
||||||
public class PebbleReceiverTest extends BaseAndroidTest
|
public class PebbleReceiverTest extends BaseAndroidTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private Habit habit1;
|
private Habit habit1;
|
||||||
|
|
||||||
private Habit habit2;
|
private Habit habit2;
|
||||||
|
|||||||
@@ -17,13 +17,14 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.tasks;
|
package org.isoron.uhabits.tasks;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
|
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
|
import org.isoron.uhabits.core.tasks.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
|
|
||||||
@@ -17,13 +17,12 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.tasks;
|
package org.isoron.uhabits.tasks;
|
||||||
|
|
||||||
import android.support.test.runner.*;
|
import android.support.test.runner.*;
|
||||||
import android.test.suitebuilder.annotation.*;
|
import android.test.suitebuilder.annotation.*;
|
||||||
|
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.tasks.*;
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
|
|
||||||
@@ -17,27 +17,26 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.utils;
|
package org.isoron.uhabits.utils;
|
||||||
|
|
||||||
import android.app.*;
|
import android.app.*;
|
||||||
|
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.core.commands.*;
|
import org.isoron.uhabits.core.commands.*;
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
|
import org.isoron.uhabits.core.utils.*;
|
||||||
import org.isoron.uhabits.intents.*;
|
import org.isoron.uhabits.intents.*;
|
||||||
import org.isoron.uhabits.utils.*;
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static java.util.Arrays.asList;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class ReminderSchedulerTest extends BaseAndroidTest
|
public class ReminderSchedulerTest extends BaseAndroidTest
|
||||||
{
|
{
|
||||||
private Habit habit;
|
private Habit habit;
|
||||||
|
|
||||||
private PendingIntent intent;
|
|
||||||
|
|
||||||
private ReminderScheduler reminderScheduler;
|
private ReminderScheduler reminderScheduler;
|
||||||
|
|
||||||
private HabitLogger logger;
|
private HabitLogger logger;
|
||||||
@@ -53,11 +52,11 @@ public class ReminderSchedulerTest extends BaseAndroidTest
|
|||||||
public void setUp()
|
public void setUp()
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
intent = mock(PendingIntent.class);
|
|
||||||
logger = mock(HabitLogger.class);
|
logger = mock(HabitLogger.class);
|
||||||
pendingIntentFactory = mock(PendingIntentFactory.class);
|
|
||||||
intentScheduler = mock(IntentScheduler.class);
|
intentScheduler = mock(IntentScheduler.class);
|
||||||
commandRunner = mock(CommandRunner.class);
|
commandRunner = mock(CommandRunner.class);
|
||||||
|
pendingIntentFactory =
|
||||||
|
new PendingIntentFactory(targetContext, new IntentFactory());
|
||||||
|
|
||||||
reminderScheduler =
|
reminderScheduler =
|
||||||
new ReminderScheduler(pendingIntentFactory, intentScheduler, logger,
|
new ReminderScheduler(pendingIntentFactory, intentScheduler, logger,
|
||||||
@@ -92,26 +91,23 @@ public class ReminderSchedulerTest extends BaseAndroidTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSchedule_list()
|
public void testScheduleAll()
|
||||||
{
|
{
|
||||||
long now = timestamp(2015, 1, 26, 13, 0);
|
long now = timestamp(2015, 1, 26, 13, 0);
|
||||||
DateUtils.setFixedLocalTime(now);
|
DateUtils.setFixedLocalTime(now);
|
||||||
|
|
||||||
Habit h1 = fixtures.createEmptyHabit();
|
Habit h1 = fixtures.createEmptyHabit();
|
||||||
h1.setReminder(new Reminder(8, 30, WeekdayList.EVERY_DAY));
|
|
||||||
habitList.add(h1);
|
|
||||||
|
|
||||||
Habit h2 = fixtures.createEmptyHabit();
|
Habit h2 = fixtures.createEmptyHabit();
|
||||||
h2.setReminder(new Reminder(18, 30, WeekdayList.EVERY_DAY));
|
|
||||||
habitList.add(h2);
|
|
||||||
|
|
||||||
Habit h3 = fixtures.createEmptyHabit();
|
Habit h3 = fixtures.createEmptyHabit();
|
||||||
habitList.add(h3);
|
h1.setReminder(new Reminder(8, 30, WeekdayList.EVERY_DAY));
|
||||||
|
h2.setReminder(new Reminder(18, 30, WeekdayList.EVERY_DAY));
|
||||||
|
h3.setReminder(null);
|
||||||
|
habitList.update(asList(h1, h2, h3));
|
||||||
|
|
||||||
reminderScheduler.scheduleAll();
|
reminderScheduler.scheduleAll();
|
||||||
|
|
||||||
verify(intentScheduler).schedule(timestamp(2015, 1, 27, 12, 30), null);
|
verify(intentScheduler).schedule(eq(timestamp(2015, 1, 27, 12, 30)), any());
|
||||||
verify(intentScheduler).schedule(timestamp(2015, 1, 26, 22, 30), null);
|
verify(intentScheduler).schedule(eq(timestamp(2015, 1, 26, 22, 30)), any());
|
||||||
verifyNoMoreInteractions(intentScheduler);
|
verifyNoMoreInteractions(intentScheduler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,15 +142,13 @@ public class ReminderSchedulerTest extends BaseAndroidTest
|
|||||||
long expectedCheckmarkTime,
|
long expectedCheckmarkTime,
|
||||||
long expectedReminderTime)
|
long expectedReminderTime)
|
||||||
{
|
{
|
||||||
when(pendingIntentFactory.showReminder(habit, expectedReminderTime,
|
PendingIntent intent =
|
||||||
expectedCheckmarkTime)).thenReturn(intent);
|
pendingIntentFactory.showReminder(habit, expectedReminderTime,
|
||||||
|
expectedCheckmarkTime);
|
||||||
|
|
||||||
reminderScheduler.schedule(habit, atTime);
|
reminderScheduler.schedule(habit, atTime);
|
||||||
|
|
||||||
verify(logger).logReminderScheduled(habit, expectedReminderTime);
|
verify(logger).logReminderScheduled(habit, expectedReminderTime);
|
||||||
|
|
||||||
verify(pendingIntentFactory).showReminder(habit, expectedReminderTime,
|
|
||||||
expectedCheckmarkTime);
|
|
||||||
verify(intentScheduler).schedule(expectedReminderTime, intent);
|
verify(intentScheduler).schedule(expectedReminderTime, intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,6 @@ import android.util.*;
|
|||||||
|
|
||||||
import org.isoron.androidbase.*;
|
import org.isoron.androidbase.*;
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.commands.*;
|
|
||||||
import org.isoron.uhabits.core.*;
|
import org.isoron.uhabits.core.*;
|
||||||
import org.isoron.uhabits.core.commands.*;
|
import org.isoron.uhabits.core.commands.*;
|
||||||
import org.isoron.uhabits.preferences.*;
|
import org.isoron.uhabits.preferences.*;
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 Álinson Santos Xavier <isoron@gmail.com>
|
||||||
|
*
|
||||||
|
* This file is part of Loop Habit Tracker.
|
||||||
|
*
|
||||||
|
* Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.isoron.uhabits;
|
||||||
|
|
||||||
|
import org.isoron.uhabits.core.commands.*;
|
||||||
|
import org.isoron.uhabits.core.models.*;
|
||||||
|
import org.isoron.uhabits.core.models.memory.*;
|
||||||
|
import org.isoron.uhabits.core.tasks.*;
|
||||||
|
import org.isoron.uhabits.core.test.*;
|
||||||
|
import org.isoron.uhabits.core.utils.*;
|
||||||
|
import org.junit.*;
|
||||||
|
import org.junit.runner.*;
|
||||||
|
import org.mockito.junit.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
|
public class BaseAndroidUnitTest
|
||||||
|
{
|
||||||
|
protected HabitList habitList;
|
||||||
|
|
||||||
|
protected HabitFixtures fixtures;
|
||||||
|
|
||||||
|
protected MemoryModelFactory modelFactory;
|
||||||
|
|
||||||
|
protected SingleThreadTaskRunner taskRunner;
|
||||||
|
|
||||||
|
protected CommandRunner commandRunner;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp()
|
||||||
|
{
|
||||||
|
long fixed_local_time = 1422172800000L;
|
||||||
|
DateUtils.setFixedLocalTime(fixed_local_time);
|
||||||
|
|
||||||
|
modelFactory = new MemoryModelFactory();
|
||||||
|
habitList = spy(modelFactory.buildHabitList());
|
||||||
|
fixtures = new HabitFixtures(modelFactory);
|
||||||
|
taskRunner = new SingleThreadTaskRunner();
|
||||||
|
commandRunner = new CommandRunner(taskRunner);
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown()
|
||||||
|
{
|
||||||
|
DateUtils.setFixedLocalTime(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long timestamp(int year, int month, int day)
|
||||||
|
{
|
||||||
|
GregorianCalendar cal = DateUtils.getStartOfTodayCalendar();
|
||||||
|
cal.set(year, month, day);
|
||||||
|
return cal.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void nothing()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,56 +23,36 @@ import android.view.*;
|
|||||||
|
|
||||||
import org.isoron.androidbase.activities.*;
|
import org.isoron.androidbase.activities.*;
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.activities.habits.list.model.*;
|
|
||||||
import org.isoron.uhabits.core.models.*;
|
|
||||||
import org.isoron.uhabits.core.ui.*;
|
import org.isoron.uhabits.core.ui.*;
|
||||||
import org.isoron.uhabits.core.ui.screens.habits.list.*;
|
import org.isoron.uhabits.core.ui.screens.habits.list.*;
|
||||||
import org.isoron.uhabits.preferences.*;
|
import org.isoron.uhabits.preferences.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.mockito.*;
|
|
||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class ListHabitsMenuTest extends BaseAndroidTest
|
public class ListHabitsMenuTest extends BaseAndroidUnitTest
|
||||||
{
|
{
|
||||||
private BaseActivity activity;
|
private BaseActivity activity;
|
||||||
|
|
||||||
private ListHabitsScreen screen;
|
|
||||||
|
|
||||||
private HabitCardListAdapter adapter;
|
|
||||||
|
|
||||||
private AndroidPreferences preferences;
|
private AndroidPreferences preferences;
|
||||||
|
|
||||||
private ThemeSwitcher themeSwitcher;
|
private ThemeSwitcher themeSwitcher;
|
||||||
|
|
||||||
private ListHabitsMenu menu;
|
private ListHabitsMenu menu;
|
||||||
|
|
||||||
private ArgumentCaptor<HabitMatcher> matcherCaptor;
|
|
||||||
|
|
||||||
private ListHabitsMenuBehavior behavior;
|
private ListHabitsMenuBehavior behavior;
|
||||||
|
|
||||||
|
@Before
|
||||||
@Override
|
@Override
|
||||||
public void setUp()
|
public void setUp()
|
||||||
{
|
{
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
activity = mock(BaseActivity.class);
|
activity = mock(BaseActivity.class);
|
||||||
screen = mock(ListHabitsScreen.class);
|
|
||||||
adapter = mock(HabitCardListAdapter.class);
|
|
||||||
preferences = mock(AndroidPreferences.class);
|
preferences = mock(AndroidPreferences.class);
|
||||||
themeSwitcher = mock(ThemeSwitcher.class);
|
themeSwitcher = mock(ThemeSwitcher.class);
|
||||||
behavior = mock(ListHabitsMenuBehavior.class);
|
behavior = mock(ListHabitsMenuBehavior.class);
|
||||||
|
|
||||||
when(preferences.getShowArchived()).thenReturn(false);
|
|
||||||
when(preferences.getShowCompleted()).thenReturn(false);
|
|
||||||
when(themeSwitcher.isNightMode()).thenReturn(false);
|
|
||||||
|
|
||||||
menu = new ListHabitsMenu(activity, preferences,
|
menu = new ListHabitsMenu(activity, preferences,
|
||||||
themeSwitcher, behavior);
|
themeSwitcher, behavior);
|
||||||
|
|
||||||
matcherCaptor = ArgumentCaptor.forClass(HabitMatcher.class);
|
|
||||||
|
|
||||||
reset(adapter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -89,84 +69,75 @@ public class ListHabitsMenuTest extends BaseAndroidTest
|
|||||||
when(androidMenu.findItem(R.id.actionHideCompleted)).thenReturn(
|
when(androidMenu.findItem(R.id.actionHideCompleted)).thenReturn(
|
||||||
hideCompletedItem);
|
hideCompletedItem);
|
||||||
|
|
||||||
|
when(preferences.getShowArchived()).thenReturn(false);
|
||||||
|
when(preferences.getShowCompleted()).thenReturn(false);
|
||||||
|
when(themeSwitcher.isNightMode()).thenReturn(false);
|
||||||
|
|
||||||
menu.onCreate(androidMenu);
|
menu.onCreate(androidMenu);
|
||||||
|
|
||||||
verify(nightModeItem).setChecked(false);
|
verify(nightModeItem).setChecked(false);
|
||||||
verify(hideArchivedItem).setChecked(true);
|
verify(hideArchivedItem).setChecked(true);
|
||||||
verify(hideCompletedItem).setChecked(true);
|
verify(hideCompletedItem).setChecked(true);
|
||||||
reset(nightModeItem, hideArchivedItem, hideCompletedItem);
|
reset(nightModeItem, hideArchivedItem, hideCompletedItem);
|
||||||
|
|
||||||
|
when(preferences.getShowArchived()).thenReturn(true);
|
||||||
|
when(preferences.getShowCompleted()).thenReturn(true);
|
||||||
when(themeSwitcher.isNightMode()).thenReturn(true);
|
when(themeSwitcher.isNightMode()).thenReturn(true);
|
||||||
|
|
||||||
menu.onCreate(androidMenu);
|
menu.onCreate(androidMenu);
|
||||||
|
|
||||||
verify(nightModeItem).setChecked(true);
|
verify(nightModeItem).setChecked(true);
|
||||||
|
verify(hideArchivedItem).setChecked(false);
|
||||||
|
verify(hideCompletedItem).setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_about()
|
public void testOnSelected_about()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionAbout);
|
onItemSelected(R.id.actionAbout);
|
||||||
verify(screen).showAboutScreen();
|
verify(behavior).onViewAbout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_add()
|
public void testOnSelected_add()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionAdd);
|
onItemSelected(R.id.actionAdd);
|
||||||
verify(screen).showCreateHabitScreen();
|
verify(behavior).onCreateHabit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_faq()
|
public void testOnSelected_faq()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionFAQ);
|
onItemSelected(R.id.actionFAQ);
|
||||||
verify(screen).showFAQScreen();
|
verify(behavior).onViewFAQ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_nightMode()
|
public void testOnSelected_nightMode()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionToggleNightMode);
|
onItemSelected(R.id.actionToggleNightMode);
|
||||||
verify(screen).applyTheme();
|
verify(behavior).onToggleNightMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_settings()
|
public void testOnSelected_settings()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionSettings);
|
onItemSelected(R.id.actionSettings);
|
||||||
verify(screen).showSettingsScreen();
|
verify(behavior).onViewSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_showArchived()
|
public void testOnSelected_showArchived()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionHideArchived);
|
onItemSelected(R.id.actionHideArchived);
|
||||||
verify(preferences).setShowArchived(true);
|
verify(behavior).onToggleShowArchived();
|
||||||
verify(adapter).setFilter(matcherCaptor.capture());
|
|
||||||
verify(adapter).refresh();
|
|
||||||
assertTrue(matcherCaptor.getValue().isArchivedAllowed());
|
|
||||||
reset(adapter);
|
|
||||||
|
|
||||||
onItemSelected(R.id.actionHideArchived);
|
|
||||||
verify(preferences).setShowArchived(false);
|
|
||||||
verify(adapter).setFilter(matcherCaptor.capture());
|
|
||||||
verify(adapter).refresh();
|
|
||||||
assertFalse(matcherCaptor.getValue().isArchivedAllowed());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOnSelected_showCompleted()
|
public void testOnSelected_showCompleted()
|
||||||
{
|
{
|
||||||
onItemSelected(R.id.actionHideCompleted);
|
onItemSelected(R.id.actionHideCompleted);
|
||||||
verify(preferences).setShowCompleted(true);
|
verify(behavior).onToggleShowCompleted();
|
||||||
verify(adapter).setFilter(matcherCaptor.capture());
|
|
||||||
verify(adapter).refresh();
|
|
||||||
assertTrue(matcherCaptor.getValue().isCompletedAllowed());
|
|
||||||
reset(adapter);
|
|
||||||
|
|
||||||
onItemSelected(R.id.actionHideCompleted);
|
|
||||||
verify(preferences).setShowCompleted(false);
|
|
||||||
verify(adapter).setFilter(matcherCaptor.capture());
|
|
||||||
verify(adapter).refresh();
|
|
||||||
assertFalse(matcherCaptor.getValue().isCompletedAllowed());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onItemSelected(int actionId)
|
protected void onItemSelected(int actionId)
|
||||||
@@ -26,24 +26,26 @@ import org.isoron.androidbase.activities.*;
|
|||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.activities.common.dialogs.*;
|
import org.isoron.uhabits.activities.common.dialogs.*;
|
||||||
import org.isoron.uhabits.activities.habits.edit.*;
|
import org.isoron.uhabits.activities.habits.edit.*;
|
||||||
import org.isoron.uhabits.commands.*;
|
|
||||||
import org.isoron.uhabits.core.commands.*;
|
import org.isoron.uhabits.core.commands.*;
|
||||||
import org.isoron.uhabits.intents.*;
|
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.isoron.uhabits.core.ui.*;
|
import org.isoron.uhabits.core.ui.*;
|
||||||
import org.isoron.uhabits.core.ui.callbacks.*;
|
import org.isoron.uhabits.core.ui.callbacks.*;
|
||||||
|
import org.isoron.uhabits.intents.*;
|
||||||
import org.isoron.uhabits.preferences.*;
|
import org.isoron.uhabits.preferences.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
import org.junit.runners.*;
|
import org.mockito.junit.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.isoron.uhabits.activities.habits.list.ListHabitsScreen.*;
|
import static org.isoron.uhabits.activities.habits.list.ListHabitsScreen.*;
|
||||||
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
|
import static org.mockito.Mockito.any;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
import static org.mockito.Mockito.eq;
|
||||||
|
|
||||||
@RunWith(JUnit4.class)
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class ListHabitsScreenTest extends BaseAndroidTest
|
public class ListHabitsScreenTest
|
||||||
{
|
{
|
||||||
private BaseActivity activity;
|
private BaseActivity activity;
|
||||||
|
|
||||||
@@ -74,12 +76,9 @@ public class ListHabitsScreenTest extends BaseAndroidTest
|
|||||||
private CommandParser commandParser;
|
private CommandParser commandParser;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@Override
|
|
||||||
public void setUp()
|
public void setUp()
|
||||||
{
|
{
|
||||||
super.setUp();
|
activity = mock(ListHabitsActivity.class);
|
||||||
|
|
||||||
activity = mock(BaseActivity.class);
|
|
||||||
commandRunner = mock(CommandRunner.class);
|
commandRunner = mock(CommandRunner.class);
|
||||||
rootView = mock(ListHabitsRootView.class);
|
rootView = mock(ListHabitsRootView.class);
|
||||||
intentFactory = mock(IntentFactory.class);
|
intentFactory = mock(IntentFactory.class);
|
||||||
@@ -99,7 +98,7 @@ public class ListHabitsScreenTest extends BaseAndroidTest
|
|||||||
controller = mock(ListHabitsController.class);
|
controller = mock(ListHabitsController.class);
|
||||||
screen.setController(controller);
|
screen.setController(controller);
|
||||||
|
|
||||||
habit = fixtures.createEmptyHabit();
|
habit = mock(Habit.class);
|
||||||
intent = mock(Intent.class);
|
intent = mock(Intent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +123,7 @@ public class ListHabitsScreenTest extends BaseAndroidTest
|
|||||||
@Test
|
@Test
|
||||||
public void testOnCommand()
|
public void testOnCommand()
|
||||||
{
|
{
|
||||||
Command c = mock(Command.class);
|
Command c = mock(DeleteHabitsCommand.class);
|
||||||
screen.onCommandExecuted(c, null);
|
screen.onCommandExecuted(c, null);
|
||||||
verify(screen).showMessage(R.string.toast_habit_deleted);
|
verify(screen).showMessage(R.string.toast_habit_deleted);
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ import org.junit.*;
|
|||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class CheckmarkButtonControllerTest extends BaseAndroidTest
|
public class CheckmarkButtonControllerTest extends BaseAndroidUnitTest
|
||||||
{
|
{
|
||||||
private CheckmarkButtonController controller;
|
private CheckmarkButtonController controller;
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ import org.junit.*;
|
|||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class HabitCardControllerTest extends BaseAndroidTest
|
public class HabitCardControllerTest extends BaseAndroidUnitTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private Habit habit;
|
private Habit habit;
|
||||||
@@ -29,7 +29,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class HabitCardListControllerTest extends BaseAndroidTest
|
public class HabitCardListControllerTest extends BaseAndroidUnitTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private LinkedList<Habit> habits;
|
private LinkedList<Habit> habits;
|
||||||
@@ -66,6 +66,7 @@ public class HabitCardListControllerTest extends BaseAndroidTest
|
|||||||
|
|
||||||
resetMocks();
|
resetMocks();
|
||||||
|
|
||||||
|
when(adapter.getObservable()).thenReturn(new ModelObservable());
|
||||||
this.controller = new HabitCardListController(adapter);
|
this.controller = new HabitCardListController(adapter);
|
||||||
controller.setHabitListener(habitListener);
|
controller.setHabitListener(habitListener);
|
||||||
controller.setSelectionListener(selectionListener);
|
controller.setSelectionListener(selectionListener);
|
||||||
@@ -29,7 +29,7 @@ import org.junit.*;
|
|||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class ReminderControllerTest extends BaseAndroidTest
|
public class ReminderControllerTest extends BaseAndroidUnitTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private ReminderController controller;
|
private ReminderController controller;
|
||||||
@@ -32,7 +32,7 @@ import static org.hamcrest.core.IsEqual.*;
|
|||||||
import static org.isoron.uhabits.core.models.Checkmark.*;
|
import static org.isoron.uhabits.core.models.Checkmark.*;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class WidgetControllerTest extends BaseAndroidTest
|
public class WidgetControllerTest extends BaseAndroidUnitTest
|
||||||
{
|
{
|
||||||
private WidgetBehavior controller;
|
private WidgetBehavior controller;
|
||||||
|
|
||||||
@@ -51,7 +51,6 @@ public class WidgetControllerTest extends BaseAndroidTest
|
|||||||
|
|
||||||
today = DateUtils.getStartOfToday();
|
today = DateUtils.getStartOfToday();
|
||||||
habit = fixtures.createEmptyHabit();
|
habit = fixtures.createEmptyHabit();
|
||||||
habitList.add(habit);
|
|
||||||
commandRunner = mock(CommandRunner.class);
|
commandRunner = mock(CommandRunner.class);
|
||||||
notificationTray = mock(AndroidNotificationTray.class);
|
notificationTray = mock(AndroidNotificationTray.class);
|
||||||
controller = new WidgetBehavior(commandRunner, notificationTray);
|
controller = new WidgetBehavior(commandRunner, notificationTray);
|
||||||
@@ -73,7 +72,7 @@ public class WidgetControllerTest extends BaseAndroidTest
|
|||||||
int todayValue = habit.getCheckmarks().getTodayValue();
|
int todayValue = habit.getCheckmarks().getTodayValue();
|
||||||
assertThat(todayValue, equalTo(UNCHECKED));
|
assertThat(todayValue, equalTo(UNCHECKED));
|
||||||
controller.onAddRepetition(habit, today);
|
controller.onAddRepetition(habit, today);
|
||||||
verify(commandRunner).execute(any(), anyLong());
|
verify(commandRunner).execute(any(), isNull());
|
||||||
verify(notificationTray).cancel(habit);
|
verify(notificationTray).cancel(habit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +83,7 @@ public class WidgetControllerTest extends BaseAndroidTest
|
|||||||
int todayValue = habit.getCheckmarks().getTodayValue();
|
int todayValue = habit.getCheckmarks().getTodayValue();
|
||||||
assertThat(todayValue, equalTo(CHECKED_EXPLICITLY));
|
assertThat(todayValue, equalTo(CHECKED_EXPLICITLY));
|
||||||
controller.onRemoveRepetition(habit, today);
|
controller.onRemoveRepetition(habit, today);
|
||||||
verify(commandRunner).execute(any(), anyLong());
|
verify(commandRunner).execute(any(), isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -100,6 +99,6 @@ public class WidgetControllerTest extends BaseAndroidTest
|
|||||||
public void testOnToggleRepetition() throws Exception
|
public void testOnToggleRepetition() throws Exception
|
||||||
{
|
{
|
||||||
controller.onToggleRepetition(habit, today);
|
controller.onToggleRepetition(habit, today);
|
||||||
verify(commandRunner).execute(any(), anyLong());
|
verify(commandRunner).execute(any(), isNull());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,13 +49,6 @@ public class ArchiveHabitsCommand extends Command
|
|||||||
habitList.update(selected);
|
habitList.update(selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo()
|
|
||||||
{
|
|
||||||
for (Habit h : selected) h.setArchived(false);
|
|
||||||
habitList.update(selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Record toRecord()
|
public Record toRecord()
|
||||||
@@ -63,6 +56,13 @@ public class ArchiveHabitsCommand extends Command
|
|||||||
return new Record(this);
|
return new Record(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void undo()
|
||||||
|
{
|
||||||
|
for (Habit h : selected) h.setArchived(false);
|
||||||
|
habitList.update(selected);
|
||||||
|
}
|
||||||
|
|
||||||
public static class Record
|
public static class Record
|
||||||
{
|
{
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|||||||
@@ -17,15 +17,13 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.commands;
|
package org.isoron.uhabits.core.commands;
|
||||||
|
|
||||||
import android.support.annotation.*;
|
import android.support.annotation.*;
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
|
|
||||||
import org.isoron.uhabits.core.commands.*;
|
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.json.*;
|
|
||||||
|
|
||||||
import javax.inject.*;
|
import javax.inject.*;
|
||||||
|
|
||||||
@@ -44,9 +42,10 @@ public class CommandParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public Command parse(@NonNull String json) throws JSONException
|
public Command parse(@NonNull String json)
|
||||||
{
|
{
|
||||||
String event = new JSONObject(json).getString("event");
|
JsonObject parsed = new JsonParser().parse(json).getAsJsonObject();
|
||||||
|
String event = parsed.get("event").getAsString();
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
|
|
||||||
if (event.equals("Archive")) return gson
|
if (event.equals("Archive")) return gson
|
||||||
@@ -17,8 +17,9 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.core.models;
|
package org.isoron.uhabits.core.test;
|
||||||
|
|
||||||
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.isoron.uhabits.core.utils.*;
|
import org.isoron.uhabits.core.utils.*;
|
||||||
|
|
||||||
public class HabitFixtures
|
public class HabitFixtures
|
||||||
@@ -23,6 +23,7 @@ import org.isoron.uhabits.core.commands.*;
|
|||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.isoron.uhabits.core.models.memory.*;
|
import org.isoron.uhabits.core.models.memory.*;
|
||||||
import org.isoron.uhabits.core.tasks.*;
|
import org.isoron.uhabits.core.tasks.*;
|
||||||
|
import org.isoron.uhabits.core.test.*;
|
||||||
import org.isoron.uhabits.core.utils.*;
|
import org.isoron.uhabits.core.utils.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import android.support.annotation.*;
|
|||||||
|
|
||||||
import org.hamcrest.*;
|
import org.hamcrest.*;
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.commands.*;
|
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.json.*;
|
import org.json.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
@@ -32,7 +31,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
public class CommandParserTest extends BaseAndroidTest
|
public class CommandParserTest extends BaseUnitTest
|
||||||
{
|
{
|
||||||
@NonNull
|
@NonNull
|
||||||
private CommandParser parser;
|
private CommandParser parser;
|
||||||
Reference in New Issue
Block a user