/
ErlangPluginsTest.java
55 lines (43 loc) · 1.59 KB
/
ErlangPluginsTest.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package org.erlide.backend;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import java.util.Enumeration;
import org.eclipse.core.runtime.Platform;
import org.junit.Test;
import org.osgi.framework.Bundle;
public class ErlangPluginsTest {
@Test
public void commonisAvailable() {
checkBundleForTwoEbinElements("org.erlide.kernel", "/common");
}
@Test
public void ideisAvailable() {
checkBundleForTwoEbinElements("org.erlide.kernel", "/ide");
}
@Test
public void debuggerIsAvailable() {
checkBundleForTwoEbinElements("org.erlide.kernel.debugger", "/debugger");
}
@Test
public void debuggerR16isAvailable() {
checkBundleForTwoEbinElements("org.erlide.kernel.debugger.otp", "/debugger/r16");
}
@Test
public void debugger17isAvailable() {
checkBundleForTwoEbinElements("org.erlide.kernel.debugger.otp", "/debugger/17");
}
@Test
public void debugger18isAvailable() {
checkBundleForTwoEbinElements("org.erlide.kernel.debugger.otp", "/debugger/18");
}
private void checkBundleForTwoEbinElements(final String pluginId, final String path) {
final Bundle b = Platform.getBundle(pluginId);
final Enumeration<String> paths = b.getEntryPaths(path);
assertThat(paths, is(not(nullValue())));
// we check for at least two elements
assertThat(paths.hasMoreElements(), is(true));
assertThat(paths.hasMoreElements(), is(true));
}
}