diff options
author | Tom Schindl | 2013-12-16 16:19:57 +0000 |
---|---|---|
committer | Tom Schindl | 2013-12-16 16:19:57 +0000 |
commit | 57591d73d2ef487d9b58c28662471754a3d9d2c3 (patch) | |
tree | 2b24c596a67fcbb778cea133bc60fabd1f41fe9e /bundles | |
parent | 1bb9926d55df2e3954133ca27ac60d1b439ec658 (diff) | |
download | org.eclipse.efxclipse-57591d73d2ef487d9b58c28662471754a3d9d2c3.tar.gz org.eclipse.efxclipse-57591d73d2ef487d9b58c28662471754a3d9d2c3.tar.xz org.eclipse.efxclipse-57591d73d2ef487d9b58c28662471754a3d9d2c3.zip |
fixed warnings
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/runtime/org.eclipse.fx.core.di.context.tests/src/org/eclipse/fx/core/di/context/tests/ContextBoundValueTestCase.java | 60 |
1 files changed, 55 insertions, 5 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core.di.context.tests/src/org/eclipse/fx/core/di/context/tests/ContextBoundValueTestCase.java b/bundles/runtime/org.eclipse.fx.core.di.context.tests/src/org/eclipse/fx/core/di/context/tests/ContextBoundValueTestCase.java index 4a222ed41..0422f53b5 100644 --- a/bundles/runtime/org.eclipse.fx.core.di.context.tests/src/org/eclipse/fx/core/di/context/tests/ContextBoundValueTestCase.java +++ b/bundles/runtime/org.eclipse.fx.core.di.context.tests/src/org/eclipse/fx/core/di/context/tests/ContextBoundValueTestCase.java @@ -31,20 +31,43 @@ import org.junit.Assert; import org.junit.Test; import org.osgi.framework.FrameworkUtil; +/** + * + */ public class ContextBoundValueTestCase { + + /** + * + */ public static class SimpleInject { + /** + * + */ @Inject @ContextValue(contextKey="simpleValue") public ContextBoundValue<String> value; } + + /** + * + */ public static class ObservableInject { + /** + * + */ @Inject @ContextValue(contextKey="simpleValue") public ContextBoundValue<String> value; + /** + * + */ public IObservableValue observableValue; + /** + * + */ @Inject @Named("simpleValue") @Optional @@ -52,17 +75,29 @@ public class ContextBoundValueTestCase { @PostConstruct void makeObservable() { - observableValue = value.adaptTo(IObservableValue.class); + this.observableValue = this.value.adaptTo(IObservableValue.class); } } + /** + * + */ public static class DirectObservableInject { + /** + * + */ @Inject @ContextValue(contextKey="simpleValue") public IObservableValue value; } + /** + * + */ public static class Target { + /** + * + */ @Inject @Named("simpleValue") @Optional @@ -70,6 +105,9 @@ public class ContextBoundValueTestCase { } + /** + * + */ @Test public void testSimpleInjection() { IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext()); @@ -77,6 +115,9 @@ public class ContextBoundValueTestCase { Assert.assertNotNull(simpleInject.value); } + /** + * + */ @Test public void testSimpleObservable() { IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext()); @@ -84,10 +125,13 @@ public class ContextBoundValueTestCase { Assert.assertNotNull(obsInject.observableValue); } + /** + * + */ @Test public void observableSupportModify() { IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext()); - serviceContext.declareModifiable("simpleValue"); + serviceContext.declareModifiable("simpleValue"); //$NON-NLS-1$ ObservableInject obsInject = ContextInjectionFactory.make(ObservableInject.class, serviceContext); Assert.assertNull(obsInject.injectedValue); @@ -108,14 +152,17 @@ public class ContextBoundValueTestCase { bool.set(uuid.equals(event.diff.getNewValue())); } }); - serviceContext.modify("simpleValue", uuid); + serviceContext.modify("simpleValue", uuid); //$NON-NLS-1$ Assert.assertTrue(bool.get()); } + /** + * + */ @Test public void testContextModify() { IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext()); - serviceContext.declareModifiable("simpleValue"); + serviceContext.declareModifiable("simpleValue"); //$NON-NLS-1$ Target t = ContextInjectionFactory.make(Target.class, serviceContext); @@ -127,10 +174,13 @@ public class ContextBoundValueTestCase { Assert.assertEquals(uuid, t.injectedValue); } + /** + * + */ @Test public void testDirectObservable() { IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext()); - serviceContext.declareModifiable("simpleValue"); + serviceContext.declareModifiable("simpleValue"); //$NON-NLS-1$ Realm r = new Realm() { @Override |