Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Problems using Virgo Test Framework
Problems using Virgo Test Framework [message #651546] Mon, 31 January 2011 15:45 Go to next message
Dmitry is currently offline DmitryFriend
Messages: 4
Registered: January 2011
Junior Member
I am trying to use Virgo Test Framework to run tests with Maven and did the following steps:

1) Create unit test class:

package com.tcds.test;

import org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(DmKernelTestRunner.class)
public class DemoIntegrationTest {

  @Test
  public void testOne() {
    Assert.assertTrue("Test failed!", false);
  }
}


2) Create test.config.properties at 'src/test/resources/META-INF/test.config.properties' with the following content:

launcher.bundles =\
 file:${virgo.kernel.libraries}/com.springsource.slf4j.api-1.6.1.jar@start,\
 file:${virgo.kernel.libraries}/com.springsource.slf4j.org.apache.commons.logging-1.6.1.jar@start,\
 file:${virgo.kernel.libraries}/com.springsource.org.aspectj.weaver-1.6.6.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.medic-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.apache.felix.configadmin-1.2.4.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.medic.core-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.util.osgi-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.apache.felix.eventadmin-1.0.0.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.util.common-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.util.io-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.util.jmx-2.1.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.util.math-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.util.parser.manifest-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/com.springsource.org.apache.commons.codec-1.3.0.jar@start,\
 file:${virgo.kernel.libraries}/com.springsource.org.apache.commons.httpclient-3.1.0.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.repository-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.springframework.aop-3.0.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.springframework.asm-3.0.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.springframework.expression-3.0.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.springframework.beans-3.0.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.springframework.core-3.0.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.springframework.context-3.0.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.core-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.agent.dm-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.springframework.osgi.core-1.2.1.jar,\
 file:${virgo.kernel.libraries}/org.springframework.osgi.extender-1.2.1.jar@start,\
 file:${virgo.kernel.libraries}/org.springframework.osgi.io-1.2.1.jar,\
 file:${virgo.kernel.libraries}/com.springsource.org.aopalliance-1.0.0.jar,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.artifact-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.services-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.osgi-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.deployer-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.model-2.1.0.RELEASE.jar@start,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.kerneldmfragment-2.1.0.RELEASE.jar,\
 file:${virgo.kernel.libraries}/org.eclipse.virgo.kernel.shell-2.1.0.RELEASE.jar@start

deployer.timeout=300

#org.eclipse.virgo.test.properties.include=file:META-INF/virgo-test.properties
virgo.home=D:/virgo-web-server-2.1.0.RELEASE
virgo.kernel.libraries=D:/virgo-web-server-2.1.0.RELEASE/lib/kernel
virgo.ext.libraries=D:/virgo-web-server-2.1.0.RELEASE/repository/ext
virgo.osgi.java.profile=D:/virgo-web-server-2.1.0.RELEASE/lib/java6-server.profile

#Equinox Configuration 
osgi.parentClassloader=fwk
osgi.context.bootdelegation=false
osgi.compatibility.bootdelegation=false
osgi.clean=true
osgi.configuration.area=target

osgi.java.profile=file:${virgo.osgi.java.profile}
osgi.java.profile.bootdelegation=override
osgi.hook.configurators.include=org.eclipse.virgo.osgi.extensions.equinox.hooks.ExtensionsHookConfigurator

org.eclipse.virgo.kernel.home=target
org.eclipse.virgo.kernel.domain=org.eclipse.virgo.kernel
# Paths are relative to the current working directory
org.eclipse.virgo.kernel.config=src/test/resources/config

org.eclipse.virgo.medic.log.config.path=src/test/resources/config/serviceability.xml

org.eclipse.gemini.web.tomcat.config.path=src/test/resources/config/tomcat-server.xml

org.eclipse.virgo.kernel.deployer.disableRecovery=true


3) Place 'config' directory from Ecipse Virgo distribution to 'src/test/resources/config'.

All relative paths at this configuration files were changed to absolute paths pointing to 'D:/virgo-web-server-2.1.0.RELEASE\' where Virgo was unpacked. Zip with this configuration files attached to this post.

