title: In-Container testing with JUnit
body: <p>I am new to JUnit and trying to implement it in a legacy project. It is a Java EE project. Its UI layer is in Flex and the backend has Hibernate as the ORM layer with a SQL Server Database. It runs on Tomcat.</p>
  
  <p>I am taking baby steps to learn JUnit myself and implement it into the codebase. There is a class which has its <code>findByFK</code> method. This method returns an array of class objects if any are found.</p>
  
  <p>The method runs fine on a web application but I can't run its JUnit test case. The test case is out of the container and doesn't have access to a datasource.</p>
  
  <p>How can I run a JUnit test case inside a container?</p>
  
  <p>I have just started with JUnit and don't want to overcomplicate it with integration issues. Is there any way to work it out without getting into stubbing the datasource and web server etc? </p>