Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB38410BC4 for ; Wed, 31 Dec 2014 14:34:53 +0000 (UTC) Received: (qmail 3601 invoked by uid 500); 31 Dec 2014 14:34:54 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 3388 invoked by uid 500); 31 Dec 2014 14:34:54 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 3297 invoked by uid 99); 31 Dec 2014 14:34:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Dec 2014 14:34:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C3F32A3AE89; Wed, 31 Dec 2014 14:34:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Wed, 31 Dec 2014 14:34:54 -0000 Message-Id: <9d17ad9ae7824684aec1c6b3e3f22474@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] camel git commit: CAMEL-7999: apt compiler to generate json schema documentation for the model, whcih we later use to enrich the xml xsd to include documentation. Work in progress. CAMEL-7999: apt compiler to generate json schema documentation for the model, whcih we later use to enrich the xml xsd to include documentation. Work in progress. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8081351f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8081351f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8081351f Branch: refs/heads/master Commit: 8081351ffae8da09d82b0339c7d5a1a667cc34c1 Parents: f93e1d5 Author: Claus Ibsen Authored: Wed Dec 31 15:33:35 2014 +0100 Committer: Claus Ibsen Committed: Wed Dec 31 15:33:35 2014 +0100 ---------------------------------------------------------------------- .../management/ManagedCamelContextTest.java | 68 +----------- .../SpringManagedCamelContextTest.java | 104 +++++++++++++++++++ .../SpringManagedCamelContextTest.xml | 39 +++++++ 3 files changed, 144 insertions(+), 67 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/8081351f/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java index dd69908..b86766b 100644 --- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java +++ b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java @@ -204,7 +204,7 @@ public class ManagedCamelContextTest extends ManagementTestSupport { Map info = (Map) mbeanServer.invoke(on, "findComponents", null, null); assertNotNull(info); - assertEquals(23, info.size()); + assertTrue(info.size() > 20); Properties prop = info.get("seda"); assertNotNull(prop); assertEquals("seda", prop.get("name")); @@ -212,72 +212,6 @@ public class ManagedCamelContextTest extends ManagementTestSupport { assertEquals("camel-core", prop.get("artifactId")); } - @Ignore("need to be tested outside camel-core") - public void testFindEipNames() throws Exception { - // JMX tests dont work well on AIX CI servers (hangs them) - if (isPlatform("aix")) { - return; - } - - MBeanServer mbeanServer = getMBeanServer(); - - ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\""); - - assertTrue("Should be registered", mbeanServer.isRegistered(on)); - - @SuppressWarnings("unchecked") - List info = (List) mbeanServer.invoke(on, "findEipNames", null, null); - assertNotNull(info); - - assertEquals(152, info.size()); - assertTrue(info.contains("transform")); - assertTrue(info.contains("split")); - assertTrue(info.contains("from")); - } - - @Ignore("need to be tested outside camel-core") - public void testFindEips() throws Exception { - // JMX tests dont work well on AIX CI servers (hangs them) - if (isPlatform("aix")) { - return; - } - - MBeanServer mbeanServer = getMBeanServer(); - - ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\""); - - assertTrue("Should be registered", mbeanServer.isRegistered(on)); - - @SuppressWarnings("unchecked") - Map info = (Map) mbeanServer.invoke(on, "findEips", null, null); - assertNotNull(info); - - assertEquals(152, info.size()); - Properties prop = info.get("transform"); - assertNotNull(prop); - assertEquals("transform", prop.get("name")); - assertEquals("org.apache.camel.model.TransformDefinition", prop.get("class")); - } - - @Ignore("need to be tested outside camel-core") - public void testListEips() throws Exception { - // JMX tests dont work well on AIX CI servers (hangs them) - if (isPlatform("aix")) { - return; - } - - MBeanServer mbeanServer = getMBeanServer(); - - ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\""); - - assertTrue("Should be registered", mbeanServer.isRegistered(on)); - - @SuppressWarnings("unchecked") - TabularData data = (TabularData) mbeanServer.invoke(on, "listEips", null, null); - assertNotNull(data); - assertEquals(152, data.size()); - } - public void testManagedCamelContextCreateRouteStaticEndpointJson() throws Exception { // JMX tests dont work well on AIX CI servers (hangs them) if (isPlatform("aix")) { http://git-wip-us.apache.org/repos/asf/camel/blob/8081351f/components/camel-spring/src/test/java/org/apache/camel/spring/management/SpringManagedCamelContextTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/management/SpringManagedCamelContextTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/management/SpringManagedCamelContextTest.java new file mode 100644 index 0000000..ff0b38b --- /dev/null +++ b/components/camel-spring/src/test/java/org/apache/camel/spring/management/SpringManagedCamelContextTest.java @@ -0,0 +1,104 @@ +/** + * 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.camel.spring.management; + +import java.util.List; +import java.util.Map; +import java.util.Properties; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.openmbean.TabularData; + +import org.apache.camel.CamelContext; +import org.apache.camel.management.ManagedCamelContextTest; +import org.junit.Test; + +import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext; + +public class SpringManagedCamelContextTest extends ManagedCamelContextTest { + + protected CamelContext createCamelContext() throws Exception { + return createSpringCamelContext(this, "org/apache/camel/spring/management/SpringManagedCamelContextTest.xml"); + } + + @Test + public void testFindEipNames() throws Exception { + // JMX tests dont work well on AIX CI servers (hangs them) + if (isPlatform("aix")) { + return; + } + + MBeanServer mbeanServer = getMBeanServer(); + + ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\""); + + assertTrue("Should be registered", mbeanServer.isRegistered(on)); + + @SuppressWarnings("unchecked") + List info = (List) mbeanServer.invoke(on, "findEipNames", null, null); + assertNotNull(info); + + assertEquals(152, info.size()); + assertTrue(info.contains("transform")); + assertTrue(info.contains("split")); + assertTrue(info.contains("from")); + } + + @Test + public void testFindEips() throws Exception { + // JMX tests dont work well on AIX CI servers (hangs them) + if (isPlatform("aix")) { + return; + } + + MBeanServer mbeanServer = getMBeanServer(); + + ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\""); + + assertTrue("Should be registered", mbeanServer.isRegistered(on)); + + @SuppressWarnings("unchecked") + Map info = (Map) mbeanServer.invoke(on, "findEips", null, null); + assertNotNull(info); + + assertEquals(152, info.size()); + Properties prop = info.get("transform"); + assertNotNull(prop); + assertEquals("transform", prop.get("name")); + assertEquals("org.apache.camel.model.TransformDefinition", prop.get("class")); + } + + @Test + public void testListEips() throws Exception { + // JMX tests dont work well on AIX CI servers (hangs them) + if (isPlatform("aix")) { + return; + } + + MBeanServer mbeanServer = getMBeanServer(); + + ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\""); + + assertTrue("Should be registered", mbeanServer.isRegistered(on)); + + @SuppressWarnings("unchecked") + TabularData data = (TabularData) mbeanServer.invoke(on, "listEips", null, null); + assertNotNull(data); + assertEquals(152, data.size()); + } + +} http://git-wip-us.apache.org/repos/asf/camel/blob/8081351f/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringManagedCamelContextTest.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringManagedCamelContextTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringManagedCamelContextTest.xml new file mode 100644 index 0000000..e470ab2 --- /dev/null +++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringManagedCamelContextTest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + Bye World + + + + +