Package com.google.inject.spi

Examples of com.google.inject.spi.Message


      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), aex);
   }

   public void testGetFirstThrowableOfTypeFail() {
      TimeoutException aex = createMock(TimeoutException.class);
      Message message = new Message(ImmutableList.of(), "test", aex);
      ProvisionException pex = new ProvisionException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }
View Full Code Here


      ProvisionException pex = new ProvisionException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }

   public void testGetFirstThrowableOfTypeWhenCauseIsNull() {
      Message message = new Message(ImmutableList.of(), "test", null);
      ProvisionException pex = new ProvisionException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }
View Full Code Here

      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }

   public void testGetCauseCreation() {
      AuthorizationException aex = createMock(AuthorizationException.class);
      Message message = new Message(ImmutableList.of(), "test", aex);
      CreationException pex = new CreationException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), aex);
   }
View Full Code Here

      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), aex);
   }

   public void testGetFirstThrowableOfTypeInnerCreation() {
      AuthorizationException aex = createMock(AuthorizationException.class);
      Message message = new Message(ImmutableList.of(), "test", aex);
      CreationException pex = new CreationException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), aex);
   }
View Full Code Here

      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), aex);
   }

   public void testGetFirstThrowableOfTypeFailCreation() {
      TimeoutException aex = createMock(TimeoutException.class);
      Message message = new Message(ImmutableList.of(), "test", aex);
      CreationException pex = new CreationException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }
View Full Code Here

      CreationException pex = new CreationException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }

   public void testGetFirstThrowableOfTypeWhenCauseIsNullCreation() {
      Message message = new Message(ImmutableList.of(), "test", null);
      CreationException pex = new CreationException(ImmutableSet.of(message));
      assertEquals(getFirstThrowableOfType(pex, AuthorizationException.class), null);
   }
View Full Code Here

   @Test(expectedExceptions = AuthorizationException.class)
   public void testPropagateProvisionExceptionAuthorizationException() throws Throwable {
      Exception e = new AuthorizationException();
      propagateIfPossible(
            new ProvisionException(ImmutableSet.of(new Message(ImmutableList.of(), "Error in custom provider", e))),
            ImmutableSet.<TypeToken<? extends Throwable>> of());
   }
View Full Code Here

   @Test(expectedExceptions = AuthorizationException.class)
   public void testPropagateCreationExceptionAuthorizationException() throws Throwable {
      Exception e = new AuthorizationException();
      propagateIfPossible(
            new CreationException(ImmutableSet.of(new Message(ImmutableList.of(), "Error in custom provider", e))),
            ImmutableSet.<TypeToken<? extends Throwable>> of());
   }
View Full Code Here

                                // call the getter which will cause object creation
                                configurationProvider.get();
                            } catch (ConfigurationException e) {
                                // if we got errors, add them to the errors list
                                for (Message message : e.getErrorMessages()) {
                                    messages.add(new Message(singletonList(binding.getSource()), message.getMessage(), message.getCause()));
                                }
                            }
                        }

                    }
View Full Code Here

        return ImmutableList.copyOf(errors);
    }

    public void addError(String format, Object... params)
    {
        Message message = new Message("Error: " + format(format, params));
        errors.add(message);
        monitor.onError(message);
    }
View Full Code Here

TOP

Related Classes of com.google.inject.spi.Message

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.