Examples of throwException()


Examples of org.hibernate.test.bytecode.Bean.throwException()

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

Examples of org.jboss.forge.classloader.mock.exceptions.ExceptionFactory.throwException()

      Assert.assertTrue(Proxies.isForgeProxy(enhancedFactory));

      String message = "AbstractA message.";
      try
      {
         enhancedFactory.throwException(message);
      }
      catch (MockException e)
      {
         Assert.assertTrue(Proxies.isForgeProxy(e));
         Assert.assertEquals(message, e.getMessage());
View Full Code Here

Examples of org.jboss.test.hello.interfaces.Hello.throwException()

   {
      HelloHome home = (HelloHome)getInitialContext().lookup(JNDI_NAME);
      Hello hello = home.create();
      try
      {
         hello.throwException();
      }
      catch(Exception e)
      {
         getLog().debug("Caught IOException as expected", e);
      }
View Full Code Here

Examples of org.jinstagram.entity.common.InstagramErrorResponse.throwException()

        final InstagramErrorResponse error;
        try {
            if (response.getCode() == 400) {
                error = InstagramErrorResponse.parse(gson, response.getBody());
                error.setHeaders(response.getHeaders());
                error.throwException();
            }
            //sending too many requests too quickly;
            //limited to 5000 requests per hour per access_token or client_id overall.  (according to spec)
            else if (response.getCode() == 503) {
                error = InstagramErrorResponse.parse(gson, response.getBody());
View Full Code Here

Examples of org.jinstagram.entity.common.InstagramErrorResponse.throwException()

            //sending too many requests too quickly;
            //limited to 5000 requests per hour per access_token or client_id overall.  (according to spec)
            else if (response.getCode() == 503) {
                error = InstagramErrorResponse.parse(gson, response.getBody());
                error.setHeaders(response.getHeaders());
                error.throwException();
            }
        } catch (JsonSyntaxException e) {
            throw new InstagramException("Failed to decode error response " + response.getBody(), e, response.getHeaders());
        }
        throw new InstagramException("Unknown error response code: " + response.getCode() + " " + response.getBody(), response.getHeaders());
View Full Code Here

Examples of org.jinstagram.entity.common.InstagramErrorResponse.throwException()

    private InstagramException handleInstagramError(Response response) throws InstagramException {
        if (response.getCode() == 400) {
            Gson gson = new Gson();
            final InstagramErrorResponse error = InstagramErrorResponse.parse(gson, response.getBody());
            error.setHeaders(response.getHeaders());
            error.throwException();
        }
        throw new InstagramException("Unknown error response code: " + response.getCode() + " " + response.getBody(), response.getHeaders());
    }

    /**
 
View Full Code Here

Examples of org.jplastic.core.InstructionBuilder.throwException()

        {
            InstructionBuilder builder = newMethod("setReturnValue", MethodInvocation.class, Object.class);

            if (isVoid)
            {
                builder.throwException(IllegalArgumentException.class, String
                        .format("Method %s of class %s is void, setting a return value is not allowed.", description,
                                className));
            }
            else
            {
View Full Code Here

Examples of org.nutz.aop.asm.test.Aop1.throwException()

  }

  @Test(expected = Exception.class)
  public void testThrowException() throws Throwable {
    Aop1 a1 = getNewInstance(Aop1.class);
    a1.throwException();
  }

  @Test
  public void testArgs() throws Throwable {
    Aop1 a1 = getNewInstance(Aop1.class);
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.throwException()

      ga.loadArg(0);
      ga.putField(bean, "f", Type.INT_TYPE);
      Label end = new Label();
      ga.goTo(end);
      ga.mark(label);
      ga.throwException(Type.getType(IllegalArgumentException.class),
          "f");
      ga.mark(end);
      ga.returnValue();
      ga.endMethod();
    }
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.throwException()

        ga.newInstance(udt);
        ga.dup();
        ga.loadLocal(loc, thr);
        ga.invokeConstructor(udt, org.objectweb.asm.commons.Method
                .getMethod("void <init>(java.lang.Throwable)"));
        ga.throwException();

        ga.visitTryCatchBlock(before, after, handler, "java/lang/Throwable");

        ga.endMethod();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.