Package org.kite9.framework.common

Examples of org.kite9.framework.common.Kite9ProcessingException


      Method m2 = a.getClass().getDeclaredMethod(field);
      Object o = m2.invoke(a);
      if ((o.getClass().isArray()) && (Enum.class.isAssignableFrom(o.getClass().getComponentType()))) {
        return (Enum<?>[]) o;
      } else {
        throw new Kite9ProcessingException("Was expecting enumeration array for " + field + " on " + annotation
            + " but was " + o.getClass());
      }
    } catch (Exception e) {
      throw new Kite9ProcessingException("Could not get annotation values for " + m + " with field " + field, e);
    }
  }
View Full Code Here


  private SimpleNoun checkSimpleNoun(NounPart np) {
    if (np instanceof SimpleNoun) {
      return (SimpleNoun) np;
    } else {
      throw new Kite9ProcessingException(
          "Noun factory must create a SimpleNoun for the FiniteStateMachineFormat" + np);
    }
  }
View Full Code Here

          InputStream is = getRepository().retrieve(id, np, ext);
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          RepositoryHelp.streamCopy(is, baos, true);
          String problemText = baos.toString();
          // an exception was thrown - throw it up.
          throw new Kite9ProcessingException("An exception occurred in processing the work item:  "+i.getSubjectId()+" "+i.getName()+"\n"+problemText);
        }
       
      }
     
      successful++;

    } catch (IOException e) {
      failed ++;
      throw new Kite9ProcessingException("Could not process server response: " + e);
    } finally {
      try {
        OutputStream fos = getRepository().store(i.getSubjectId(), i.getName(), "xml");
        XMLHelper xh = new XMLHelper();
        String xml = xh.toXML(i);
        OutputStreamWriter w = new OutputStreamWriter(fos);
        w.write(xml);
        w.close();
      } catch (IOException e) {
        throw new Kite9ProcessingException("Could not store request XML in local repository: " + e);
      }
    }
  }
View Full Code Here

        int at = m.end();
        os.write(input.substring(cursor, at));
        processClassLevelDoc(cl, r.getFile(), os, mods);
        cursor = at;
      } else {
        throw new Kite9ProcessingException("Could not find string: \"" + classDocPattern + "\" in "
            + r.getFilename());
      }

      // ok, next up, match any methods
      String methodDocPattern = methodDocPattern();
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

  @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

  @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.common.Kite9ProcessingException

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.