Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[22682] TripKitUI submodule and all modules inside refactoring #478

Merged
merged 26 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class RoutingResponse {
</DIRECTION></DIRECTION> */
@JvmStatic
fun processDirectionTemplate(
serviceDirectionNode: JsonPrimitive,
serviceDirectionNode: JsonPrimitive?,
notes: String,
resources: Resources?
): String {
Expand All @@ -323,7 +323,7 @@ class RoutingResponse {
}

if (!isElementMissing(serviceDirectionNode)) {
val serviceDirection = serviceDirectionNode.asString
val serviceDirection = serviceDirectionNode?.asString
notes = if (!TextUtils.isEmpty(serviceDirection)) {
notes.replace(
SegmentNotesTemplates.TEMPLATE_DIRECTION,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.skedgo.tripkit

import androidx.test.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.skedgo.tripkit.geocoding.ReverseGeocodable
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class AndroidGeocoderTest {
private var factory: ReverseGeocodable? = null

@Before
fun before() {
factory = AndroidGeocoder(InstrumentationRegistry.getInstrumentation().targetContext)
}

/* This test may fail if devices don't have network. */
@Test
fun reverseGeocodeInCA() {
val subscriber = factory!!.getAddress(33.956252, -118.217896).test()
subscriber.awaitTerminalEvent()
subscriber.assertNoErrors()
subscriber.assertValue("8677 Evergreen Ave, South Gate, CA 90280, USA")
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.skedgo.tripkit

import android.content.Context
import androidx.test.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.skedgo.sqlite.DatabaseTable
import junit.framework.Assert
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class RegionDatabaseHelperTest {
private var databaseHelper: RegionDatabaseHelper? = null
private var databaseName: String? = null
private var context: Context? = null

@Before
fun before() {
databaseName = RegionDatabaseHelperTest::class.java.simpleName
context = InstrumentationRegistry.getInstrumentation().targetContext
databaseHelper = RegionDatabaseHelper(
context,
databaseName
)

// To trigger table creation.
databaseHelper!!.readableDatabase.close()
}

@Test
fun RegionsTableExists() {
checkTable(Tables.REGIONS)
}

@Test
fun TransportModesTableExists() {
checkTable(Tables.TRANSPORT_MODES)
}

@After
fun after() {
databaseHelper?.close()
val databasePath = context!!.getDatabasePath(databaseName)
Assert.assertTrue(databasePath.delete())
}

private fun checkTable(table: DatabaseTable) {
val database = databaseHelper!!.readableDatabase
val cursor = database.rawQuery("SELECT * FROM " + table.name, null)
cursor.close()
database.close()
}
}
148 changes: 0 additions & 148 deletions TripKitAndroid/src/main/java/com/skedgo/TripKit.java

This file was deleted.

Loading
Loading