mreutegg commented on a change in pull request #260: URL: https://github.com/apache/jackrabbit-oak/pull/260#discussion_r520540835
########## File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentBatchSplitTest.java ########## @@ -0,0 +1,245 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.oak.plugins.document; + +import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES; +import static org.apache.jackrabbit.oak.plugins.memory.BinaryPropertyState.binaryProperty; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.util.List; +import java.util.Random; +import java.util.concurrent.TimeUnit; + +import org.apache.jackrabbit.oak.api.PropertyState; +import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.VersionGCStats; +import org.apache.jackrabbit.oak.plugins.document.util.TimingDocumentStoreWrapper; +import org.apache.jackrabbit.oak.spi.commit.CommitInfo; +import org.apache.jackrabbit.oak.spi.commit.EmptyHook; +import org.apache.jackrabbit.oak.spi.state.NodeBuilder; +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.Lists; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.LoggerContext; + +/** + * Check correct splitting of documents (OAK-926 & OAK-1342). + */ +@RunWith(Parameterized.class) +public class DocumentBatchSplitTest { + + private static final Logger LOG = LoggerFactory.getLogger(DocumentBatchSplitTest.class); + + private String createOrUpdateBatchSize; + private boolean createOrUpdateBatchSizeIsNull; + + private DocumentStoreFixture fixture; + protected DocumentMK mk; + + public DocumentBatchSplitTest(DocumentStoreFixture fixture) { + this.fixture = fixture; + } + + @Parameterized.Parameters(name="{0}") + public static java.util.Collection<Object[]> fixtures() throws IOException { + List<Object[]> fixtures = Lists.newArrayList(); + fixtures.add(new Object[] {new DocumentStoreFixture.MemoryFixture()}); + + DocumentStoreFixture mongo = new DocumentStoreFixture.MongoFixture(); + if(mongo.isAvailable()){ + fixtures.add(new Object[] {mongo}); + } + return fixtures; + } + + @After + public void tearDown() throws Exception { + if (mk != null) { + mk.dispose(); + mk = null; + } + fixture.dispose(); Review comment: The log level should also be reset to default. Otherwise tests running after defaultLogLevelBatchSplit() will also run on DEBUG. ```suggestion fixture.dispose(); // reset log level to default enableLevel("org", null); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
