Package net.riccardocossu.autodoc.parsers

Source Code of net.riccardocossu.autodoc.parsers.PackageParserTest

package net.riccardocossu.autodoc.parsers;

import static org.junit.Assert.assertEquals;
import net.riccardocossu.autodoc.base.PackageContainer;
import net.riccardocossu.autodoc.jpa.JPAPlugin;
import net.riccardocossu.autodoc.test.plugin.TestSimplestPlugin;

import org.junit.Test;

public class PackageParserTest {

  @Test
  public void testJPAPlugin() {
    PackageParser parser = new PackageParser();
    PluginFactory factory = new PluginFactory();
    factory.registerPlugin(new JPAPlugin());
    PackageContainer pack = parser.parse(
        "net.riccardocossu.autodoc.test.model", factory);
    assertEquals(6, pack.getClasses().size());
  }

  @Test
  public void testSimplestPlugin() {
    PackageParser parser = new PackageParser();
    PluginFactory factory = new PluginFactory();
    factory.registerPlugin(new TestSimplestPlugin());
    PackageContainer pack = parser.parse(
        "net.riccardocossu.autodoc.test.model", factory);
    assertEquals(1, pack.getClasses().size());
  }

  @Test
  public void testSimplestAndJPAPlugin() {
    PackageParser parser = new PackageParser();
    PluginFactory factory = new PluginFactory();
    factory.registerPlugin(new TestSimplestPlugin());
    factory.registerPlugin(new JPAPlugin());
    PackageContainer pack = parser.parse(
        "net.riccardocossu.autodoc.test.model", factory);
    assertEquals(7, pack.getClasses().size());
  }

}
TOP

Related Classes of net.riccardocossu.autodoc.parsers.PackageParserTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.