Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F2473200CC6 for ; Tue, 4 Jul 2017 05:59:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F1068160C00; Tue, 4 Jul 2017 03:59:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 264A6160BEC for ; Tue, 4 Jul 2017 05:59:59 +0200 (CEST) Received: (qmail 91886 invoked by uid 500); 4 Jul 2017 03:59:57 -0000 Mailing-List: contact commits-help@bookkeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bookkeeper-dev@bookkeeper.apache.org Delivered-To: mailing list commits@bookkeeper.apache.org Received: (qmail 91877 invoked by uid 99); 4 Jul 2017 03:59:57 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jul 2017 03:59:57 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 66EFE811B4; Tue, 4 Jul 2017 03:59:54 +0000 (UTC) Date: Tue, 04 Jul 2017 03:59:54 +0000 To: "commits@bookkeeper.apache.org" Subject: [bookkeeper] branch master updated: Issue 225: Remove Parameterized from CompactionTest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <149914079451.22506.10962257994609534494@gitbox.apache.org> From: zhaijia@apache.org Reply-To: "commits@bookkeeper.apache.org" X-Git-Host: gitbox.apache.org X-Git-Repo: bookkeeper X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 450629d4314cf467fbf78da2d2a43840d0ccf783 X-Git-Newrev: e735c0305c8b3737e78ba5a1ba15b5d80a5ffb47 X-Git-Rev: e735c0305c8b3737e78ba5a1ba15b5d80a5ffb47 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Tue, 04 Jul 2017 04:00:00 -0000 This is an automated email from the ASF dual-hosted git repository. zhaijia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/bookkeeper.git The following commit(s) were added to refs/heads/master by this push: new e735c03 Issue 225: Remove Parameterized from CompactionTest e735c03 is described below commit e735c0305c8b3737e78ba5a1ba15b5d80a5ffb47 Author: Sijie Guo AuthorDate: Tue Jul 4 11:59:41 2017 +0800 Issue 225: Remove Parameterized from CompactionTest Descriptions of the changes in this PR: - Split the CompactionTest into two, one is by bytes, while the other one is by entries. Author: Sijie Guo Reviewers: Enrico Olivelli , Jia Zhai This closes #226 from sijie/compaction_tests --- .../bookkeeper/bookie/CompactionByBytesTest.java | 27 ++++++++++++++++++ .../bookkeeper/bookie/CompactionByEntriesTest.java | 27 ++++++++++++++++++ .../apache/bookkeeper/bookie/CompactionTest.java | 33 +++++++--------------- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionByBytesTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionByBytesTest.java new file mode 100644 index 0000000..1893761 --- /dev/null +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionByBytesTest.java @@ -0,0 +1,27 @@ +/* + * + * 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.bookkeeper.bookie; + +public class CompactionByBytesTest extends CompactionTest { + public CompactionByBytesTest() { + super(true); + } +} diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionByEntriesTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionByEntriesTest.java new file mode 100644 index 0000000..3ffb210 --- /dev/null +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionByEntriesTest.java @@ -0,0 +1,27 @@ +/* + * + * 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.bookkeeper.bookie; + +public class CompactionByEntriesTest extends CompactionTest { + public CompactionByEntriesTest() { + super(false); + } +} diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java index f6253cf..3570775 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java @@ -32,14 +32,11 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.Collections; import java.util.Enumeration; import java.util.List; -import java.util.Arrays; -import java.util.Collection; import org.apache.bookkeeper.client.BookKeeper.DigestType; import org.apache.bookkeeper.bookie.EntryLogger.EntryLogScanner; import org.apache.bookkeeper.bookie.GarbageCollectorThread.CompactionScannerFactory; import org.apache.bookkeeper.bookie.LedgerDirsManager.NoWritableLedgerDirException; -import org.apache.bookkeeper.client.BKException; import org.apache.bookkeeper.client.LedgerEntry; import org.apache.bookkeeper.client.LedgerHandle; import org.apache.bookkeeper.client.LedgerMetadata; @@ -61,9 +58,6 @@ import org.apache.zookeeper.AsyncCallback; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,29 +65,22 @@ import static org.junit.Assert.*; /** * This class tests the entry log compaction functionality. */ -@RunWith(Parameterized.class) -public class CompactionTest extends BookKeeperClusterTestCase { - @Parameters - public static Collection data() { - return Arrays.asList(new Object[][] {{true}, {false}}); - } - - private boolean isThrottleByBytes; +public abstract class CompactionTest extends BookKeeperClusterTestCase { private final static Logger LOG = LoggerFactory.getLogger(CompactionTest.class); - DigestType digestType; static int ENTRY_SIZE = 1024; static int NUM_BOOKIES = 1; - int numEntries; - int gcWaitTime; - double minorCompactionThreshold; - double majorCompactionThreshold; - long minorCompactionInterval; - long majorCompactionInterval; - - String msg; + private final boolean isThrottleByBytes; + private final DigestType digestType; + private final int numEntries; + private final int gcWaitTime; + private final double minorCompactionThreshold; + private final double majorCompactionThreshold; + private final long minorCompactionInterval; + private final long majorCompactionInterval; + private final String msg; public CompactionTest(boolean isByBytes) { super(NUM_BOOKIES); -- To stop receiving notification emails like this one, please contact ['"commits@bookkeeper.apache.org" '].