[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| RE: [pde-dev] Profiling PDE Junit Plugin Tests | 
Dan,
 
Thank you very much...this information helped a GREAT deal. 
 
Out-of-curiousity, have you ever tried to run all JUnit 
plug-in tests within a plug-in by right-clicking on the plugin in Eclipse's 
Package Explorer and selecting the "Run JUnit Plug-in Test" option? The reason 
why I initally needed to profile my tests was due to excessive memory usage when 
I was testing using this method. However, it seems like Eclipse does some funky 
things when trying to run a bunch of JUnit PDE test suites at a time. I was 
seeing almost TWICE the number of tests that actually existed in the JUnit pane 
(I just joined this project, so at first, the larger number didn't trigger an 
alarm with me) and many of the tests were being run multiple times. The order 
that the tests were run also seemed a bit wacky, as it LOOKED like the test 
runner was starting top down (from a Package Explorer point-of-view). However, I 
set a breakpoint in the setUp() of one of the last tests, which was hit almost 
instantly in the beginning of the test run. Immediately following this event, 
tests that were situated at the top of the plug-in/package hierarchy were 
executed. So, to summarize, tests were being run multiple times and 
out-of-order. Has anyone else seen this behavior? Very wacky...(btw, all our 
JUnit PDE tests have the suite() method defined, as there are oneTimeSetup and 
oneTimeTearDown methods that need to be called for each test 
class).
 
Thanks again for the info, though, I'm definitely well on 
my way into profiling land now. :)
 
Scott
Your question is really appropriate 
for the newsgroups, but I can offer some suggestions.  I've had good 
success with YourKit Java Profiler under Eclipse, whether running standalone or 
with the PDE. The setup is straightforward -- copy their DLL (yjpagent.dll) to 
your JRE's bin directory, specify -Xrunyjpagent as vmargs in the launch 
configuration / command line, and it communicates with the YK user 
interface. I've also used JProbe in 
the PDE, but that's a little more challenging since JProbe wants to launch the 
profilee as a child process, and the PDE by default makes the same assumption. 
 Making them both happy involved launching my application using the PDE to 
establish its runtime configuration area, exiting the runtime instance, then 
having JProbe relaunch Eclipse using the same parameters / setup area as the PDE 
would.  The "trick" is finding what options the PDE uses to get the runtime 
instance going.  Well, no magic there -- launch your application in the PDE 
and in the Debug view, select "Properties" on the process to see the equivalent 
command line options you would need to launch it under JProbe (or any other 
profiler which launches the application as a child process).  One small 
caveat I noted was that JProbe doesn't handle quoted paths correctly in its 
sessions settings (*.jpl), although I have an old copy and it may have since 
been corrected (v5.0.1). Hope this 
helps... -- Dan 
----- Message from 
Scott Gelb <SGelb@xxxxxxxxxxxxxx> on Tue, 1 Feb 2005 16:37:45 -0600 
----- 
  
  
    | To: | pde-dev@xxxxxxxxxxx | 
    | Subject: | [pde-dev] Profiling PDE Junit Plugin 
Tests | 
Greetings, 
     I'm new 
to Eclipse PDE development, so please bare with me...      I've been having 
some difficulty using a few of the profilers out there to investigate some 
memory issues in a few of my junit tests. These tests require the pde and thus 
they run as junit plugin tests via the Eclipse environment. If I try to use the 
Eclipse profiler, I get the same error/exception that I receive when trying to 
run a pde test as a normal junit test:   
org.eclipse.core.internal.runtime.AssertionFailedException: assertion 
failed: The application has not been initialized. 
at 
org.eclipse.core.internal.runtime.Assert.isTrue(Assert.java:101) 
at 
org.eclipse.core.internal.runtime.InternalPlatform.assertInitialized(InternalPlatform.java:191) 
at 
org.eclipse.core.internal.runtime.InternalPlatform.getPluginRegistry(InternalPlatform.java:410) 
at 
org.eclipse.core.runtime.Platform.getPluginRegistry(Platform.java:321) 
at 
com.metamatrix.core.util.SmartPdeTestSuite.<init>(SmartPdeTestSuite.java:24) 
at 
com.metamatrix.modeler.core.PdeTestAutomatedTestUtil.suite(PdeTestAutomatedTestUtil.java:73) 
at 
com.metamatrix.modeler.core.PdeTestAutomatedTestUtil.main(PdeTestAutomatedTestUtil.java:40) 
Exception in thread "main" 
 
   What type of strategy do people use when 
profiling junit tests that require the pde? Is there a way to bootstrap a 
profiling tool to the jvm that the pde initializes? Again, I apologize for my 
naiveté, but I'm nearing my wits' end on figuring out a good way to accomplish 
this goal. 
 
Thanks, 
Scott 
 _______________________________________________
pde-dev mailing 
list
pde-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/pde-dev