While running test I have the following output:
[2011-01-31 21:26:26.328] Thread-18                    < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] Thread-18                    Before filtering: 0 
[2011-01-31 21:26:26.328] Thread-18                    After filtering: 0 
[2011-01-31 21:26:26.328] Thread-18                    > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.312] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] startup-tracker              < public boolean org.eclipse.virgo.kernel.core.BlockingSignal.awaitCompletion(long, java.util.concurrent.TimeUnit) org.eclipse.virgo.kernel.core.FailureSignalledException: java.lang.RuntimeException: bundle stopped
	at org.eclipse.virgo.kernel.core.BlockingSignal.awaitCompletion(BlockingSignal.java:56)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.run(StartupTracker.java:161)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: bundle stopped
	at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$StartupTrackerBundleListener.bundleChanged(BundleStartTracker.java:246)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1349)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1300)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:517)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:550)
	at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1097)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.suspendAllBundles(StartLevelManager.java:617)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:261)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:215)
	at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.suspend(InternalSystemBundle.java:266)
	at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:690)
	at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:588)
	at org.eclipse.osgi.framework.internal.core.InternalSystemBundle$1.run(InternalSystemBundle.java:243)
	... 1 common frames omitted

[2011-01-31 21:26:26.328] Thread-18                    < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] Thread-18                    > public java.lang.String org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.toString() 
[2011-01-31 21:26:26.328] Thread-18                    < public java.lang.String org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.toString() 
[2011-01-31 21:26:26.328] Thread-18                    global > org.eclipse.virgo.kernel.shell.CommandExecutor [null] (org.eclipse.virgo.kernel.osgicommand_2.1.0.RELEASE [3]) 
[2011-01-31 21:26:26.328] Thread-18                    > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] Thread-18                    < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] Thread-18                    > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] Thread-18                    < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.328] Thread-18                    Before filtering: 0 
[2011-01-31 21:26:26.328] Thread-18                    After filtering: 0 
[2011-01-31 21:26:26.328] startup-tracker              > public static boolean org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.seen(java.lang.Throwable) 
[2011-01-31 21:26:26.328] startup-tracker              < public static boolean org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.seen(java.lang.Throwable) 
[2011-01-31 21:26:26.328] startup-tracker              > public static void org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.record(java.lang.Throwable) 
[2011-01-31 21:26:26.328] startup-tracker              < public static void org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.record(java.lang.Throwable) 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       > public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] System Bundle Shutdown       < public boolean org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory.GlobalScope.isGlobal() 
[2011-01-31 21:26:26.343] startup-tracker              <ME0001W> A message with the key 'ME0003I' was not found. The inserts for the message were '[serviceability\dump\2011-01-31-21-26-328]' 
[2011-01-31 21:26:26.343] startup-tracker              A message with the key 'ME0003I' was not found. The inserts for the message were '[serviceability\dump\2011-01-31-21-26-328]' 
[2011-01-31 21:26:26.343] startup-tracker              Dump 'serviceability\dump\2011-01-31-21-26-328' generated 
[2011-01-31 21:26:26.343] startup-tracker              > public static boolean org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.seen(java.lang.Throwable) 
[2011-01-31 21:26:26.343] startup-tracker              < public static boolean org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.seen(java.lang.Throwable) 
[2011-01-31 21:26:26.343] startup-tracker              > public void org.eclipse.virgo.kernel.core.internal.ServiceReferenceTracker.ungetAll() 
[2011-01-31 21:26:26.343] startup-tracker              < public void org.eclipse.virgo.kernel.core.internal.ServiceReferenceTracker.ungetAll() 
[2011-01-31 21:26:26.343] startup-tracker              > public static boolean org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.seen(java.lang.Throwable) 
[2011-01-31 21:26:26.343] startup-tracker              < public static boolean org.eclipse.virgo.kernel.serviceability.dump.FFDCExceptionState.seen(java.lang.Throwable) 
[2011-01-31 21:26:26.343] startup-tracker              < public void org.eclipse.virgo.kernel.core.internal.StartupTracker.StartupTrackingRunnable.run() java.lang.IllegalStateException: The EventAdmin is stopped
	at org.apache.felix.eventadmin.impl.EventAdminImpl$1.createHandlerTasks(EventAdminImpl.java:128)
	at org.apache.felix.eventadmin.impl.EventAdminImpl.postEvent(EventAdminImpl.java:87)
	at org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.postEvent(EventAdminSecurityDecorator.java:85)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.postEvent(StartupTracker.java:249)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.kernelStartFailed(StartupTracker.java:223)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.run(StartupTracker.java:169)
	at java.lang.Thread.run(Thread.java:619)

Exception in thread "startup-tracker" java.lang.IllegalStateException: The EventAdmin is stopped
	at org.apache.felix.eventadmin.impl.EventAdminImpl$1.createHandlerTasks(EventAdminImpl.java:128)
	at org.apache.felix.eventadmin.impl.EventAdminImpl.postEvent(EventAdminImpl.java:87)
	at org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.postEvent(EventAdminSecurityDecorator.java:85)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.postEvent(StartupTracker.java:249)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.kernelStartFailed(StartupTracker.java:223)
	at org.eclipse.virgo.kernel.core.internal.StartupTracker$StartupTrackingRunnable.run(StartupTracker.java:169)
	at java.lang.Thread.run(Thread.java:619)
