EN · DE · RU · FR · ES

#1730: BaseDaoTest.kt

projectforge-business/src/test/kotlin/org/projectforge/core/BaseDaoTest.kt Type: Kotlin · Role: Test · Source: projectforge-business/src/test/kotlin/org/projectforge/core/BaseDaoTest.kt 58 lines · 33 code · 22 comments · 3 blank
Data Access Object for BaseTest entities. Extends BaseDao to provide CRUD operations, Hibernate Search queries, and business-logic-level data access.

Code Structure

Annotations: projectforge, Test

Classes: BaseDaoTest

Functions (1): modifySearchString

Imports: 3 packages

Package: org.projectforge.core

Source Code (abridged)

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 History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5e7def3e6 BaseDaoJpaAdapter: modificationStatus (doesn't ignore @Transparent fields).