EN · DE · RU · FR · ES

#1730: BaseDaoTest.kt

projectforge-business/src/test/kotlin/org/projectforge/core/BaseDaoTest.kt Typ: Kotlin · Rolle: Test · Quelle: projectforge-business/src/test/kotlin/org/projectforge/core/BaseDaoTest.kt 58 Zeilen · 33 Code · 22 Kommentare · 3 leer
Datenzugriffsobjekt für BaseTest-Entitäten. Erweitert BaseDao, um CRUD-Operationen, Hibernate-Search-Abfragen und Datenzugriff auf Geschäftslogikebene bereitzustellen.

Codestruktur

Annotationen: projectforge, Test

Klassen: BaseDaoTest

Funktionen (1): modifySearchString

Importe: 3 Pakete

Paket: org.projectforge.core

Quellcode (gekürzt)

package org.projectforge.core

import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.projectforge.framework.persistence.jpa.impl.HibernateSearchFilterUtils.modifySearchString

class BaseDaoTest {
  @Test
  fun modifySearchString() {
    Assertions.assertEquals("hallo*", modifySearchString("hallo"))
    Assertions.assertEquals("hallo* ProjectForge*", modifySearchString("hallo ProjectForge"))
    Assertions.assertEquals("ha1lo* ProjectForge*", modifySearchString("ha1lo ProjectForge"))
    Assertions.assertEquals("k.reinhard@projectforge*", modifySearchString("k.reinhard@projectforge"))
    Assertions.assertEquals(
      "email:k.reinhard@projectforge",
      modifySearchString("email:k.reinhard@projectforge")
    )
    Assertions.assertEquals("hallo", modifySearchString("'hallo"))
    Assertions.assertEquals("title:hallo", modifySearchString("'title:hallo"))
    Assertions.assertEquals(
      "(hallo* AND test* NOT hurz* OR test*)",
      modifySearchString("hallo AND test NOT hurz OR test")
    )
    Assertions.assertEquals(
      "(hallo* AND 2008-11-21 NOT hurz* OR test*)",
      modifySearchString("hallo AND 2008-11-21 NOT hurz OR test")
    )
    Assertions.assertEquals("-hallo", modifySearchString("-hallo"))
    Assertions.assertEquals("+hallo", modifySearchString("+hallo"))
    Assertions.assertEquals("+hallo", modifySearchString("+hallo"))
    Assertions.assertEquals("h+a-llo", modifySearchString("h+a-llo"))
    Assertions.assertEquals("hu-melder", modifySearchString("hu-melder"))
    Assertions.assertEquals("*h+a-llo*", modifySearchString("*h+a-llo*"))
  }
}

Git-Verlauf

868d6abb7 2025 -> 2026
63081666f Quellcode-Dateiköpfe: 2024 -> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5e7def3e6 BaseDaoJpaAdapter: modificationStatus (ignoriert @Transparent-Felder nicht).