Package org.kite9.framework.model

Examples of org.kite9.framework.model.MethodHandle


  public void setUpModel() throws SecurityException, NoSuchMethodException {
    pmi.addClass(convertClassName(Test6Dependency.class));
    pmi.addClass(convertClassName(A.class));
    pmi.addClass(convertClassName(B.class));
    pmi.addClass(convertClassName(C.class));
    pmi.addCalls(new MethodHandle(A.class.getDeclaredMethod("someMethod", new Class[] { B.class })),
        new MethodHandle(B.class.getDeclaredMethod("execute")));
    pmi.addSubclass(convertClassName(B.class), convertClassName(C.class));
    pmi.addClassDependency(convertClassName(C.class), convertClassName(B.class));
    pmi.addClassDependency(convertClassName(A.class), convertClassName(B.class));
  }
View Full Code Here


    @Before
    public void setUpModel() throws SecurityException, NoSuchMethodException {
  pmi.addClass(convertClassName(Test2Method.class));
  pmi.addClass(convertClassName(DummyClass.class));
  pmi.addClass(convertClassName(CallerClass.class));
  pmi.addCalls(new MethodHandle(CallerClass.class.getDeclaredMethod("someMethod")), new MethodHandle(Test2Method.class.getDeclaredMethod("someOtherMethod", String[].class)));
    }
View Full Code Here

  public void setUpModel() throws Exception {
    pmi.addClass(convertClassName(State.class));
    pmi.addClass(convertClassName(StateMovingClass.class));
    pmi.addClass(convertClassName(BeforeState.class));
    pmi.addClass(convertClassName(AfterState.class));
    MethodHandle a = new MethodHandle(StateMovingClass.class.getDeclaredMethod("moveToTwo"));
    MethodHandle b = new MethodHandle(StateMovingClass.class.getDeclaredMethod("moveToThree"));
    MethodHandle c = new MethodHandle(StateMovingClass.class.getDeclaredMethod("reset"));
    FieldHandle f = new FieldHandle(StateMovingClass.class.getDeclaredField("current"));
    pmi.addCalls(a, f);
    pmi.addCalls(b, f);
    pmi.addCalls(c, f);
  }
View Full Code Here

  protected void buildSteps(SimpleNoun caller, AccessibleObject m2) {
    SimpleNoun np = createCallStep(m2);
 
    if (m2 instanceof Method) {
      List<MemberHandle> handles = pm.getCalls(new MethodHandle((Method) m2));

      for (MemberHandle memberHandle : handles) {
        AccessibleObject ao = memberHandle.hydrate(cl);
        if ((limitFilter==null) || (limitFilter.accept(ao))) {
          buildSteps(np, ao);
View Full Code Here

  public void setUpModel() throws Exception {
    pmi.addClass(convertClassName(Test16SequenceDiagram.class));
    pmi.addClass(convertClassName(Class1.class));
    pmi.addClass(convertClassName(Class2.class));
    pmi.addClass(convertClassName(Class3.class));
    MethodHandle someMethod1 = new MethodHandle(Test16SequenceDiagram.class.getDeclaredMethod("someMethod1"));
    MethodHandle startMethod = new MethodHandle(Class1.class.getDeclaredMethod("startMethod"));
    MethodHandle method3 = new MethodHandle(Class2.class.getDeclaredMethod("method3"));
    MethodHandle method4 = new MethodHandle(Class2.class.getDeclaredMethod("method4"));
    MethodHandle methodA = new MethodHandle(Class3.class.getDeclaredMethod("methodA"));
    FieldHandle value = new FieldHandle(Class1.class.getDeclaredField("value"));
    FieldHandle set = new FieldHandle(Class1.class.getDeclaredField("set"));
    pmi.addCalls(someMethod1, startMethod);
    pmi.addCalls(someMethod1, methodA);
    pmi.addCalls(startMethod, method3);
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

      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.framework.model.MethodHandle

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.