/**
 * Copyright 2008 Matthew Hillsdon
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.hillsdon.reviki.wiki.renderer;

import junit.framework.TestCase;

public class TestRendererRegistry extends TestCase {

  private HtmlRenderer _default;

  private RendererRegistry _registry;

  public void setUp() {
    _default = new HtmlRenderer(null, null, null, null);
    _registry = new RendererRegistry(_default);
  }

  /**
   * Test that we can retrieve the default renderer.
   */
  public void testGetDefault() {
    assertNotNull(_registry.getDefaultRenderer());
    assertEquals(_default, _registry.getDefaultRenderer());
  }
}

@@ -638,16 +638,93 @@
 derer;%0A%0A
+import java.io.InputStream;%0A%0Aimport net.hillsdon.reviki.wiki.MarkupRenderer;%0A
 import j
@@ -1222,11 +1222,589 @@
 ());%0A  %7D
+%0A%0A  /**%0A   * Test that we can insert and retrieve renderers.%0A   */%0A  public void testRetrieve() %7B%0A    MarkupRenderer%3CInputStream%3E renderer = new XSLFORenderer(null);%0A    String ctype = %22xslfo%22;%0A%0A    assertFalse(_registry.hasRenderer(ctype));%0A    _registry.addRenderer(ctype, renderer);%0A    assertTrue(_registry.hasRenderer(ctype));%0A    assertEquals(renderer, _registry.getRenderer(ctype));%0A  %7D%0A%0A  /**%0A   * Test that null ctypes are correctly handled.%0A   */%0A  public void testNull() %7B%0A    assertFalse(_registry.hasRenderer(null));%0A    assertNull(_registry.getRenderer(null));%0A  %7D
 %0A%7D%0A

Add extra tests for the renderer registry