[2011-01-31 21:26:27.250] System Bundle Shutdown       > public void org.eclipse.virgo.kernel.core.internal.ShutdownManager.ShutdownLoggingListener.bundleChanged(org.osgi.framework.BundleEvent) 
[2011-01-31 21:26:27.250] System Bundle Shutdown       < public void org.eclipse.virgo.kernel.core.internal.ShutdownManager.ShutdownLoggingListener.bundleChanged(org.osgi.framework.BundleEvent) 
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 37.157 sec <<< FAILURE!

Results :

Tests in error: 
  uk.co.utel.tcds.test.DemoIntegrationTest: An error occurred trying to read the bundle

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to D:\eclipseProjects\tcds_workspace\tcds-persistence-service\target\surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44 seconds
[INFO] Finished at: Mon Jan 31 21:26:35 NOVT 2011
[INFO] Final Memory: 26M/63M
[INFO] ------------------------------------------------------------------------



Sometimes output is different - both versions can be found at attached zip file.

I have no ideas about the source of problem which prevent Virgo to be started. Can anyone advise how to handle this?
  • Attachment: log_files.zip
    (Size: 663.56KB, Downloaded 403 times)
Re: Problems using Virgo Test Framework [message #654095 is a reply to message #651546] Mon, 14 February 2011 08:14 Go to previous messageGo to next message
Hristo Iliev is currently offline Hristo IlievFriend
Messages: 156
Registered: May 2010
Location: Sofia, Bulgaria
Senior Member

The problem seems to be a bundle that failed to start.

Unfortunately there are far too many logs and I cannot determine the exact bundle. Can you please try to reduce the log level/severity?

The exception "java.lang.RuntimeException: bundle stopped" can also be improved to provide the bundle's name and version. That will be helpful in cases with many logs. Can you please file a bug about the exception?


Re: Problems using Virgo Test Framework [message #654225 is a reply to message #654095] Mon, 14 February 2011 16:33 Go to previous messageGo to next message
Dmitry is currently offline DmitryFriend
Messages: 4
Registered: January 2011
Junior Member
Hristo Iliev wrote on Mon, 14 February 2011 03:14

Unfortunately there are far too many logs and I cannot determine the exact bundle. Can you please try to reduce the log level/severity?



I will try to do this tomorrow.
Re: Problems using Virgo Test Framework [message #654386 is a reply to message #651546] Tue, 15 February 2011 14:30 Go to previous messageGo to next message
Dmitry is currently offline DmitryFriend
Messages: 4
Registered: January 2011
Junior Member
Here is log files with less details.
Re: Problems using Virgo Test Framework [message #656424 is a reply to message #654386] Fri, 25 February 2011 15:02 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

I've had some time to look at this and could you explain the difference between output_1 and output_2, are they just different runs of the same problem, while not identical they are pretty close. During startup, a kernel bundle shutdown for some unknown reason. This then prompts the whole kernel to shutdown, this is the correct behaviour, the question is why one of the kernel bundles goes down in the first place. Unfortunately this seems to be an area we could do with some better logging in.

I've had a look over the configuration and all seems to be in order although I haven't been through it in detail. First, could you confirm that when you took a copy from one of the Virgo repos it was at the 2.1.0 tag and not master as there have been a lot of changes to the required configuration. Also, I can't find any sign of the test.config file. In the Virgo projects this is not kept with the rest of the config, it's normally in the META-INF directory. This is the default location, there is an annotation to specify where it is if you want to put it somewhere else. If you did grab that as well, could you please attach that so I can have a look. If not then this may be what your missing.

Thanks, Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Problems using Virgo Test Framework [message #656548 is a reply to message #656424] Sat, 26 February 2011 17:24 Go to previous message
Peter  ardfj is currently offline Peter ardfjFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,

I recognize the error although I cannot remember exactly how I resolved it. One thing I did note, and that may be causing your problems, is that your test bundle needs a MANIFEST.MF file, which you probably should place under src/test/resources/META-INF/MANIFEST.MF.

See http://git.eclipse.org/c/virgo/org.eclipse.virgo.web.git/tre e/org.eclipse.virgo.web.test/src/test/resources/META-INF/MAN IFEST.MF for an example.

best regards, Peter
Previous Topic:Remote repository configuration
Next Topic:JMX and Spring bean
Goto Forum:
  


Current Time: Thu Dec 26 14:22:30 GMT 2024

Powered by FUDForum. Page generated in 0.03016 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top