You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Lance (JIRA)" <ji...@apache.org> on 2014/01/22 15:19:19 UTC

[jira] [Created] (TAP5-2273) TapestryIOCJunit4ClassRunner

Lance created TAP5-2273:
---------------------------

             Summary: TapestryIOCJunit4ClassRunner
                 Key: TAP5-2273
                 URL: https://issues.apache.org/jira/browse/TAP5-2273
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-test
            Reporter: Lance


Implement a TapestryIOCJunit4ClassRunner in a similar style to SpringJUnit4ClassRunner (http://docs.spring.io/spring/docs/2.5.6/api/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.html)

eg:
{code}
@RunWith(TapestryJUnit4ClassRunner.class)

// call RegistryBuilder.add(Class... moduleClasses) 
@Modules({SecurityModule.class, HibernateModule.class, MyTestModule.class})

// call RegistryBuilder.add(ModuleDef moduleDef) 
@ModuleDefs({SpringModuleDef.class})

// call IOCUtilities.addDefaultModules(RegistryBuilder)
@AddDefaultModules

public class MyIOCTest {
   public static class MyTestModule {
      public static void bind(ServiceBinder binder) {
         binder.bind(Foo.class, FooImpl.class);
      }
   }

   // lookup from registry
   @Inject
   private Foo foo;

   public void testFoo() {
      Assert.assertNotNull(foo.doStuff());
   }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)