Not sure if this is feasible for you, but in equinox tests we fire up a
separate OSGi Framework within the same VM for this and install our test
bundles into the separate framework [1].  In order to do that cleanly you
will have to install all your ECF bundles you want to test into the second
framework while testing them.

IIRC an important point if you are doing this all in the same VM is to make
sure you setup the Policy to make sure AllPermission is granted correctly.
Otherwise your currently runnig framework will all of a sudden not have
sufficient permissions to continue executing.

The permission.perm files are only necessary if you want to scope the set
of default permissions granted to your bundles.  The default permission set
is AllPermission.  While this may be nice to do, it is not necessary.  Your
tests can use the permission admin services in order to set permissions on
your test bundles if you want to scope their permissions down for tests.  I
find this easier to deal with because then you only need one client bundle
to test different conditions based on what permissions the client bundle is
granted.

[1]
http://git.eclipse.org/c/equinox/rt.equinox.framework.git/tree/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/securityadmin/SecurityManagerTests.java



From:   Scott Lewis <[email protected]>
To:     Equinox development mailing list <[email protected]>
Date:   07/21/2014 02:07 PM
Subject:        [equinox-dev] Running junit plugin tests with security manager
Sent by:        [email protected]



We/ECF would like to be able to run some junit plugin tests (junit 3 at
least, 4 if possible) with the java security manager running in the target.

Has anyone previously created/got the .java.security policy and
appropriate permission.perms that would allow this to happen?   I fussed
with creating the .java.security policy files to allow use of
EclipseStarter, junit, etc...but didn't get very far.

Thanks,

Scott


_______________________________________________
equinox-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to