/* (non-Javadoc)
  * @see junit.framework.TestCase#setUp()
  */
 protected void setUp() throws Exception {
   super.setUp();
   datatypeManager = (DatatypeManager) this.lookup(DatatypeManager.ROLE);
   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
   factory.setNamespaceAware(true);
   parser = factory.newDocumentBuilder();
 }
  /**
   * @see
   *     org.apache.cocoon.core.container.ContainerTestCase#addContext(org.apache.avalon.framework.context.DefaultContext)
   */
  protected void addContext(DefaultContext context) {
    super.addContext(context);
    // Create a temp file
    try {
      tempDir = File.createTempFile("jcr-test", null);
    } catch (IOException e) {
      throw new CascadingRuntimeException("Cannot setup temp dir", e);
    }
    // and turn it to a directory
    tempDir.delete();
    tempDir.mkdir();
    tempDir.deleteOnExit();

    // Setup context root as the temp dir so that relative URI used in the
    // repository configuration go there
    context.put("context-root", tempDir);

    // Make VariableResolver used in repository configuration happy
    context.put("object-model", Collections.EMPTY_MAP);
  }
 /* (non-Javadoc)
  * @see junit.framework.TestCase#tearDown()
  */
 protected void tearDown() throws Exception {
   if (datatypeManager != null) {
     this.release(datatypeManager);
   }
   super.tearDown();
 }
 /** @see org.apache.cocoon.core.container.ContainerTestCase#setUp() */
 protected void setUp() throws Exception {
   super.setUp();
   resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
 }
 /** @see org.apache.cocoon.core.container.ContainerTestCase#tearDown() */
 protected void tearDown() throws Exception {
   super.tearDown();
   deleteFile(tempDir);
 }