From 2940e85f85b63f0fb2c7d6b60209535cab313d6d Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 11:10:39 +0100 Subject: [PATCH 1/7] Update ical4j dependency --- gradle/libs.versions.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9f298b7a..1159f3d5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,8 +8,7 @@ androidx-test-runner = "1.7.0" dokka = "2.1.0" ezvcard = "0.12.2" guava = "33.5.0-android" -# noinspection NewerVersionAvailable -ical4j = "3.2.19" # final version; update to 4.x will require much work +ical4j = "4.2.3" junit = "4.13.2" kotlin = "2.3.10" mockk = "1.14.9" From 65eb0448aed423ca1352b50a4547200c4fbd76b5 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 11:23:40 +0100 Subject: [PATCH 2/7] Make at.bitfire.ical4android package compile again --- .../AndroidCompatTimeZoneRegistry.kt | 13 +- .../at/bitfire/ical4android/ICalendar.kt | 41 +++--- .../at/bitfire/ical4android/JtxCollection.kt | 8 +- .../at/bitfire/ical4android/JtxICalObject.kt | 120 ++++-------------- .../kotlin/at/bitfire/ical4android/Task.kt | 18 +-- .../at/bitfire/ical4android/TaskReader.kt | 35 +---- .../at/bitfire/ical4android/TaskWriter.kt | 32 +---- .../bitfire/ical4android/UnknownProperty.kt | 6 +- .../at/bitfire/ical4android/util/DateUtils.kt | 13 +- .../main/kotlin/at/techbee/jtx/JtxContract.kt | 27 ++-- 10 files changed, 95 insertions(+), 218 deletions(-) diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistry.kt b/lib/src/main/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistry.kt index 4d71c40b..97a4e907 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistry.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistry.kt @@ -6,17 +6,13 @@ package at.bitfire.ical4android -import java.time.ZoneId -import java.util.logging.Logger import net.fortuna.ical4j.model.DefaultTimeZoneRegistryFactory -import net.fortuna.ical4j.model.Property -import net.fortuna.ical4j.model.PropertyList import net.fortuna.ical4j.model.TimeZone import net.fortuna.ical4j.model.TimeZoneRegistry import net.fortuna.ical4j.model.TimeZoneRegistryFactory import net.fortuna.ical4j.model.TimeZoneRegistryImpl -import net.fortuna.ical4j.model.component.VTimeZone -import net.fortuna.ical4j.model.property.TzId +import java.time.ZoneId +import java.util.logging.Logger /** * Wrapper around default [TimeZoneRegistry] that uses the Android name if a time zone has a @@ -78,12 +74,13 @@ class AndroidCompatTimeZoneRegistry( // create a copy of the VTIMEZONE so that we don't modify the original registry values (which are not immutable) val vTimeZone = tz.vTimeZone - val newVTimeZoneProperties = PropertyList() + TODO("ical4j 4.x") + /*val newVTimeZoneProperties = PropertyList() newVTimeZoneProperties += TzId(androidTzId) return TimeZone(VTimeZone( newVTimeZoneProperties, vTimeZone.observances - )) + ))*/ } else return tz } diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/ICalendar.kt b/lib/src/main/kotlin/at/bitfire/ical4android/ICalendar.kt index 36fdfbb7..0a85a361 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/ICalendar.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/ICalendar.kt @@ -11,31 +11,17 @@ import at.bitfire.synctools.BuildConfig import at.bitfire.synctools.exception.InvalidICalendarException import at.bitfire.synctools.icalendar.ICalendarParser import at.bitfire.synctools.icalendar.validation.ICalPreprocessor -import net.fortuna.ical4j.data.CalendarBuilder -import net.fortuna.ical4j.data.ParserException import net.fortuna.ical4j.model.Calendar -import net.fortuna.ical4j.model.ComponentList import net.fortuna.ical4j.model.Date -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.Property -import net.fortuna.ical4j.model.PropertyList -import net.fortuna.ical4j.model.component.Daylight import net.fortuna.ical4j.model.component.Observance -import net.fortuna.ical4j.model.component.Standard import net.fortuna.ical4j.model.component.VAlarm import net.fortuna.ical4j.model.component.VTimeZone import net.fortuna.ical4j.model.parameter.Related -import net.fortuna.ical4j.model.property.Color import net.fortuna.ical4j.model.property.DateProperty import net.fortuna.ical4j.model.property.DtStart import net.fortuna.ical4j.model.property.ProdId -import net.fortuna.ical4j.model.property.RDate -import net.fortuna.ical4j.model.property.RRule import net.fortuna.ical4j.validate.ValidationException import java.io.Reader -import java.io.StringReader -import java.time.Duration -import java.time.Period import java.util.LinkedList import java.util.UUID import java.util.logging.Level @@ -102,7 +88,8 @@ open class ICalendar { // fill calendar properties properties?.let { - calendar.getProperty(CALENDAR_NAME)?.let { calName -> + TODO("ical4j 4.x") + /*calendar.getProperty(CALENDAR_NAME)?.let { calName -> properties[CALENDAR_NAME] = calName.value } @@ -111,7 +98,7 @@ open class ICalendar { } calendar.getProperty(CALENDAR_COLOR)?.let { calColor -> properties[CALENDAR_COLOR] = calColor.value - } + }*/ } return calendar @@ -137,6 +124,10 @@ open class ICalendar { var newTz: VTimeZone? = null val keep = mutableSetOf() + TODO("ical4j 4.x") + // Note: big method – maybe split? + + /* if (start != null) { // find latest matching STANDARD/DAYLIGHT observances var latestDaylight: Pair? = null @@ -210,7 +201,7 @@ open class ICalendar { logger.log(Level.WARNING, "Minified timezone is invalid, using original one", e) newTz = null } - } + }*/ // use original time zone if we couldn't calculate a minified one return newTz ?: originalTz @@ -222,14 +213,15 @@ open class ICalendar { * @return time zone id (TZID) if VTIMEZONE contains a TZID, null otherwise */ fun timezoneDefToTzId(timezoneDef: String): String? { - try { + TODO("ical4j 4.x") + /*try { val builder = CalendarBuilder() val cal = builder.build(StringReader(timezoneDef)) val timezone = cal.getComponent(VTimeZone.VTIMEZONE) as VTimeZone? timezone?.timeZoneId?.let { return it.value } } catch (e: ParserException) { logger.log(Level.SEVERE, "Can't understand time zone definition", e) - } + }*/ return null } @@ -279,14 +271,17 @@ open class ICalendar { */ fun vAlarmToMin( alarm: VAlarm, - refStart: DtStart?, - refEnd: DateProperty?, + refStart: DtStart<*>?, + refEnd: DateProperty<*>?, refDuration: net.fortuna.ical4j.model.property.Duration?, allowRelEnd: Boolean ): Pair? { val trigger = alarm.trigger ?: return null - val minutes: Int // minutes before/after the event + TODO("ical4j 4.x") + // Note: big method – maybe split? + + /*val minutes: Int // minutes before/after the event var related = trigger.getParameter(Parameter.RELATED) ?: Related.START // event/task start time @@ -345,7 +340,7 @@ open class ICalendar { return null } - return Pair(related, minutes) + return Pair(related, minutes)*/ } } diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt b/lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt index 748e30b8..a6330bb1 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt @@ -17,10 +17,7 @@ import at.bitfire.synctools.storage.toContentValues import at.techbee.jtx.JtxContract import at.techbee.jtx.JtxContract.asSyncAdapter import net.fortuna.ical4j.model.Calendar -import net.fortuna.ical4j.model.component.VJournal -import net.fortuna.ical4j.model.component.VToDo import net.fortuna.ical4j.model.property.ProdId -import net.fortuna.ical4j.model.property.Version import java.util.LinkedList import java.util.logging.Level import java.util.logging.Logger @@ -259,7 +256,8 @@ open class JtxCollection(val account: Account, logger.fine("getICSForCollection: found ${cursor?.count} records in ${account.name}") val ical = Calendar() - ical.properties += Version.VERSION_2_0 + TODO("ical4j 4.x") + /*ical.properties += Version.VERSION_2_0 ical.properties += prodId while (cursor?.moveToNext() == true) { @@ -270,7 +268,7 @@ open class JtxCollection(val account: Account, if(component is VToDo || component is VJournal) ical.components += component } - } + }*/ return ical.toString() } } diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt b/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt index 545aace4..fcddc3cb 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt @@ -6,100 +6,26 @@ package at.bitfire.ical4android -import android.content.ContentUris import android.content.ContentValues -import android.net.ParseException import android.net.Uri import android.os.ParcelFileDescriptor import android.util.Base64 import androidx.core.content.contentValuesOf -import at.bitfire.ical4android.ICalendar.Companion.withUserAgents import at.bitfire.synctools.exception.InvalidICalendarException -import at.bitfire.synctools.icalendar.Css3Color import at.bitfire.synctools.storage.BatchOperation import at.bitfire.synctools.storage.JtxBatchOperation import at.bitfire.synctools.storage.toContentValues import at.techbee.jtx.JtxContract -import at.techbee.jtx.JtxContract.JtxICalObject.TZ_ALLDAY import at.techbee.jtx.JtxContract.asSyncAdapter import net.fortuna.ical4j.data.CalendarOutputter import net.fortuna.ical4j.model.Calendar import net.fortuna.ical4j.model.ComponentList -import net.fortuna.ical4j.model.Date -import net.fortuna.ical4j.model.DateList -import net.fortuna.ical4j.model.DateTime -import net.fortuna.ical4j.model.Parameter -import net.fortuna.ical4j.model.ParameterList -import net.fortuna.ical4j.model.Property import net.fortuna.ical4j.model.PropertyList -import net.fortuna.ical4j.model.TextList -import net.fortuna.ical4j.model.TimeZoneRegistryFactory -import net.fortuna.ical4j.model.component.VAlarm -import net.fortuna.ical4j.model.component.VJournal -import net.fortuna.ical4j.model.component.VToDo -import net.fortuna.ical4j.model.parameter.AltRep -import net.fortuna.ical4j.model.parameter.Cn -import net.fortuna.ical4j.model.parameter.CuType -import net.fortuna.ical4j.model.parameter.DelegatedFrom -import net.fortuna.ical4j.model.parameter.DelegatedTo -import net.fortuna.ical4j.model.parameter.Dir -import net.fortuna.ical4j.model.parameter.FmtType -import net.fortuna.ical4j.model.parameter.Language -import net.fortuna.ical4j.model.parameter.Member -import net.fortuna.ical4j.model.parameter.PartStat -import net.fortuna.ical4j.model.parameter.RelType -import net.fortuna.ical4j.model.parameter.Related -import net.fortuna.ical4j.model.parameter.Role -import net.fortuna.ical4j.model.parameter.Rsvp -import net.fortuna.ical4j.model.parameter.SentBy -import net.fortuna.ical4j.model.parameter.Value -import net.fortuna.ical4j.model.parameter.XParameter -import net.fortuna.ical4j.model.property.Action -import net.fortuna.ical4j.model.property.Attach -import net.fortuna.ical4j.model.property.Categories -import net.fortuna.ical4j.model.property.Clazz -import net.fortuna.ical4j.model.property.Color -import net.fortuna.ical4j.model.property.Comment -import net.fortuna.ical4j.model.property.Completed -import net.fortuna.ical4j.model.property.Contact -import net.fortuna.ical4j.model.property.Created -import net.fortuna.ical4j.model.property.Description -import net.fortuna.ical4j.model.property.DtEnd -import net.fortuna.ical4j.model.property.DtStamp -import net.fortuna.ical4j.model.property.DtStart -import net.fortuna.ical4j.model.property.Due -import net.fortuna.ical4j.model.property.Duration -import net.fortuna.ical4j.model.property.ExDate -import net.fortuna.ical4j.model.property.Geo -import net.fortuna.ical4j.model.property.LastModified -import net.fortuna.ical4j.model.property.Location -import net.fortuna.ical4j.model.property.PercentComplete -import net.fortuna.ical4j.model.property.Priority import net.fortuna.ical4j.model.property.ProdId -import net.fortuna.ical4j.model.property.RDate -import net.fortuna.ical4j.model.property.RRule -import net.fortuna.ical4j.model.property.RecurrenceId -import net.fortuna.ical4j.model.property.RelatedTo -import net.fortuna.ical4j.model.property.Repeat -import net.fortuna.ical4j.model.property.Resources -import net.fortuna.ical4j.model.property.Sequence -import net.fortuna.ical4j.model.property.Status -import net.fortuna.ical4j.model.property.Summary -import net.fortuna.ical4j.model.property.Trigger -import net.fortuna.ical4j.model.property.Uid -import net.fortuna.ical4j.model.property.Url -import net.fortuna.ical4j.model.property.Version -import net.fortuna.ical4j.model.property.XProperty -import java.io.FileNotFoundException import java.io.IOException import java.io.OutputStream import java.io.Reader -import java.net.URI -import java.net.URISyntaxException -import java.time.format.DateTimeParseException -import java.util.TimeZone import java.util.UUID -import java.util.logging.Level import java.util.logging.Logger open class JtxICalObject( @@ -296,6 +222,8 @@ open class JtxICalObject( val iCalObjectList = mutableListOf() + TODO("ical4j 4.x") + /* ical.components.forEach { component -> val iCalObject = JtxICalObject(collection) @@ -317,7 +245,7 @@ open class JtxICalObject( iCalObjectList.add(iCalObject) } } - } + }*/ return iCalObjectList } @@ -328,8 +256,8 @@ open class JtxICalObject( * @param [calComponents] from which the VAlarms should be extracted */ private fun extractVAlarms(iCalObject: JtxICalObject, calComponents: ComponentList<*>) { - - calComponents.forEach { component -> + TODO("ical4j 4.x") + /*calComponents.forEach { component -> if(component is VAlarm) { val jtxAlarm = Alarm().apply { component.action?.value?.let { vAlarmAction -> this.action = vAlarmAction } @@ -364,7 +292,7 @@ open class JtxICalObject( } iCalObject.alarms.add(jtxAlarm) } - } + }*/ } /** @@ -372,12 +300,12 @@ open class JtxICalObject( * @param [iCalObject] where the properties should be mapped to * @param [properties] from which the properties can be extracted */ - private fun extractProperties(iCalObject: JtxICalObject, properties: PropertyList<*>) { - + private fun extractProperties(iCalObject: JtxICalObject, properties: PropertyList) { // sequence must only be null for locally created, not-yet-synchronized events iCalObject.sequence = 0 - for (prop in properties) { + TODO("ical4j 4.x") + /*for (prop in properties) { when (prop) { is Sequence -> iCalObject.sequence = prop.sequenceNo.toLong() is Created -> iCalObject.created = prop.dateTime.time @@ -625,7 +553,7 @@ open class JtxICalObject( if (iCalObject.duration != null && iCalObject.dtstart == null) { logger.warning("Found DURATION without DTSTART; ignoring") iCalObject.duration = null - } + }*/ } } @@ -638,7 +566,8 @@ open class JtxICalObject( */ fun getICalendarFormat(prodId: ProdId): Calendar? { val ical = Calendar() - ical.properties += Version.VERSION_2_0 + TODO("ical4j 4.x") + /*ical.properties += Version.VERSION_2_0 ical.properties += prodId.withUserAgents(listOf(TaskProvider.ProviderName.JtxBoard.packageName)) val calComponent = when (component) { @@ -730,7 +659,7 @@ open class JtxICalObject( recurInstance.addProperties(recurCalComponent.properties) } - ICalendar.softValidate(ical) + ICalendar.softValidate(ical)*/ return ical } @@ -748,9 +677,9 @@ open class JtxICalObject( * This function maps the current JtxICalObject to a iCalendar property list * @param [props] The PropertyList where the properties should be added */ - private fun addProperties(props: PropertyList) { - - uid.let { props += Uid(it) } + private fun addProperties(props: PropertyList) { + TODO("ical4j 4.x") + /*uid.let { props += Uid(it) } sequence.let { props += Sequence(it.toInt()) } created.let { props += Created(DateTime(it).apply { @@ -1134,8 +1063,6 @@ duration?.let(props::add) } } - /* - // determine earliest referenced date val earliest = arrayOf( dtStart?.date, @@ -1145,7 +1072,8 @@ duration?.let(props::add) // add VTIMEZONE components for (tz in usedTimeZones) ical.components += ICalendar.minifyVTimeZone(tz.vTimeZone, earliest) -*/ + + TODO */ } @@ -1175,7 +1103,6 @@ duration?.let(props::add) * @param [flags] to be set as [Int] */ fun updateFlags(flags: Int) { - var updateUri = JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(collection.account) updateUri = Uri.withAppendedPath(updateUri, this.id.toString()) @@ -1190,7 +1117,8 @@ duration?.let(props::add) * @return the Content [Uri] of the inserted object */ fun add(): Uri { - val values = this.toContentValues() + TODO("ical4j 4.x") + /*val values = this.toContentValues() val newUri = collection.client.insert( JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(collection.account), @@ -1200,7 +1128,7 @@ duration?.let(props::add) insertOrUpdateListProperties(false) - return newUri + return newUri*/ } /** @@ -1209,8 +1137,8 @@ duration?.let(props::add) * @return [Uri] of the updated entry */ fun update(data: JtxICalObject): Uri { - - this.applyNewData(data) + TODO("ical4j 4.x") + /*this.applyNewData(data) val values = this.toContentValues() var updateUri = JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(collection.account) @@ -1224,7 +1152,7 @@ duration?.let(props::add) insertOrUpdateListProperties(true) - return updateUri + return updateUri*/ } diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/Task.kt b/lib/src/main/kotlin/at/bitfire/ical4android/Task.kt index 381d3aa7..900c51a3 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/Task.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/Task.kt @@ -7,7 +7,6 @@ package at.bitfire.ical4android import androidx.annotation.IntRange -import at.bitfire.ical4android.util.DateUtils import net.fortuna.ical4j.model.Property import net.fortuna.ical4j.model.component.VAlarm import net.fortuna.ical4j.model.property.Clazz @@ -44,22 +43,22 @@ data class Task( var organizer: Organizer? = null, @IntRange(from = 0, to = 9) - var priority: Int = Priority.UNDEFINED.level, + var priority: Int = Priority.VALUE_UNDEFINED, var classification: Clazz? = null, var status: Status? = null, - var dtStart: DtStart? = null, - var due: Due? = null, + var dtStart: DtStart<*>? = null, + var due: Due<*>? = null, var duration: Duration? = null, var completedAt: Completed? = null, @IntRange(from = 0, to = 100) var percentComplete: Int? = null, - var rRule: RRule? = null, - val rDates: LinkedList = LinkedList(), - val exDates: LinkedList = LinkedList(), + var rRule: RRule<*>? = null, + val rDates: LinkedList> = LinkedList(), + val exDates: LinkedList> = LinkedList(), val categories: LinkedList = LinkedList(), var comment: String? = null, @@ -70,9 +69,10 @@ data class Task( ) : ICalendar() { fun isAllDay(): Boolean { - return dtStart?.let { DateUtils.isDate(it) } + TODO("ical4j 4.x") + /*return dtStart?.let { DateUtils.isDate(it) } ?: due?.let { DateUtils.isDate(it) } - ?: true + ?: true*/ } } diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/TaskReader.kt b/lib/src/main/kotlin/at/bitfire/ical4android/TaskReader.kt index c8c2685e..64661c3d 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/TaskReader.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/TaskReader.kt @@ -7,39 +7,9 @@ package at.bitfire.ical4android import at.bitfire.ical4android.ICalendar.Companion.fromReader -import at.bitfire.ical4android.util.DateUtils import at.bitfire.synctools.exception.InvalidICalendarException -import at.bitfire.synctools.icalendar.Css3Color import net.fortuna.ical4j.model.Component -import net.fortuna.ical4j.model.DateTime import net.fortuna.ical4j.model.component.VToDo -import net.fortuna.ical4j.model.property.Categories -import net.fortuna.ical4j.model.property.Clazz -import net.fortuna.ical4j.model.property.Color -import net.fortuna.ical4j.model.property.Comment -import net.fortuna.ical4j.model.property.Completed -import net.fortuna.ical4j.model.property.Created -import net.fortuna.ical4j.model.property.Description -import net.fortuna.ical4j.model.property.DtStamp -import net.fortuna.ical4j.model.property.DtStart -import net.fortuna.ical4j.model.property.Due -import net.fortuna.ical4j.model.property.Duration -import net.fortuna.ical4j.model.property.ExDate -import net.fortuna.ical4j.model.property.Geo -import net.fortuna.ical4j.model.property.LastModified -import net.fortuna.ical4j.model.property.Location -import net.fortuna.ical4j.model.property.Organizer -import net.fortuna.ical4j.model.property.PercentComplete -import net.fortuna.ical4j.model.property.Priority -import net.fortuna.ical4j.model.property.ProdId -import net.fortuna.ical4j.model.property.RDate -import net.fortuna.ical4j.model.property.RRule -import net.fortuna.ical4j.model.property.RelatedTo -import net.fortuna.ical4j.model.property.Sequence -import net.fortuna.ical4j.model.property.Status -import net.fortuna.ical4j.model.property.Summary -import net.fortuna.ical4j.model.property.Uid -import net.fortuna.ical4j.model.property.Url import java.io.IOException import java.io.Reader import java.util.LinkedList @@ -71,7 +41,8 @@ class TaskReader { } private fun fromVToDo(todo: VToDo): Task { - val t = Task() + TODO("ical4j 4.x") + /*val t = Task() if (todo.uid != null) t.uid = todo.uid.value @@ -142,7 +113,7 @@ class TaskReader { t.duration = null } - return t + return t*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/TaskWriter.kt b/lib/src/main/kotlin/at/bitfire/ical4android/TaskWriter.kt index 876f3312..cc6226e1 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/TaskWriter.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/TaskWriter.kt @@ -6,35 +6,8 @@ package at.bitfire.ical4android -import at.bitfire.ical4android.ICalendar.Companion.minifyVTimeZone -import at.bitfire.ical4android.ICalendar.Companion.softValidate -import at.bitfire.ical4android.ICalendar.Companion.withUserAgents -import at.bitfire.synctools.icalendar.Css3Color -import net.fortuna.ical4j.data.CalendarOutputter -import net.fortuna.ical4j.model.Calendar -import net.fortuna.ical4j.model.DateTime -import net.fortuna.ical4j.model.TextList -import net.fortuna.ical4j.model.TimeZone -import net.fortuna.ical4j.model.component.VToDo -import net.fortuna.ical4j.model.property.Categories -import net.fortuna.ical4j.model.property.Color -import net.fortuna.ical4j.model.property.Comment -import net.fortuna.ical4j.model.property.Created -import net.fortuna.ical4j.model.property.Description -import net.fortuna.ical4j.model.property.LastModified -import net.fortuna.ical4j.model.property.Location -import net.fortuna.ical4j.model.property.PercentComplete -import net.fortuna.ical4j.model.property.Priority import net.fortuna.ical4j.model.property.ProdId -import net.fortuna.ical4j.model.property.Sequence -import net.fortuna.ical4j.model.property.Summary -import net.fortuna.ical4j.model.property.Uid -import net.fortuna.ical4j.model.property.Url -import net.fortuna.ical4j.model.property.Version import java.io.Writer -import java.net.URI -import java.net.URISyntaxException -import java.util.logging.Level import java.util.logging.Logger /** @@ -58,7 +31,8 @@ class TaskWriter( * @param to stream that the iCalendar is written to */ fun write(task: Task, to: Writer): Unit = with(task) { - val ical = Calendar() + TODO() + /*val ical = Calendar() ical.properties += Version.VERSION_2_0 ical.properties += prodId.withUserAgents(userAgents) @@ -135,7 +109,7 @@ class TaskWriter( ical.components += minifyVTimeZone(tz.vTimeZone, earliest) softValidate(ical) - CalendarOutputter(false).output(ical, to) + CalendarOutputter(false).output(ical, to)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/UnknownProperty.kt b/lib/src/main/kotlin/at/bitfire/ical4android/UnknownProperty.kt index 504cd92b..66bcaa6e 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/UnknownProperty.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/UnknownProperty.kt @@ -16,7 +16,6 @@ import net.fortuna.ical4j.model.Property import net.fortuna.ical4j.model.PropertyBuilder import net.fortuna.ical4j.model.PropertyFactory import org.json.JSONArray -import org.json.JSONObject /** * Helpers to (de)serialize unknown properties as JSON to store it in an Android ExtendedProperty row. @@ -82,12 +81,13 @@ object UnknownProperty { json.put(prop.name) json.put(prop.value) - if (!prop.parameters.isEmpty) { + TODO("ical4j 4.x") + /*if (!prop.parameters.isEmpty) { val jsonParams = JSONObject() for (param in prop.parameters) jsonParams.put(param.name, param.value) json.put(jsonParams) - } + }*/ return json.toString() } diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/util/DateUtils.kt b/lib/src/main/kotlin/at/bitfire/ical4android/util/DateUtils.kt index e7629195..34ad0449 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/util/DateUtils.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/util/DateUtils.kt @@ -7,8 +7,6 @@ package at.bitfire.ical4android.util import net.fortuna.ical4j.data.CalendarBuilder -import net.fortuna.ical4j.model.Date -import net.fortuna.ical4j.model.DateTime import net.fortuna.ical4j.model.TimeZone import net.fortuna.ical4j.model.component.VTimeZone import net.fortuna.ical4j.model.property.DateProperty @@ -90,14 +88,18 @@ object DateUtils { * @param date date property to check * @return *true* if the date is a DATE value; *false* otherwise (for instance, when the argument is a DATE-TIME value or null) */ - fun isDate(date: DateProperty?) = date != null && date.date is Date && date.date !is DateTime + fun isDate(date: DateProperty<*>?): Boolean = + TODO("ical4j 4.x") + //date != null && date.date is Date && date.date !is DateTime /** * Determines whether a given date represents a DATE-TIME value. * @param date date property to check * @return *true* if the date is a DATE-TIME value; *false* otherwise (for instance, when the argument is a DATE value or null) */ - fun isDateTime(date: DateProperty?) = date != null && date.date is DateTime + fun isDateTime(date: DateProperty<*>?): Boolean = + TODO("ical4j 4.x") + //date != null && date.date is DateTime /** * Parses an iCalendar that only contains a `VTIMEZONE` definition to a VTimeZone object. @@ -110,7 +112,8 @@ object DateUtils { val builder = CalendarBuilder() try { val cal = builder.build(StringReader(timezoneDef)) - return cal.getComponent(VTimeZone.VTIMEZONE) as VTimeZone + return TODO("ical4j 4.x") + //return cal.getComponent(VTimeZone.VTIMEZONE) as VTimeZone } catch (_: Exception) { // Couldn't parse timezone definition return null diff --git a/lib/src/main/kotlin/at/techbee/jtx/JtxContract.kt b/lib/src/main/kotlin/at/techbee/jtx/JtxContract.kt index c5da00dc..2059e5cd 100644 --- a/lib/src/main/kotlin/at/techbee/jtx/JtxContract.kt +++ b/lib/src/main/kotlin/at/techbee/jtx/JtxContract.kt @@ -1,3 +1,9 @@ +/* + * This file is part of bitfireAT/synctools which is released under GPLv3. + * Copyright © All Contributors. See the LICENSE and AUTHOR files in the root directory for details. + * SPDX-License-Identifier: GPL-3.0-or-later + */ + /* * Copyright (c) Techbee e.U. * All rights reserved. This program and the accompanying materials @@ -27,7 +33,6 @@ import at.techbee.jtx.JtxContract.JtxICalObject.GEO_LAT import at.techbee.jtx.JtxContract.JtxICalObject.GEO_LONG import at.techbee.jtx.JtxContract.JtxICalObject.TZ_ALLDAY import net.fortuna.ical4j.model.ParameterList -import net.fortuna.ical4j.model.Property import net.fortuna.ical4j.model.PropertyList import net.fortuna.ical4j.model.parameter.XParameter import net.fortuna.ical4j.model.property.XProperty @@ -101,8 +106,8 @@ object JtxContract { * @param [string] that should be parsed * @return The list of XProperty parsed from the string */ - fun getXPropertyListFromJson(string: String): PropertyList { - val propertyList = PropertyList() + fun getXPropertyListFromJson(string: String): PropertyList { + val propertyList = PropertyList() if (string.isBlank()) return propertyList @@ -136,9 +141,12 @@ object JtxContract { return null val jsonObject = JSONObject() - parameters.forEach { parameter -> + TODO("ical4j 4.x") + // Note: probably the contract should be separated from methods that do things, especially if they depend on ical4j + + /*parameters.forEach { parameter -> jsonObject.put(parameter.name, parameter.value) - } + }*/ return if (jsonObject.length() == 0) null else @@ -151,18 +159,21 @@ object JtxContract { * @param [propertyList] The PropertyList that should be transformed into a Json String * @return The generated Json object as a [String] */ - fun getJsonStringFromXProperties(propertyList: PropertyList<*>?): String? { + fun getJsonStringFromXProperties(propertyList: PropertyList?): String? { if (propertyList == null) return null - val jsonObject = JSONObject() + TODO("ical4j 4.x") + // Note: probably the contract should be separated from methods that do things, especially if they depend on ical4j + + /*val jsonObject = JSONObject() propertyList.forEach { property -> jsonObject.put(property.name, property.value) } return if (jsonObject.length() == 0) null else - jsonObject.toString() + jsonObject.toString()*/ } From 8d6a6c24be6623ae5e3ccb5db92dccebe51ac616 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 11:31:02 +0100 Subject: [PATCH 3/7] Make package at.bitfire.synctools.icalendar compile again --- .../icalendar/CalendarUidSplitter.kt | 12 ++- .../synctools/icalendar/ICalendarGenerator.kt | 10 ++- .../synctools/icalendar/ICalendarParser.kt | 6 +- .../synctools/icalendar/Ical4jHelpers.kt | 30 +++++--- .../icalendar/validation/ICalPreprocessor.kt | 19 ++--- .../synctools/util/AndroidTimeUtils.kt | 74 ++++++++++--------- 6 files changed, 87 insertions(+), 64 deletions(-) diff --git a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitter.kt b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitter.kt index 2cd96283..4a9e10a6 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitter.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitter.kt @@ -23,9 +23,11 @@ class CalendarUidSplitter { // get all components of type T (for instance: all VEVENTs) val all = calendar.getComponents(componentName) + TODO("ical4j 4.x") + // Note for VEVENT: UID is REQUIRED in RFC 5545 section 3.6.1, but optional in RFC 2445 section 4.6.1, // so it's possible that the Uid is null. - val byUid: Map> = all + /*val byUid: Map> = all .groupBy { it.uid?.value } .mapValues { filterBySequence(it.value) } @@ -36,7 +38,7 @@ class CalendarUidSplitter { result[uid] = AssociatedComponents(mainVEvent, exceptions) } - return result + return result*/ } /** @@ -48,15 +50,17 @@ class CalendarUidSplitter { */ @VisibleForTesting internal fun filterBySequence(events: List): List { + TODO("ical4j 4.x") + // group by RECURRENCE-ID (may be null) - val byRecurId = events.groupBy { it.recurrenceId?.value }.values + /*val byRecurId = events.groupBy { it.recurrenceId?.value }.values // for every RECURRENCE-ID: keep only event with highest sequence val latest = byRecurId.map { sameUidAndRecurId -> sameUidAndRecurId.maxBy { it.sequence?.sequenceNo ?: 0 } } - return latest + return latest*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarGenerator.kt b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarGenerator.kt index b254d4b3..c928ae42 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarGenerator.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarGenerator.kt @@ -34,7 +34,8 @@ class ICalendarGenerator { * @param to stream that the iCalendar is written to */ fun write(event: AssociatedComponents<*>, @WillNotClose to: Writer) { - val ical = Calendar() + TODO("ical4j 4.x") + /*val ical = Calendar() ical.properties += Version.VERSION_2_0 // add PRODID @@ -68,11 +69,12 @@ class ICalendarGenerator { for (tz in usedTimeZones) ical.components += ICalendar.minifyVTimeZone(tz.vTimeZone, earliestStart) - CalendarOutputter(false).output(ical, to) + CalendarOutputter(false).output(ical, to)*/ } private fun timeZonesOf(component: CalendarComponent): Set { - val timeZones = mutableSetOf() + TODO("ical4j 4.x") + /*val timeZones = mutableSetOf() // properties timeZones += component.properties @@ -86,7 +88,7 @@ class ICalendarGenerator { .filterIsInstance() .mapNotNull { (it.date as? DateTime)?.timeZone } - return timeZones + return timeZones*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarParser.kt b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarParser.kt index c1a0dc47..f2bdd8de 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarParser.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/ICalendarParser.kt @@ -42,8 +42,10 @@ class ICalendarParser( * @throws InvalidICalendarException when the resource is can't be parsed */ fun parse(@WillNotClose reader: Reader): Calendar { + TODO("ical4j 4.x") + // preprocess stream to work around problems that prevent parsing and thus can't be fixed later - val preprocessed = preprocessor.preprocessStream(reader) + /*val preprocessed = preprocessor.preprocessStream(reader) // parse stream, ignoring invalid properties (if possible) val calendar: Calendar @@ -66,7 +68,7 @@ class ICalendarParser( logger.log(Level.WARNING, "Couldn't pre-process iCalendar", e) } - return calendar + return calendar*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/Ical4jHelpers.kt b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/Ical4jHelpers.kt index d57b65a7..50840fdc 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/Ical4jHelpers.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/Ical4jHelpers.kt @@ -27,24 +27,30 @@ const val ical4jVersion = BuildConfig.version_ical4j // component access helpers -fun componentListOf(vararg components: T) = - ComponentList().apply { +fun componentListOf(vararg components: T): ComponentList = + TODO("ical4j 4.x") + /*ComponentList().apply { addAll(components) - } + }*/ -fun propertyListOf(vararg properties: Property) = - PropertyList().apply { +fun propertyListOf(vararg properties: Property): PropertyList = + TODO("ical4j 4.x") + /*PropertyList().apply { addAll(properties) - } + }*/ val CalendarComponent.uid: Uid? - get() = getProperty(Property.UID) + get() = TODO("ical4j 4.x") + // getProperty(Property.UID) -val CalendarComponent.recurrenceId: RecurrenceId? - get() = getProperty(Property.RECURRENCE_ID) +val CalendarComponent.recurrenceId: RecurrenceId<*>? + get() = TODO("ical4j 4.x") + // getProperty(Property.RECURRENCE_ID) val CalendarComponent.sequence: Sequence? - get() = getProperty(Property.SEQUENCE) + get() = TODO("ical4j 4.x") + // getProperty(Property.SEQUENCE) -fun VEvent.requireDtStart(): DtStart = - startDate ?: throw InvalidICalendarException("Missing DTSTART in VEVENT") +fun VEvent.requireDtStart(): DtStart<*> = + TODO("ical4j 4.x") + // startDate ?: throw InvalidICalendarException("Missing DTSTART in VEVENT") diff --git a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessor.kt b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessor.kt index baeb9cdd..1f7fc029 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessor.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessor.kt @@ -10,10 +10,8 @@ import androidx.annotation.VisibleForTesting import com.google.common.io.CharSource import net.fortuna.ical4j.model.Calendar import net.fortuna.ical4j.model.Property -import net.fortuna.ical4j.transform.rfc5545.CreatedPropertyRule -import net.fortuna.ical4j.transform.rfc5545.DateListPropertyRule -import net.fortuna.ical4j.transform.rfc5545.DatePropertyRule -import net.fortuna.ical4j.transform.rfc5545.Rfc5545PropertyRule +import net.fortuna.ical4j.transform.compliance.DateListPropertyRule +import net.fortuna.ical4j.transform.compliance.DatePropertyRule import java.io.BufferedReader import java.io.Reader import java.util.logging.Logger @@ -32,7 +30,8 @@ class ICalPreprocessor { get() = Logger.getLogger(javaClass.name) private val propertyRules = arrayOf( - CreatedPropertyRule(), // make sure CREATED is UTC + TODO("ical4j 4.x"), + //CreatedPropertyRule(), // make sure CREATED is UTC DatePropertyRule(), // These two rules also replace VTIMEZONEs of the iCalendar ... DateListPropertyRule() // ... by the ical4j VTIMEZONE with the same TZID! @@ -97,14 +96,16 @@ class ICalPreprocessor { * @param calendar the calendar object that is going to be modified */ fun preprocessCalendar(calendar: Calendar) { - for (component in calendar.components) + TODO("ical4j 4.x") + /*for (component in calendar.components) for (property in component.properties) - applyRules(property) + applyRules(property)*/ } @Suppress("UNCHECKED_CAST") private fun applyRules(property: Property) { - propertyRules + TODO("ical4j 4.x") + /*propertyRules .filter { rule -> rule.supportedType.isAssignableFrom(property::class.java) } .forEach { rule -> val beforeStr = property.toString() @@ -112,7 +113,7 @@ class ICalPreprocessor { val afterStr = property.toString() if (beforeStr != afterStr) logger.info("${rule.javaClass.name}: $beforeStr -> $afterStr") - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/util/AndroidTimeUtils.kt b/lib/src/main/kotlin/at/bitfire/synctools/util/AndroidTimeUtils.kt index 3159c2f7..49818680 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/util/AndroidTimeUtils.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/util/AndroidTimeUtils.kt @@ -66,11 +66,12 @@ object AndroidTimeUtils { * @param date [net.fortuna.ical4j.model.property.DateProperty] to validate. Values which are not DATE-TIME will be ignored. * @param tzRegistry time zone registry to get time zones from */ - fun androidifyTimeZone(date: DateProperty?, tzRegistry: TimeZoneRegistry) { - if (DateUtils.isDateTime(date) && date?.isUtc == false) { + fun androidifyTimeZone(date: DateProperty<*>?, tzRegistry: TimeZoneRegistry) { + TODO("ical4j 4.x") + /*if (DateUtils.isDateTime(date) && date?.isUtc == false) { val tzID = DateUtils.findAndroidTimezoneID(date.timeZone?.id) date.timeZone = tzRegistry.getTimeZone(tzID) - } + }*/ } /** @@ -81,11 +82,12 @@ object AndroidTimeUtils { * * * @param dateList [net.fortuna.ical4j.model.property.DateListProperty] to validate. Values which are not DATE-TIME will be ignored. */ - fun androidifyTimeZone(dateList: DateListProperty) { + fun androidifyTimeZone(dateList: DateListProperty<*>) { val tzRegistry by lazy { TimeZoneRegistryFactory.getInstance().createRegistry() } // periods (RDate only) - val periods = (dateList as? RDate)?.periods + TODO("ical4j 4.x") + /*val periods = (dateList as? RDate)?.periods if (periods != null && periods.isNotEmpty() && !periods.isUtc) { val tzID = DateUtils.findAndroidTimezoneID(periods.timeZone?.id) @@ -103,7 +105,7 @@ object AndroidTimeUtils { val tzID = DateUtils.findAndroidTimezoneID(dates.timeZone?.id) dateList.timeZone = tzRegistry.getTimeZone(tzID) } - } + }*/ } /** @@ -118,23 +120,24 @@ object AndroidTimeUtils { * - the specified time zone ID for date-times with given time zone * - the currently set default time zone ID for floating date-times */ - fun storageTzId(date: DateProperty): String = - if (DateUtils.isDateTime(date)) { - // DATE-TIME - when { - date.isUtc -> - // DATE-TIME in UTC format - TimeZones.UTC_ID - date.timeZone != null -> - // DATE-TIME with given time-zone - date.timeZone.id - else -> - // DATE-TIME in local format (floating) - TimeZone.getDefault().id - } - } else - // DATE - TZID_UTC + fun storageTzId(date: DateProperty<*>): String = + TODO("ical4j 4.x") + /*if (DateUtils.isDateTime(date)) { + // DATE-TIME + when { + date.isUtc -> + // DATE-TIME in UTC format + TimeZones.UTC_ID + date.timeZone != null -> + // DATE-TIME with given time-zone + date.timeZone.id + else -> + // DATE-TIME in local format (floating) + TimeZone.getDefault().id + } + } else + // DATE + TZID_UTC*/ // recurrence sets @@ -159,7 +162,7 @@ object AndroidTimeUtils { * * @return formatted string for Android calendar provider */ - fun recurrenceSetsToAndroidString(dates: List, dtStart: Date): String { + fun recurrenceSetsToAndroidString(dates: List>, dtStart: Date): String { /* rdate/exdate: DATE DATE_TIME all-day store as ...T000000Z cut off time and store as ...T000000Z event with time (undefined) store as ...ThhmmssZ @@ -169,7 +172,8 @@ object AndroidTimeUtils { val allDay = dtStart !is DateTime // use time zone of first entry for the whole set; null for UTC - val tz = + TODO("ical4j 4.x") + /*val tz = (dates.firstOrNull() as? RDate)?.periods?.timeZone ?: // VALUE=PERIOD (only RDate) dates.firstOrNull()?.dates?.timeZone // VALUE=DATE/DATE-TIME @@ -223,7 +227,7 @@ object AndroidTimeUtils { if (tz != null) result.append(tz.id).append(RECURRENCE_LIST_TZID_SEPARATOR) result.append(strDates.joinToString(RECURRENCE_LIST_VALUE_SEPARATOR)) - return result.toString() + return result.toString()*/ } /** @@ -241,16 +245,18 @@ object AndroidTimeUtils { * * @throws java.text.ParseException when the string cannot be parsed */ - fun androidStringToRecurrenceSet( + fun> androidStringToRecurrenceSet( dbStr: String, tzRegistry: TimeZoneRegistry, allDay: Boolean, exclude: Long? = null, - generator: (DateList) -> T + generator: (DateList<*>) -> T ): T { + TODO("ical4j 4.x") + // 1. split string into time zone and actual dates - var timeZone: net.fortuna.ical4j.model.TimeZone? + /*var timeZone: net.fortuna.ical4j.model.TimeZone? val datesStr: String val limiter = dbStr.indexOf(RECURRENCE_LIST_TZID_SEPARATOR) @@ -289,7 +295,7 @@ object AndroidTimeUtils { property.setUtc(true) } - return property + return property*/ } /** @@ -303,8 +309,10 @@ object AndroidTimeUtils { * * @return formatted string for Android calendar provider */ - fun recurrenceSetsToOpenTasksString(dates: List, tz: net.fortuna.ical4j.model.TimeZone?): String { - val allDay = tz == null + fun recurrenceSetsToOpenTasksString(dates: List>, tz: net.fortuna.ical4j.model.TimeZone?): String { + TODO("ical4j 4.x") + + /*val allDay = tz == null val strDates = LinkedList() for (dateListProp in dates) { if (dateListProp is RDate && dateListProp.periods.isNotEmpty()) @@ -326,7 +334,7 @@ object AndroidTimeUtils { strDates += dateToUse.toString() } } - return strDates.joinToString(RECURRENCE_LIST_VALUE_SEPARATOR) + return strDates.joinToString(RECURRENCE_LIST_VALUE_SEPARATOR)*/ } From 578d4a2155638d8b662900c3c20b8424131470ad Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 11:52:53 +0100 Subject: [PATCH 4/7] Make at.bitfire.synctools compile again (add TODOs) --- .../mapping/calendar/AndroidEventHandler.kt | 17 +++++++----- .../mapping/calendar/AttendeeMappings.kt | 14 ++++++---- .../calendar/builder/AccessLevelBuilder.kt | 4 ++- .../mapping/calendar/builder/AllDayBuilder.kt | 5 ++-- .../calendar/builder/AttendeesBuilder.kt | 8 +++--- .../calendar/builder/AvailabilityBuilder.kt | 5 ++-- .../calendar/builder/CategoriesBuilder.kt | 5 ++-- .../mapping/calendar/builder/ColorBuilder.kt | 5 ++-- .../calendar/builder/DurationBuilder.kt | 19 ++++++++------ .../calendar/builder/EndTimeBuilder.kt | 26 +++++++++++-------- .../calendar/builder/OrganizerBuilder.kt | 5 ++-- .../builder/OriginalInstanceTimeBuilder.kt | 7 +++-- .../builder/RecurrenceFieldsBuilder.kt | 5 ++-- .../calendar/builder/RemindersBuilder.kt | 5 ++-- .../calendar/builder/StartTimeBuilder.kt | 5 ++-- .../mapping/calendar/builder/StatusBuilder.kt | 5 ++-- .../mapping/calendar/builder/UidBuilder.kt | 3 ++- .../builder/UnknownPropertiesBuilder.kt | 5 ++-- .../calendar/handler/AccessLevelHandler.kt | 7 ++--- .../calendar/handler/AttendeesHandler.kt | 5 ++-- .../calendar/handler/AvailabilityHandler.kt | 5 ++-- .../calendar/handler/CategoriesHandler.kt | 5 ++-- .../mapping/calendar/handler/ColorHandler.kt | 5 ++-- .../calendar/handler/DescriptionHandler.kt | 5 ++-- .../calendar/handler/DurationHandler.kt | 5 ++-- .../calendar/handler/EndTimeHandler.kt | 3 ++- .../calendar/handler/LocationHandler.kt | 5 ++-- .../calendar/handler/OrganizerHandler.kt | 3 ++- .../handler/OriginalInstanceTimeHandler.kt | 5 ++-- .../handler/RecurrenceFieldsHandler.kt | 14 ++++++---- .../calendar/handler/RemindersHandler.kt | 5 ++-- .../calendar/handler/SequenceHandler.kt | 5 ++-- .../calendar/handler/StartTimeHandler.kt | 3 ++- .../mapping/calendar/handler/StatusHandler.kt | 5 ++-- .../mapping/calendar/handler/TitleHandler.kt | 5 ++-- .../mapping/calendar/handler/UidHandler.kt | 5 ++-- .../handler/UnknownPropertiesHandler.kt | 5 ++-- .../mapping/calendar/handler/UrlHandler.kt | 5 ++-- .../mapping/tasks/DmfsTaskBuilder.kt | 24 ++++++++++------- .../mapping/tasks/DmfsTaskProcessor.kt | 21 +++++++++------ 40 files changed, 182 insertions(+), 116 deletions(-) diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandler.kt index 6889277d..389bda99 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandler.kt @@ -10,6 +10,7 @@ import android.content.Entity import android.provider.CalendarContract.Events import android.provider.CalendarContract.ExtendedProperties import at.bitfire.synctools.icalendar.AssociatedEvents +import at.bitfire.synctools.icalendar.recurrenceId import at.bitfire.synctools.mapping.calendar.handler.AccessLevelHandler import at.bitfire.synctools.mapping.calendar.handler.AndroidEventFieldHandler import at.bitfire.synctools.mapping.calendar.handler.AttendeesHandler @@ -121,8 +122,8 @@ class AndroidEventHandler( ) // add exceptions of recurring main event - val rRules = main.getProperties(Property.RRULE) - val rDates = main.getProperties(Property.RDATE) + val rRules = main.getProperties>(Property.RRULE) + val rDates = main.getProperties>(Property.RDATE) val exceptions = LinkedList() if (rRules.isNotEmpty() || rDates.isNotEmpty()) { for (exception in eventAndExceptions.exceptions) { @@ -136,10 +137,11 @@ class AndroidEventHandler( val recurrenceId = exceptionEvent.recurrenceId ?: continue // generate EXDATE instead of VEVENT with RECURRENCE-ID for cancelled instances - if (exception.entityValues.getAsInteger(Events.STATUS) == Events.STATUS_CANCELED) + TODO("ical4j 4.x") + /*if (exception.entityValues.getAsInteger(Events.STATUS) == Events.STATUS_CANCELED) main.properties += asExDate(exception, recurrenceId) else - exceptions += exceptionEvent + exceptions += exceptionEvent*/ } } @@ -155,8 +157,9 @@ class AndroidEventHandler( ) } - private fun asExDate(entity: Entity, recurrenceId: RecurrenceId): ExDate { - val originalAllDay = (entity.entityValues.getAsInteger(Events.ORIGINAL_ALL_DAY) ?: 0) != 0 + private fun asExDate(entity: Entity, recurrenceId: RecurrenceId<*>): ExDate<*> { + TODO("ical4j 4.x") + /*val originalAllDay = (entity.entityValues.getAsInteger(Events.ORIGINAL_ALL_DAY) ?: 0) != 0 val list = DateList( if (originalAllDay) Value.DATE else Value.DATE_TIME, recurrenceId.timeZone @@ -170,7 +173,7 @@ class AndroidEventHandler( else timeZone = recurrenceId.timeZone } - } + }*/ } private fun generateProdId(main: Entity): ProdId { diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappings.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappings.kt index 1a8be62f..a9dbeeee 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappings.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappings.kt @@ -79,10 +79,11 @@ object AttendeeMappings { } - if (cuType != null && cuType != CuType.INDIVIDUAL) + TODO("ical4j 4.x") + /*if (cuType != null && cuType != CuType.INDIVIDUAL) attendee.parameters.add(cuType) if (role != null && role != Role.REQ_PARTICIPANT) - attendee.parameters.add(role) + attendee.parameters.add(role)*/ } @@ -112,8 +113,10 @@ object AttendeeMappings { val type: Int var relationship: Int - val cuType = attendee.getParameter(Parameter.CUTYPE) ?: CuType.INDIVIDUAL - val role = attendee.getParameter(Parameter.ROLE) ?: Role.REQ_PARTICIPANT + val cuType: CuType = TODO("ical4j 4.x") + // attendee.getParameter(Parameter.CUTYPE) ?: CuType.INDIVIDUAL + val role: Role = TODO("ical4j 4.x") + // attendee.getParameter(Parameter.ROLE) ?: Role.REQ_PARTICIPANT when (cuType) { CuType.RESOURCE -> { @@ -160,7 +163,8 @@ object AttendeeMappings { val email = if (uri.scheme.equals("mailto", true)) uri.schemeSpecificPart else - attendee.getParameter(Parameter.EMAIL)?.value + TODO("ical4j 4.x") + //attendee.getParameter(Parameter.EMAIL)?.value if (email == organizer) relationship = Attendees.RELATIONSHIP_ORGANIZER diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilder.kt index eedc9e85..9fa344d0 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilder.kt @@ -20,7 +20,8 @@ class AccessLevelBuilder: AndroidEntityBuilder { val accessLevel: Int val retainValue: Boolean - val classification = from.classification + TODO("ical4j 4.x") + /*val classification = from.classification when (classification) { Clazz.PUBLIC -> { accessLevel = Events.ACCESS_PUBLIC @@ -60,6 +61,7 @@ class AccessLevelBuilder: AndroidEntityBuilder { ExtendedProperties.VALUE to UnknownProperty.toJsonString(classification) ) ) + */ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilder.kt index 80b79017..e56d2821 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilder.kt @@ -14,8 +14,9 @@ import net.fortuna.ical4j.model.component.VEvent class AllDayBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { - val allDay = DateUtils.isDate(from.startDate) - to.entityValues.put(Events.ALL_DAY, if (allDay) 1 else 0) + TODO("ical4j 4.x") + /*val allDay = DateUtils.isDate(from.startDate) + to.entityValues.put(Events.ALL_DAY, if (allDay) 1 else 0)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilder.kt index 27faa9e2..9c93a13d 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilder.kt @@ -36,7 +36,8 @@ class AttendeesBuilder( calendar.ownerAccount ?: calendar.account.name val member = attendee.calAddress - if (member.scheme.equals("mailto", true)) // attendee identified by email + TODO("ical4j 4.x") + /*if (member.scheme.equals("mailto", true)) // attendee identified by email values.put(Attendees.ATTENDEE_EMAIL, member.schemeSpecificPart) else { // attendee identified by other URI @@ -62,7 +63,7 @@ class AttendeesBuilder( PartStat.DELEGATED -> Attendees.ATTENDEE_STATUS_NONE else /* default: PartStat.NEEDS_ACTION */ -> Attendees.ATTENDEE_STATUS_INVITED } - values.put(Attendees.ATTENDEE_STATUS, status) + values.put(Attendees.ATTENDEE_STATUS, status)*/ return values } @@ -74,7 +75,8 @@ class AttendeesBuilder( return if (uri.scheme.equals("mailto", true)) uri.schemeSpecificPart else - organizer.getParameter(Parameter.EMAIL)?.value + TODO("ical4j 4.x") + // organizer.getParameter(Parameter.EMAIL)?.value } return null } diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilder.kt index b085ec51..931d772f 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilder.kt @@ -14,7 +14,8 @@ import net.fortuna.ical4j.model.property.Transp class AvailabilityBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { - val availability = when (from.transparency) { + TODO("ical4j 4.x") + /*val availability = when (from.transparency) { Transp.TRANSPARENT -> Events.AVAILABILITY_FREE @@ -25,7 +26,7 @@ class AvailabilityBuilder: AndroidEntityBuilder { to.entityValues.put( Events.AVAILABILITY, availability - ) + )*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilder.kt index b5fa60a7..3468ae3a 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilder.kt @@ -17,7 +17,8 @@ import net.fortuna.ical4j.model.property.Categories class CategoriesBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { - val categories = from.getProperty(Property.CATEGORIES)?.categories + TODO("ical4j 4.x") + /*val categories = from.getProperty(Property.CATEGORIES)?.categories if (categories != null && !categories.isEmpty) { val rawCategories = categories.joinToString(EventsContract.CATEGORIES_SEPARATOR.toString()) { category -> // drop occurrences of CATEGORIES_SEPARATOR in category names @@ -31,7 +32,7 @@ class CategoriesBuilder: AndroidEntityBuilder { ExtendedProperties.VALUE to rawCategories ) ) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/ColorBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/ColorBuilder.kt index 753adb36..08264452 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/ColorBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/ColorBuilder.kt @@ -22,7 +22,8 @@ class ColorBuilder( override fun build(from: VEvent, main: VEvent, to: Entity) { val values = to.entityValues - val color = from.getProperty(Color.PROPERTY_NAME)?.value + TODO("ical4j 4.x") + /*val color = from.getProperty(Color.PROPERTY_NAME)?.value if (color != null && hasColor(color)) { // set event color (if it's available for this account) values.put(Events.EVENT_COLOR_KEY, color) @@ -30,7 +31,7 @@ class ColorBuilder( // reset color index and value values.putNull(Events.EVENT_COLOR_KEY) values.putNull(Events.EVENT_COLOR) - } + }*/ } @VisibleForTesting diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilder.kt index ff48cea4..41a209b5 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilder.kt @@ -35,7 +35,8 @@ class DurationBuilder: AndroidEntityBuilder { - DURATION when the event is recurring. So we'll skip if this event is not a recurring main event (only main events can be recurring). */ - val rRules = from.getProperties(Property.RRULE) + TODO("ical4j 4.x") + /*val rRules = from.getProperties(Property.RRULE) val rDates = from.getProperties(Property.RDATE) if (from !== main || (rRules.isEmpty() && rDates.isEmpty())) { values.putNull(Events.DURATION) @@ -68,7 +69,7 @@ class DurationBuilder: AndroidEntityBuilder { The calendar provider accepts every DURATION that `com.android.calendarcommon2.Duration` can parse, which is weeks, days, hours, minutes and seconds, like for the RFC 5545 duration. */ val durationStr = alignedDuration.toRfc5545Duration(dtStart.date.toInstant()) - values.put(Events.DURATION, durationStr) + values.put(Events.DURATION, durationStr)*/ } /** @@ -83,8 +84,9 @@ class DurationBuilder: AndroidEntityBuilder { * - a [Duration] (exact time that can be represented by an exact number of seconds) when [dtStart] is a DATE-TIME. */ @VisibleForTesting - internal fun alignWithDtStart(amount: TemporalAmount, dtStart: DtStart): TemporalAmount { - if (DateUtils.isDate(dtStart)) { + internal fun alignWithDtStart(amount: TemporalAmount, dtStart: DtStart<*>): TemporalAmount { + TODO("ical4j 4.x") + /*if (DateUtils.isDate(dtStart)) { // DTSTART is DATE return if (amount is Duration) { // amount is Duration, change to Period of days instead @@ -103,7 +105,7 @@ class DurationBuilder: AndroidEntityBuilder { // amount is already Duration amount } - } + }*/ } /** @@ -115,8 +117,9 @@ class DurationBuilder: AndroidEntityBuilder { * @return temporal amount ([Period] or [Duration]) or `null` if no valid end time was available */ @VisibleForTesting - internal fun calculateFromDtEnd(dtStart: DtStart, dtEnd: DtEnd?): TemporalAmount? { - if (dtEnd == null || dtEnd.date.toInstant() <= dtStart.date.toInstant()) + internal fun calculateFromDtEnd(dtStart: DtStart<*>, dtEnd: DtEnd<*>?): TemporalAmount? { + TODO("ical4j 4.x") + /*if (dtEnd == null || dtEnd.date.toInstant() <= dtStart.date.toInstant()) return null return if (DateUtils.isDateTime(dtStart) && DateUtils.isDateTime(dtEnd)) { @@ -131,7 +134,7 @@ class DurationBuilder: AndroidEntityBuilder { val startDate = dtStart.date.toLocalDate() val endDate = dtEnd.date.toLocalDate() Period.between(startDate, endDate) - } + }*/ } private fun defaultDuration(allDay: Boolean): TemporalAmount = diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilder.kt index 8e071a87..aaf65405 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilder.kt @@ -41,7 +41,8 @@ class EndTimeBuilder: AndroidEntityBuilder { - DURATION when the event is recurring. So we'll skip if this event is a recurring main event (only main events can be recurring). */ - val rRules = from.getProperties(Property.RRULE) + TODO("ical4j 4.x") + /*val rRules = from.getProperties(Property.RRULE) val rDates = from.getProperties(Property.RDATE) if (from === main && (rRules.isNotEmpty() || rDates.isNotEmpty())) { values.putNull(Events.DTEND) @@ -91,7 +92,7 @@ class EndTimeBuilder: AndroidEntityBuilder { } else { // DTEND is a DATE values.put(Events.EVENT_END_TIMEZONE, AndroidTimeUtils.TZID_UTC) - } + }*/ } @@ -110,8 +111,9 @@ class EndTimeBuilder: AndroidEntityBuilder { * @see at.bitfire.synctools.mapping.calendar.handler.RecurrenceFieldsHandler.alignUntil */ @VisibleForTesting - internal fun alignWithDtStart(dtEnd: DtEnd, dtStart: DtStart): DtEnd { - if (DateUtils.isDate(dtEnd)) { + internal fun alignWithDtStart(dtEnd: DtEnd<*>, dtStart: DtStart<*>): DtEnd<*> { + TODO("ical4j 4.x") + /*if (DateUtils.isDate(dtEnd)) { // DTEND is DATE if (DateUtils.isDate(dtStart)) { // DTEND is DATE, DTSTART is DATE @@ -133,7 +135,7 @@ class EndTimeBuilder: AndroidEntityBuilder { // DTEND is DATE-TIME, DTSTART is DATE-TIME return dtEnd } - } + }*/ } /** @@ -145,13 +147,14 @@ class EndTimeBuilder: AndroidEntityBuilder { * @return end date/date-time (same value type as [dtStart]) or `null` if [duration] was not given */ @VisibleForTesting - internal fun calculateFromDuration(dtStart: DtStart, duration: TemporalAmount?): DtEnd? { + internal fun calculateFromDuration(dtStart: DtStart<*>, duration: TemporalAmount?): DtEnd<*>? { if (duration == null) return null val dur = duration.abs() // always take positive temporal amount - return if (DateUtils.isDate(dtStart)) { + TODO("ical4j 4.x") + /*return if (DateUtils.isDate(dtStart)) { // DTSTART is DATE if (dur is Period) { // date-based amount of time ("4 days") @@ -170,7 +173,7 @@ class EndTimeBuilder: AndroidEntityBuilder { // We can add both date-based (Period) and time-based (Duration) amounts of time to an exact date/time. val result = (dtStart.date as DateTime).toZonedDateTime() + dur DtEnd(result.toIcal4jDateTime()) - } + }*/ } /** @@ -194,14 +197,15 @@ class EndTimeBuilder: AndroidEntityBuilder { * - when [dtStart] is a `DATE-TIME`: [dtStart] */ @VisibleForTesting - internal fun calculateFromDefault(dtStart: DtStart): DtEnd = - if (DateUtils.isDate(dtStart)) { + internal fun calculateFromDefault(dtStart: DtStart<*>): DtEnd<*> = + TODO("ical4j 4.x") + /*if (DateUtils.isDate(dtStart)) { // DATE → one day duration val endDate: LocalDate = dtStart.date.toLocalDate().plusDays(1) DtEnd(endDate.toIcal4jDate()) } else { // DATE-TIME → same as DTSTART to indicate there was no DTEND set DtEnd(dtStart.value, dtStart.timeZone) - } + }*/ } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilder.kt index 368f64f0..4789c2b1 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilder.kt @@ -46,7 +46,8 @@ class OrganizerBuilder( return null // Take from mailto: value or EMAIL parameter - val uri: URI? = organizer.calAddress + TODO("ical4j 4.x") + /*val uri: URI? = organizer.calAddress val email = if (uri?.scheme.equals("mailto", true)) uri?.schemeSpecificPart else @@ -55,7 +56,7 @@ class OrganizerBuilder( if (email != null) return email - logger.log(Level.WARNING, "Ignoring ORGANIZER without email address (not supported by Android)", organizer) + logger.log(Level.WARNING, "Ignoring ORGANIZER without email address (not supported by Android)", organizer)*/ return null } diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilder.kt index b9403480..8c91d633 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilder.kt @@ -14,6 +14,7 @@ import at.bitfire.ical4android.util.TimeApiExtensions.toIcal4jDate import at.bitfire.ical4android.util.TimeApiExtensions.toIcal4jDateTime import at.bitfire.ical4android.util.TimeApiExtensions.toLocalDate import at.bitfire.ical4android.util.TimeApiExtensions.toLocalTime +import at.bitfire.synctools.icalendar.recurrenceId import at.bitfire.synctools.icalendar.requireDtStart import net.fortuna.ical4j.model.Date import net.fortuna.ical4j.model.DateTime @@ -23,7 +24,9 @@ import java.time.ZonedDateTime class OriginalInstanceTimeBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { - val values = to.entityValues + TODO("ical4j 4.x") + + /*val values = to.entityValues if (from !== main) { // only for exceptions val originalDtStart = main.requireDtStart() @@ -55,7 +58,7 @@ class OriginalInstanceTimeBuilder: AndroidEntityBuilder { // main event values.putNull(Events.ORIGINAL_ALL_DAY) values.putNull(Events.ORIGINAL_INSTANCE_TIME) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilder.kt index cd61a40d..e0020a5b 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilder.kt @@ -27,7 +27,8 @@ class RecurrenceFieldsBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { val values = to.entityValues - val rRules = from.getProperties(Property.RRULE) + TODO("ical4j 4.x") + /*val rRules = from.getProperties(Property.RRULE) val rDates = from.getProperties(Property.RDATE) val recurring = rRules.isNotEmpty() || rDates.isNotEmpty() if (recurring && from === main) { @@ -84,7 +85,7 @@ class RecurrenceFieldsBuilder: AndroidEntityBuilder { values.putNull(Events.EXRULE) values.putNull(Events.RDATE) values.putNull(Events.EXDATE) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilder.kt index ac595091..c545f4cf 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilder.kt @@ -24,7 +24,8 @@ class RemindersBuilder: AndroidEntityBuilder { } private fun buildReminder(alarm: VAlarm, event: VEvent): ContentValues { - val method = when (alarm.action?.value?.uppercase(Locale.ROOT)) { + TODO("ical4j 4.x") + /*val method = when (alarm.action?.value?.uppercase(Locale.ROOT)) { Action.DISPLAY.value, Action.AUDIO.value -> Reminders.METHOD_ALERT // will trigger an alarm on the Android device @@ -45,7 +46,7 @@ class RemindersBuilder: AndroidEntityBuilder { return contentValuesOf( Reminders.METHOD to method, Reminders.MINUTES to minutes - ) + )*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilder.kt index ad5d4bae..082d07b9 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilder.kt @@ -17,7 +17,8 @@ import java.time.ZoneId class StartTimeBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { - val values = to.entityValues + TODO("ical4j 4.x") + /*val values = to.entityValues val dtStart = from.requireDtStart() @@ -47,7 +48,7 @@ class StartTimeBuilder: AndroidEntityBuilder { } else { // DTSTART is a DATE values.put(Events.EVENT_TIMEZONE, AndroidTimeUtils.TZID_UTC) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilder.kt index b4490fdf..24a26b69 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilder.kt @@ -14,12 +14,13 @@ import net.fortuna.ical4j.model.property.Status class StatusBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { - to.entityValues.put(Events.STATUS, when (from.status) { + TODO("ical4j 4.x") + /*to.entityValues.put(Events.STATUS, when (from.status) { Status.VEVENT_CONFIRMED -> Events.STATUS_CONFIRMED Status.VEVENT_CANCELLED -> Events.STATUS_CANCELED null -> null else -> Events.STATUS_TENTATIVE - }) + })*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UidBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UidBuilder.kt index 5c8c7b3d..bbd722bf 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UidBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UidBuilder.kt @@ -15,7 +15,8 @@ class UidBuilder: AndroidEntityBuilder { override fun build(from: VEvent, main: VEvent, to: Entity) { // Always take UID from main event because exceptions must have the same UID anyway. // Note: RFC 5545 requires UID for VEVENTs, however the obsoleted RFC 2445 does not. - to.entityValues.put(Events.UID_2445, main.uid?.value) + TODO("ical4j 4.x") + /*to.entityValues.put(Events.UID_2445, main.uid?.value)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilder.kt index dcf9e0b3..aad9959b 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilder.kt @@ -48,9 +48,10 @@ class UnknownPropertiesBuilder: AndroidEntityBuilder { @VisibleForTesting internal fun unknownProperties(event: VEvent): List = - event.properties.filterNot { + TODO("ical4j 4.x") + /*event.properties.filterNot { KNOWN_PROPERTY_NAMES.contains(it.name.uppercase()) - } + }*/ companion object { diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandler.kt index 290981b6..89d0ad1a 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandler.kt @@ -20,7 +20,8 @@ class AccessLevelHandler: AndroidEventFieldHandler { val values = from.entityValues // take classification from main row - val classification = when (values.getAsInteger(Events.ACCESS_LEVEL)) { + TODO("ical4j 4.x") + /*val classification = when (values.getAsInteger(Events.ACCESS_LEVEL)) { Events.ACCESS_PUBLIC -> Clazz.PUBLIC @@ -30,11 +31,11 @@ class AccessLevelHandler: AndroidEventFieldHandler { Events.ACCESS_CONFIDENTIAL -> Clazz.CONFIDENTIAL - else /* Events.ACCESS_DEFAULT */ -> + else *//* Events.ACCESS_DEFAULT *//* -> retainedClassification(from) } if (classification != null) - to.properties += classification + to.properties += classification*/ } private fun retainedClassification(from: Entity): Clazz? { diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandler.kt index f3471c04..09f40176 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandler.kt @@ -34,7 +34,8 @@ class AttendeesHandler: AndroidEventFieldHandler { private fun populateAttendee(row: ContentValues, to: VEvent) { logger.log(Level.FINE, "Read event attendee from calendar provider", row) - try { + TODO("ical4j 4.x") + /*try { val attendee: Attendee val email = row.getAsString(Attendees.ATTENDEE_EMAIL) val idNS = row.getAsString(Attendees.ATTENDEE_ID_NAMESPACE) @@ -69,7 +70,7 @@ class AttendeesHandler: AndroidEventFieldHandler { to.properties += attendee } catch (e: URISyntaxException) { logger.log(Level.WARNING, "Couldn't parse attendee information, ignoring", e) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandler.kt index 69393f09..9e032357 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandler.kt @@ -14,7 +14,8 @@ import net.fortuna.ical4j.model.property.Transp class AvailabilityHandler: AndroidEventFieldHandler { override fun process(from: Entity, main: Entity, to: VEvent) { - val transp: Transp = when (from.entityValues.getAsInteger(Events.AVAILABILITY)) { + TODO("ical4j 4.x") + /*val transp: Transp = when (from.entityValues.getAsInteger(Events.AVAILABILITY)) { Events.AVAILABILITY_FREE -> Transp.TRANSPARENT @@ -23,7 +24,7 @@ class AvailabilityHandler: AndroidEventFieldHandler { Transp.OPAQUE } if (transp != Transp.OPAQUE) // iCalendar default value is OPAQUE - to.properties += transp + to.properties += transp*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandler.kt index d7e17da9..023e65e1 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandler.kt @@ -20,9 +20,10 @@ class CategoriesHandler: AndroidEventFieldHandler { val categories = extended.firstOrNull { it.getAsString(ExtendedProperties.NAME) == EventsContract.EXTNAME_CATEGORIES } val listValue = categories?.getAsString(ExtendedProperties.VALUE) if (listValue != null) { - to.properties += Categories(TextList( + TODO("ical4j 4.x") + /*to.properties += Categories(TextList( listValue.split(EventsContract.CATEGORIES_SEPARATOR).toTypedArray() - )) + ))*/ } } diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandler.kt index c8efcadd..ac205816 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandler.kt @@ -34,8 +34,9 @@ class ColorHandler: AndroidEventFieldHandler { Css3Color.entries.firstOrNull { it.argb == color } } - if (color != null) - to.properties += Color(null, color.name) + TODO("ical4j 4.x") + /*if (color != null) + to.properties += Color(null, color.name)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DescriptionHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DescriptionHandler.kt index 0aa4f52f..92687131 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DescriptionHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DescriptionHandler.kt @@ -15,9 +15,10 @@ import net.fortuna.ical4j.model.property.Description class DescriptionHandler: AndroidEventFieldHandler { override fun process(from: Entity, main: Entity, to: VEvent) { - val description = from.entityValues.getAsString(Events.DESCRIPTION).trimToNull() + TODO("ical4j 4.x") + /*val description = from.entityValues.getAsString(Events.DESCRIPTION).trimToNull() if (description != null) - to.properties += Description(description) + to.properties += Description(description)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandler.kt index 78cc7069..5c969611 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandler.kt @@ -52,7 +52,8 @@ class DurationHandler( val tsStart = values.getAsLong(Events.DTSTART) ?: return val allDay = (values.getAsInteger(Events.ALL_DAY) ?: 0) != 0 - if (allDay) { + TODO("ical4j 4.x") + /*if (allDay) { val startTimeUTC = Instant.ofEpochMilli(tsStart).atOffset(ZoneOffset.UTC) val endDate = (startTimeUTC + duration).toLocalDate() @@ -72,7 +73,7 @@ class DurationHandler( val end = start + duration to.properties += DtEnd(end.toIcal4jDateTime(tzRegistry)) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandler.kt index adce1a29..01382478 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandler.kt @@ -60,7 +60,8 @@ class EndTimeHandler( tzRegistry = tzRegistry ).asIcal4jDate() - to.properties += DtEnd(end) + TODO("ical4j 4.x") + //to.properties += DtEnd(end) } @VisibleForTesting diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/LocationHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/LocationHandler.kt index a86ac604..51c429e2 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/LocationHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/LocationHandler.kt @@ -16,8 +16,9 @@ class LocationHandler: AndroidEventFieldHandler { override fun process(from: Entity, main: Entity, to: VEvent) { val location = from.entityValues.getAsString(Events.EVENT_LOCATION).trimToNull() - if (location != null) - to.properties += Location(location) + TODO("ical4j 4.x") + /*if (location != null) + to.properties += Location(location)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OrganizerHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OrganizerHandler.kt index b87abd63..0142acf5 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OrganizerHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OrganizerHandler.kt @@ -30,7 +30,8 @@ class OrganizerHandler: AndroidEventFieldHandler { val hasAttendees = from.subValues.any { it.uri == Attendees.CONTENT_URI } if (hasAttendees && mainValues.containsKey(Events.ORGANIZER)) try { - to.properties += Organizer(URI("mailto", mainValues.getAsString(Events.ORGANIZER), null)) + TODO("ical4j 4.x") + //to.properties += Organizer(URI("mailto", mainValues.getAsString(Events.ORGANIZER), null)) } catch (e: URISyntaxException) { logger.log(Level.WARNING, "Error when creating ORGANIZER mailto URI, ignoring", e) } diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandler.kt index ac2120a7..5373a303 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandler.kt @@ -26,7 +26,8 @@ class OriginalInstanceTimeHandler( return val values = from.entityValues - values.getAsLong(Events.ORIGINAL_INSTANCE_TIME)?.let { originalInstanceTime -> + TODO("ical4j 4.x") + /*values.getAsLong(Events.ORIGINAL_INSTANCE_TIME)?.let { originalInstanceTime -> val originalAllDay = (values.getAsInteger(Events.ORIGINAL_ALL_DAY) ?: 0) != 0 val originalDate = if (originalAllDay) @@ -48,7 +49,7 @@ class OriginalInstanceTimeHandler( } to.properties += RecurrenceId(originalDate) - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldsHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldsHandler.kt index 7833a8ae..fb55c593 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldsHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldsHandler.kt @@ -51,8 +51,11 @@ class RecurrenceFieldsHandler( ).asIcal4jDate() } + TODO("ical4j 4.x") + // Note: big method – maybe split? + // process RRULE field - val rRules = LinkedList() + /*val rRules = LinkedList() values.getAsString(Events.RRULE)?.let { rRuleField -> try { for (rule in rRuleField.split(AndroidTimeUtils.RECURRENCE_RULE_SEPARATOR)) { @@ -130,7 +133,7 @@ class RecurrenceFieldsHandler( to.properties += rDates to.properties += exRules to.properties += exDates - } + }*/ } /** @@ -151,8 +154,9 @@ class RecurrenceFieldsHandler( * * @see at.bitfire.synctools.mapping.calendar.builder.EndTimeBuilder.alignWithDtStart */ - fun alignUntil(recur: Recur, startDate: Date): Recur { - val until: Date = recur.until ?: return recur + fun alignUntil(recur: Recur<*>, startDate: Date): Recur<*> { + TODO("ical4j 4.x") + /*val until: Date = recur.until ?: return recur if (until is DateTime) { // UNTIL is DATE-TIME @@ -182,7 +186,7 @@ class RecurrenceFieldsHandler( // DTSTART is DATE return recur } - } + }*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandler.kt index 729852ce..3be0c41e 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandler.kt @@ -40,7 +40,8 @@ class RemindersHandler( val eventTitle = event.entityValues.getAsString(Events.TITLE) ?: "Calendar Event Reminder" val alarm = VAlarm(Duration.ofMinutes(-row.getAsLong(Reminders.MINUTES))) - val props = alarm.properties + TODO("ical4j 4.x") + /*val props = alarm.properties when (row.getAsInteger(Reminders.METHOD)) { Reminders.METHOD_EMAIL -> { if (Patterns.EMAIL_ADDRESS.matcher(accountName).matches()) { @@ -64,7 +65,7 @@ class RemindersHandler( props += Description(eventTitle) } } - to.components += alarm + to.components += alarm*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/SequenceHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/SequenceHandler.kt index af4a0deb..447b040b 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/SequenceHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/SequenceHandler.kt @@ -15,8 +15,9 @@ class SequenceHandler: AndroidEventFieldHandler { override fun process(from: Entity, main: Entity, to: VEvent) { val seqNo = from.entityValues.getAsInteger(EventsContract.COLUMN_SEQUENCE) - if (seqNo != null && seqNo > 0) - to.properties += Sequence(seqNo) + TODO("ical4j 4.x") + /*if (seqNo != null && seqNo > 0) + to.properties += Sequence(seqNo)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandler.kt index 2539e78b..e97c75e4 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandler.kt @@ -29,7 +29,8 @@ class StartTimeHandler( tzRegistry = tzRegistry ).asIcal4jDate() - to.properties += DtStart(start) + TODO("ical4j 4.x") + //to.properties += DtStart(start) } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandler.kt index 9c8f2730..7eb9a925 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandler.kt @@ -14,7 +14,8 @@ import net.fortuna.ical4j.model.property.Status class StatusHandler: AndroidEventFieldHandler { override fun process(from: Entity, main: Entity, to: VEvent) { - val status = when (from.entityValues.getAsInteger(Events.STATUS)) { + TODO("ical4j 4.x") + /*val status = when (from.entityValues.getAsInteger(Events.STATUS)) { Events.STATUS_CONFIRMED -> Status.VEVENT_CONFIRMED @@ -28,7 +29,7 @@ class StatusHandler: AndroidEventFieldHandler { null } if (status != null) - to.properties += status + to.properties += status*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/TitleHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/TitleHandler.kt index 2894cc90..1b26c592 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/TitleHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/TitleHandler.kt @@ -16,8 +16,9 @@ class TitleHandler: AndroidEventFieldHandler { override fun process(from: Entity, main: Entity, to: VEvent) { val summary = from.entityValues.getAsString(Events.TITLE).trimToNull() - if (summary != null) - to.properties += Summary(summary) + TODO("ical4j 4.x") + /*if (summary != null) + to.properties += Summary(summary)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandler.kt index 92633d8a..0c2d358a 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandler.kt @@ -17,8 +17,9 @@ class UidHandler: AndroidEventFieldHandler { // Should always be available because AndroidEventHandler ensures there's a UID to be RFC 5545-compliant. // However technically it can be null (and no UID is OK according to RFC 2445). val uid = main.entityValues.getAsString(Events.UID_2445) - if (uid != null) - to.properties += Uid(uid) + TODO("ical4j 4.x") + /*if (uid != null) + to.properties += Uid(uid)*/ } } \ No newline at end of file diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandler.kt index 1c8994b0..b8fd32e1 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandler.kt @@ -27,8 +27,9 @@ class UnknownPropertiesHandler: AndroidEventFieldHandler { for (json in jsonProperties) try { val prop = UnknownProperty.fromJsonString(json) - if (!EXCLUDED.contains(prop.name)) - to.properties += prop + TODO("ical4j 4.x") + /*if (!EXCLUDED.contains(prop.name)) + to.properties += prop*/ } catch (e: JSONException) { logger.log(Level.WARNING, "Couldn't parse unknown properties", e) } diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UrlHandler.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UrlHandler.kt index b12931ab..868379e4 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UrlHandler.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/handler/UrlHandler.kt @@ -26,8 +26,9 @@ class UrlHandler: AndroidEventFieldHandler { } catch (_: URISyntaxException) { null } - if (uri != null) - to.properties += Url(uri) + TODO("ical4j 4.x") + /*if (uri != null) + to.properties += Url(uri)*/ } } diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilder.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilder.kt index fab70455..a7ff6096 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilder.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilder.kt @@ -94,7 +94,10 @@ class DmfsTaskBuilder( .withValue(Tasks.PARENT_ID, null) // organizer - task.organizer?.let { organizer -> + TODO("ical4j 4.x") + // Note: big method – maybe split? Depends on how we want to proceed with refactoring. + + /*task.organizer?.let { organizer -> val uri = organizer.calAddress val email = if (uri.scheme.equals("mailto", true)) uri.schemeSpecificPart @@ -160,11 +163,12 @@ class DmfsTaskBuilder( else AndroidTimeUtils.recurrenceSetsToOpenTasksString(task.exDates, if (allDay) null else getTimeZone())) - logger.log(Level.FINE, "Built task object", builder.build()) + logger.log(Level.FINE, "Built task object", builder.build())*/ } fun getTimeZone(): TimeZone { - return task.dtStart?.let { dtStart -> + TODO("ical4j 4.x") + /*return task.dtStart?.let { dtStart -> if (dtStart.isUtc) tzRegistry.getTimeZone(TimeZones.UTC_ID) else @@ -176,7 +180,7 @@ class DmfsTaskBuilder( else due.timeZone } ?: - tzRegistry.getTimeZone(ZoneId.systemDefault().id)!! + tzRegistry.getTimeZone(ZoneId.systemDefault().id)!!*/ } fun insertProperties(batch: TasksBatchOperation, idxTask: Int?) { @@ -203,7 +207,8 @@ class DmfsTaskBuilder( Alarm.ALARM_REFERENCE_START_DATE } - val alarmType = when (alarm.action?.value?.uppercase(Locale.ROOT)) { + TODO("ical4j 4.x") + /*val alarmType = when (alarm.action?.value?.uppercase(Locale.ROOT)) { Action.AUDIO.value -> Alarm.ALARM_TYPE_SOUND Action.DISPLAY.value -> @@ -224,7 +229,7 @@ class DmfsTaskBuilder( .withValue(Alarm.ALARM_TYPE, alarmType) logger.log(Level.FINE, "Inserting alarm", builder.build()) - batch += builder + batch += builder*/ } } @@ -250,13 +255,14 @@ class DmfsTaskBuilder( } private fun insertRelatedTo(batch: TasksBatchOperation, idxTask: Int?) { - for (relatedTo in task.relatedTo) { + TODO("ical4j 4.x") + /*for (relatedTo in task.relatedTo) { val relType = when ((relatedTo.getParameter(Parameter.RELTYPE) as RelType?)) { RelType.CHILD -> Relation.RELTYPE_CHILD RelType.SIBLING -> Relation.RELTYPE_SIBLING - else /* RelType.PARENT, default value */ -> + else *//* RelType.PARENT, default value *//* -> Relation.RELTYPE_PARENT } val builder = CpoBuilder.newInsert(taskList.tasksPropertiesUri()) @@ -266,7 +272,7 @@ class DmfsTaskBuilder( .withValue(Relation.RELATED_TYPE, relType) logger.log(Level.FINE, "Inserting relation", builder.build()) batch += builder - } + }*/ } private fun insertUnknownProperties(batch: TasksBatchOperation, idxTask: Int?) { diff --git a/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskProcessor.kt b/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskProcessor.kt index 7a775f8f..b61f95d3 100644 --- a/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskProcessor.kt +++ b/lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskProcessor.kt @@ -88,7 +88,10 @@ class DmfsTaskProcessor( values.getAsInteger(Tasks.PRIORITY)?.let { to.priority = it } - to.classification = when (values.getAsInteger(Tasks.CLASSIFICATION)) { + TODO("ical4j 4.x") + // Note: big method – maybe split? Depends on how we want to proceed with refactoring. + + /*to.classification = when (values.getAsInteger(Tasks.CLASSIFICATION)) { Tasks.CLASSIFICATION_PUBLIC -> Clazz.PUBLIC Tasks.CLASSIFICATION_PRIVATE -> Clazz.PRIVATE Tasks.CLASSIFICATION_CONFIDENTIAL -> Clazz.CONFIDENTIAL @@ -160,7 +163,7 @@ class DmfsTaskProcessor( to.exDates += AndroidTimeUtils.androidStringToRecurrenceSet(it, tzRegistry, allDay) { dates -> ExDate(dates) } } - values.getAsString(Tasks.RRULE)?.let { to.rRule = RRule(it) } + values.getAsString(Tasks.RRULE)?.let { to.rRule = RRule(it) }*/ } fun populateProperty(row: ContentValues, to: Task) { @@ -183,10 +186,11 @@ class DmfsTaskProcessor( } private fun populateAlarm(row: ContentValues, to: Task) { - val props = PropertyList() + val props = PropertyList() val trigger = Trigger(java.time.Duration.ofMinutes(-row.getAsLong(Alarm.MINUTES_BEFORE))) - when (row.getAsInteger(Alarm.REFERENCE)) { + TODO("ical4j 4.x") + /*when (row.getAsInteger(Alarm.REFERENCE)) { Alarm.ALARM_REFERENCE_START_DATE -> trigger.parameters.add(Related.START) Alarm.ALARM_REFERENCE_DUE_DATE -> @@ -204,7 +208,7 @@ class DmfsTaskProcessor( Action.DISPLAY } - props += Description(row.getAsString(Alarm.MESSAGE) ?: to.summary) + props += Description(row.getAsString(Alarm.MESSAGE) ?: to.summary)*/ to.alarms += VAlarm(props) } @@ -219,14 +223,15 @@ class DmfsTaskProcessor( val relatedTo = RelatedTo(uid) // add relation type as reltypeparam - relatedTo.parameters.add(when (row.getAsInteger(Relation.RELATED_TYPE)) { + TODO("ical4j 4.x") + /*relatedTo.parameters.add(when (row.getAsInteger(Relation.RELATED_TYPE)) { Relation.RELTYPE_CHILD -> RelType.CHILD Relation.RELTYPE_SIBLING -> RelType.SIBLING - else /* Relation.RELTYPE_PARENT, default value */ -> + else *//* Relation.RELTYPE_PARENT, default value *//* -> RelType.PARENT - }) + })*/ to.relatedTo.add(relatedTo) } From a77462f3910cf0287f8530978d2a5074af00376d Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 12:00:29 +0100 Subject: [PATCH 5/7] Make at.bitfire.ical4android unit tests run again --- .../AndroidCompatTimeZoneRegistryTest.kt | 5 ++-- .../at/bitfire/ical4android/DmfsTaskTest.kt | 16 ++++++++----- .../bitfire/ical4android/JtxICalObjectTest.kt | 5 ++-- .../mapping/tasks/DmfsTaskBuilderTest.kt | 10 +++++--- .../at/bitfire/ical4android/ICalendarTest.kt | 23 +++++++++++++------ .../at/bitfire/ical4android/TaskReaderTest.kt | 23 ++++++++++++------- .../at/bitfire/ical4android/TaskTest.kt | 5 ++-- .../at/bitfire/ical4android/TaskWriterTest.kt | 5 ++-- .../ical4android/UnknownPropertyTest.kt | 10 ++++---- .../ical4android/util/DateUtilsTest.kt | 10 ++++---- 10 files changed, 72 insertions(+), 40 deletions(-) diff --git a/lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt b/lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt index 43a763ba..5663ea5e 100644 --- a/lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt +++ b/lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt @@ -48,14 +48,15 @@ class AndroidCompatTimeZoneRegistryTest { @Test fun getTimeZone_Existing_ButNotInIcal4j() { - val reg = AndroidCompatTimeZoneRegistry(object: TimeZoneRegistry { + TODO("ical4j 4.x") + /*val reg = AndroidCompatTimeZoneRegistry(object: TimeZoneRegistry { override fun register(timezone: TimeZone?) = throw NotImplementedError() override fun register(timezone: TimeZone?, update: Boolean) = throw NotImplementedError() override fun clear() = throw NotImplementedError() override fun getTimeZone(id: String?) = null }) - assertNull(reg.getTimeZone("Europe/Berlin")) + assertNull(reg.getTimeZone("Europe/Berlin"))*/ } @Test diff --git a/lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskTest.kt b/lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskTest.kt index a6d3fa5d..4ae45c94 100644 --- a/lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskTest.kt +++ b/lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskTest.kt @@ -82,7 +82,8 @@ class DmfsTaskTest( @Test fun testAddTask() { // build and write event to calendar provider - val task = Task() + TODO("ical4j 4.x") + /*val task = Task() task.uid = "sample1@testAddEvent" task.summary = "Sample event" task.description = "Sample event with date/time" @@ -125,18 +126,19 @@ class DmfsTaskTest( assertEquals(task.unknownProperties, task2.unknownProperties) } finally { testTask.delete() - } + }*/ } @Test(expected = LocalStorageException::class) fun testAddTaskWithInvalidDue() { val task = Task() - task.uid = "invalidDUE@ical4android.tests" + TODO("ical4j 4.x") + /*task.uid = "invalidDUE@ical4android.tests" task.summary = "Task with invalid DUE" task.dtStart = DtStart(Date("20150102")) task.due = Due(Date("20150101")) - DmfsTask(taskList!!, task, "9468a4cf-0d5b-4379-a704-12f1f84100ba", null, 0).add() + DmfsTask(taskList!!, task, "9468a4cf-0d5b-4379-a704-12f1f84100ba", null, 0).add()*/ } @Test @@ -144,7 +146,8 @@ class DmfsTaskTest( val task = Task() task.uid = "TaskWithManyAlarms" task.summary = "Task with many alarms" - task.dtStart = DtStart(Date("20150102")) + TODO("ical4j 4.x") + //task.dtStart = DtStart(Date("20150102")) for (i in 1..1050) task.alarms += VAlarm(java.time.Duration.ofMinutes(i.toLong())) @@ -162,7 +165,8 @@ class DmfsTaskTest( task.summary = "Sample event" task.description = "Sample event with date/time" task.location = "Sample location" - task.dtStart = DtStart("20150501T120000", tzVienna) + TODO("ical4j 4.x") + //task.dtStart = DtStart("20150501T120000", tzVienna) assertFalse(task.isAllDay()) val uri = DmfsTask(taskList!!, task, "9468a4cf-0d5b-4379-a704-12f1f84100ba", null, 0).add() assertNotNull(uri) diff --git a/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt b/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt index cff10a33..ea4fb928 100644 --- a/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt +++ b/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt @@ -837,7 +837,8 @@ class JtxICalObjectTest { //assertEquals(iCalIn.components[0].getProperty(Component.VTODO), iCalOut.components[0].getProperty(Component.VTODO)) // there should only be one component for VJOURNAL and VTODO! - for(i in 0 until iCalIn.components.size) { + TODO("ical4j 4.x") + /*for(i in 0 until iCalIn.components.size) { iCalIn.components[i].properties.forEach { inProp -> @@ -846,7 +847,7 @@ class JtxICalObjectTest { val outProp = iCalOut.components[i].properties.getProperty(inProp.name) assertEquals(inProp, outProp) } - } + }*/ } diff --git a/lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilderTest.kt b/lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilderTest.kt index 8e467979..e8e884d1 100644 --- a/lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilderTest.kt +++ b/lib/src/androidTest/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskBuilderTest.kt @@ -82,7 +82,11 @@ class DmfsTaskBuilderTest ( // builder tests - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun testBuildTask_Sequence() { buildTask { ICalendar.apply { sequence = 12345 } @@ -263,7 +267,7 @@ class DmfsTaskBuilderTest ( buildTask { }.let { result -> assertEquals( - TaskContract.Tasks.CLASSIFICATION_DEFAULT /* null */, + TaskContract.Tasks.CLASSIFICATION_DEFAULT *//* null *//*, result.getAsInteger(TaskContract.Tasks.CLASSIFICATION) ) } @@ -771,7 +775,7 @@ class DmfsTaskBuilderTest ( val dmfsTask = DmfsTask(taskList!!, task, "9dc64544-1816-4f04-b952-e894164467f6", null, 0) dmfsTask.task!!.dtStart = DtStart("20150101", tzVienna) assertEquals(tzVienna, builder.getTimeZone()) - } + }*/ // helpers diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/ICalendarTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/ICalendarTest.kt index 6b818bde..aae7649a 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/ICalendarTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/ICalendarTest.kt @@ -50,11 +50,12 @@ class ICalendarTest { private fun readTimeZone(fileName: String): VTimeZone { - javaClass.classLoader!!.getResourceAsStream("tz/$fileName").use { tzStream -> + TODO("ical4j 4.x") + /*javaClass.classLoader!!.getResourceAsStream("tz/$fileName").use { tzStream -> val cal = CalendarBuilder().build(tzStream) val vTimeZone = cal.getComponent(Component.VTIMEZONE) as VTimeZone return vTimeZone - } + }*/ } @Test @@ -71,9 +72,10 @@ class ICalendarTest { "END:VCALENDAR" ) ) - assertEquals("Some Calendar", calendar.getProperty(ICalendar.CALENDAR_NAME).value) + TODO("ical4j 4.x") + /*assertEquals("Some Calendar", calendar.getProperty(ICalendar.CALENDAR_NAME).value) assertEquals("darkred", calendar.getProperty(Color.PROPERTY_NAME).value) - assertEquals("#123456", calendar.getProperty(ICalendar.CALENDAR_COLOR).value) + assertEquals("#123456", calendar.getProperty(ICalendar.CALENDAR_COLOR).value)*/ } @Test @@ -217,7 +219,11 @@ class ICalendarTest { } - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun testVAlarmToMin_TriggerDuration_Negative() { // TRIGGER;REL=START:-P1DT1H1M29S val (ref, min) = ICalendar.vAlarmToMin( @@ -306,7 +312,7 @@ class ICalendarTest { false )!! assertEquals(Related.START, ref) - assertEquals(-(60 * 24 + 60 + 1 + 1) /* duration of event: */ - 1, min) + assertEquals(-(60 * 24 + 60 + 1 + 1) *//* duration of event: *//* - 1, min) } @Test @@ -328,7 +334,10 @@ class ICalendarTest { val (ref, min) = ICalendar.vAlarmToMin(alarm, DtStart(DateTime(currentTime)), null, null, false)!! assertEquals(Related.START, ref) assertEquals(1, min) - } + }*/ + + + // TODO Note: can we use the following now when we have ical4j 4.x? /* DOES NOT WORK YET! Will work as soon as Java 8 API is consequently used in ical4j and ical4android. diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/TaskReaderTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/TaskReaderTest.kt index 8360c02a..a1d81b8d 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/TaskReaderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/TaskReaderTest.kt @@ -62,8 +62,9 @@ class TaskReaderTest { "END:VCALENDAR\r\n") assertEquals("DTSTART is DATE, but DUE is DATE-TIME", t.summary) // rewrite DTSTART to DATE-TIME, too - assertEquals(DtStart(DateTime("20200731T000000", tzVienna)), t.dtStart) - assertEquals(Due(DateTime("20200731T234600", tzVienna)), t.due) + TODO("ical4j 4.x") + /*assertEquals(DtStart(DateTime("20200731T000000", tzVienna)), t.dtStart) + assertEquals(Due(DateTime("20200731T234600", tzVienna)), t.due)*/ } @Test @@ -78,8 +79,9 @@ class TaskReaderTest { "END:VCALENDAR\r\n") assertEquals("DTSTART is DATE-TIME, but DUE is DATE", t.summary) // rewrite DTSTART to DATE-TIME, too - assertEquals(DtStart(DateTime("20200731T235510", tzVienna)), t.dtStart) - assertEquals(Due(DateTime("20200801T000000", tzVienna)), t.due) + TODO("ical4j 4.x") + /*assertEquals(DtStart(DateTime("20200731T235510", tzVienna)), t.dtStart) + assertEquals(Due(DateTime("20200801T000000", tzVienna)), t.due)*/ } @Test @@ -95,7 +97,8 @@ class TaskReaderTest { assertEquals("DUE before DTSTART", t.summary) // invalid tasks with DUE before DTSTART: DTSTART should be set to null assertNull(t.dtStart) - assertEquals(Due(DateTime("20200731T123000", tzVienna)), t.due) + TODO("ical4j 4.x") + //assertEquals(Due(DateTime("20200731T123000", tzVienna)), t.due) } @Test @@ -126,7 +129,11 @@ class TaskReaderTest { } - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun testSamples() { val t = regenerate(parseCalendarFile("rfc5545-sample1.ics")) assertEquals(2, t.sequence) @@ -190,11 +197,11 @@ class TaskReaderTest { assertEquals("most-fields2@example.com", t.uid) assertEquals(DtStart(DateTime("20100101T101010Z")), t.dtStart) assertEquals( - net.fortuna.ical4j.model.property.Duration(Duration.ofSeconds(4 * 86400 + 3 * 3600 + 2 * 60 + 1) /*Dur(4, 3, 2, 1)*/), + net.fortuna.ical4j.model.property.Duration(Duration.ofSeconds(4 * 86400 + 3 * 3600 + 2 * 60 + 1) *//*Dur(4, 3, 2, 1)*//*), t.duration ) assertTrue(t.unknownProperties.isEmpty()) - } + }*/ /* helpers */ diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/TaskTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/TaskTest.kt index 977ed15e..7837d795 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/TaskTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/TaskTest.kt @@ -21,7 +21,8 @@ class TaskTest { assertTrue(Task().isAllDay()) // DTSTART has priority - assertFalse(Task().apply { + TODO("ical4j 4.x") + /*assertFalse(Task().apply { dtStart = DtStart(DateTime()) }.isAllDay()) assertFalse(Task().apply { @@ -42,7 +43,7 @@ class TaskTest { }.isAllDay()) assertTrue(Task().apply { due = Due(Date()) - }.isAllDay()) + }.isAllDay())*/ } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/TaskWriterTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/TaskWriterTest.kt index b9095e2c..8854c74e 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/TaskWriterTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/TaskWriterTest.kt @@ -29,10 +29,11 @@ class TaskWriterTest { fun testWrite() { val t = Task() t.uid = "SAMPLEUID" - t.dtStart = DtStart("20190101T100000", tzBerlin) + TODO("ical4j 4.x") + //t.dtStart = DtStart("20190101T100000", tzBerlin) val alarm = VAlarm(Duration.ofHours(-1) /*Dur(0, -1, 0, 0)*/) - alarm.properties += Action.AUDIO + //alarm.properties += Action.AUDIO t.alarms += alarm val icalWriter = StringWriter() diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/UnknownPropertyTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/UnknownPropertyTest.kt index 11c831ca..1ca07c43 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/UnknownPropertyTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/UnknownPropertyTest.kt @@ -38,9 +38,10 @@ class UnknownPropertyTest { assertTrue(prop is Attendee) assertEquals("ATTENDEE", prop.name) assertEquals("PropValue", prop.value) - assertEquals(2, prop.parameters.size()) + TODO("ical4j 4.x") + /*assertEquals(2, prop.parameters.size()) assertEquals("value1", prop.parameters.getParameter("x-param1").value) - assertEquals("value2", prop.parameters.getParameter("x-param2").value) + assertEquals("value2", prop.parameters.getParameter("x-param2").value)*/ } @Test(expected = JSONException::class) @@ -59,8 +60,9 @@ class UnknownPropertyTest { attendee.toString().trim() ) - attendee.parameters.add(Rsvp(true)) - attendee.parameters.add(XParameter("X-My-Param", "SomeValue")) + TODO("ical4j 4.x") + /*attendee.parameters.add(Rsvp(true)) + attendee.parameters.add(XParameter("X-My-Param", "SomeValue"))*/ assertEquals( "ATTENDEE;RSVP=TRUE;X-My-Param=SomeValue:mailto:test@test.at", attendee.toString().trim() diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/util/DateUtilsTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/util/DateUtilsTest.kt index 9163a750..859f02ff 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/util/DateUtilsTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/util/DateUtilsTest.kt @@ -40,15 +40,17 @@ class DateUtilsTest { @Test fun testIsDate() { - assertTrue(DateUtils.isDate(DtStart(Date("20200101")))) - assertFalse(DateUtils.isDate(DtStart(DateTime("20200101T010203Z")))) + TODO("ical4j 4.x") + /*assertTrue(DateUtils.isDate(DtStart(Date("20200101")))) + assertFalse(DateUtils.isDate(DtStart(DateTime("20200101T010203Z"))))*/ assertFalse(DateUtils.isDate(null)) } @Test fun testIsDateTime() { - assertFalse(DateUtils.isDateTime(DtEnd(Date("20200101")))) - assertTrue(DateUtils.isDateTime(DtEnd(DateTime("20200101T010203Z")))) + TODO("ical4j 4.x") + /*assertFalse(DateUtils.isDateTime(DtEnd(Date("20200101")))) + assertTrue(DateUtils.isDateTime(DtEnd(DateTime("20200101T010203Z"))))*/ assertFalse(DateUtils.isDateTime(null)) } From cadcdc00e7601db6002bc876ea1f3140c887131d Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 12:07:10 +0100 Subject: [PATCH 6/7] Make event builder tests run again --- .../icalendar/AssociatedComponentsTest.kt | 8 ++++-- .../icalendar/CalendarUidSplitterTest.kt | 11 +++++--- .../icalendar/ICalendarGeneratorTest.kt | 5 ++-- .../bitfire/synctools/icalendar/Ical4jTest.kt | 26 +++++++++++-------- .../validation/ICalPreprocessorTest.kt | 5 ++-- .../builder/AccessLevelBuilderTest.kt | 15 ++++++----- .../calendar/builder/AllDayBuilderTest.kt | 10 ++++--- .../builder/AvailabilityBuilderTest.kt | 10 ++++--- .../calendar/builder/CategoriesBuilderTest.kt | 3 ++- .../calendar/builder/DurationBuilderTest.kt | 8 ++++-- .../calendar/builder/EndTimeBuilderTest.kt | 8 ++++-- .../calendar/builder/OrganizerBuilderTest.kt | 9 ++++--- .../OriginalInstanceTimeBuilderTest.kt | 8 ++++-- .../builder/RecurrenceFieldsBuilderTest.kt | 8 ++++-- .../calendar/builder/RemindersBuilderTest.kt | 8 ++++-- .../calendar/builder/StartTimeBuilderTest.kt | 8 ++++-- .../calendar/builder/StatusBuilderTest.kt | 8 ++++-- .../builder/UnknownPropertiesBuilderTest.kt | 5 ++-- .../synctools/util/AndroidTimeUtilsTest.kt | 13 +++++++--- 19 files changed, 118 insertions(+), 58 deletions(-) diff --git a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/AssociatedComponentsTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/AssociatedComponentsTest.kt index 679b6b9a..8aba346a 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/AssociatedComponentsTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/AssociatedComponentsTest.kt @@ -19,7 +19,11 @@ class AssociatedComponentsTest { AssociatedEvents(null, emptyList()) } - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun testOnlyExceptions_UidNull() { AssociatedEvents(null, listOf( VEvent(propertyListOf( @@ -74,6 +78,6 @@ class AssociatedComponentsTest { Uid("test1"), RecurrenceId(Date("20250629")) )), emptyList()) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitterTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitterTest.kt index ce06de1f..bc4d55ba 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitterTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/CalendarUidSplitterTest.kt @@ -30,7 +30,8 @@ class CalendarUidSplitterTest { @Test fun testAssociatedVEventsByUid_ExceptionOnly_NoUid() { val exception = VEvent(propertyListOf( - RecurrenceId("20250629T000000Z") + TODO("ical4j 4.x") + //RecurrenceId("20250629T000000Z") )) val calendar = Calendar(componentListOf(exception)) val result = CalendarUidSplitter().associateByUid(calendar, Component.VEVENT) @@ -77,7 +78,11 @@ class CalendarUidSplitterTest { assertEquals(emptyList(), result) } - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun testFilterBySequence_MainAndExceptions_MultipleSequences() { val mainEvent1a = VEvent(propertyListOf(Sequence(1))) val mainEvent1b = VEvent(propertyListOf(Sequence(2))) @@ -159,7 +164,7 @@ class CalendarUidSplitterTest { listOf(exception1a, exception1c, exception1b, exception2a, exception2b) ) assertEquals(listOf(exception1c, exception2b), result) - } + }*/ @Test fun testFilterBySequence_OnlyMain_SingleSequence() { diff --git a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/ICalendarGeneratorTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/ICalendarGeneratorTest.kt index cc0561a6..bf49c630 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/ICalendarGeneratorTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/ICalendarGeneratorTest.kt @@ -36,7 +36,8 @@ class ICalendarGeneratorTest { @Test fun `Write event with exceptions and various timezones`() { val iCal = StringWriter() - writer.write(AssociatedEvents( + TODO("ical4j 4.x") + /*writer.write(AssociatedEvents( main = VEvent(propertyListOf( Uid("SAMPLEUID"), @@ -57,7 +58,7 @@ class ICalendarGeneratorTest { )) ), prodId = userAgent - ), iCal) + ), iCal)*/ assertEquals("BEGIN:VCALENDAR\r\n" + "VERSION:2.0\r\n" + diff --git a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/Ical4jTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/Ical4jTest.kt index 6dd6d04d..757b3fec 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/Ical4jTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/Ical4jTest.kt @@ -25,7 +25,6 @@ import net.fortuna.ical4j.model.property.Attendee import net.fortuna.ical4j.model.property.DtEnd import net.fortuna.ical4j.model.property.DtStart import net.fortuna.ical4j.model.property.ProdId -import net.fortuna.ical4j.transform.rfc5545.DatePropertyRule import org.junit.Assert.assertEquals import org.junit.Assert.assertNotEquals import org.junit.Assert.assertNotNull @@ -53,8 +52,9 @@ class Ical4jTest { "END:VCALENDAR" ) ).getComponent(Component.VEVENT) - val attendee = event.getProperty(Property.ATTENDEE) - assertEquals("attendee1@example.virtual", attendee.getParameter(Parameter.EMAIL).value) + TODO("ical4j 4.x") + /*val attendee = event.getProperty(Property.ATTENDEE) + assertEquals("attendee1@example.virtual", attendee.getParameter(Parameter.EMAIL).value)*/ } @Test @@ -88,7 +88,8 @@ class Ical4jTest { val iCalFromKOrganizer = CalendarBuilder().build(StringReader(vtzFromKOrganizer)) ICalPreprocessor().preprocessCalendar(iCalFromKOrganizer) val vEvent = iCalFromKOrganizer.getComponent(Component.VEVENT) - val dtStart = vEvent.startDate + TODO("ical4j 4.x") + /*val dtStart = vEvent.startDate*/ // SHOULD BE UTC -3: // assertEquals(1756396800000, dtStart.date.time) // However is one hour later: 1756400400000 @@ -97,7 +98,8 @@ class Ical4jTest { @Test fun `PRODID is folded when exactly max line length`() { val calendar = Calendar().apply { - properties += ProdId("01234567890123456789012345678901234567890123456789012345678901234567") + TODO("ical4j 4.x") + //properties += ProdId("01234567890123456789012345678901234567890123456789012345678901234567") } val writer = StringWriter() CalendarOutputter().output(calendar, writer) @@ -165,9 +167,10 @@ class Ical4jTest { "END:VTIMEZONE\n" + "END:VCALENDAR" val iCalFromGoogle = CalendarBuilder().build(StringReader(vtzFromGoogle)) - val dublinFromGoogle = iCalFromGoogle.getComponent(Component.VTIMEZONE) as VTimeZone + TODO("ical4j 4.x") + /*val dublinFromGoogle = iCalFromGoogle.getComponent(Component.VTIMEZONE) as VTimeZone val dt = DateTime("20210108T151500", TimeZone(dublinFromGoogle)) - assertEquals("20210108T151500", dt.toString()) + assertEquals("20210108T151500", dt.toString())*/ } @Test @@ -218,17 +221,18 @@ class Ical4jTest { val event = cal.getComponent(Component.VEVENT) val tzGMT5 = tzRegistry.getTimeZone("(GMT -05:00)") assertNotNull(tzGMT5) - assertEquals(DtStart("20250124T190000", tzGMT5), event.startDate) + TODO("ical4j 4.x") + /*assertEquals(DtStart("20250124T190000", tzGMT5), event.startDate) assertEquals(DtEnd("20250124T203000", tzGMT5), event.endDate) // now apply DatePropertyRule DatePropertyRule().applyTo(event.startDate) DatePropertyRule().applyTo(event.endDate) - /* "(GMT -05:00)" is neither in msTimezones, nor in IANA timezones, so - DatePropertyRule completely removes it, but keeps the offset. */ + *//* "(GMT -05:00)" is neither in msTimezones, nor in IANA timezones, so + DatePropertyRule completely removes it, but keeps the offset. *//* assertEquals(DtStart(DateTime("20250125T000000Z")), event.startDate) - assertEquals(DtEnd(DateTime("20250125T013000Z")), event.endDate) + assertEquals(DtEnd(DateTime("20250125T013000Z")), event.endDate)*/ } @Test(expected = ParserException::class) diff --git a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessorTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessorTest.kt index a8076d96..85a83af2 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessorTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessorTest.kt @@ -54,11 +54,12 @@ class ICalPreprocessorTest { javaClass.getResourceAsStream("/events/outlook1.ics").use { stream -> val reader = InputStreamReader(stream, Charsets.UTF_8) val calendar = CalendarBuilder().build(reader) - val vEvent = calendar.getComponent(Component.VEVENT) as VEvent + TODO("ical4j 4.x") + /*val vEvent = calendar.getComponent(Component.VEVENT) as VEvent assertEquals("W. Europe Standard Time", vEvent.startDate.timeZone.id) processor.preprocessCalendar(calendar) - assertEquals("Europe/Vienna", vEvent.startDate.timeZone.id) + assertEquals("Europe/Vienna", vEvent.startDate.timeZone.id)*/ } } diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilderTest.kt index 0451ad41..36a5bd16 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AccessLevelBuilderTest.kt @@ -43,11 +43,12 @@ class AccessLevelBuilderTest { @Test fun `Classification is PUBLIC`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(Clazz.PUBLIC)), main = VEvent(), to = result - ) + )*/ assertContentValuesEqual(contentValuesOf( Events.ACCESS_LEVEL to Events.ACCESS_PUBLIC ), result.entityValues) @@ -57,11 +58,12 @@ class AccessLevelBuilderTest { @Test fun `Classification is PRIVATE`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(Clazz.PRIVATE)), main = VEvent(), to = result - ) + )*/ assertContentValuesEqual(contentValuesOf( Events.ACCESS_LEVEL to Events.ACCESS_PRIVATE ), result.entityValues) @@ -71,11 +73,12 @@ class AccessLevelBuilderTest { @Test fun `Classification is CONFIDENTIAL`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(Clazz.CONFIDENTIAL)), main = VEvent(), to = result - ) + )*/ assertContentValuesEqual(contentValuesOf( Events.ACCESS_LEVEL to Events.ACCESS_CONFIDENTIAL diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilderTest.kt index ce2e79ff..bd9b4a54 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AllDayBuilderTest.kt @@ -41,11 +41,12 @@ class AllDayBuilderTest { @Test fun `DTSTART is DATE`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(DtStart(Date()))), main = VEvent(), to = result - ) + )*/ assertContentValuesEqual(contentValuesOf( Events.ALL_DAY to 1 ), result.entityValues) @@ -54,11 +55,12 @@ class AllDayBuilderTest { @Test fun `DTSTART is DATE-TIME`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(DtStart(DateTime()))), main = VEvent(), to = result - ) + )*/ assertContentValuesEqual(contentValuesOf( Events.ALL_DAY to 0 ), result.entityValues) diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilderTest.kt index 45c7e0c1..a33c63df 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AvailabilityBuilderTest.kt @@ -38,22 +38,24 @@ class AvailabilityBuilderTest { @Test fun `Transparency is OPAQUE`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(Transp.OPAQUE)), main = VEvent(), to = result - ) + )*/ assertEquals(Events.AVAILABILITY_BUSY, result.entityValues.get(Events.AVAILABILITY)) } @Test fun `Transparency is TRANSPARENT`() { val result = Entity(ContentValues()) - builder.build( + TODO("ical4j 4.x") + /*builder.build( from = VEvent(propertyListOf(Transp.TRANSPARENT)), main = VEvent(), to = result - ) + )*/ assertEquals(Events.AVAILABILITY_FREE, result.entityValues.get(Events.AVAILABILITY)) } diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilderTest.kt index 8a9e8af3..1b72adf0 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/CategoriesBuilderTest.kt @@ -31,7 +31,8 @@ class CategoriesBuilderTest { val result = Entity(ContentValues()) builder.build( from = VEvent().apply { - properties += Categories(TextList(arrayOf("Cat 1", "Cat\\2"))) + TODO("ical4j 4.x") + // properties += Categories(TextList(arrayOf("Cat 1", "Cat\\2"))) }, main = VEvent(), to = result diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilderTest.kt index 39005f7b..2403e1ae 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/DurationBuilderTest.kt @@ -34,7 +34,11 @@ class DurationBuilderTest { private val builder = DurationBuilder() - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Not a main event`() { val result = Entity(ContentValues()) builder.build(VEvent(propertyListOf( @@ -319,6 +323,6 @@ class DurationBuilderTest { java.time.Duration.ofHours(2), result ) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilderTest.kt index 2afb2310..ee909f07 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/EndTimeBuilderTest.kt @@ -36,7 +36,11 @@ class EndTimeBuilderTest { private val builder = EndTimeBuilder() - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Recurring event`() { val result = Entity(ContentValues()) val event = VEvent(propertyListOf( @@ -322,6 +326,6 @@ class EndTimeBuilderTest { DtEnd(DateTime("20250102T055623", tzVienna)), result ) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilderTest.kt index 48da87b7..00500711 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OrganizerBuilderTest.kt @@ -46,7 +46,8 @@ class OrganizerBuilderTest { builder.build( from = VEvent(propertyListOf(Organizer("mailto:organizer@example.com"))).apply { // at least one attendee to make event group-scheduled - properties += Attendee("mailto:attendee@example.com") + TODO("ical4j 4.x") + // properties += Attendee("mailto:attendee@example.com") }, main = VEvent(), to = result @@ -63,7 +64,8 @@ class OrganizerBuilderTest { builder.build( from = VEvent(propertyListOf(Organizer("local-id:user"))).apply { // at least one attendee to make event group-scheduled - properties += Attendee("mailto:attendee@example.com") + TODO("ical4j 4.x") + // properties += Attendee("mailto:attendee@example.com") }, main = VEvent(), to = result @@ -80,7 +82,8 @@ class OrganizerBuilderTest { builder.build( from = VEvent(propertyListOf( Organizer("local-id:user").apply { - parameters.add(Email("organizer@example.com")) + TODO("ical4j 4.x") + // parameters.add(Email("organizer@example.com")) }, Attendee("mailto:attendee@example.com") )), diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilderTest.kt index 5ac06c10..d591175f 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/OriginalInstanceTimeBuilderTest.kt @@ -31,7 +31,11 @@ class OriginalInstanceTimeBuilderTest { private val builder = OriginalInstanceTimeBuilder() - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Main event`() { val result = Entity(ContentValues()) val event = VEvent(propertyListOf(DtStart())) @@ -124,6 +128,6 @@ class OriginalInstanceTimeBuilderTest { Events.ORIGINAL_ALL_DAY to 0, Events.ORIGINAL_INSTANCE_TIME to 1594143000000L ), result.entityValues) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilderTest.kt index abeb030d..fc2657ff 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RecurrenceFieldsBuilderTest.kt @@ -31,7 +31,11 @@ class RecurrenceFieldsBuilderTest { private val builder = RecurrenceFieldsBuilder() - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Exception event`() { // Exceptions (of recurring events) must never have recurrence properties themselves. val result = Entity(ContentValues()) @@ -199,6 +203,6 @@ class RecurrenceFieldsBuilderTest { Events.EXRULE to null, Events.EXDATE to "20250920T000000Z" ), result.entityValues) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilderTest.kt index d6d9bbb4..be87283b 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/RemindersBuilderTest.kt @@ -36,7 +36,11 @@ class RemindersBuilderTest { private val builder = RemindersBuilder() - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `No trigger`() { val result = Entity(ContentValues()) builder.build( @@ -248,7 +252,7 @@ class RemindersBuilderTest { to = result ) assertReminder(result, Reminders.MINUTES to 420) - } + }*/ // helpers diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilderTest.kt index caf79408..0bd60e27 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StartTimeBuilderTest.kt @@ -39,7 +39,11 @@ class StartTimeBuilderTest { } - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `All-day event`() { val result = Entity(ContentValues()) val event = VEvent(propertyListOf( @@ -77,6 +81,6 @@ class StartTimeBuilderTest { )) builder.build(event, event, result) assertEquals(1760050923000, result.entityValues.get(Events.DTSTART)) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilderTest.kt index 3761bf6b..47db3c5f 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/StatusBuilderTest.kt @@ -36,7 +36,11 @@ class StatusBuilderTest { assertNull(result.entityValues.get(Events.STATUS)) } - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `STATUS is CONFIRMED`() { val result = Entity(ContentValues()) builder.build( @@ -78,6 +82,6 @@ class StatusBuilderTest { to = result ) assertEquals(Events.STATUS_TENTATIVE, result.entityValues.getAsInteger(Events.STATUS)) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilderTest.kt index a56a7e3a..61b72ffc 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/UnknownPropertiesBuilderTest.kt @@ -46,8 +46,9 @@ class UnknownPropertiesBuilderTest { builder.build( from = VEvent(propertyListOf( XProperty("X-Some-Property", "Some Value").apply { - parameters.add(XParameter("Param1", "Value1")) - parameters.add(XParameter("Param2", "Value2")) + TODO("ical4j 4.x") + /*parameters.add(XParameter("Param1", "Value1")) + parameters.add(XParameter("Param2", "Value2"))*/ } )), main = VEvent(), diff --git a/lib/src/test/kotlin/at/bitfire/synctools/util/AndroidTimeUtilsTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/util/AndroidTimeUtilsTest.kt index c71dc1ee..c79b9aa4 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/util/AndroidTimeUtilsTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/util/AndroidTimeUtilsTest.kt @@ -38,7 +38,7 @@ class AndroidTimeUtilsTest { val tzBerlin: TimeZone = tzRegistry.getTimeZone("Europe/Berlin")!! val tzToronto: TimeZone = tzRegistry.getTimeZone("America/Toronto")!! - val tzCustom by lazy { + val tzCustom: TimeZone by lazy { val builder = CalendarBuilder(tzRegistry) val cal = builder.build( StringReader( @@ -54,7 +54,8 @@ class AndroidTimeUtilsTest { "END:VCALENDAR" ) ) - TimeZone(cal.getComponent(VTimeZone.VTIMEZONE) as VTimeZone) + TODO("ical4j 4.x") + //TimeZone(cal.getComponent(VTimeZone.VTIMEZONE) as VTimeZone) } val tzIdDefault = java.util.TimeZone.getDefault().id!! @@ -71,7 +72,11 @@ class AndroidTimeUtilsTest { // androidifyTimeZone // DateProperty - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun testAndroidifyTimeZone_DateProperty_Date() { // dates (without time) should be ignored val dtStart = DtStart(Date("20150101")) @@ -493,7 +498,7 @@ class AndroidTimeUtilsTest { val list = ArrayList(1) list.add(RDate(DateList("20150101,20150702", Value.DATE))) assertEquals("20150101T000000,20150702T000000", AndroidTimeUtils.recurrenceSetsToOpenTasksString(list, tzBerlin)) - } + }*/ @Test From 47041f0f9d200ea62586ab95199fc5c265a5d1b6 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Sun, 22 Feb 2026 12:28:16 +0100 Subject: [PATCH 7/7] Make remaining unit tests compile again --- .../at/bitfire/ical4android/Ical4jServiceLoaderTest.kt | 3 ++- .../mapping/calendar/AndroidEventHandlerTest.kt | 8 ++++++-- .../synctools/mapping/calendar/AttendeeMappingsTest.kt | 7 +++++-- .../mapping/calendar/builder/AttendeesBuilderTest.kt | 8 ++++++-- .../mapping/calendar/handler/AccessLevelHandlerTest.kt | 9 ++++++--- .../mapping/calendar/handler/AttendeesHandlerTest.kt | 8 ++++++-- .../mapping/calendar/handler/AvailabilityHandlerTest.kt | 3 ++- .../mapping/calendar/handler/CategoriesHandlerTest.kt | 3 ++- .../mapping/calendar/handler/ColorHandlerTest.kt | 6 ++++-- .../mapping/calendar/handler/DurationHandlerTest.kt | 8 ++++++-- .../mapping/calendar/handler/EndTimeHandlerTest.kt | 8 ++++++-- .../calendar/handler/OriginalInstanceTimeHandlerTest.kt | 8 ++++++-- .../calendar/handler/RecurrenceFieldHandlerTest.kt | 8 ++++++-- .../mapping/calendar/handler/RemindersHandlerTest.kt | 8 ++++++-- .../mapping/calendar/handler/StartTimeHandlerTest.kt | 6 ++++-- .../mapping/calendar/handler/StatusHandlerTest.kt | 9 ++++++--- .../synctools/mapping/calendar/handler/UidHandlerTest.kt | 3 ++- .../calendar/handler/UnknownPropertiesHandlerTest.kt | 8 +++++--- 18 files changed, 86 insertions(+), 35 deletions(-) diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/Ical4jServiceLoaderTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/Ical4jServiceLoaderTest.kt index 3d8397ff..3af07a22 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/Ical4jServiceLoaderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/Ical4jServiceLoaderTest.kt @@ -31,7 +31,8 @@ class Ical4jServiceLoaderTest { "END:VCALENDAR\n" val result = CalendarBuilder().build(StringReader(iCal)) val vEvent = result.getComponent(Component.VEVENT) - assertEquals("Networld+Interop Conference", vEvent.summary.value) + TODO("ical4j 4.x") + //assertEquals("Networld+Interop Conference", vEvent.summary.value) } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandlerTest.kt index 18a765de..1904a93e 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventHandlerTest.kt @@ -42,9 +42,13 @@ class AndroidEventHandlerTest { private val tzVienna = tzRegistry.getTimeZone("Europe/Vienna")!! + init { + TODO("ical4j 4.x") + } + // mapToVEvents → MappingResult.associatedEvents - @Test + /*@Test fun `mapToVEvents processes exceptions`() { val result = handler.mapToVEvents( eventAndExceptions = EventAndExceptions( @@ -283,6 +287,6 @@ class AndroidEventHandlerTest { assertFalse(result.generatedUid) assertEquals("sample-uid", result.uid) assertEquals("sample-uid", result.associatedEvents.main?.uid?.value) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappingsTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappingsTest.kt index 8f8ea0e5..e533c616 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappingsTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappingsTest.kt @@ -27,8 +27,11 @@ class AttendeeMappingsTest { val RoleFancy = Role("X-FANCY") } + init { + TODO("ical4j 4.x") + } - @Test + /*@Test fun testAndroidToICalendar_TypeRequired_RelationshipAttendee() { testAndroidToICalendar(ContentValues().apply { put(Attendees.ATTENDEE_TYPE, Attendees.TYPE_REQUIRED) @@ -1126,6 +1129,6 @@ class AttendeeMappingsTest { val attendee = Attendee() AttendeeMappings.androidToICalendar(values, attendee) test(attendee) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilderTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilderTest.kt index 0797fa34..63296feb 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilderTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/builder/AttendeesBuilderTest.kt @@ -39,7 +39,11 @@ class AttendeesBuilderTest { private val builder = AttendeesBuilder(mockCalendar) - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Attendee is email address`() { val result = Entity(ContentValues()) builder.build( @@ -524,6 +528,6 @@ class AttendeesBuilderTest { result.subValues.first { it.uri == Attendees.CONTENT_URI }.values, onlyFieldsInExpected = true ) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandlerTest.kt index 7eb438fd..d2a73979 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AccessLevelHandlerTest.kt @@ -76,7 +76,8 @@ class AccessLevelHandlerTest { Events.ACCESS_LEVEL to Events.ACCESS_PUBLIC )) handler.process(entity, entity, result) - assertEquals(Clazz.PUBLIC, result.classification) + TODO("ical4j 4.x") + //assertEquals(Clazz.PUBLIC, result.classification) } @Test @@ -86,7 +87,8 @@ class AccessLevelHandlerTest { Events.ACCESS_LEVEL to Events.ACCESS_PRIVATE )) handler.process(entity, entity, result) - assertEquals(Clazz.PRIVATE, result.classification) + TODO("ical4j 4.x") + //assertEquals(Clazz.PRIVATE, result.classification) } @Test @@ -96,7 +98,8 @@ class AccessLevelHandlerTest { Events.ACCESS_LEVEL to Events.ACCESS_CONFIDENTIAL )) handler.process(entity, entity, result) - assertEquals(Clazz.CONFIDENTIAL, result.classification) + TODO("ical4j 4.x") + //assertEquals(Clazz.CONFIDENTIAL, result.classification) } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandlerTest.kt index b8d244af..c0404a18 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AttendeesHandlerTest.kt @@ -32,7 +32,11 @@ class AttendeesHandlerTest { private val handler = AttendeesHandler() - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Attendee is email address`() { val entity = Entity(ContentValues()) entity.addSubValue(Attendees.CONTENT_URI, contentValuesOf( @@ -329,6 +333,6 @@ class AttendeesHandlerTest { handler.process(entity, entity, result) val attendee = result.getProperty(Property.ATTENDEE) assertTrue(attendee.getParameter(Parameter.RSVP).rsvp) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandlerTest.kt index db72c57d..cce14704 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/AvailabilityHandlerTest.kt @@ -51,7 +51,8 @@ class AvailabilityHandlerTest { Events.AVAILABILITY to Events.AVAILABILITY_FREE )) handler.process(entity, entity, result) - assertEquals(Transp.TRANSPARENT, result.getProperty(Property.TRANSP)) + TODO("ical4j 4.x") + //assertEquals(Transp.TRANSPARENT, result.getProperty(Property.TRANSP)) } @Test diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandlerTest.kt index ba640d72..75b45972 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/CategoriesHandlerTest.kt @@ -42,7 +42,8 @@ class CategoriesHandlerTest { ExtendedProperties.VALUE to "Cat 1\\Cat 2" )) handler.process(entity, entity, result) - assertEquals(listOf("Cat 1", "Cat 2"), result.getProperty(Property.CATEGORIES).categories.toList()) + TODO("ical4j 4.x") + //assertEquals(listOf("Cat 1", "Cat 2"), result.getProperty(Property.CATEGORIES).categories.toList()) } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandlerTest.kt index 0f6e3586..28240bf0 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/ColorHandlerTest.kt @@ -39,7 +39,8 @@ class ColorHandlerTest { Events.EVENT_COLOR_KEY to Css3Color.silver.name )) handler.process(entity, entity, result) - assertEquals("silver", result.getProperty(Color.PROPERTY_NAME).value) + TODO("ical4j 4.x") + //assertEquals("silver", result.getProperty(Color.PROPERTY_NAME).value) } @Test @@ -49,7 +50,8 @@ class ColorHandlerTest { Events.EVENT_COLOR to Css3Color.silver.argb )) handler.process(entity, entity, result) - assertEquals("silver", result.getProperty(Color.PROPERTY_NAME).value) + TODO("ical4j 4.x") + //assertEquals("silver", result.getProperty(Color.PROPERTY_NAME).value) } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandlerTest.kt index 17e351cb..d70bb7ac 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/DurationHandlerTest.kt @@ -28,9 +28,13 @@ class DurationHandlerTest { private val handler = DurationHandler(tzRegistry) + init { + TODO("ical4j 4.x") + } + // Note: When the calendar provider sets a non-null DURATION, it implies that the event is recurring. - @Test + /*@Test fun `All-day event with all-day duration`() { val result = VEvent() val entity = Entity(contentValuesOf( @@ -177,6 +181,6 @@ class DurationHandlerTest { handler.process(entity, entity, result) assertNull(result.endDate) assertNull(result.duration) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandlerTest.kt index e470dff0..39d25af5 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/EndTimeHandlerTest.kt @@ -35,7 +35,11 @@ class EndTimeHandlerTest { // Note: When the calendar provider sets a non-null DTEND, it implies that the event is not recurring. - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `All-day event`() { val result = VEvent() val entity = Entity(contentValuesOf( @@ -157,6 +161,6 @@ class EndTimeHandlerTest { val start = System.currentTimeMillis() val result = handler.calculateFromDefault(start, allDay = false) assertEquals(start, result) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandlerTest.kt index 507c6532..98159d13 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/OriginalInstanceTimeHandlerTest.kt @@ -28,7 +28,11 @@ class OriginalInstanceTimeHandlerTest { private val handler = OriginalInstanceTimeHandler(tzRegistry) - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Original event is all-day`() { val result = VEvent() val entity = Entity(contentValuesOf( @@ -49,6 +53,6 @@ class OriginalInstanceTimeHandlerTest { )) handler.process(entity, Entity(ContentValues()), result) assertEquals(RecurrenceId(DateTime("20250922T161348", tzVienna)), result.recurrenceId) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldHandlerTest.kt index 9e4f3898..cdc76fb3 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RecurrenceFieldHandlerTest.kt @@ -39,7 +39,11 @@ class RecurrenceFieldHandlerTest { private val handler = RecurrenceFieldsHandler(tzRegistry) - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Recurring exception`() { val result = VEvent() val entity = Entity(contentValuesOf( @@ -236,6 +240,6 @@ class RecurrenceFieldHandlerTest { .build(), result ) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandlerTest.kt index 8eb06b96..c3d6538e 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/RemindersHandlerTest.kt @@ -26,7 +26,11 @@ class RemindersHandlerTest { private val accountName = "user@example.com" private val handler = RemindersHandler(accountName) - @Test + init { + TODO("ical4j 4.x") + } + + /*@Test fun `Email reminder`() { // account name looks like an email address assumeTrue(accountName.endsWith("@example.com")) @@ -103,6 +107,6 @@ class RemindersHandlerTest { handler.process(entity, entity, result) val alarm = result.alarms.first() assertEquals(Duration.ofMinutes(10), alarm.trigger.duration) - } + }*/ } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandlerTest.kt index 3863f27c..6ccca590 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StartTimeHandlerTest.kt @@ -39,7 +39,8 @@ class StartTimeHandlerTest { Events.EVENT_TIMEZONE to AndroidTimeUtils.TZID_UTC )) handler.process(entity, entity, result) - assertEquals(DtStart(Date("20200621")), result.startDate) + TODO("ical4j 4.x") + //assertEquals(DtStart(Date("20200621")), result.startDate) } @Test @@ -50,7 +51,8 @@ class StartTimeHandlerTest { Events.EVENT_TIMEZONE to "Europe/Vienna" )) handler.process(entity, entity, result) - assertEquals(DtStart(DateTime("20200621T120000", tzVienna)), result.startDate) + TODO("ical4j 4.x") + //assertEquals(DtStart(DateTime("20200621T120000", tzVienna)), result.startDate) } @Test(expected = InvalidLocalResourceException::class) diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandlerTest.kt index 8f063514..99346fc8 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/StatusHandlerTest.kt @@ -38,7 +38,8 @@ class StatusHandlerTest { Events.STATUS to Events.STATUS_CONFIRMED )) handler.process(entity, entity, result) - assertEquals(Status.VEVENT_CONFIRMED, result.status) + TODO("ical4j 4.x") + //assertEquals(Status.VEVENT_CONFIRMED, result.status) } @Test @@ -48,7 +49,8 @@ class StatusHandlerTest { Events.STATUS to Events.STATUS_TENTATIVE )) handler.process(entity, entity, result) - assertEquals(Status.VEVENT_TENTATIVE, result.status) + TODO("ical4j 4.x") + //assertEquals(Status.VEVENT_TENTATIVE, result.status) } @Test @@ -58,7 +60,8 @@ class StatusHandlerTest { Events.STATUS to Events.STATUS_CANCELED )) handler.process(entity, entity, result) - assertEquals(Status.VEVENT_CANCELLED, result.status) + TODO("ical4j 4.x") + //assertEquals(Status.VEVENT_CANCELLED, result.status) } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandlerTest.kt index a79e4342..34514672 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UidHandlerTest.kt @@ -37,7 +37,8 @@ class UidHandlerTest { )) val result = VEvent() handler.process(entity, entity, result) - assertEquals("from-event", result.uid.value) + TODO("ical4j 4.x") + //assertEquals("from-event", result.uid.value) } } \ No newline at end of file diff --git a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandlerTest.kt b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandlerTest.kt index ebb6d574..b37f67f8 100644 --- a/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandlerTest.kt +++ b/lib/src/test/kotlin/at/bitfire/synctools/mapping/calendar/handler/UnknownPropertiesHandlerTest.kt @@ -30,7 +30,8 @@ class UnknownPropertiesHandlerTest { val result = VEvent(/* initialise = */ false) val entity = Entity(ContentValues()) handler.process(entity, entity, result) - assertTrue(result.properties.isEmpty()) + TODO("ical4j 4.x") + //assertTrue(result.properties.isEmpty()) } @Test @@ -50,12 +51,13 @@ class UnknownPropertiesHandlerTest { ExtendedProperties.VALUE to "[\"X-PROP2\", \"value 2\", {\"arg1\": \"arg-value\"}]" )) handler.process(entity, entity, result) - assertEquals(listOf( + TODO("ical4j 4.x") + /*assertEquals(listOf( XProperty("X-PROP1", "value 1"), XProperty("X-PROP2", "value 2").apply { parameters.add(XParameter("ARG1", "arg-value")) }, - ), result.properties) + ), result.properties)*/ } } \ No newline at end of file