[JBoss OSGi Development] - Re: Unexpected dependee state changes
by thomas.diesler@jboss.com
It's not quite ok AFAIK
| If this bundle has exported any packages, the Framework must continue to make these packages available to their importing bundles until the PackageAdmin.refreshPackages method has been called or the Framework is relaunched.
|
Hence, from the class loading perspective bundle B should continue to work. From the service perspective, bundle B may track services that are provided by X and may unregister its own services. However, that behaviour would depend on the nature of those services.
Generally, it is not ok that BundleActivator.stop() is called on bundle B (causing all of its services to get unregistered) only because one of the bundles it imports packages from gets uninstalled.
I realize that this behaviour may not be natural to MC, but it is how OSGi works AFAIU.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268428#4268428
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268428
16 years, 4 months
[JBoss Microcontainer Development] - Re: Testing Deployers with new Reflect + ClassPool
by alesj
"alesj" wrote :
| I guess you now do this explicitly in maven?
|
Ah, I see now what you've done.
| <plugin>
| <groupId>org.apache.maven.plugins</groupId>
| <artifactId>maven-antrun-plugin</artifactId>
| <version>1.2</version>
| <executions>
| <execution>
| <id>create-test-jars</id>
| <goals>
| <goal>run</goal>
| </goals>
| <phase>process-test-classes</phase>
| <configuration>
| <tasks>
| <property name="test.jar.suffix" value="-test-classpool-"/>
| <property name="archive.dir" value="${project.build.directory}/archives"/>
| <mkdir dir="${archive.dir}"/>
| <jar destfile="${archive.dir}/a1.jar"
| basedir="${project.build.testOutputDirectory}"
| includes="org/jboss/test/classpool/support/excluded/a/*.class"/>
|
Well, this works too, but, as it's shows, it makes harder to test/debug tests.
I thought you would use VFS's Assembled notion.
Or is there a valid reason you didn't?
To simplify + speed-up things, what you can do,
is to put this created artifacts directly into test's resources.
(they will get copied to the proper location by any env)
Then all you need to do is to add programmatic exclusion of test classes.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268390#4268390
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268390
16 years, 4 months
[JBoss Microcontainer Development] - Re: Testing Deployers with new Reflect + ClassPool
by alesj
"flavia.rainone(a)jboss.com" wrote :
| That error is fully expected as the classes belonging to the excluded package must be excluded from the classpath during test execution :-)
|
I guess you now do this explicitly in maven?
You should do it programatically,
the same way we do it in our CL, Deployers, Weld, ... tests.
Check CL tests, where we create new ClassLoaderSystem, set parent policy, filters, ...
This way we will be able to run them in any env - IDE, mvn, ant, ivy, ...
"flavia.rainone(a)jboss.com" wrote :
| What about the NPE I couldn't reproduce in my computer?
|
This was in attempt to get to the bottom of the NPE, debuging via IDE. ;-)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268370#4268370
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268370
16 years, 4 months
[JBoss Microcontainer Development] - Re: Testing Deployers with new Reflect + ClassPool
by flavia.rainone@jboss.com
"alesj" wrote : Running from IDE I get this for all org.jboss.test.classpool.jbosscl.test.RepositoryClassPoolTestCase tests
|
| | junit.framework.AssertionFailedError: Should not have been able to load org.jboss.test.classpool.support.excluded.a.A
| | at org.jboss.test.classpool.support.TestScenario.assertCannotLoaderSupportClasses(TestScenario.java:260)
| | at org.jboss.test.classpool.support.TestScenario.destroyLoaders(TestScenario.java:118)
| | at org.jboss.test.classpool.jbosscl.test.JBossClClassPoolTest.tearDown(JBossClClassPoolTest.java:160)
| | at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
| | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| | at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
That error is fully expected as the classes belonging to the excluded package must be excluded from the classpath during test execution :-)
What about the NPE I couldn't reproduce in my computer?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268352#4268352
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268352
16 years, 4 months