/code.lucamarrocco.scala.eclipse/test/code/lucamarrocco/scala/eclipse/ScalaModuleTest.java
Java | 80 lines | 54 code | 26 blank | 0 comment | 0 complexity | 6586bb1cbd176eb6711dd47906faa04f MD5 | raw file
- package code.lucamarrocco.scala.eclipse;
- import static com.google.inject.Guice.*;
- import static org.hamcrest.Matchers.*;
- import static org.junit.Assert.*;
- import static org.mockito.Mockito.*;
- import org.eclipse.core.resources.*;
- import org.eclipse.core.runtime.*;
- import org.eclipse.core.runtime.content.*;
- import org.eclipse.ui.*;
- import org.junit.*;
- import com.google.inject.*;
- public class ScalaModuleTest {
- private Injector injector;
- private ScalaModule module;
- private Plugin plugin;
- private ILog log;
- private IEditorRegistry editorRegistry;
- private IContentTypeManager contentTypeManager;
- private IWorkspace workspace;
- @Before
- public void setUp() {
- plugin = mock(Plugin.class);
- log = mock(ILog.class);
- editorRegistry = mock(IEditorRegistry.class);
- contentTypeManager = mock(IContentTypeManager.class);
- workspace = mock(IWorkspace.class);
- module = new ScalaModule(plugin, log, editorRegistry, contentTypeManager, workspace);
- injector = createInjector(module);
- }
- @Test
- public void testInstantiateIndex() {
- final IIndex index = injector.getInstance(IIndex.class);
- assertThat(index, is(notNullValue()));
- }
- @Test
- public void testInstantiateInjector() {
- assertThat(injector, is(notNullValue()));
- }
- @Test
- public void testInstantiateSimpleLog() {
- final ISimpleLog simpleLog = injector.getInstance(ISimpleLog.class);
- assertThat(simpleLog, is(notNullValue()));
- }
- @Test
- public void testInstantiateWorkbench() {
- final ScalaEditorTest workbench = injector.getInstance(ScalaEditorTest.class);
- assertThat(workbench, is(notNullValue()));
- }
- @Test
- public void testInstantiateWorkspace() {
- final IScalaWorkspace workspace = injector.getInstance(IScalaWorkspace.class);
- assertThat(workspace, is(notNullValue()));
- }
- }