[Workspace Model] Remove unsupported test

GitOrigin-RevId: 1b229103cc09bafe930f98353e72cf216c87fe09
This commit is contained in:
Alex Plate
2020-06-09 13:04:05 +03:00
committed by intellij-monorepo-bot
parent 17663fd984
commit efc7e0a52b
3 changed files with 4 additions and 10 deletions
@@ -678,12 +678,10 @@ internal class WorkspaceEntityStorageBuilderImpl(
private fun updateEntityRefs(entityId: EntityId, updatedChildren: ChildrenConnectionsInfo,
updatedParents: ParentConnectionsInfo) {
// Restore children references of the entity
val localChildrenByConnectionid = this.refs.getChildrenRefsOfParentBy(entityId)
for ((connectionId, children) in updatedChildren) {
val (missingChildren, existingChildren) = children.partition { this.entityDataById(it) == null }
if (missingChildren.isNotEmpty() && !connectionId.canRemoveChild()) adFailed("Cannot restore some dependencies")
val localChildren = localChildrenByConnectionid[connectionId] ?: emptySet()
refs.updateChildrenOfParent(connectionId, entityId, existingChildren + localChildren)
refs.updateChildrenOfParent(connectionId, entityId, existingChildren)
}
// Restore parent references of the entity
@@ -6,6 +6,7 @@ import com.intellij.workspaceModel.storage.entities.*
import com.intellij.workspaceModel.storage.impl.WorkspaceEntityStorageBuilderImpl
import com.intellij.workspaceModel.storage.impl.WorkspaceEntityStorageImpl
import org.junit.Assert.*
import org.junit.Ignore
import org.junit.Test
private fun WorkspaceEntityStorageBuilder.applyDiff(anotherBuilder: WorkspaceEntityStorageBuilder): WorkspaceEntityStorage {
@@ -190,6 +191,7 @@ class DiffBuilderTest {
source.applyDiff(target)
}
@Ignore("Unsupported")
@Test
fun `modify child and parent`() {
val source = WorkspaceEntityStorageBuilderImpl.create()
@@ -1,7 +1,6 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.workspaceModel.storage.propertyBased
import com.intellij.idea.Bombed
import com.intellij.workspaceModel.storage.EntitySource
import com.intellij.workspaceModel.storage.WorkspaceEntityStorage
import com.intellij.workspaceModel.storage.WorkspaceEntityStorageBuilder
@@ -18,7 +17,6 @@ import org.jetbrains.jetCheck.Generator
import org.jetbrains.jetCheck.ImperativeCommand
import org.jetbrains.jetCheck.PropertyChecker
import org.junit.Test
import java.util.*
import kotlin.reflect.full.memberProperties
class PropertyTest {
@@ -45,7 +43,6 @@ class PropertyTest {
}
}
@Bombed(year = 2020, month = Calendar.JUNE, day = 14, user = "Alex Plate")
@Test
fun testAddDiff() {
PropertyChecker.checkScenarios {
@@ -66,15 +63,12 @@ private class AddDiff(private val storage: WorkspaceEntityStorageBuilder) : Impe
env.logMessage("Modify diff:")
env.executeCommands(getEntityManipulation(another))
env.logMessage("Modify original storage:")
env.executeCommands(getEntityManipulation(storage as WorkspaceEntityStorageBuilderImpl))
try {
storage.addDiff(another)
}
catch (e: AddDiffException) {
env.logMessage("Cannot perform addDiff: ${e.message}. Fallback to previous state")
storage.restoreFromBackup(backup)
(storage as WorkspaceEntityStorageBuilderImpl).restoreFromBackup(backup)
}
}