262263264265266267268269270271272
replay(); ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, findMethod(fixture, "buildWithUnorderedConfiguration")); Object actual = sc.createObject(); assertSame(actual, fixture.fie); verify(); }
295296297298299300301302303304305
ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method); try { sc.createObject(); unreachable(); } catch (RuntimeException ex) { Assert.assertEquals(ex.getMessage(), "Builder method " + CREATOR_DESCRIPTION + " (for service 'Fie') returned null.");
327328329330331332333334335336337
ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method); try { sc.createObject(); unreachable(); } catch (RuntimeException ex) { assertMessageContains(ex, "build_fail()", "Method failed.");
365366367368369370371372373374375
replay(); ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method); Object actual = sc.createObject(); verify(); assertSame(actual, fixture.fie); }
155156157158159160161162163164165
String description = proxyFactory.getConstructorLocation(constructor).toString(); ObjectCreator creator = new ConstructorServiceCreator(ServiceResourcesImpl.this, description, constructor); return clazz.cast(creator.createObject()); } }); } @Override
4950515253545556
"Service implementation class %s does not have a suitable public constructor.", clazz.getName())); ObjectCreator constructorServiceCreator = new ConstructorServiceCreator(resources, constructor.toString(), constructor); return constructorServiceCreator.createObject(); } }
172173174175176177178179180181182
5657585960616263646566
replay(); ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, findMethod(fixture, "build_noargs")); Object actual = sc.createObject(); assertSame(actual, fixture.fie); verify(); }
99100101102103104105106107108109
replay(); ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method); Object actual = sc.createObject(); assertSame(actual, fixture.fie); verify(); }
135136137138139140141142143144145