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 C668A200B98 for ; Mon, 3 Oct 2016 22:41:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4E9E160ADC; Mon, 3 Oct 2016 20:41:35 +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 011A6160ACD for ; Mon, 3 Oct 2016 22:41:33 +0200 (CEST) Received: (qmail 53175 invoked by uid 500); 3 Oct 2016 20:41:33 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 53165 invoked by uid 99); 3 Oct 2016 20:41:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Oct 2016 20:41:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1A6BE0230; Mon, 3 Oct 2016 20:41:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alejandro@apache.org To: commits@ambari.apache.org Message-Id: <18c38c5e6207446eafb86507a77678db@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro) Date: Mon, 3 Oct 2016 20:41:32 +0000 (UTC) archived-at: Mon, 03 Oct 2016 20:41:36 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.5 46268ad37 -> 21e36a043 AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/21e36a04 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/21e36a04 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/21e36a04 Branch: refs/heads/branch-2.5 Commit: 21e36a04311fd427dc8a02d9852ef8b38b8e76aa Parents: 46268ad Author: Alejandro Fernandez Authored: Mon Oct 3 13:34:18 2016 -0700 Committer: Alejandro Fernandez Committed: Mon Oct 3 13:46:52 2016 -0700 ---------------------------------------------------------------------- ambari-logsearch/pom.xml | 13 +++ .../ambari-metrics-timelineservice/pom.xml | 9 ++ ambari-metrics/pom.xml | 26 +++++- ambari-server/pom.xml | 11 +++ .../alerts/AggregateAlertListenerTest.java | 2 + .../alerts/AlertDefinitionEqualityTest.java | 2 + .../state/alerts/AlertDefinitionHashTest.java | 2 + .../state/alerts/AlertEventPublisherTest.java | 2 + .../state/alerts/AlertReceivedListenerTest.java | 2 + .../alerts/AlertStateChangedEventTest.java | 2 + .../state/alerts/InitialAlertEventTest.java | 2 + .../KerberosComponentDescriptorTest.java | 2 + .../KerberosConfigurationDescriptorTest.java | 2 + .../state/kerberos/KerberosDescriptorTest.java | 2 + .../KerberosDescriptorUpdateHelperTest.java | 2 + .../KerberosIdentityDescriptorTest.java | 2 + .../kerberos/KerberosKeytabDescriptorTest.java | 2 + .../KerberosPrincipalDescriptorTest.java | 2 + .../kerberos/KerberosServiceDescriptorTest.java | 2 + .../kerberos/VariableReplacementHelperTest.java | 2 + .../state/stack/ConfigUpgradePackTest.java | 2 + .../state/stack/ConfigUpgradeValidityTest.java | 2 + .../ambari/server/state/stack/OSFamilyTest.java | 3 + .../server/state/stack/UpgradePackTest.java | 2 + pom.xml | 92 +++++++++++++++++++- utility/pom.xml | 19 ++++ utility/src/main/java/category/AlertTest.java | 27 ++++++ .../main/java/category/AmbariUpgradeTest.java | 27 ++++++ .../src/main/java/category/BlueprintTest.java | 27 ++++++ utility/src/main/java/category/FastTest.java | 27 ++++++ .../src/main/java/category/KerberosTest.java | 27 ++++++ utility/src/main/java/category/MetricsTest.java | 27 ++++++ utility/src/main/java/category/SlowTest.java | 27 ++++++ .../main/java/category/StackUpgradeTest.java | 27 ++++++ 34 files changed, 424 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-logsearch/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml index 2334cdb..e4a0622 100644 --- a/ambari-logsearch/pom.xml +++ b/ambari-logsearch/pom.xml @@ -70,6 +70,9 @@ maven-surefire-plugin ${skipSurefireTests} + + + ${testcase.groups} @@ -174,4 +177,14 @@ + + + + utility + utility + 1.0.0.0-SNAPSHOT + test + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-metrics/ambari-metrics-timelineservice/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml index 25f85c3..1144573 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml +++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml @@ -226,6 +226,8 @@ true always -XX:-UseSplitVerifier + + ${testcase.groups} @@ -592,6 +594,13 @@ test + + + utility + utility + 1.0.0.0-SNAPSHOT + test + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-metrics/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index bbb07f4..02dd5e7 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -168,6 +168,9 @@ maven-surefire-plugin ${skipSurefireTests} + + + ${testcase.groups} @@ -297,7 +300,28 @@ + + + utility + utility + 1.0.0.0-SNAPSHOT + test + - + + + FastTests + + category.FastTest + + + + utility + utility + 1.0.0.0-SNAPSHOT + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 49ab61f..4ec65ef 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -572,6 +572,9 @@ ${skipSurefireTests} -Xmx1024m -XX:MaxPermSize=512m -Xms512m + + + ${testcase.groups} @@ -1442,6 +1445,14 @@ jul-to-slf4j 1.7.2 + + + + utility + utility + 1.0.0.0-SNAPSHOT + test + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java index 85dedba..d53857c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java @@ -48,10 +48,12 @@ import com.google.inject.persist.PersistService; import com.google.inject.util.Modules; import junit.framework.Assert; +import org.junit.experimental.categories.Category; /** * Tests the {@link AlertAggregateListener}. */ +@Category({ category.AlertTest.class}) public class AggregateAlertListenerTest { private Injector m_injector; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java index 3cc84c0..1a914cd 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java @@ -32,10 +32,12 @@ import org.apache.ambari.server.state.alert.ScriptSource; import org.apache.ambari.server.state.alert.Source; import org.apache.ambari.server.state.alert.SourceType; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Tests equality of {@link AlertDefinition} for hashing and merging purposes. */ +@Category({ category.AlertTest.class}) public class AlertDefinitionEqualityTest extends TestCase { @Test http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java index c534c4a..7a24966 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java @@ -62,10 +62,12 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.util.Modules; +import org.junit.experimental.categories.Category; /** * Tests for {@link AlertDefinitionHash}. */ +@Category({ category.AlertTest.class}) public class AlertDefinitionHashTest extends TestCase { private AlertDefinitionHash m_hash; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java index 76aa2e4..c511f1a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java @@ -56,11 +56,13 @@ import com.google.gson.Gson; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.persist.PersistService; +import org.junit.experimental.categories.Category; /** * Tests that {@link AmbariEvent} instances are fired correctly and that alert * data is bootstrapped into the database. */ +@Category({ category.AlertTest.class}) public class AlertEventPublisherTest { private AlertDispatchDAO dispatchDao; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java index 7aef175..1867bda 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java @@ -61,10 +61,12 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.persist.PersistService; import com.google.inject.persist.UnitOfWork; +import org.junit.experimental.categories.Category; /** * Tests the {@link AlertReceivedListener}. */ +@Category({ category.AlertTest.class}) public class AlertReceivedListenerTest { private static final String ALERT_DEFINITION = "alert_definition_"; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java index 7964d14..15ffef0 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java @@ -61,6 +61,7 @@ import com.google.inject.persist.PersistService; import com.google.inject.util.Modules; import junit.framework.Assert; +import org.junit.experimental.categories.Category; /** * Tests that {@link AlertStateChangeEvent} instances cause @@ -68,6 +69,7 @@ import junit.framework.Assert; * should only be created when received alerts which have a firmness of * {@link AlertFirmness#HARD}. */ +@Category({ category.AlertTest.class}) public class AlertStateChangedEventTest extends EasyMockSupport { private AlertEventPublisher eventPublisher; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java index fc4803b..c7a5915 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java @@ -51,10 +51,12 @@ import com.google.inject.persist.PersistService; import com.google.inject.util.Modules; import junit.framework.Assert; +import org.junit.experimental.categories.Category; /** * Tests that {@link InitialAlertEventTest} instances are fired correctly. */ +@Category({ category.AlertTest.class }) public class InitialAlertEventTest { private AlertsDAO m_alertsDao; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java index 201d84e..814e010 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java @@ -22,6 +22,7 @@ import com.google.gson.reflect.TypeToken; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.ArrayList; import java.util.Collection; @@ -32,6 +33,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; +@Category({ category.KerberosTest.class}) public class KerberosComponentDescriptorTest { public static final String JSON_VALUE = " {" + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java index 4f2a2f5..47c4f19 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java @@ -22,9 +22,11 @@ import com.google.gson.reflect.TypeToken; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.*; +@Category({ category.KerberosTest.class}) public class KerberosConfigurationDescriptorTest { private static final String JSON_SINGLE_VALUE = "{ \"configuration-type\": {" + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java index 0070e6d..9e21742 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java @@ -21,6 +21,7 @@ import com.google.gson.*; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.io.File; import java.io.IOException; @@ -34,6 +35,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; +@Category({ category.KerberosTest.class}) public class KerberosDescriptorTest { private static final KerberosDescriptorFactory KERBEROS_DESCRIPTOR_FACTORY = new KerberosDescriptorFactory(); private static final KerberosServiceDescriptorFactory KERBEROS_SERVICE_DESCRIPTOR_FACTORY = new KerberosServiceDescriptorFactory(); http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java index fca2f1f..3f347dc 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java @@ -38,6 +38,7 @@ import org.apache.ambari.server.state.stack.OsFamily; import org.easymock.EasyMock; import org.easymock.EasyMockSupport; import org.junit.Test; +import org.junit.experimental.categories.Category; import javax.persistence.EntityManager; import javax.persistence.TypedQuery; @@ -47,6 +48,7 @@ import java.util.Properties; import static org.easymock.EasyMock.anyString; import static org.easymock.EasyMock.expect; +@Category({ category.KerberosTest.class}) public class KerberosDescriptorUpdateHelperTest extends EasyMockSupport { private static final KerberosDescriptorFactory KERBEROS_DESCRIPTOR_FACTORY = new KerberosDescriptorFactory(); private static final Gson GSON = new Gson(); http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java index ef1c7bb..dbf090e 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java @@ -22,12 +22,14 @@ import com.google.gson.reflect.TypeToken; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.TreeMap; +@Category({ category.KerberosTest.class}) public class KerberosIdentityDescriptorTest { public static final String JSON_VALUE = "{" + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java index 79350eb..5c82662 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java @@ -22,10 +22,12 @@ import com.google.gson.reflect.TypeToken; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.Map; import java.util.TreeMap; +@Category({ category.KerberosTest.class}) public class KerberosKeytabDescriptorTest { public static final String JSON_VALUE = "{" + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java index 635cc30..54f5c3f 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java @@ -22,9 +22,11 @@ import com.google.gson.reflect.TypeToken; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.*; +@Category({ category.KerberosTest.class}) public class KerberosPrincipalDescriptorTest { public static final String JSON_VALUE = "{" + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java index 9896317..fb341ca 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java @@ -21,6 +21,7 @@ import com.google.gson.Gson; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.io.File; import java.io.IOException; @@ -34,6 +35,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; +@Category({ category.KerberosTest.class}) public class KerberosServiceDescriptorTest { public static final String JSON_VALUE = "{" + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java index ee2a671..e3048e0 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java @@ -21,10 +21,12 @@ package org.apache.ambari.server.state.kerberos; import junit.framework.Assert; import org.apache.ambari.server.AmbariException; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.HashMap; import java.util.Map; +@Category({ category.KerberosTest.class}) public class VariableReplacementHelperTest { VariableReplacementHelper helper = new VariableReplacementHelper(); http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java index 388a81f..27ee146 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java @@ -28,6 +28,7 @@ import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping.ExecuteStage import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.ArrayList; import java.util.Arrays; @@ -43,6 +44,7 @@ import static org.junit.Assert.*; /** * Tests for the config upgrade pack */ +@Category({ category.StackUpgradeTest.class}) public class ConfigUpgradePackTest { private Injector injector; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java index bf716b7..e764781 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java @@ -39,6 +39,7 @@ import org.apache.ambari.server.state.stack.upgrade.Task.Type; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,6 +53,7 @@ import junit.framework.Assert; * Tests that for every upgrade pack found, that all referenced configuration * IDs exist in the {@code config-upgrade.xml} which will be used/created. */ +@Category({ category.StackUpgradeTest.class}) public class ConfigUpgradeValidityTest { private static final Logger LOG = LoggerFactory.getLogger(ConfigUpgradeValidityTest.class); http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java index 9654dc3..ba41687 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java @@ -25,10 +25,13 @@ import junit.framework.Assert; import org.apache.ambari.server.orm.InMemoryDefaultTestModule; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; + import java.lang.reflect.Method; import java.util.*; +@Category({ category.StackUpgradeTest.class}) public class OSFamilyTest { OsFamily os_family = null; private Injector injector; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java index c6701b6..56d44ce 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java @@ -56,10 +56,12 @@ import org.junit.Test; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.persist.PersistService; +import org.junit.experimental.categories.Category; /** * Tests for the upgrade pack */ +@Category({ category.StackUpgradeTest.class}) public class UpgradePackTest { private Injector injector; http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 073b887..219943a 100644 --- a/pom.xml +++ b/pom.xml @@ -515,7 +515,7 @@ ambari-client ambari-shell ambari-logsearch - + ambari-metrics @@ -541,7 +541,7 @@ ambari-agent ambari-client ambari-shell - + clover @@ -661,5 +661,93 @@ instead of a SNAPSHOT. --> + + + + + + FastTests + + category.FastTest + + + + + + SlowTests + + category.SlowTest + + + + + + NonFastTests + + + + org.apache.maven.plugins + maven-surefire-plugin + + org.apache.ambari.server.FastTest + + + + + + + + + AlertTests + + category.AlertTest + + + + AmbariUpgradeTests + + category.AmbariUpgradeTest + + + + BlueprintTests + + category.BlueprintTest + + + + KerberosTests + + category.KerberosTest + + + + MetricsTests + + category.MetricsTest + + + + StackUpgradeTests + + category.StackUpgradeTest + + + + + + + utility + http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/pom.xml ---------------------------------------------------------------------- diff --git a/utility/pom.xml b/utility/pom.xml new file mode 100644 index 0000000..c98e2ed --- /dev/null +++ b/utility/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + utility + utility + 1.0.0.0-SNAPSHOT + + + + junit + junit + 4.12 + compile + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/AlertTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/AlertTest.java b/utility/src/main/java/category/AlertTest.java new file mode 100644 index 0000000..b6a20ec --- /dev/null +++ b/utility/src/main/java/category/AlertTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.AlertTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P AlertTests + */ +public interface AlertTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/AmbariUpgradeTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/AmbariUpgradeTest.java b/utility/src/main/java/category/AmbariUpgradeTest.java new file mode 100644 index 0000000..881107a --- /dev/null +++ b/utility/src/main/java/category/AmbariUpgradeTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.AmbariUpgradeTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P AmbariUpgradeTests + */ +public interface AmbariUpgradeTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/BlueprintTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/BlueprintTest.java b/utility/src/main/java/category/BlueprintTest.java new file mode 100644 index 0000000..cb7871d --- /dev/null +++ b/utility/src/main/java/category/BlueprintTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.BlueprintTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P BlueprintTests + */ +public interface BlueprintTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/FastTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/FastTest.java b/utility/src/main/java/category/FastTest.java new file mode 100644 index 0000000..a0abddf --- /dev/null +++ b/utility/src/main/java/category/FastTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.FastTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P FastTests + */ +public interface FastTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/KerberosTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/KerberosTest.java b/utility/src/main/java/category/KerberosTest.java new file mode 100644 index 0000000..f7cebdf --- /dev/null +++ b/utility/src/main/java/category/KerberosTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.KerberosTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P KerberosTests + */ +public interface KerberosTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/MetricsTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/MetricsTest.java b/utility/src/main/java/category/MetricsTest.java new file mode 100644 index 0000000..a352ae2 --- /dev/null +++ b/utility/src/main/java/category/MetricsTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.MetricsTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P MetricsTests + */ +public interface MetricsTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/SlowTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/SlowTest.java b/utility/src/main/java/category/SlowTest.java new file mode 100644 index 0000000..c1025a9 --- /dev/null +++ b/utility/src/main/java/category/SlowTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.SlowTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P SlowTests + */ +public interface SlowTest {} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/21e36a04/utility/src/main/java/category/StackUpgradeTest.java ---------------------------------------------------------------------- diff --git a/utility/src/main/java/category/StackUpgradeTest.java b/utility/src/main/java/category/StackUpgradeTest.java new file mode 100644 index 0000000..20a1723 --- /dev/null +++ b/utility/src/main/java/category/StackUpgradeTest.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 category; + +/** + * Category of unit tests that can be annotated. E.g., + * {@code @Category({ category.StackUpgradeTest.class}) } + * + * A Profile can have csv of categories, in order to run the unit tests like, + * mvn clean test -P StackUpgradeTests + */ +public interface StackUpgradeTest {} \ No newline at end of file