diff --git a/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/CommonSteps.kt b/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/CommonSteps.kt index e7978c977..4a89cc748 100644 --- a/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/CommonSteps.kt +++ b/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/CommonSteps.kt @@ -20,7 +20,6 @@ package org.isoron.uhabits.acceptance.steps import android.os.Build import android.os.Build.VERSION.SDK_INT -import android.os.Build.VERSION_CODES import androidx.annotation.StringRes import androidx.recyclerview.widget.RecyclerView import androidx.test.espresso.Espresso @@ -33,11 +32,11 @@ import androidx.test.espresso.matcher.ViewMatchers import androidx.test.uiautomator.By import androidx.test.uiautomator.UiSelector import androidx.test.uiautomator.Until -import junit.framework.Assert.assertTrue import org.hamcrest.CoreMatchers import org.isoron.uhabits.BaseUserInterfaceTest import org.isoron.uhabits.R import org.isoron.uhabits.activities.habits.list.ListHabitsActivity +import org.junit.Assert.assertTrue object CommonSteps : BaseUserInterfaceTest() { fun pressBack() { @@ -148,15 +147,19 @@ object CommonSteps : BaseUserInterfaceTest() { Screen.LIST_HABITS -> Espresso.onView(ViewMatchers.withClassName(CoreMatchers.endsWith("ListHabitsRootView"))) .check(ViewAssertions.matches(ViewMatchers.isDisplayed())) + Screen.SHOW_HABIT -> Espresso.onView(ViewMatchers.withId(R.id.subtitleCard)) .check(ViewAssertions.matches(ViewMatchers.isDisplayed())) + Screen.EDIT_HABIT -> Espresso.onView(ViewMatchers.withId(R.id.questionInput)) .check(ViewAssertions.matches(ViewMatchers.isDisplayed())) + Screen.SELECT_HABIT_TYPE -> Espresso.onView(ViewMatchers.withText(R.string.yes_or_no_example)) .check(ViewAssertions.matches(ViewMatchers.isDisplayed())) + else -> throw IllegalStateException() } } diff --git a/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/WidgetSteps.kt b/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/WidgetSteps.kt index 46efe525a..b859e1868 100644 --- a/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/WidgetSteps.kt +++ b/uhabits-android/src/androidTest/java/org/isoron/uhabits/acceptance/steps/WidgetSteps.kt @@ -21,9 +21,9 @@ package org.isoron.uhabits.acceptance.steps import android.os.Build.VERSION.SDK_INT import androidx.test.uiautomator.UiScrollable import androidx.test.uiautomator.UiSelector -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.isoron.uhabits.BaseUserInterfaceTest +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue object WidgetSteps { @Throws(Exception::class) diff --git a/uhabits-core/src/jvmMain/java/org/isoron/platform/io/JavaFiles.kt b/uhabits-core/src/jvmMain/java/org/isoron/platform/io/JavaFiles.kt index 1af817835..ff5f4427a 100644 --- a/uhabits-core/src/jvmMain/java/org/isoron/platform/io/JavaFiles.kt +++ b/uhabits-core/src/jvmMain/java/org/isoron/platform/io/JavaFiles.kt @@ -82,8 +82,8 @@ class JavaUserFile(val path: Path) : UserFile { @Suppress("NewApi") class JavaFileOpener : FileOpener { override fun openUserFile(path: String): UserFile { - val path = Paths.get("/tmp/$path") - return JavaUserFile(path) + val resolvedPath = Paths.get("/tmp/$path") + return JavaUserFile(resolvedPath) } override fun openResourceFile(path: String): ResourceFile { diff --git a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/database/SQLParser.kt b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/database/SQLParser.kt index 3e4f2eb38..5f609241a 100644 --- a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/database/SQLParser.kt +++ b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/database/SQLParser.kt @@ -45,14 +45,14 @@ internal class Tokenizer( if (s == null || s.isEmpty()) { return false } - if (s[0].toInt() != mCurrent) { + if (s[0].code != mCurrent) { return false } val len = s.length mStream.mark(len - 1) for (n in 1 until len) { val value = mStream.read() - if (value != s[n].toInt()) { + if (value != s[n].code) { mStream.reset() return false } @@ -68,10 +68,9 @@ object SQLParser { private const val STATE_COMMENT_BLOCK = 3 fun parse(stream: InputStream): List { - val buffer = BufferedInputStream(stream) val commands: MutableList = ArrayList() val sb = StringBuffer() - buffer.use { buffer -> + BufferedInputStream(stream).use { buffer -> val tokenizer = Tokenizer(buffer) var state = STATE_NONE while (tokenizer.hasNext()) { diff --git a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/tasks/Task.kt b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/tasks/Task.kt index 13492b834..8aae0e5f7 100644 --- a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/tasks/Task.kt +++ b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/tasks/Task.kt @@ -25,5 +25,5 @@ fun interface Task { fun onAttached(runner: TaskRunner) {} fun onPostExecute() {} fun onPreExecute() {} - fun onProgressUpdate(value: Int) {} + fun onProgressUpdate(currentPosition: Int) {} } diff --git a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/ui/views/HabitListHeader.kt b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/ui/views/HabitListHeader.kt index d3c8a5395..e51c11607 100644 --- a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/ui/views/HabitListHeader.kt +++ b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/ui/views/HabitListHeader.kt @@ -49,7 +49,7 @@ class HabitListHeader( repeat(nButtons) { index -> val date = today.minus(nButtons - index - 1) - val name = fmt.shortWeekdayName(date).toUpperCase() + val name = fmt.shortWeekdayName(date).uppercase() val number = date.day.toString() val x = width - (index + 1) * buttonSize + buttonSize / 2 diff --git a/uhabits-core/src/jvmTest/java/org/isoron/platform/gui/JavaCanvasTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/platform/gui/JavaCanvasTest.kt index 8d2745d55..5c219ba07 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/platform/gui/JavaCanvasTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/platform/gui/JavaCanvasTest.kt @@ -19,9 +19,9 @@ package org.isoron.platform.gui -import junit.framework.Assert.fail import kotlinx.coroutines.runBlocking import org.isoron.platform.io.JavaFileOpener +import org.junit.Assert.fail import org.junit.Test import java.awt.image.BufferedImage import java.awt.image.BufferedImage.TYPE_INT_ARGB diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/ArchiveHabitsCommandTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/ArchiveHabitsCommandTest.kt index 05b9e1605..3baa726b3 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/ArchiveHabitsCommandTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/ArchiveHabitsCommandTest.kt @@ -18,12 +18,12 @@ */ package org.isoron.uhabits.core.commands -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.isoron.uhabits.core.BaseUnitTest import org.isoron.uhabits.core.models.Habit import org.junit.Before import org.junit.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue class ArchiveHabitsCommandTest : BaseUnitTest() { private lateinit var command: ArchiveHabitsCommand diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateHabitCommandTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateHabitCommandTest.kt index f5d7f3fc0..795e0468b 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateHabitCommandTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateHabitCommandTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.commands -import junit.framework.Assert.assertTrue import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.core.BaseUnitTest @@ -27,6 +26,7 @@ import org.isoron.uhabits.core.models.Reminder import org.isoron.uhabits.core.models.WeekdayList import org.junit.Before import org.junit.Test +import kotlin.test.assertTrue class CreateHabitCommandTest : BaseUnitTest() { private lateinit var command: CreateHabitCommand diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateRepetitionCommandTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateRepetitionCommandTest.kt index bc5c234d5..02ec5958a 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateRepetitionCommandTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/CreateRepetitionCommandTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.commands -import junit.framework.Assert.assertEquals import org.isoron.uhabits.core.BaseUnitTest import org.isoron.uhabits.core.models.Entry import org.isoron.uhabits.core.models.Habit @@ -26,6 +25,7 @@ import org.isoron.uhabits.core.models.Timestamp import org.isoron.uhabits.core.utils.DateUtils.Companion.getToday import org.junit.Before import org.junit.Test +import kotlin.test.assertEquals class CreateRepetitionCommandTest : BaseUnitTest() { private lateinit var command: CreateRepetitionCommand diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/UnarchiveHabitsCommandTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/UnarchiveHabitsCommandTest.kt index cf334e767..c8abb85d9 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/UnarchiveHabitsCommandTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/commands/UnarchiveHabitsCommandTest.kt @@ -18,12 +18,12 @@ */ package org.isoron.uhabits.core.commands -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.isoron.uhabits.core.BaseUnitTest import org.isoron.uhabits.core.models.Habit import org.junit.Before import org.junit.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue class UnarchiveHabitsCommandTest : BaseUnitTest() { private lateinit var command: UnarchiveHabitsCommand diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/database/RepositoryTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/database/RepositoryTest.kt index 30c79d700..b5c3109c9 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/database/RepositoryTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/database/RepositoryTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.database -import junit.framework.Assert.assertNull import org.apache.commons.lang3.builder.EqualsBuilder import org.apache.commons.lang3.builder.HashCodeBuilder import org.apache.commons.lang3.builder.ToStringBuilder @@ -27,6 +26,7 @@ import org.hamcrest.core.IsEqual.equalTo import org.isoron.uhabits.core.BaseUnitTest import org.junit.Before import org.junit.Test +import kotlin.test.assertNull class RepositoryTest : BaseUnitTest() { private lateinit var repository: Repository diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/HabitsCSVExporterTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/HabitsCSVExporterTest.kt index c56bfe622..bbe069be8 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/HabitsCSVExporterTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/HabitsCSVExporterTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.io -import junit.framework.Assert.assertTrue import org.apache.commons.io.FileUtils import org.apache.commons.io.IOUtils import org.isoron.uhabits.core.BaseUnitTest @@ -29,8 +28,9 @@ import java.io.File import java.io.FileOutputStream import java.io.IOException import java.nio.file.Files -import java.util.LinkedList +import java.util.* import java.util.zip.ZipFile +import kotlin.test.assertTrue class HabitsCSVExporterTest : BaseUnitTest() { private lateinit var baseDir: File @@ -102,9 +102,8 @@ class HabitsCSVExporterTest : BaseUnitTest() { private fun assertAbsolutePathExists(s: String) { val file = File(s) assertTrue( - String.format("File %s should exist", file.absolutePath), - file.exists() - ) + String.format("File %s should exist", file.absolutePath) + ) { file.exists() } } private fun assertFileAndReferenceAreEqual(s: String) { diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/ImportTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/ImportTest.kt index 9c53d149c..af5f9d5a5 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/ImportTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/io/ImportTest.kt @@ -18,8 +18,6 @@ */ package org.isoron.uhabits.core.io -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.core.IsEqual.equalTo import org.isoron.uhabits.core.BaseUnitTest @@ -34,6 +32,8 @@ import org.junit.Before import org.junit.Test import java.io.File import java.io.IOException +import kotlin.test.assertFalse +import kotlin.test.assertTrue class ImportTest : BaseUnitTest() { @Before diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitListTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitListTest.kt index 6b591cdb6..82f8d2c24 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitListTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitListTest.kt @@ -18,9 +18,6 @@ */ package org.isoron.uhabits.core.models -import junit.framework.Assert.assertEquals -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertNull import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.CoreMatchers.not import org.hamcrest.MatcherAssert.assertThat @@ -31,6 +28,9 @@ import org.junit.rules.ExpectedException import java.io.IOException import java.io.StringWriter import java.util.ArrayList +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertNull class HabitListTest : BaseUnitTest() { @get:Rule diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitTest.kt index da568adf2..df06d3d2c 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/HabitTest.kt @@ -18,17 +18,18 @@ */ package org.isoron.uhabits.core.models -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.hamcrest.CoreMatchers.`is` +import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.core.IsEqual.equalTo import org.isoron.uhabits.core.BaseUnitTest import org.isoron.uhabits.core.utils.DateUtils.Companion.getToday import org.junit.Assert.assertNotEquals -import org.junit.Assert.assertThat import org.junit.Rule import org.junit.Test import org.junit.rules.ExpectedException +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue class HabitTest : BaseUnitTest() { @get:Rule @@ -55,7 +56,7 @@ class HabitTest : BaseUnitTest() { model.reminder = Reminder(8, 30, WeekdayList(1)) val habit = modelFactory.buildHabit() habit.copyFrom(model) - assertTrue(habit.isArchived == model.isArchived) + assertEquals(habit.isArchived, model.isArchived) assertThat(habit.isArchived, `is`(model.isArchived)) assertThat(habit.color, `is`(model.color)) assertThat(habit.frequency, equalTo(model.frequency)) diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/ScoreListTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/ScoreListTest.kt index 622e1d116..9b653cd4a 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/ScoreListTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/ScoreListTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.models -import junit.framework.Assert.assertTrue import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.number.IsCloseTo import org.hamcrest.number.OrderingComparison @@ -28,6 +27,7 @@ import org.isoron.uhabits.core.utils.DateUtils.Companion.getToday import org.junit.Before import org.junit.Test import java.util.ArrayList +import kotlin.test.assertTrue open class BaseScoreListTest : BaseUnitTest() { protected lateinit var habit: Habit diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/TimestampTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/TimestampTest.kt index 8296528b7..690a61f80 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/TimestampTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/TimestampTest.kt @@ -18,8 +18,6 @@ */ package org.isoron.uhabits.core.models -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.greaterThan @@ -27,6 +25,8 @@ import org.hamcrest.Matchers.lessThan import org.isoron.uhabits.core.BaseUnitTest import org.isoron.uhabits.core.utils.DateUtils.Companion.getToday import org.junit.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue class TimestampTest : BaseUnitTest() { @Test diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/WeekdayListTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/WeekdayListTest.kt index 9d622d540..5f9dcc07d 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/WeekdayListTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/WeekdayListTest.kt @@ -18,12 +18,12 @@ */ package org.isoron.uhabits.core.models -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.core.BaseUnitTest import org.junit.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue class WeekdayListTest : BaseUnitTest() { @Test diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteEntryListTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteEntryListTest.kt index 9f2457fb6..0ee7a8dda 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteEntryListTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteEntryListTest.kt @@ -19,8 +19,6 @@ package org.isoron.uhabits.core.models.sqlite -import junit.framework.Assert.assertEquals -import junit.framework.Assert.assertNull import org.isoron.uhabits.core.BaseUnitTest.Companion.buildMemoryDatabase import org.isoron.uhabits.core.database.Repository import org.isoron.uhabits.core.models.Entry @@ -30,6 +28,8 @@ import org.isoron.uhabits.core.models.sqlite.records.EntryRecord import org.isoron.uhabits.core.utils.DateUtils import org.junit.Before import org.junit.Test +import kotlin.test.assertEquals +import kotlin.test.assertNull class SQLiteEntryListTest { diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteHabitListTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteHabitListTest.kt index c6cb93ec8..a3101a5d5 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteHabitListTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/models/sqlite/SQLiteHabitListTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.models.sqlite -import junit.framework.Assert.assertNull import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.core.BaseUnitTest @@ -38,6 +37,7 @@ import org.junit.rules.ExpectedException import org.mockito.kotlin.mock import org.mockito.kotlin.verify import java.util.ArrayList +import kotlin.test.assertNull class SQLiteHabitListTest : BaseUnitTest() { @get:Rule diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PreferencesTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PreferencesTest.kt index 2f54ac25a..1dd2eace4 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PreferencesTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PreferencesTest.kt @@ -18,9 +18,6 @@ */ package org.isoron.uhabits.core.preferences -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertNull -import junit.framework.Assert.assertTrue import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.core.BaseUnitTest @@ -31,6 +28,9 @@ import org.junit.Before import org.junit.Test import org.mockito.kotlin.mock import java.io.File +import kotlin.test.assertFalse +import kotlin.test.assertNull +import kotlin.test.assertTrue class PreferencesTest : BaseUnitTest() { private lateinit var prefs: Preferences diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PropertiesStorageTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PropertiesStorageTest.kt index 65066b916..2d65b4477 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PropertiesStorageTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/preferences/PropertiesStorageTest.kt @@ -18,9 +18,6 @@ */ package org.isoron.uhabits.core.preferences -import junit.framework.Assert.assertEquals -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.core.BaseUnitTest @@ -28,6 +25,9 @@ import org.junit.Before import org.junit.Test import java.io.File import java.util.Arrays +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue class PropertiesStorageTest : BaseUnitTest() { private lateinit var storage: PropertiesStorage diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/HintListTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/HintListTest.kt index b420604b8..6efeb19de 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/HintListTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/HintListTest.kt @@ -18,9 +18,6 @@ */ package org.isoron.uhabits.core.ui.screens.habits.list -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertNull -import junit.framework.Assert.assertTrue import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.isoron.uhabits.core.BaseUnitTest @@ -31,6 +28,9 @@ import org.junit.Test import org.mockito.kotlin.mock import org.mockito.kotlin.verify import org.mockito.kotlin.whenever +import kotlin.test.assertFalse +import kotlin.test.assertNull +import kotlin.test.assertTrue class HintListTest : BaseUnitTest() { private lateinit var hintList: HintList diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsBehaviorTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsBehaviorTest.kt index 6926b4384..ead82c1e9 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsBehaviorTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsBehaviorTest.kt @@ -18,8 +18,6 @@ */ package org.isoron.uhabits.core.ui.screens.habits.list -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.apache.commons.io.FileUtils import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.core.IsEqual.equalTo @@ -41,6 +39,8 @@ import org.mockito.kotlin.verify import org.mockito.kotlin.whenever import java.io.IOException import java.nio.file.Files +import kotlin.test.assertFalse +import kotlin.test.assertTrue class ListHabitsBehaviorTest : BaseUnitTest() { private val dirFinder: ListHabitsBehavior.DirFinder = mock() diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.kt index 466daa304..5ac679862 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.kt @@ -18,8 +18,6 @@ */ package org.isoron.uhabits.core.ui.screens.habits.list -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.isoron.uhabits.core.BaseUnitTest @@ -37,6 +35,8 @@ import org.mockito.kotlin.never import org.mockito.kotlin.verify import org.mockito.kotlin.verifyNoMoreInteractions import org.mockito.kotlin.whenever +import kotlin.test.assertFalse +import kotlin.test.assertTrue class ListHabitsMenuBehaviorTest : BaseUnitTest() { private lateinit var behavior: ListHabitsMenuBehavior diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsSelectionMenuBehaviorTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsSelectionMenuBehaviorTest.kt index b67a43d8e..b60ee037c 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsSelectionMenuBehaviorTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsSelectionMenuBehaviorTest.kt @@ -18,9 +18,6 @@ */ package org.isoron.uhabits.core.ui.screens.habits.list -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertNull -import junit.framework.Assert.assertTrue import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.isoron.uhabits.core.BaseUnitTest @@ -35,6 +32,9 @@ import org.mockito.kotlin.eq import org.mockito.kotlin.mock import org.mockito.kotlin.verify import org.mockito.kotlin.whenever +import kotlin.test.assertFalse +import kotlin.test.assertNull +import kotlin.test.assertTrue class ListHabitsSelectionMenuBehaviorTest : BaseUnitTest() { private val screen: ListHabitsSelectionMenuBehavior.Screen = mock() diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/utils/DateUtilsTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/utils/DateUtilsTest.kt index 22b6e0057..19534a5bd 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/utils/DateUtilsTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/utils/DateUtilsTest.kt @@ -18,7 +18,6 @@ */ package org.isoron.uhabits.core.utils -import junit.framework.Assert.assertEquals import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.core.IsEqual.equalTo import org.isoron.uhabits.core.BaseUnitTest @@ -40,6 +39,7 @@ import java.util.Calendar import java.util.GregorianCalendar import java.util.Locale import java.util.TimeZone +import kotlin.test.assertEquals class DateUtilsTest : BaseUnitTest() { var firstWeekday = Calendar.SUNDAY