EN · DE · RU · FR · ES

#1730: BaseDaoTest.kt

projectforge-business/src/test/kotlin/org/projectforge/core/BaseDaoTest.kt Type : Kotlin · Rôle : Test · Source : projectforge-business/src/test/kotlin/org/projectforge/core/BaseDaoTest.kt 58 lignes · 33 code · 22 commentaires · 3 vides
Objet d'accès aux données pour les entités BaseTest. Étend BaseDao pour fournir des opérations CRUD, des requêtes Hibernate Search et un accès aux données au niveau de la logique métier.

Structure du code

Annotations : projectforge, Test

Classes : BaseDaoTest

Fonctions (1) : modifySearchString

Importations : 3 paquetages

Paquetage : org.projectforge.core

Code source (abrégé)

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*"))
  }
}

Historique Git

868d6abb7 2025 -> 2026
63081666f En-têtes des fichiers source : 2024 -> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5e7def3e6 BaseDaoJpaAdapter : modificationStatus (n'ignore pas les champs @Transparent).