bookmarks  3

  •  

    AtUnit minimizes boilerplate code in unit tests and guides test development by enforcing good practices. * mark exactly one field with @Unit to indicate the object under test. * mark fields with @Mock or @Stub to obtain mock objects * inject your tests, and your test subjects, using your favorite IoC container Mock Objects Integration AtUnit integrates with JMock or EasyMock to provide mock objects: * obtain a JMock context simply by declaring a field * annotate fields with @Mock to obtain JMock or EasyMock mock objects * annotate fields with @Stub to obtain a JMock or EasyMock stub object ... or you can use your own mock objects plug-in with two easy steps: * implement the MockFramework interface * annotate your tests with @MockFrameworkClass(MyMockFramework.class) Container Integration AtUnit integrates with Guice or Spring to take all of the work out of dependency-injected tests. With Guice: * never see the Injector, never write bootstrapping boilerplate! * @Inject test class fields without even defining a Module * declaratively obtain mock objects with @Inject @Mock * if you need more binding flexibility, simply have your test class implement Module With Spring: * annotate fields with @Bean to get them from the Spring context * fields annotated with @Bean which do not appear in your Spring context are added to it automatically! (This includes @Mock and @Stub fields.) * AtUnit looks for a Spring XML file with the same name as your test, or you can specify the location yourself with @Context("filename") * Most of the time, you don't even need a Spring XML file! You can easily plug in other containers in two steps: * implement the Container interface * annotate your tests with @ContainerClass(MyContainer.class)
    16 years ago by @gresch
    (0)
     
     
  •  

    Spring AutoMock is a test enabling framework to allow automatic exposure of Mocked beans for a Spring application. Used in conjunction with Spring autowiring of bean dependencies you can develop teired application contexts that represent the architectural tiers of your application, and thus you testing strategy. The simplest example is a separation of service beans and DAO beans into separate xml application contexts so that the services can be fully tested in isolation of the DAOs. The DAO beans are still required by the services typically as an injected property. Spring AutoMock can automatically register a Mock and a proxy of certain beans, so that the Mocks can be injected into your test cases and the matching proxy into the item under test. This reduces the need for repeated Spring test configuration.
    16 years ago by @gresch
    (0)
     
     
  •  

    The mock-object testing pattern has commonly been used to test an individual unit of code without testing its dependencies. While this pattern works well for interaction-based testing, it can be overkill for state-based testing. Learn how to streamline your unit-testing using stubs and the pseudo-objects testing pattern.
    16 years ago by @gresch
    (0)
     
     
  • ⟨⟨
  • 1
  • ⟩⟩

publications  

    No matching posts.
  • ⟨⟨
  • ⟩⟩