From: <ldi...@us...> - 2006-03-08 22:15:34
|
Revision: 76 Author: ldikmans Date: 2006-03-08 14:15:24 -0800 (Wed, 08 Mar 2006) ViewCVS: http://svn.sourceforge.net/sensor/?rev=76&view=rev Log Message: ----------- changed project.xml to make sure all the jars are downloadable with maven. Modified Paths: -------------- trunk/sensor-support/.classpath trunk/sensor-support/project.properties trunk/sensor-support/project.xml Modified: trunk/sensor-support/.classpath =================================================================== --- trunk/sensor-support/.classpath 2006-03-08 22:15:15 UTC (rev 75) +++ trunk/sensor-support/.classpath 2006-03-08 22:15:24 UTC (rev 76) @@ -12,7 +12,7 @@ <classpathentry sourcepath="/MAVEN_REPO/xfire/zips/xfire-all-1.0-M6a.zip" kind="var" path="MAVEN_REPO/xfire/jars/xfire-all-1.0-M6a.jar"/> <classpathentry kind="var" path="MAVEN_REPO/stax/jars/stax-api-1.0.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jdom/jars/jdom-1.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/wstx/jars/wstx-asl-2.0.3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/woodstox/jars/wstx-asl-2.0.3.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jaxen/jars/jaxen-1.1-beta-8.jar"/> <classpathentry kind="var" path="MAVEN_REPO/wsdl4j/jars/wsdl4j-1.4.jar"/> <classpathentry kind="lib" path="lib/javamail-1.3.2.jar"/> Modified: trunk/sensor-support/project.properties =================================================================== --- trunk/sensor-support/project.properties 2006-03-08 22:15:15 UTC (rev 75) +++ trunk/sensor-support/project.properties 2006-03-08 22:15:24 UTC (rev 76) @@ -3,7 +3,6 @@ # ------------------------------------------------------------------------ maven.repo.remote = http://www.ibiblio.org/maven,\ - http://stage.inspiring.nl/maven,\ http://dist.codehaus.org,\ http://www.codeczar.com/maven,\ http://mirrors.sunsite.dk/maven/,\ Modified: trunk/sensor-support/project.xml =================================================================== --- trunk/sensor-support/project.xml 2006-03-08 22:15:15 UTC (rev 75) +++ trunk/sensor-support/project.xml 2006-03-08 22:15:24 UTC (rev 76) @@ -128,7 +128,7 @@ <type>jar</type> </dependency> <dependency> - <groupId>wstx</groupId> + <groupId>woodstox</groupId> <artifactId>wstx-asl</artifactId> <version>2.0.3</version> <type>jar</type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ldi...@us...> - 2006-03-12 19:58:21
|
Revision: 79 Author: ldikmans Date: 2006-03-12 11:58:15 -0800 (Sun, 12 Mar 2006) ViewCVS: http://svn.sourceforge.net/sensor/?rev=79&view=rev Log Message: ----------- Fixed the dependency for rmock. Modified Paths: -------------- trunk/sensor-support/.classpath trunk/sensor-support/project.xml Modified: trunk/sensor-support/.classpath =================================================================== --- trunk/sensor-support/.classpath 2006-03-12 18:49:05 UTC (rev 78) +++ trunk/sensor-support/.classpath 2006-03-12 19:58:15 UTC (rev 79) @@ -17,7 +17,7 @@ <classpathentry kind="var" path="MAVEN_REPO/wsdl4j/jars/wsdl4j-1.4.jar"/> <classpathentry kind="lib" path="lib/javamail-1.3.2.jar"/> <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar"/> - <classpathentry sourcepath="/MAVEN_REPO/rmock/zips/rmock-src-2.0.0-rc-5.zip" kind="var" path="MAVEN_REPO/rmock/jars/rmock-2.0.0-rc-5.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/com.agical.rmock/jars/rmock-2.0.0-rc-5.jar"/> <classpathentry kind="src" path="src/resources"/> <classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.11.jar"/> <classpathentry kind="output" path="target/classes"/> Modified: trunk/sensor-support/project.xml =================================================================== --- trunk/sensor-support/project.xml 2006-03-12 18:49:05 UTC (rev 78) +++ trunk/sensor-support/project.xml 2006-03-12 19:58:15 UTC (rev 79) @@ -169,7 +169,7 @@ <type>jar</type> </dependency>--> <dependency> - <groupId>rmock</groupId> + <groupId>com.agical.rmock</groupId> <artifactId>rmock</artifactId> <version>2.0.0-rc-5</version> <type>jar</type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2006-03-28 20:36:47
|
Revision: 99 Author: rswart Date: 2006-03-28 12:36:22 -0800 (Tue, 28 Mar 2006) ViewCVS: http://svn.sourceforge.net/sensor/?rev=99&view=rev Log Message: ----------- Modified Paths: -------------- trunk/sensor-support/.settings/.component trunk/sensor-support/project.xml trunk/sensor-support/src/java/net/sf/sensor/support/spring/SpringBeanNameConstants.java trunk/sensor-support/src/resources/net/sf/sensor/support/spring/sensor-jmx.xml trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorSpringConfigurationsTest.java Added Paths: ----------- trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorJMXTest.java trunk/sensor-support/test/resources/ Modified: trunk/sensor-support/.settings/.component =================================================================== --- trunk/sensor-support/.settings/.component 2006-03-25 21:31:23 UTC (rev 98) +++ trunk/sensor-support/.settings/.component 2006-03-28 20:36:22 UTC (rev 99) @@ -4,5 +4,6 @@ <wb-resource deploy-path="/" source-path="/src/java"/> <wb-resource deploy-path="/" source-path="/src/resources"/> <wb-resource deploy-path="/" source-path="/test/java"/> +<wb-resource deploy-path="/" source-path="/test/resources"/> </wb-module> </project-modules> Modified: trunk/sensor-support/project.xml =================================================================== --- trunk/sensor-support/project.xml 2006-03-25 21:31:23 UTC (rev 98) +++ trunk/sensor-support/project.xml 2006-03-28 20:36:22 UTC (rev 99) @@ -188,7 +188,19 @@ <version>2.0.0-rc-5</version> <type>jar</type> </dependency> - + <dependency> + <groupId>mx4j</groupId> + <artifactId>mx4j</artifactId> + <version>3.0.1</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>mx4j</groupId> + <artifactId>mx4j-remote</artifactId> + <version>3.0.1</version> + <type>jar</type> + </dependency> + <!-- Maven Plugins Used by this Project --> <dependency> <groupId>maven</groupId> @@ -244,6 +256,15 @@ <include>**/*.xml</include> </includes> </resource> + <resource> + <directory>${basedir}/test/resources</directory> + <includes> + <include>**/*.xml</include> + <include>**/*.dtd</include> + <include>**/*.properties</include> + <include>**/*.xsd</include> + </includes> + </resource> </resources> </unitTest> Modified: trunk/sensor-support/src/java/net/sf/sensor/support/spring/SpringBeanNameConstants.java =================================================================== --- trunk/sensor-support/src/java/net/sf/sensor/support/spring/SpringBeanNameConstants.java 2006-03-25 21:31:23 UTC (rev 98) +++ trunk/sensor-support/src/java/net/sf/sensor/support/spring/SpringBeanNameConstants.java 2006-03-28 20:36:22 UTC (rev 99) @@ -90,5 +90,35 @@ // ========================================================================== + /** + * The bean name of the MbeanServer bean as defined in the jmx sensor + * Spring configuration file, which is available on the classpath as + * <code>/sf/sensor/support/spring/sensor-jmx.xml</code>. + */ + public static final String MBEAN_SERVER_BEAN_NAME = "sensor.mbeanServer"; + + /** + * The bean name of the JMX exporter bean as defined in the jmx sensor + * Spring configuration file, which is available on the classpath as + * <code>/sf/sensor/support/spring/sensor-jmx.xml</code>. + */ + public static final String JMX_EXPORTER_BEAN_NAME = "sensor.jmxExporter"; + + + /** + * The bean name of the RMI registry bean as defined in the jmx sensor + * Spring configuration file, which is available on the classpath as + * <code>/sf/sensor/support/spring/sensor-jmx.xml</code>. + */ + public static final String JMX_RMI_REGISTRY_BEAN_NAME = "sensor.rmiRegistry"; + + + /** + * The bean name of the JMX server connector bean as defined in the jmx sensor + * Spring configuration file, which is available on the classpath as + * <code>/sf/sensor/support/spring/sensor-jmx.xml</code>. + */ + public static final String JMX_SERVER_CONNECTOR_BEAN_NAME = "sensor.jmxServerConnector"; + } Modified: trunk/sensor-support/src/resources/net/sf/sensor/support/spring/sensor-jmx.xml =================================================================== --- trunk/sensor-support/src/resources/net/sf/sensor/support/spring/sensor-jmx.xml 2006-03-25 21:31:23 UTC (rev 98) +++ trunk/sensor-support/src/resources/net/sf/sensor/support/spring/sensor-jmx.xml 2006-03-28 20:36:22 UTC (rev 99) @@ -2,29 +2,47 @@ <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!-- - - - - --> + + + +--> <beans> - - <!-- JMX MBeans for the Sensor Runtimes --> - -<!-- <bean id="sensor.mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"> - <property name="locateExistingServerIfPossible" value="true"/> - </bean> - - <bean id="sensor.jmxExporter" class="org.springframework.jmx.export.MBeanExporter"> - <property name="beans"> - <map> - <entry key="sensor:name=TimerRuntime" value-ref="sensor.TimerRuntime"/> - <entry key="sensor:name=MeterRuntime" value-ref="sensor.MeterRuntime"/> - <entry key="sensor:name=CounterRuntime" value-ref="sensor.CounterRuntime"/> - <entry key="sensor:name=GaugeRuntime" value-ref="sensor.GaugeRuntime"/> - </map> - </property> - <property name="server" ref="sensor.mbeanServer"/> - </bean>--> - + + <!-- JMX MBeans for the Sensor Runtimes --> + + <bean id="sensor.mbeanServer" + class="org.springframework.jmx.support.MBeanServerFactoryBean"> + <property name="locateExistingServerIfPossible" value="true" /> + </bean> + + <bean id="sensor.jmxExporter" + class="org.springframework.jmx.export.MBeanExporter"> + <property name="beans"> + <map> + <entry key="sensor:name=TimerRuntime" + value-ref="sensor.timerRuntime" /> + <entry key="sensor:name=MeterRuntime" + value-ref="sensor.meterRuntime" /> + <entry key="sensor:name=CounterRuntime" + value-ref="sensor.counterRuntime" /> + <entry key="sensor:name=GaugeRuntime" + value-ref="sensor.gaugeRuntime" /> + </map> + </property> + <property name="server" ref="sensor.mbeanServer" /> + </bean> + + <bean id="sensor.rmiRegistry" + class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"> + <property name="port" value="1099" /> + </bean> + + <bean id="sensor.jmxServerConnector" + class="org.springframework.jmx.support.ConnectorServerFactoryBean"> + <property name="objectName" value="connector:sensor=rmi" /> + <property name="serviceUrl" + value="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/myconnector" /> + </bean> + </beans> \ No newline at end of file Added: trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorJMXTest.java =================================================================== --- trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorJMXTest.java (rev 0) +++ trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorJMXTest.java 2006-03-28 20:36:22 UTC (rev 99) @@ -0,0 +1,123 @@ +/* + * Copyright 2005 the original author or authors. + * + * Licensed 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 net.sf.sensor.support.spring; + +import java.util.List; + +import junit.framework.TestCase; + +import net.sf.sensor.timer.DefaultTimerRuntime; +import net.sf.sensor.timer.Timer; +import net.sf.sensor.timer.TimerRuntime; +import net.sf.sensor.timer.TimerStatistics; +import net.sf.sensor.timer.TimerStatisticsFilter; +import net.sf.sensor.util.conditions.Conditions; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + + +/** + * @author Richard Swart + * + */ +public class SensorJMXTest extends TestCase { + + private static ApplicationContext applicationContext; + + private static boolean setUpDone = false; + + protected void setUp() throws Exception { + + if (!setUpDone) { + + applicationContext = new ClassPathXmlApplicationContext(new String[] {"/net/sf/sensor/support/spring/sensor.xml", + "/net/sf/sensor/support/spring/sensor-jmx.xml", "/net/sf/sensor/support/spring/sensor-jmx-test.xml"}); + + TimerRuntime runtime = (TimerRuntime) applicationContext.getBean(SpringBeanNameConstants.TIMER_RUNTIME_BEAN_NAME); + Timer timerA = runtime.getTimer("A", "label"); + Timer timerB = runtime.getTimer("B", "label"); + + timerA.start(); + long minimumTimeTaken = 25L; + Thread.sleep(minimumTimeTaken); + timerB.start(); + Thread.sleep(minimumTimeTaken); + timerB.stop(); + timerA.stop(); + List timerStatistics = runtime.getTimerStatistics(); + + assertNotNull(timerStatistics); + assertEquals(1, timerStatistics.size()); + + setUpDone = true; + } + } + + public void testLocalMbeanTimerRuntimeInvocation() { + + String[] myArr = applicationContext.getBeanDefinitionNames(); + for (int i = 0; i < myArr.length; i++) { + System.out.println(myArr[i]); + } + + TimerRuntime mbeanTimerRuntime = (TimerRuntime) applicationContext.getBean("sensor.timerRuntime.mbeanProxy"); + + assertNotNull(mbeanTimerRuntime); + + List timerStatistics = mbeanTimerRuntime.getTimerStatistics(); + + assertNotNull(timerStatistics); + assertEquals(1, timerStatistics.size()); + + TimerStatistics statisticsA = (TimerStatistics) timerStatistics.get(0); + System.out.println(statisticsA.getAverageTime()); + System.out.println(statisticsA.getMaximumTime()); + assertEquals(1, statisticsA.getNumberOfHits()); + + TimerStatistics statisticsB = (TimerStatistics) statisticsA.getChildren().get(0); + System.out.println(statisticsB.getId()); + assertEquals("B",statisticsB.getId()); + } + + public void testRemoteMbeanTimerRuntimeInvocation() { + TimerRuntime mbeanTimerRuntime = (TimerRuntime) applicationContext.getBean("sensor.timerRuntime.remoteMbeanProxy"); + + assertNotNull(mbeanTimerRuntime); + + List timerStatistics = mbeanTimerRuntime.getTimerStatistics(); + + assertNotNull(timerStatistics); + assertEquals(1, timerStatistics.size()); + + TimerStatistics statisticsA = (TimerStatistics) timerStatistics.get(0); + System.out.println(statisticsA.getAverageTime()); + System.out.println(statisticsA.getMaximumTime()); + assertEquals(1, statisticsA.getNumberOfHits()); + + TimerStatistics statisticsB = (TimerStatistics) statisticsA.getChildren().get(0); + System.out.println(statisticsB.getId()); + assertEquals("B",statisticsB.getId()); + try { + // uncomment to pause the test and connect to the mbean server using MC4J + //System.in.read(); + } + catch (Exception e) {}; + + } + +} Modified: trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorSpringConfigurationsTest.java =================================================================== --- trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorSpringConfigurationsTest.java 2006-03-25 21:31:23 UTC (rev 98) +++ trunk/sensor-support/test/java/net/sf/sensor/support/spring/SensorSpringConfigurationsTest.java 2006-03-28 20:36:22 UTC (rev 99) @@ -53,5 +53,21 @@ assertTrue(applicationContext.containsBean(SpringBeanNameConstants.XFIRE_TIMER_RUNTIME_BEAN_NAME)); } - + + /** + * Test method for the JMX sensor configuration + */ + public void testJMXConfiguration() { + // if the default spring config loads without throwing exceptions, we are already almost there... + ApplicationContext applicationContext = new ClassPathXmlApplicationContext( + new String[] {"/net/sf/sensor/support/spring/sensor.xml", + "/net/sf/sensor/support/spring/sensor-jmx.xml"}); + + assertTrue(applicationContext.containsBean(SpringBeanNameConstants.JMX_EXPORTER_BEAN_NAME)); + assertTrue(applicationContext.containsBean(SpringBeanNameConstants.MBEAN_SERVER_BEAN_NAME)); + assertTrue(applicationContext.containsBean(SpringBeanNameConstants.JMX_RMI_REGISTRY_BEAN_NAME)); + assertTrue(applicationContext.containsBean(SpringBeanNameConstants.JMX_SERVER_CONNECTOR_BEAN_NAME)); + + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2006-04-09 15:21:08
|
Revision: 115 Author: amooy Date: 2006-04-09 08:20:59 -0700 (Sun, 09 Apr 2006) ViewCVS: http://svn.sourceforge.net/sensor/?rev=115&view=rev Log Message: ----------- removed wtp stuff from sensor-support module Modified Paths: -------------- trunk/sensor-support/.classpath trunk/sensor-support/.project trunk/sensor-support/project.xml Modified: trunk/sensor-support/.classpath =================================================================== --- trunk/sensor-support/.classpath 2006-04-09 15:19:47 UTC (rev 114) +++ trunk/sensor-support/.classpath 2006-04-09 15:20:59 UTC (rev 115) @@ -15,11 +15,12 @@ <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar"/> <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/com.agical.rmock/jars/rmock-2.0.0-rc-5.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-3.0.1.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-remote-3.0.1.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="src/java"/> <classpathentry output="target/test-classes" kind="src" path="test/java"/> - <classpathentry including="**/*.xml|**/*.dtd|**/*.properties|**/*.xsd" output="target/classes" kind="src" path="src/resources"/> - <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-3.0.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-remote-3.0.1.jar"/> + <classpathentry including="**/*.xml|**/*.dtd|**/*.properties" output="target/classes" kind="src" path="src/resources"/> + <classpathentry including="**/*.xml|**/*.properties" output="target/test-classes" kind="src" path="test/resources"/> <classpathentry kind="output" path="target/classes"/> </classpath> Modified: trunk/sensor-support/.project =================================================================== --- trunk/sensor-support/.project 2006-04-09 15:19:47 UTC (rev 114) +++ trunk/sensor-support/.project 2006-04-09 15:20:59 UTC (rev 115) @@ -16,11 +16,6 @@ </arguments> </buildCommand> <buildCommand> - <name>org.eclipse.wst.validation.validationbuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> <name>org.springframework.ide.eclipse.core.springbuilder</name> <arguments> </arguments> @@ -30,8 +25,5 @@ <nature>nl.inspiring.maviclipse.core.maviclipseNature</nature> <nature>org.springframework.ide.eclipse.core.springnature</nature> <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.wst.common.project.facet.core.nature</nature> - <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> - <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> </natures> </projectDescription> Modified: trunk/sensor-support/project.xml =================================================================== --- trunk/sensor-support/project.xml 2006-04-09 15:19:47 UTC (rev 114) +++ trunk/sensor-support/project.xml 2006-04-09 15:20:59 UTC (rev 115) @@ -256,15 +256,13 @@ <include>**/*.xml</include> </includes> </resource> - <resource> - <directory>${basedir}/test/resources</directory> - <includes> - <include>**/*.xml</include> - <include>**/*.dtd</include> - <include>**/*.properties</include> - <include>**/*.xsd</include> - </includes> - </resource> + <resource> + <directory>${basedir}/test/resources</directory> + <includes> + <include>**/*.xml</include> + <include>**/*.properties</include> + </includes> + </resource> </resources> </unitTest> @@ -275,7 +273,6 @@ <include>**/*.xml</include> <include>**/*.dtd</include> <include>**/*.properties</include> - <include>**/*.xsd</include> </includes> </resource> </resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |