import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
public class OsgiBundleScanningSchemaServiceTest {
private final BundleContext bundleContext = mock(BundleContext.class, "bundleContext");
@Before
- public void setUp() throws Exception {
+ public void setUp() throws InvalidSyntaxException {
destroyInstance();
doReturn(mock(Filter.class)).when(bundleContext).createFilter(any());
doNothing().when(bundleContext).addBundleListener(any());
@SuppressWarnings("checkstyle:IllegalCatch")
@After
- public void destroyInstance() throws Exception {
+ public void destroyInstance() {
try {
OsgiBundleScanningSchemaService.getInstance();
OsgiBundleScanningSchemaService.destroyInstance();
}
@Test
- public void basicTest() throws Exception {
+ public void basicTest() {
assertTrue(osgiService instanceof DOMSchemaService);
final SchemaContext schemaContext = TestModel.createTestContext();
}
@Test(expected = UnsupportedOperationException.class)
- public void sessionContextTest() throws Exception {
+ public void sessionContextTest() {
osgiService.getSessionContext();
}
}