You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently PDE supports running a JUnit Plug-in Test, but this is tightly
coupled to PDE and Eclipse Applications. On the other hand PDE offers to
launch plain OSGi Frameworks but something similar for tests is missing.
This adds a new launch type "OSGi Test" that offers such type of tests
that are not tied to PDE/Eclipse but targeting generic OSGi
applications, this is very similar to what Tycho offers as
'tycho-surefire-plugin:bnd-test' and will also allow better interfacing
with the OSGi Test framework.
Copy file name to clipboardexpand all lines: ui/org.eclipse.pde.bnd.ui/README.MD
+47-2
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,15 @@ One problem for such a reusable component is that it usually needs to get holds
18
18
To mitigate we use the [Eclipse Adapter Pattern](https://www.eclipse.org/articles/Article-Adapters/) as it is widely used in Eclipse, flexible and allows
19
19
the use of [OSGi services / Dependency Injection](https://eclipse.dev/eclipse/news/4.18/platform_isv.php#dialog-adapterfactory-as-service) already.
20
20
21
-
### The IProject adapter
21
+
### The `IProject` adapter
22
22
23
23
Components need to learn the project and workspace of a bndlib backed project, for this the very first step for an integration is to provide an adapter that can
24
24
transform an (Eclipse) `IProject` into a (bndlib) `Project` (from were the Workspace then can be derived), an example might look like this:
public class BndPluginAdapter implements IAdapterFactory {
29
+
public class BndProjectAdapter implements IAdapterFactory {
30
30
31
31
@Override
32
32
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
@@ -46,6 +46,51 @@ public class BndPluginAdapter implements IAdapterFactory {
46
46
}
47
47
```
48
48
49
+
### The `Bndrun` adapter
50
+
51
+
For some cases one would need to get hold of a `Bndrun` (e.g. for launching tests), to support this similar is needed as to create a template that then can further be customized.
52
+
For this use-case it is required to provide an adapter that can transform an (Eclipse) `IProject` into a (bndlib) `Bndrun` that is initialized with the runrequires contain the identity
53
+
of the project and the workspace be able to resolve such bundle.
//make sure the file is deleted when the bndrun is closed...
78
+
bndrun.addClose(new AutoCloseable() {
79
+
80
+
@Override
81
+
public void close() throws Exception {
82
+
Files.delete(file);
83
+
}
84
+
});
85
+
}
86
+
}
87
+
}
88
+
return null;
89
+
}
90
+
91
+
}
92
+
```
93
+
49
94
## Available components
50
95
51
96
Beside some integration stuff (e.g. enable to [discover bndlib plugins](https://github.com/eclipse-pde/eclipse.pde/blob/master/ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/internal/Auxiliary.java) inside an OSGi runtime)
0 commit comments