Package org.kite9.tool.model

Examples of org.kite9.tool.model.ClassFileModelBuilder


  @Test
  public void test_1_4_TestFieldCalledByMethodB() throws IOException, SecurityException, NoSuchFieldException,
      NoSuchMethodException {
    Method mb = CallerCalling.class.getMethod("methodB");
    Field sub = CallerCalling.class.getDeclaredField("sub");
    Assert.assertTrue(pm.getCalledBy(new FieldHandle(sub)).contains(new MethodHandle(mb)));
  }
View Full Code Here


  @Test
  public void test_1_8_MethodHavingAnnotation() throws IOException, SecurityException, NoSuchMethodException {
    Set<MemberHandle> subs = pm.getMembersWithAnnotation(convertName(Kite9Item.class));
    Method sm = Annotated.class.getMethod("someMethod");
    Assert.assertTrue(subs.contains(new MethodHandle(sm)));
  }
View Full Code Here

  @Test
  public void test_1_14_AnnotationReference() throws Exception {
    Set<AnnotationHandle> refs = pm.getAnnotationReferences(convertName(Refs.Referenced.class));
    Method m = Refs.class.getMethod("referencer");
    MethodHandle mh = new MethodHandle(m);
    Reference ref = m.getAnnotation(Reference.class);
    AnnotationHandle expected = new AnnotationHandle(ref, mh, "refs");
    Assert.assertTrue(refs.contains(expected));
  }
View Full Code Here

 
  private MemberHandle createHandle(String owner, String name, String desc) {
    if (name.equals("<init>")) {
      return new ConstructorHandle(owner, desc);     
    } else {
      return new MethodHandle(owner, name, desc);
    }
  }
View Full Code Here

    Assert.assertFalse(deps.contains(convertName(Map.class)));
  }

  @Test
  public void test_1_13_PackageDependency() throws IOException {
    PackageHandle sub1 = new PackageHandle(SubPackageDependency.class);
    PackageHandle sub2 = new PackageHandle(SubPackageDependency2.class);
    PackageHandle current = new PackageHandle(this.getClass());

    Assert.assertTrue(pm.getDependsOnPackages(sub1).contains(current));
    Assert.assertTrue(pm.getDependsOnPackages(sub2).contains(current));
    Assert.assertTrue(pm.getDependedOnPackages(current).contains(sub1));
    Assert.assertTrue(pm.getDependedOnPackages(current).contains(sub2))
View Full Code Here

  pmi.addClass(convertClassName(Test4Package.class))
  Package p = this.getClass().getPackage();
  pmi.addPackageClass(convertPackageName(p), convertClassName(Test3Field.class));
  pmi.addPackageClass(convertPackageName(p), convertClassName(Test4Package.class));
  Package pack2= PropositionFormat.class.getPackage();
  PackageHandle p1 = new PackageHandle(convertPackageName(p), convertClassName(Test4Package.class));
  PackageHandle p2 = new PackageHandle(convertPackageName(pack2), convertClassName(PropositionFormat.class));
  pmi.addPackageDependency(p1, p2);
    }
View Full Code Here

  private void addDependency(final String className, final ProjectModelImpl model, String className2) {
    model.addClassDependency(className, className2);
    String packageName1 = getPackageName(className);
    String packageName2 = getPackageName(className2);
    PackageHandle ph1 = new PackageHandle(packageName1, className);
    PackageHandle ph2 = new PackageHandle(packageName2, className2);
   
    model.addPackageDependency(ph1, ph2);
  }
View Full Code Here

      getContext().getLogger().send("Found: "+resources.length+" matches");

    }

    ProjectModelImpl model = cfmb.getModel();
   
    getContext().getLogger().send(
        "Created project model from \"" + getContext().getClassPath() + "\" with " + fileCount + " files and "
            + model.getClassCount() + " classes");

    return model;

  }
View Full Code Here

  protected Kite9Context ctx = createContext();

  protected static Kite9Context createContext() {
    Aliaser a = new PropertyAliaser();
    Repository<File> r = new BasicFileRepository();
    Kite9ContextImpl out = new Kite9ContextImpl(a, r);
    out.setClassPath("target/classes" + File.pathSeparator + "target/test-classes");
//    out.setProjectId(35);
//    out.setSecretKey("PFB9T1V97AK96WFK");
    out.afterPropertiesSet();
View Full Code Here

 
  protected ServerCallingBuildListener createServerCallingListener() {
    ServerCallingBuildListener scbl = new ServerCallingBuildListener();
    scbl.setContext(ctx);
    scbl.setServer(new AbstractLocalServer() {
      @Override
      protected void processItem(WorkItem workItem, ZipOutputStream zos) throws IOException {
        // just returns 'canned' responses from the test artifacts
        // directory
        File png = getFileFromWorkItem(workItem, "png");
View Full Code Here

TOP

Related Classes of org.kite9.tool.model.ClassFileModelBuilder

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.