Package com.google.gwt.user.client.rpc

Examples of com.google.gwt.user.client.rpc.SerializableException


        p.add(b1);

        Button b2 = new Button("throw exception ", new ClickListener() {
          public void onClick(Widget sender) {
            Log.log("User Exception " + exceptionCount++, level, "user",
                new SerializableException(box.getText()));

            box.setText("message " + messageNumber++);
          }
        });
View Full Code Here


   *
   */
  public void testEncodeResponseForFailure() throws SecurityException,
      NoSuchMethodException, SerializationException {
    // Case 1
    RPC.encodeResponseForFailure(null, new SerializableException());

    Method A_method1 = null;
    A_method1 = A.class.getMethod("method1");

    // Case 2
    try {
      RPC.encodeResponseForFailure(A_method1, null);
      fail("Expected NullPointerException");
    } catch (NullPointerException e) {
      // expected to get here
    }

    // Case 3
    try {
      RPC.encodeResponseForFailure(A.class.getMethod("method1"),
          new IllegalArgumentException());
      fail("Expected UnexpectedException");
    } catch (UnexpectedException e) {
      // expected to get here
    }

    // Case 4
    String str = RPC.encodeResponseForFailure(A.class.getMethod("method1"),
        new SerializableException());
    assertTrue(str.indexOf("SerializableException") != -1);
  }
View Full Code Here

    // Case 2
    RPC.encodeResponseForSuccess(A_method1, null);

    // Case 3
    try {
      RPC.encodeResponseForSuccess(A_method2, new SerializableException());
      fail("Expected IllegalArgumentException");
    } catch (IllegalArgumentException e) {
      // expected to get here
    }
View Full Code Here

    // Case 5
    RPC.invokeAndEncodeResponse(new A() {
      @Override
      public void method1() throws SerializableException {
        throw new SerializableException();
      }

      @Override
      public int method2() {
        return 0;
View Full Code Here

            if ( e.getCause() instanceof ItemExistsException ) {
                return "DUPLICATE";
            } else {
                log.error( "An error occurred creating new asset" + ruleName + "] in package [" + initialPackage + "]: ",
                           e );
                throw new SerializableException( e.getMessage() );
            }
        }

    }
View Full Code Here

            if ( e.getCause() instanceof ItemExistsException ) {
                return "DUPLICATE";
            } else {
                log.error( "An error occurred creating shared asset" + sharedAssetName + "] in package [" + initialPackage + "]: ",
                           e );
                throw new SerializableException( e.getMessage() );
            }
        }

    }
View Full Code Here

            name = cleanHTML( name );
            String uuid = repository.createState( name ).getNode().getUUID();
            repository.save();
            return uuid;
        } catch ( RepositoryException e ) {
            throw new SerializableException( "Unable to create the status." );
        }
    }
View Full Code Here

            log.info( "USER:" + getCurrentUserName() + " REMOVING SNAPSHOT for package: [" + packageName + "] snapshot: [" + snapshotName + "]" );
            repository.removePackageSnapshot( packageName,
                                              snapshotName );
        } else {
            if ( newSnapshotName.equals( "" ) ) {
                throw new SerializableException( "Need to have a new snapshot name." );
            }
            log.info( "USER:" + getCurrentUserName() + " COPYING SNAPSHOT for package: [" + packageName + "] snapshot: [" + snapshotName + "] to [" + newSnapshotName + "]" );

            repository.copyPackageSnapshot( packageName,
                                            snapshotName,
View Full Code Here

            result = loader.getSuggestionEngine( pkg );

        } catch ( RulesRepositoryException e ) {
            log.error( "An error occurred loadSuggestionCompletionEngine: " + e.getMessage() );
            throw new SerializableException( e.getMessage() );
        } finally {
            Thread.currentThread().setContextClassLoader( originalCL );
        }
        return result;
    }
View Full Code Here

                return runner.verify( drl,
                                      VerifierConfiguration.VERIFYING_SCOPE_SINGLE_RULE,
                                      constraintRules );
            }
        } catch (Throwable t){
            throw new SerializableException( t.getMessage() );
        }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.rpc.SerializableException

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.