2 Replies Latest reply on Oct 3, 2007 9:43 AM by Joseph Celano

    Create a Logger for a Simple Seam Test

    Joseph Celano Newbie

      I am using Seam 2.0 CR1 with simple Hibernate session and i want to write a simple test that tests the some methods of my business object. I was hoping to avoid having to integrate TestNG at this point (and add this later on), so... on my business objects i was hoping that i could implement setLog(...) getLog() methods and supply my own logger for the logger that Seam normaly injects. Once the state is set, then i can just execute all my tests with logging in place. Is this a valid approach? Should i just bite the bullet and integrate TestNG. The project that i am working on is a Prototype/POC, so i don't want to spend too much time with the automated tests at this point, but i do want to be able to shortcut some of the test cycle.

      Any suggestions or pointers to examples/docs would be great. I haven't seen any on the forums or in the documentation.

      thx,

      Joe C

        • 1. Re: Create a Logger for a Simple Seam Test
          Jacob Orshalick Apprentice

          This is certainly a valid approach IMO and one that I have used for years. EasyMock and JMock are great frameworks that make this easy to do and you can always write stubs (which it sounds like you were already considering). I always strive to make my components testable outside a container as it generally leads to loosely coupled components.

          • 2. Re: Create a Logger for a Simple Seam Test
            Joseph Celano Newbie

            Thx for the reply.

            Looking through the SEAM documentation a bit, i see the section about using the SeamTest objects. The problem that i am having is that i didn't create my project using Seam-Gen (i am trying to integrate with an existing project), so i cannot use the auto-gen tools, which make is easy to get up and running fast.

            i think that i am going to have to take a step back and figure it all out. I was just hoping that there was a tutorial or example for this kind of thing to kick start my prototype.