tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TAP5-2273) TapestryIOCJunit4ClassRunner
Date Wed, 22 Jan 2014 14:19:19 GMT
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)

Mime
View raw message