Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move inner test classes from NativeIndexPopulatorTest out
Because inner test classes are ignored by maven. This should make those tests run on CI. Change name: NativeIndexPopulatorTest -> NativeIndexPopulatorTestCases NativeIndexPopulatorTest.UniqueTest -> NativeUniqueIndexPopulatorTest NativeIndexPopulatorTest.NonUniqueTest -> NativeNonUniqueIndexPopulatorTest
- Loading branch information
Showing
3 changed files
with
172 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...l/src/test/java/org/neo4j/kernel/impl/index/schema/NativeNonUniqueIndexPopulatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2002-2019 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.kernel.impl.index.schema; | ||
|
||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.io.IOException; | ||
import java.util.Collection; | ||
|
||
import org.neo4j.kernel.api.schema.index.TestIndexDescriptorFactory; | ||
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor; | ||
|
||
@RunWith( Parameterized.class ) | ||
public class NativeNonUniqueIndexPopulatorTest<KEY extends NativeIndexKey<KEY>, VALUE extends NativeIndexValue> | ||
extends NativeIndexPopulatorTests.NonUnique<KEY,VALUE> | ||
{ | ||
@Parameterized.Parameters( name = "{index} {0}" ) | ||
public static Collection<Object[]> data() | ||
{ | ||
return NativeIndexPopulatorTestCases.allCases(); | ||
} | ||
|
||
@Parameterized.Parameter() | ||
public NativeIndexPopulatorTestCases.TestCase<KEY,VALUE> testCase; | ||
|
||
private static final StoreIndexDescriptor nonUniqueDescriptor = TestIndexDescriptorFactory.forLabel( 42, 666 ).withId( 0 ); | ||
|
||
@Override | ||
NativeIndexPopulator<KEY,VALUE> createPopulator() throws IOException | ||
{ | ||
return testCase.populatorFactory.create( pageCache, fs, getIndexFile(), layout, monitor, indexDescriptor ); | ||
} | ||
|
||
@Override | ||
ValueCreatorUtil<KEY,VALUE> createValueCreatorUtil() | ||
{ | ||
return new ValueCreatorUtil<>( nonUniqueDescriptor, testCase.typesOfGroup, ValueCreatorUtil.FRACTION_DUPLICATE_NON_UNIQUE ); | ||
} | ||
|
||
@Override | ||
IndexLayout<KEY,VALUE> createLayout() | ||
{ | ||
return testCase.indexLayoutFactory.create(); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...rnel/src/test/java/org/neo4j/kernel/impl/index/schema/NativeUniqueIndexPopulatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2002-2019 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.kernel.impl.index.schema; | ||
|
||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.io.IOException; | ||
import java.util.Collection; | ||
|
||
import org.neo4j.kernel.api.schema.index.TestIndexDescriptorFactory; | ||
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor; | ||
|
||
@RunWith( Parameterized.class ) | ||
public class NativeUniqueIndexPopulatorTest<KEY extends NativeIndexKey<KEY>, VALUE extends NativeIndexValue> extends NativeIndexPopulatorTests.Unique<KEY,VALUE> | ||
{ | ||
@Parameterized.Parameters( name = "{index} {0}" ) | ||
public static Collection<Object[]> data() | ||
{ | ||
return NativeIndexPopulatorTestCases.allCases(); | ||
} | ||
|
||
@Parameterized.Parameter() | ||
public NativeIndexPopulatorTestCases.TestCase<KEY,VALUE> testCase; | ||
|
||
private static final StoreIndexDescriptor uniqueDescriptor = TestIndexDescriptorFactory.uniqueForLabel( 42, 666 ).withId( 0 ); | ||
|
||
@Override | ||
NativeIndexPopulator<KEY,VALUE> createPopulator() throws IOException | ||
{ | ||
return testCase.populatorFactory.create( pageCache, fs, getIndexFile(), layout, monitor, indexDescriptor ); | ||
} | ||
|
||
@Override | ||
ValueCreatorUtil<KEY,VALUE> createValueCreatorUtil() | ||
{ | ||
return new ValueCreatorUtil<>( uniqueDescriptor, testCase.typesOfGroup, ValueCreatorUtil.FRACTION_DUPLICATE_UNIQUE ); | ||
} | ||
|
||
@Override | ||
IndexLayout<KEY,VALUE> createLayout() | ||
{ | ||
return testCase.indexLayoutFactory.create(); | ||
} | ||
} |