Skip to content

Commit

Permalink
OAK-5191: Deprecate stubs and fixtures related to oak-segment
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1772010 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mduerig committed Nov 30, 2016
1 parent 6da722a commit 5ff40f3
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private FixturesHelper() { }
* default fixtures when no {@code nsfixtures} is provided
*/
public enum Fixture {
DOCUMENT_NS, SEGMENT_MK, DOCUMENT_RDB, MEMORY_NS, DOCUMENT_MEM, SEGMENT_TAR, MULTIPLEXED_SEGMENT, MULTIPLEXED_MEM
DOCUMENT_NS, @Deprecated SEGMENT_MK, DOCUMENT_RDB, MEMORY_NS, DOCUMENT_MEM, SEGMENT_TAR, MULTIPLEXED_SEGMENT, MULTIPLEXED_MEM
}

private static final Set<Fixture> FIXTURES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class NodeStoreFixtures {

public static final NodeStoreFixture MEMORY_NS = new MemoryFixture();

@Deprecated
public static final NodeStoreFixture SEGMENT_MK = new SegmentFixture();

public static final NodeStoreFixture SEGMENT_TAR = new SegmentTarFixture();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

package org.apache.jackrabbit.oak.plugins.segment;

import static org.apache.jackrabbit.oak.commons.FixturesHelper.Fixture.SEGMENT_MK;
import static org.apache.jackrabbit.oak.commons.FixturesHelper.Fixture.SEGMENT_TAR;
import static org.apache.jackrabbit.oak.commons.FixturesHelper.getFixtures;
import static org.junit.Assume.assumeTrue;

import java.io.File;
import java.util.List;
import java.util.Properties;
Expand All @@ -31,10 +36,6 @@
import org.junit.BeforeClass;
import org.junit.runners.Parameterized;

import static org.apache.jackrabbit.oak.commons.FixturesHelper.Fixture.SEGMENT_MK;
import static org.apache.jackrabbit.oak.commons.FixturesHelper.getFixtures;
import static org.junit.Assume.assumeTrue;

/**
* Tests for SegmentNodeStore on S3DataStore GC
*/
Expand All @@ -60,7 +61,7 @@ public static List<Object[]> fixtures1() {

@BeforeClass
public static void assumptions() {
assumeTrue(getFixtures().contains(SEGMENT_MK));
assumeTrue(getFixtures().contains(SEGMENT_MK) || getFixtures().contains(SEGMENT_TAR));
assumeTrue(S3DataStoreUtils.isS3Configured());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import static org.junit.Assume.assumeTrue;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

/**
* A repository stub implementation for Oak on TarMK
* @deprecated Use {@link OakSegmentTarRepositoryStub} instead.
*/
@Deprecated
public class OakTarMKRepositoryStub extends OakRepositoryStub {

private final FileStore store;
Expand Down
2 changes: 1 addition & 1 deletion oak-jcr/src/test/resources/repositoryStubImpl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

# Stub implementation class
javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.oak.jcr.OakTarMKRepositoryStub
javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.oak.jcr.OakSegmentTarRepositoryStub

# credential configuration
javax.jcr.tck.superuser.name=admin
Expand Down
6 changes: 6 additions & 0 deletions oak-lucene/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-segment-tar</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jcr</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;

public class LuceneOakRepositoryStub extends OakTarMKRepositoryStub {
public class LuceneOakRepositoryStub extends OakSegmentTarRepositoryStub {

public LuceneOakRepositoryStub(Properties settings)
throws RepositoryException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public void close() throws IOException {
}
}

@Deprecated
private static class SegmentFixture implements NodeStoreFixture {
private final SegmentStore segmentStore;
private final SegmentNodeStore nodeStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public abstract class OakFixture {
public static final String OAK_RDB = "Oak-RDB";
public static final String OAK_RDB_DS = "Oak-RDB-DS";

@Deprecated
public static final String OAK_TAR = "Oak-Tar";

@Deprecated
public static final String OAK_TAR_DS = "Oak-Tar-DS";

public static final String OAK_SEGMENT_TAR = "Oak-Segment-Tar";
Expand Down Expand Up @@ -255,6 +258,7 @@ private void initializeBlobStoreFixture(StatisticsProvider statsProvider) {
};
}

@Deprecated
public static OakFixture getTar(
final String name, final File base, final int maxFileSizeMB, final int cacheSizeMB,
final boolean memoryMapping, final boolean useBlobStore) {
Expand All @@ -267,6 +271,7 @@ public static OakFixture getSegmentTar(final String name, final File base,
return getSegmentTar(name, base, maxFileSizeMB, cacheSizeMB, memoryMapping, useBlobStore, 0);
}

@Deprecated
public static OakFixture getTar(
final String name, final File base, final int maxFileSizeMB, final int cacheSizeMB,
final boolean memoryMapping, final boolean useBlobStore, int dsCacheInMB) {
Expand Down Expand Up @@ -387,6 +392,7 @@ private void initializeBlobStoreFixture(StatisticsProvider statsProvider) {

}

@Deprecated
public static class SegmentFixture extends OakFixture {
private FileStore[] stores;
private BlobStoreFixture[] blobStoreFixtures = new BlobStoreFixture[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ public static RepositoryFixture getRDBWithDS(String jdbcuri, String jdbcuser, St
dropDBAfterTest, cacheSize, true, base, fdsCacheInMB));
}

@Deprecated
public static RepositoryFixture getTar(File base, int maxFileSizeMB, int cacheSizeMB,
boolean memoryMapping) {
return new OakRepositoryFixture(OakFixture
.getTar(OakFixture.OAK_TAR, base, maxFileSizeMB, cacheSizeMB, memoryMapping, false));
}

@Deprecated
public static RepositoryFixture getTarWithBlobStore(File base, int maxFileSizeMB,
int cacheSizeMB, boolean memoryMapping, int dsCacheInMB) {
return new OakRepositoryFixture(OakFixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

import com.google.common.collect.ImmutableList;
import org.apache.jackrabbit.oak.api.Blob;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.commons.FixturesHelper;
import org.apache.jackrabbit.oak.commons.FixturesHelper.Fixture;
import org.apache.jackrabbit.oak.plugins.segment.compaction.CompactionStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.jackrabbit.oak.plugins.segment.memory.MemoryStore;
import org.apache.jackrabbit.oak.spi.state.NodeStore;

@Deprecated
public class SegmentFixture extends NodeStoreFixture {

private final SegmentStore store;
Expand Down
6 changes: 6 additions & 0 deletions oak-solr-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-segment-tar</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jcr</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.apache.jackrabbit.oak.plugins.index.solr.util.SolrIndexInitializer;
import org.apache.solr.client.solrj.SolrServer;

public class SolrOakRepositoryStub extends OakTarMKRepositoryStub {
public class SolrOakRepositoryStub extends OakSegmentTarRepositoryStub {

public SolrOakRepositoryStub(Properties settings)
throws RepositoryException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.jackrabbit.oak.plugins.segment.standby;

import static org.apache.jackrabbit.oak.commons.FixturesHelper.Fixture.SEGMENT_TAR;
import static org.apache.jackrabbit.oak.commons.FixturesHelper.getFixtures;
import static org.apache.jackrabbit.oak.plugins.segment.SegmentTestUtils.createTmpTargetDir;
import static org.junit.Assume.assumeTrue;

Expand Down Expand Up @@ -66,7 +68,7 @@ public class TestBase {
@BeforeClass
public static void assumptions() {
assumeTrue(!CIHelper.travis());
assumeTrue(FIXTURES.contains(Fixture.SEGMENT_MK));
assumeTrue(FIXTURES.contains(Fixture.SEGMENT_MK) || getFixtures().contains(SEGMENT_TAR));
}

public void setUpServerAndClient() throws Exception {
Expand Down

0 comments on commit 5ff40f3

Please sign in to comment.