ConstrProjectInfoBuilderRef implements ProjectInfoBuilder2<T>, BuilderWrapper { @Override public T getProjectInfo(Object project) { Object result = getWrapped().getProjectInfo(project); return modelType.cast(result); } ConstrProjectInfoBuilderRef(Class<? extends T> modelType, String wrappedTypeName, Object[] arguments); @Override T getProjectInfo(Object project); @Override String getName(); @Override Object getWrappedObject(); @Override Class<?> getWrappedType();  }
@Test public void testNoArgumentWithoutPackage() { ProjectInfoBuilder2<TestObj> builderRef = create(TestObj.class, TestInfoBuilder.REL_NAME); TestObj returned = builderRef.getProjectInfo(new Object()); assertSame("model", TestInfoBuilder.DEFAULT_ARG, returned); }
@Test public void test1ArgumentWithoutPackage() { TestObj model = new TestObj("MyTestObj"); ProjectInfoBuilder2<TestObj> builderRef = create(TestObj.class, TestInfoBuilder.REL_NAME, model); TestObj returned = builderRef.getProjectInfo(new Object()); assertSame("model", model, returned); }
@Test public void testNoArgumentWithPackage() { ProjectInfoBuilder2<TestObj> builderRef = create(TestObj.class, TestInfoBuilder.ABS_NAME); TestObj returned = builderRef.getProjectInfo(new Object()); assertSame("model", TestInfoBuilder.DEFAULT_ARG, returned); }
@Test public void test1ArgumentWithPackage() { TestObj model = new TestObj("MyTestObj"); ProjectInfoBuilder2<TestObj> builderRef = create(TestObj.class, TestInfoBuilder.ABS_NAME, model); TestObj returned = builderRef.getProjectInfo(new Object()); assertSame("model", model, returned); }
@Test public void testProjectArgWithoutPackage() { ProjectInfoBuilder2<TestObj> builderRef = create(TestObj.class, TestInfoBuilderBasic.REL_NAME); TestObj project = new TestObj("MyTestProject"); Object returned = builderRef.getProjectInfo(project); assertSame("project", project, returned); }
@Test public void testProjectArgWithPackage() { ProjectInfoBuilder2<TestObj> builderRef = create(TestObj.class, TestInfoBuilderBasic.ABS_NAME); TestObj project = new TestObj("MyTestProject"); Object returned = builderRef.getProjectInfo(project); assertSame("project", project, returned); }