use of org.osgl.inject.Genie in project java-di by osglworks.
the class GH21 method testEquality.
@Test
public void testEquality() {
Genie genie = Genie.create();
Field xfoo = $.fieldOf(X.class, "foo");
Field yfoo = $.fieldOf(Y.class, "foo");
assertNotEquals(BeanSpec.of(xfoo, genie), BeanSpec.of(yfoo, genie));
}
use of org.osgl.inject.Genie in project java-di by osglworks.
the class GH25 method test.
@Test
public void test() {
Genie genie = Genie.create();
genie.registerNamedProvider(Foo.class, new FooProvider());
FooHolder fooHolder = genie.get(FooHolder.class);
eq("bar", fooHolder.foo.name);
}
use of org.osgl.inject.Genie in project java-di by osglworks.
the class Gh20 method test.
@Test
public void test() {
Genie genie = Genie.create();
BeanSpec spec = BeanSpec.of(int[].class, genie);
eq(int.class, spec.componentSpec().rawType());
}
use of org.osgl.inject.Genie in project java-di by osglworks.
the class Gh19 method test.
@Test
public void test() {
Genie genie = Genie.create();
BeanSpec spec = BeanSpec.of(IntA.class, genie);
yes(spec.isInterface());
spec = BeanSpec.of(Gh19.class, genie);
no(spec.isInterface());
}
use of org.osgl.inject.Genie in project java-di by osglworks.
the class GH10 method test.
@Test
public void test() {
Genie genie = Genie.create(Binder.class);
A a = genie.get(A.class);
eq("foo", a.a());
}