Package gov.nasa.jpf.autodoc.types.parser

Examples of gov.nasa.jpf.autodoc.types.parser.ClassPath


   
    String dir = "build" + System.getProperty("file.separator");
    String[] pathnames = new String[]{dir + "jpf-autodoc-types.jar",
                                      dir + "main", dir + "tests"};
   
    ClassPath cp = new ClassPath();
    cp.addAllPathNames(pathnames);
   
    for (String s : cp.getPathNames()) {
      System.out.println("  " + s);
    }
   
    assertArrayEquals(pathnames, cp.getPathNames());
  }
View Full Code Here


    System.out.println("method> classFound");
   
    String classname = "gov.nasa.jpf.autodoc.types.AutoDocTool";
    String badclassname = "gov.nasa.jpf.unexistent.FakeBadClass";
   
    ClassPath cp = new ClassPath();
    cp.addPathName("build/jpf-autodoc-types.jar");
    assertTrue(cp.classFound(classname));
    assertFalse(cp.classFound(badclassname));
  }
View Full Code Here

  public void testGetSource() throws Exception {
    System.out.println("method> getSource");
   
    String classname = "gov.nasa.jpf.autodoc.types.AutoDocTool";
   
    ClassPath cp = new ClassPath();
    cp.addPathName("lib/jpf.jar");
    cp.addPathName("build/tests");
    cp.addPathName("build/main/");
   
    String source = cp.getSource(classname);
    System.out.println("  source: " + source);
    assertTrue(source.endsWith("main"));
  }
View Full Code Here

  public void testParse_String_ClassPath() throws Exception {
    System.out.println("method> parse(String, ClassPath)");

    ClassFileParser cfparser = new ClassFileParser();
    String classname = "gov.nasa.jpf.autodoc.types.parser.ClassFileParser";
    ClassPath classpath = new ClassPath();

    classpath.addPathName("build/main");
    cfparser.parse(classname, classpath);

    assertFalse(cfparser.getClassInfo().getName().isEmpty());
    System.out.print("  [0] class: " + cfparser.getClassInfo().getName());
    //--- No assertion for superClsName. It could be empty.
View Full Code Here

  @Test
  public void testParse_byteArr() throws Exception {
    System.out.println("method> parse(byte[])");

    ClassFileParser cfparser = new ClassFileParser();
    ClassPath cp = new ClassPath();

    cp.addPathName("build/main");
    cfparser.parse(cp.getClassData("gov.nasa.jpf.autodoc.types.parser"
                                   + ".ClassFileParser"));

    assertFalse(cfparser.getClassInfo().getName().isEmpty());
    System.out.print("  [0] class: " + cfparser.getClassInfo().getName());
    //--- No assertion for superClsName. It could be empty.
View Full Code Here

  @Test
  public void testInferLayer_ClassPath() throws Exception {
    System.out.println("method> inferLayer(String, ClassPath)");

    ClassFileParser cfparser = new ClassFileParser();
    ClassPath classpath = new ClassPath();

    String classname = "gov.nasa.jpf.autodoc.types.AutoDocTool";
   
    classpath.addPathName("build/main");
    String layer = cfparser.inferLayer(classname, classpath);
   
    assertEquals("main", layer);
    System.out.println("  layer: " + layer);
  }
View Full Code Here

   */
  @Test
  public void testParseBytes() throws Exception {
    System.out.println("method> parseBytes");
   
    ClassPath cp = new ClassPath();
    cp.addPathName("build/jpf-autodoc-types.jar");

    ArrayList<byte[]> data = new ArrayList<byte[]>();
    data.add(cp.getClassData("gov.nasa.jpf.autodoc.types.AutoDocTool"));
    data.add(cp.getClassData("gov.nasa.jpf.autodoc.types.parser.TargetParser"));
    data.add(cp.getClassData("gov.nasa.jpf.autodoc.types.parser.ClassFileParser"));
    data.add(cp.getClassData("gov.nasa.jpf.autodoc.types.parser.Parser"));

    TargetParser parser = new TargetParser();
    List<ClassInfo> classes = parser.parseBytes(data);
    assertFalse(classes.isEmpty());

View Full Code Here

TOP

Related Classes of gov.nasa.jpf.autodoc.types.parser.ClassPath

Copyright © 2018 www.massapicom. 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.