bookmarks  4

  •  

    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)
     
     
  •  

    This article demonstrates a brand new open source library for unit testing, called Unitils. Unitils helps you in writing simple and maintainable unit tests with JUnit or TestNG . It glues together some widely used test libraries like DbUnit and EasyMock and offers integration with Spring and Hibernate . Unitils encourages applying good practices and unit testing guidelines. The ideas behind the code are based on the authors' concrete experience on enterprise projects. Unitils offers following features * Equality assertion through reflection, with options like ignoring Java default/null values and ignoring order of collections * Support for database testing involving test data management with DbUnit, automatic maintenance of unit test databases and automatic constraints disabling * Hibernate integration features such as session management and testing the mapping with the database * Integration with Spring, involving ApplicationContext management and injection of spring managed beans * Integration with EasyMock and injection of mocks into other objects
    16 years ago by @gresch
    (0)
     
     
  •  

    This is a very simple integration of Spring and FitNesse. FitnNesse is a Wiki-based framework to implement integration tests. Fit as well. This framework uses HTML files as input and output for the integration tests. Therefore the tests can be written using Word or Excel instead of a Wiki. This makes usage much easier and can be critical for success or failure. This framework offers new classes that you can inherit from to implement or Fit FitNesse Fixtures. These Fixtures are then autowired to Spring Beans. So the Fixtures just need to implement set-methods. These are automatically called by Spring with a Spring Bean of the right type. This way Dependency Injection also covers the Fitnesse tests.
    16 years ago by @gresch
    (0)
     
     
  • ⟨⟨
  • 1
  • ⟩⟩

publications  

    No matching posts.
  • ⟨⟨
  • ⟩⟩