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 149202009F2 for ; Thu, 5 May 2016 22:27:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 130A7160A04; Thu, 5 May 2016 20:27:18 +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 364E81609F9 for ; Thu, 5 May 2016 22:27:17 +0200 (CEST) Received: (qmail 17183 invoked by uid 500); 5 May 2016 20:27:16 -0000 Mailing-List: contact issues-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list issues@geode.incubator.apache.org Received: (qmail 17168 invoked by uid 99); 5 May 2016 20:27:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 20:27:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 070A9C27C0 for ; Thu, 5 May 2016 20:27:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.299 X-Spam-Level: X-Spam-Status: No, score=-5.299 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.079] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id sCiOw437355M for ; Thu, 5 May 2016 20:27:14 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 84F355F1F0 for ; Thu, 5 May 2016 20:27:13 +0000 (UTC) Received: (qmail 17160 invoked by uid 99); 5 May 2016 20:27:12 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2016 20:27:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C5CBF2C0451 for ; Thu, 5 May 2016 20:27:12 +0000 (UTC) Date: Thu, 5 May 2016 20:27:12 +0000 (UTC) From: "Kirk Lund (JIRA)" To: issues@geode.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-1350) JUnit 4 Category plus Parameterized results in tests being skipped during build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 May 2016 20:27:18 -0000 [ https://issues.apache.org/jira/browse/GEODE-1350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15273009#comment-15273009 ] Kirk Lund commented on GEODE-1350: ---------------------------------- These are the tests in the Geode project using Parameterized: {noformat} GfshCommandsSecurityTest CliCommandTestBase ConfigCommandsDUnitTest CreateAlterDestroyRegionCommandsDUnitTest DeployCommandsDUnitTest DiskStoreCommandsDUnitTest FunctionCommandsDUnitTest GemfireDataCommandsDUnitTest GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest IndexCommandsDUnitTest ListAndDescribeDiskStoreCommandsDUnitTest ListAndDescribeRegionDUnitTest ListIndexCommandDUnitTest MiscellaneousCommandsDUnitTest MiscellaneousCommandsExportLogsPart1DUnitTest MiscellaneousCommandsExportLogsPart2DUnitTest MiscellaneousCommandsExportLogsPart3DUnitTest MiscellaneousCommandsExportLogsPart4DUnitTest QueueCommandsDUnitTest SharedConfigurationCommandsDUnitTest ShellCommandsDUnitTest ShowMetricsDUnitTest ShowStackTraceDUnitTest UserCommandsDUnitTest {noformat} > JUnit 4 Category plus Parameterized results in tests being skipped during build > ------------------------------------------------------------------------------- > > Key: GEODE-1350 > URL: https://issues.apache.org/jira/browse/GEODE-1350 > Project: Geode > Issue Type: Bug > Components: build > Reporter: Kirk Lund > > As of JUnit 4.12, the use of Categories with the Parameterized runner is broken and may not get fixed by the JUnit community. > All Geode tests using Parameterized should be reimplemented to use JUnitParamsRunner. > Example 1 of test using JUnitParamsRunner: > {noformat} > @Category(UnitTest.class) > @RunWith(JUnitParamsRunner.class) > public class LogServiceJUnitTest { > @Test > @Parameters(method = "getToLevelParameters") > public void toLevelShouldReturnMatchingLog4jLevel(final int intLevel, final Level level) { > assertThat(LogService.toLevel(intLevel)).isSameAs(level); > } > private static final Object[] getToLevelParameters() { > return $( > new Object[] { 0, Level.OFF }, > new Object[] { 100, Level.FATAL }, > new Object[] { 200, Level.ERROR }, > new Object[] { 300, Level.WARN }, > new Object[] { 400, Level.INFO }, > new Object[] { 500, Level.DEBUG }, > new Object[] { 600, Level.TRACE }, > new Object[] { Integer.MAX_VALUE, Level.ALL } > ); > } > {noformat} > Example 2 of test using JUnitParamsRunner: > {noformat} > @Category(UnitTest.class) > @RunWith(JUnitParamsRunner.class) > public class RegionEntryFactoryBuilderJUnitTest { > /** > * This method will test that the correct RegionEntryFactory is created > * dependent on the 5 conditionals: > * enableStats, enableLRU, enableDisk, enableVersion, enableOffHeap > */ > @Test > @Parameters({ > "VMThinRegionEntryHeapFactory,false,false,false,false,false", > "VMThinRegionEntryOffHeapFactory,false,false,false,false,true", > "VersionedThinRegionEntryHeapFactory,false,false,false,true,false", > "VersionedThinRegionEntryOffHeapFactory,false,false,false,true,true", > "VMThinDiskRegionEntryHeapFactory,false,false,true,false,false", > "VMThinDiskRegionEntryOffHeapFactory,false,false,true,false,true", > "VersionedThinDiskRegionEntryHeapFactory,false,false,true,true,false", > "VersionedThinDiskRegionEntryOffHeapFactory,false,false,true,true,true", > "VMThinLRURegionEntryHeapFactory,false,true,false,false,false", > "VMThinLRURegionEntryOffHeapFactory,false,true,false,false,true", > "VersionedThinLRURegionEntryHeapFactory,false,true,false,true,false", > "VersionedThinLRURegionEntryOffHeapFactory,false,true,false,true,true", > "VMThinDiskLRURegionEntryHeapFactory,false,true,true,false,false", > "VMThinDiskLRURegionEntryOffHeapFactory,false,true,true,false,true", > "VersionedThinDiskLRURegionEntryHeapFactory,false,true,true,true,false", > "VersionedThinDiskLRURegionEntryOffHeapFactory,false,true,true,true,true", > "VMStatsRegionEntryHeapFactory,true,false,false,false,false", > "VMStatsRegionEntryOffHeapFactory,true,false,false,false,true", > "VersionedStatsRegionEntryHeapFactory,true,false,false,true,false", > "VersionedStatsRegionEntryOffHeapFactory,true,false,false,true,true", > "VMStatsDiskRegionEntryHeapFactory,true,false,true,false,false", > "VMStatsDiskRegionEntryOffHeapFactory,true,false,true,false,true", > "VersionedStatsDiskRegionEntryHeapFactory,true,false,true,true,false", > "VersionedStatsDiskRegionEntryOffHeapFactory,true,false,true,true,true", > "VMStatsLRURegionEntryHeapFactory,true,true,false,false,false", > "VMStatsLRURegionEntryOffHeapFactory,true,true,false,false,true", > "VersionedStatsLRURegionEntryHeapFactory,true,true,false,true,false", > "VersionedStatsLRURegionEntryOffHeapFactory,true,true,false,true,true", > "VMStatsDiskLRURegionEntryHeapFactory,true,true,true,false,false", > "VMStatsDiskLRURegionEntryOffHeapFactory,true,true,true,false,true", > "VersionedStatsDiskLRURegionEntryHeapFactory,true,true,true,true,false", > "VersionedStatsDiskLRURegionEntryOffHeapFactory,true,true,true,true,true" > }) > public void testRegionEntryFactoryUnitTest(String factoryName, boolean enableStats, boolean enableLRU, boolean enableDisk, > boolean enableVersioning, boolean enableOffHeap) { > assertEquals(factoryName, > regionEntryFactoryBuilder.getRegionEntryFactoryOrNull(enableStats, enableLRU, enableDisk, enableVersioning, enableOffHeap).getClass().getSimpleName()); > } > {noformat} > Example of BROKEN test using Parameterized which is skipped by our test targets due to use of Categories: > {noformat} > @Category(IntegrationTest.class) > @RunWith(Parameterized.class) > public class GfshCommandsSecurityTest { > public GfshCommandsSecurityTest(boolean useHttp){ > gfshConnection = new GfshShellConnectionRule(jmxPort, httpPort, useHttp); > } > @Parameterized.Parameters > public static Collection parameters() { > return Arrays.asList(new Object[][] { > { false}, // useHttp=false, > { true } // useHttp=true, > }); > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)