forked from njbartlett/bndtools.runtime.eclipse
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExampleTest.java
More file actions
32 lines (24 loc) · 1004 Bytes
/
ExampleTest.java
File metadata and controls
32 lines (24 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package bndtools.runtime.applaunch.eclipse3.test;
import java.util.Map;
import junit.framework.TestCase;
import org.eclipse.equinox.app.IApplicationContext;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
public class ExampleTest extends TestCase {
private final BundleContext context = FrameworkUtil.getBundle(
this.getClass()).getBundleContext();
public void testVMarguments() throws Exception {
assertEquals("vmArg1", System.getProperty("vmArg1"));
}
public void testArgumentsService() throws Exception {
assertNotNull(context);
ServiceReference<?> srv = context
.getServiceReference(IApplicationContext.class.getName());
assertNotNull(srv);
IApplicationContext iac = (IApplicationContext) context.getService(srv);
Map<?, ?> arguments = iac.getArguments();
assertEquals("example.equinox.headless.application",
arguments.get("eclipse.application"));
}
}