[jboss-cvs] JBoss Profiler SVN: r577 - branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 5 08:14:25 EST 2010


Author: clebert.suconic at jboss.com
Date: 2010-03-05 08:14:24 -0500 (Fri, 05 Mar 2010)
New Revision: 577

Added:
   branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/WebLoadTest.java
Modified:
   branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/TestClass.java
Log:
tweaks

Modified: branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/TestClass.java
===================================================================
--- branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/TestClass.java	2009-11-04 19:21:12 UTC (rev 576)
+++ branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/TestClass.java	2010-03-05 13:14:24 UTC (rev 577)
@@ -32,13 +32,18 @@
 public class TestClass
 {
 
-   long a = 1;
+   static long counter = 0 ;
+   
+   long a = counter++;
 
-   long a2 = 1;
+   long a2 = counter++;
 
-   long a3 = 1;
+   long a3 = counter++;
 
-   long a4 = 1;
+   long a4 = counter++;
+   long a5 = counter++;
+
+   long a6 = counter++;
    // Constants -----------------------------------------------------
 
    // Attributes ----------------------------------------------------

Added: branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/WebLoadTest.java
===================================================================
--- branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/WebLoadTest.java	                        (rev 0)
+++ branches/JBossProfiler2/src/test/java/org/jboss/profiler/test/jvmti/WebLoadTest.java	2010-03-05 13:14:24 UTC (rev 577)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.jboss.profiler.test.jvmti;
+
+import org.jboss.profiler.jvmti.JVMTIInterface;
+import org.jboss.profiler.jvmti.memoryweb.WebMemoryUI;
+
+import java.net.InetSocketAddress;
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+/**
+ * A IsLoadedTest
+ *
+ * @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class WebLoadTest extends TestCase
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+   
+   
+   public void testWeb() throws Exception
+   {
+      ArrayList<TestClass> tests = new ArrayList<TestClass>();
+      
+      for (int i = 0 ; i < 10000; i++)
+      {
+         tests.add(new TestClass());
+      }
+      
+      
+      JVMTIInterface jvmti = new JVMTIInterface();
+      WebMemoryUI web = new WebMemoryUI(new InetSocketAddress(8080), jvmti);
+      
+      web.start();
+   }
+   
+   public void testIsLoaded() throws Exception
+   {
+      JVMTIInterface jvmti = new JVMTIInterface();
+      
+      System.out.println("active = " + jvmti.isActive());
+      
+      jvmti.startMeasure("/tmp", "log", "log");
+      
+      
+      for (int i = 0 ; i < 100; i++)
+      {
+         bala();
+      }
+      
+      jvmti.stopMeasure();
+   }
+   
+   public static void bala()
+   {
+      
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}




More information about the jboss-cvs-commits mailing list