Skip to content

Commit

Permalink
Merge pull request #107 from JetBrains/xd-969-1
Browse files Browse the repository at this point in the history
Valid tests were enabled.
  • Loading branch information
andrii0lomakin authored Sep 18, 2024
2 parents 404b971 + 4e07474 commit e26fd24
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import jetbrains.exodus.entitystore.iterate.EntityIterableBase
import jetbrains.exodus.entitystore.iterate.EntityIteratorWithPropId
import jetbrains.exodus.entitystore.orientdb.OEntity
import jetbrains.exodus.entitystore.orientdb.OReadonlyVertexEntity
import jetbrains.exodus.entitystore.orientdb.iterate.OQueryEntityIterator
import java.io.File
import java.io.InputStream

Expand Down
10 changes: 1 addition & 9 deletions dnq/src/main/kotlin/kotlinx/dnq/query/NodeBaseOperations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package kotlinx.dnq.query

import jetbrains.exodus.entitystore.Entity
import jetbrains.exodus.entitystore.iterate.EntityIterableBase
import jetbrains.exodus.entitystore.util.unsupported
import jetbrains.exodus.query.*
import jetbrains.exodus.query.metadata.ModelMetaData
import kotlinx.dnq.XdEntity
Expand Down Expand Up @@ -396,15 +397,6 @@ inline infix fun <reified R : XdEntity, T : Comparable<T>> KProperty1<R, Set<T>>
return eq(this.getDBName(R::class), value)
}

/**
* Returns new [NodeBase] representing filter:
*
* value of `this` Set<String> property contains element that starts with the given [value].
*/
inline infix fun <reified R : XdEntity> KProperty1<R, Set<String>>.anyStartsWith(value: String?): NodeBase {
return startsWith(getDBName(R::class), value)
}

/**
* Returns new [NodeBase] representing filter:
*
Expand Down

This file was deleted.

18 changes: 0 additions & 18 deletions dnq/src/test/kotlin/kotlinx/dnq/MutableSetPropertyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ import com.google.common.truth.IterableSubject
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import jetbrains.exodus.entitystore.Entity
import kotlinx.dnq.query.anyStartsWith
import kotlinx.dnq.query.contains
import kotlinx.dnq.query.query
import kotlinx.dnq.query.toList
import kotlinx.dnq.util.hasChanges
import kotlinx.dnq.util.isDefined
import org.junit.Ignore
import org.junit.Test

class MutableSetPropertyTest : DBTest() {
Expand Down Expand Up @@ -102,22 +100,6 @@ class MutableSetPropertyTest : DBTest() {
}
}

@Test
@Ignore
fun `anyStartsWith query`() {
val employee = store.transactional {
Employee.new { skills.addAll(listOf("Java", "Kotlin", "Xodus-DNQ")) }
}

store.transactional {
assertThat(Employee.query(Employee::skills anyStartsWith "Kot").toList())
.containsExactly(employee)

assertThat(Employee.query(Employee::skills anyStartsWith "Sc").toList())
.isEmpty()
}
}

private fun createEmployee(vararg skills: String): Employee {
return transactional {
Employee.new { this.skills.addAll(skills) }
Expand Down
24 changes: 3 additions & 21 deletions dnq/src/test/kotlin/kotlinx/dnq/SetPropertyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ package kotlinx.dnq

import com.google.common.truth.Truth.assertThat
import jetbrains.exodus.entitystore.Entity
import kotlinx.dnq.query.anyStartsWith
import kotlinx.dnq.query.contains
import kotlinx.dnq.query.query
import kotlinx.dnq.query.toList
import kotlinx.dnq.util.isDefined
import org.junit.Ignore
import org.junit.Test

class SetPropertyTest : DBTest() {
Expand Down Expand Up @@ -58,7 +56,7 @@ class SetPropertyTest : DBTest() {

store.transactional {
assertThat(employee.skills)
.containsExactly("Java", "Kotlin", "Xodus-DNQ")
.containsExactly("Java", "Kotlin", "Xodus-DNQ")
}
}

Expand Down Expand Up @@ -108,26 +106,10 @@ class SetPropertyTest : DBTest() {

store.transactional {
assertThat(Employee.query(Employee::skills contains "Kotlin").toList())
.containsExactly(employee)
.containsExactly(employee)

assertThat(Employee.query(Employee::skills contains "Scala").toList())
.isEmpty()
}
}

@Test
@Ignore
fun `anyStartsWith query`() {
val employee = store.transactional {
Employee.new { skills = setOf("Java", "Kotlin", "Xodus-DNQ") }
}

store.transactional {
assertThat(Employee.query(Employee::skills anyStartsWith "Kot").toList())
.containsExactly(employee)

assertThat(Employee.query(Employee::skills anyStartsWith "Sc").toList())
.isEmpty()
.isEmpty()
}
}
}
111 changes: 0 additions & 111 deletions dnq/src/test/kotlin/kotlinx/dnq/ThreadLocalStoreContainerTest.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class ConcurrentAggregationTest : DBTest() {
}

@Test
@Ignore
fun setOneToOne() {
val focus = transactional { Car.new() }
val c4 = transactional { Car.new() }
Expand All @@ -72,7 +71,6 @@ class ConcurrentAggregationTest : DBTest() {
}

@Test
@Ignore
fun setManyToOne() {
val focus = transactional { Car.new() }
val c4 = transactional { Car.new() }
Expand All @@ -96,7 +94,6 @@ class ConcurrentAggregationTest : DBTest() {
}

@Test
@Ignore
fun setManyToOne2() {
val focus = transactional { txn ->
val focus = Car.new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class DirectedAssociationTest : DBTest() {
}

@Test
@Ignore
fun createToMany() {
val phone = transactional { txn ->
val phone = Phone.new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class FilterQueryPropertiesTest : DBTest() {
}

@Test
@Ignore
fun `should search by contains`(){
val (user1, user2, user3) = store.transactional {
Triple(User.new {
Expand Down
52 changes: 0 additions & 52 deletions dnq/src/test/kotlin/kotlinx/dnq/sample/MultiStoreSample.kt

This file was deleted.

0 comments on commit e26fd24

Please sign in to comment.