Search in sources :

Example 36 with EnumSource

use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.

the class EntityTokenUpdatesTest method shouldGenerateUpdateForRemovedTokens.

@ParameterizedTest
@EnumSource(Entity.class)
void shouldGenerateUpdateForRemovedTokens(Entity entity) {
    EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN_1_ID, TOKEN_2_ID).withTokensAfter(EMPTY).build();
    assertThat(updates.tokenUpdateForIndexKey(entity.getTokenIndex(), -1)).contains(IndexEntryUpdate.change(ENTITY_ID, entity.getTokenIndex(), new long[] { TOKEN_1_ID, TOKEN_2_ID }, EMPTY));
}
Also used : EntityUpdates(org.neo4j.storageengine.api.EntityUpdates) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 37 with EnumSource

use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.

the class EntityTokenUpdatesTest method shouldNotGenerateUpdateForExistingToken.

@ParameterizedTest
@EnumSource(Entity.class)
void shouldNotGenerateUpdateForExistingToken(Entity entity) {
    EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN_1_ID).build();
    assertThat(updates.tokenUpdateForIndexKey(entity.getTokenIndex(), -1)).isEmpty();
}
Also used : EntityUpdates(org.neo4j.storageengine.api.EntityUpdates) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 38 with EnumSource

use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.

the class EntityValueUpdatesTest method shouldNotGenerateUpdateForPartialCompositeSchemaIndexUpdate.

@ParameterizedTest
@EnumSource(Entity.class)
void shouldNotGenerateUpdateForPartialCompositeSchemaIndexUpdate(Entity entity) {
    // When
    EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN).withTokensAfter(TOKEN).added(PROPERTY_KEY_ID_1, Values.of("Neo")).added(PROPERTY_KEY_ID_3, Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6)).build();
    // Then
    assertThat(updates.valueUpdatesForIndexKeys(singleton(entity.index123()), propertyLoader(), entity.type(), NULL, INSTANCE)).isEmpty();
}
Also used : EntityUpdates(org.neo4j.storageengine.api.EntityUpdates) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 39 with EnumSource

use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.

the class EntityValueUpdatesTest method shouldGenerateUpdateForPartialNonSchemaIndexUpdate.

@ParameterizedTest
@EnumSource(Entity.class)
void shouldGenerateUpdateForPartialNonSchemaIndexUpdate(Entity entity) {
    // When
    EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN).withTokensAfter(TOKEN).added(PROPERTY_KEY_ID_1, Values.of("Neo")).build();
    // Then
    assertThat(updates.valueUpdatesForIndexKeys(singleton(entity.nonSchemaIndex()), propertyLoader(), entity.type(), NULL, INSTANCE)).contains(IndexEntryUpdate.add(ENTITY_ID, entity.nonSchemaIndex(), PROPERTY_1.value(), null, null));
}
Also used : EntityUpdates(org.neo4j.storageengine.api.EntityUpdates) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 40 with EnumSource

use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.

the class EntityTokenUpdatesTest method shouldNotGenerateUpdatesForEmptyEntityUpdates.

@ParameterizedTest
@EnumSource(Entity.class)
void shouldNotGenerateUpdatesForEmptyEntityUpdates(Entity entity) {
    EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).build();
    assertThat(updates.tokenUpdateForIndexKey(entity.getTokenIndex(), -1)).isEmpty();
}
Also used : EntityUpdates(org.neo4j.storageengine.api.EntityUpdates) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

EnumSource (org.junit.jupiter.params.provider.EnumSource)1563 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1559 Objs (io.github.mianalysis.mia.object.Objs)238 Obj (io.github.mianalysis.mia.object.Obj)232 SpatCal (io.github.sjcross.common.object.volume.SpatCal)174 Workspace (io.github.mianalysis.mia.object.Workspace)112 Workspaces (io.github.mianalysis.mia.object.Workspaces)112 JavaFileObject (javax.tools.JavaFileObject)108 Compilation (io.jbock.testing.compile.Compilation)102 Point (io.github.sjcross.common.object.Point)88 ImagePlus (ij.ImagePlus)84 Objects3D (io.github.mianalysis.mia.expectedobjects.Objects3D)82 Image (io.github.mianalysis.mia.object.Image)82 ArrayList (java.util.ArrayList)64 HashMap (java.util.HashMap)43 Account (io.nem.symbol.sdk.model.account.Account)40 TransferTransaction (io.nem.symbol.sdk.model.transaction.TransferTransaction)38 List (java.util.List)38 SignedTransaction (io.nem.symbol.sdk.model.transaction.SignedTransaction)34 Transaction (io.nem.symbol.sdk.model.transaction.Transaction)34