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 16:30:23 UTC

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

    [ https://issues.apache.org/jira/browse/TAP5-2273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13878760#comment-13878760 ] 

Lance commented on TAP5-2273:
-----------------------------

eg:
{code:java}
@RunWith(TapestryIOCJunit4ClassRunner.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}

> TapestryIOCJunit4ClassRunner
> ----------------------------
>
>                 Key: TAP5-2273
>                 URL: https://issues.apache.org/jira/browse/TAP5-2273
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-test
>            Reporter: Lance
>            Priority: Minor
>
> 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)



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