Package org.kite9.framework.logging

Examples of org.kite9.framework.logging.LogicException


  public X otherEnd(X end) {
    if (end == from)
      return to;
    if (end == to)
      return from;
    throw new LogicException("This is not an end: " + end + " of " + this);
  }
View Full Code Here


  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

        setFieldName(arg0);
        if (arg1 instanceof Type) {
          Type referenced = (Type) arg1;
          String name = referenced.getClassName();
          Type annotationClass = Type.getType(desc);
          AnnotationHandle ah = new AnnotationHandle(field, handle, MemberHandle
              .convertClassName(annotationClass.getClassName()));
          model.addAnnotationReference(MemberHandle.convertClassName(name), ah);
          addDependency(handle.getDeclaringClass(), model, referenced);
        }
      }
View Full Code Here

      }

      public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
        model.addClassAnnotation(convertAnnotationDescriptor(desc), className);
        addDependency(className, model, desc, false);
        return createAnnotationVisitor(model, new ClassHandle(className), desc);
      }

      public FieldVisitor visitField(int access, String name, String desc, String sign, Object value) {
        final FieldHandle mh = new FieldHandle(className, name);
        addDependency(className, model, desc, true);
View Full Code Here

  @Test
  public void test_1_17_TestConstructor1CallingContainsConstructor2() throws IOException, SecurityException, NoSuchMethodException {
    Constructor<?> c1 = Con1.class.getConstructor();
    Constructor<?> c2 = Con2.class.getConstructor();
   
    Assert.assertTrue(pm.getCalls(new ConstructorHandle(c1)).contains(new ConstructorHandle(c2)));
  }
View Full Code Here

    return name.substring(0, li);
  }
 
  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

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

  @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_9_ClassHavingAnnotation() throws IOException, SecurityException, NoSuchFieldException {
    Set<MemberHandle> subs = pm.getMembersWithAnnotation(convertName(K9OnDiagram.class));
    Field sf = Annotated.class.getField("someField");
    Assert.assertTrue(subs.contains(new FieldHandle(sf)));
  }
View Full Code Here

  @Test
  public void test_1_1_TestMethodBCallersContainsA() throws IOException, SecurityException, NoSuchMethodException {
    Method mb = CallerCalling.class.getMethod("methodB");
    Method ma = CallerCalling.class.getMethod("methodA");

    Assert.assertTrue(pm.getCalledBy(new MethodHandle(mb)).contains(new MethodHandle(ma)));
  }
View Full Code Here

TOP

Related Classes of org.kite9.framework.logging.LogicException

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.