Examples of AssertThrows


Examples of org.springframework.test.AssertThrows

    AbstractBeanDefinition beanDefinition = builder.getBeanDefinition();
    beanDefinition.setScope("he put himself so low could hardly look me in the face");

    final DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
    factory.registerBeanDefinition("testBean", beanDefinition);
    new AssertThrows(IllegalStateException.class) {
      public void test() throws Exception {
        factory.getBean("testBean");
      }
    }.runTest();
  }
View Full Code Here

Examples of org.springframework.test.AssertThrows

  }

  public void testWhereScopeMapHasNullScopeValueInEntrySet() throws Exception {
    new ConfigurableListableBeanFactoryMockTemplate() {
      protected void doTest(final ConfigurableListableBeanFactory factory) {
        new AssertThrows(IllegalArgumentException.class) {
          public void test() throws Exception {
            Map scopes = new HashMap();
            scopes.put(FOO_SCOPE, null);
            CustomScopeConfigurer figurer = new CustomScopeConfigurer();
            figurer.setScopes(scopes);
View Full Code Here

Examples of org.springframework.test.AssertThrows

  }

  public void testWhereScopeMapHasNonScopeInstanceInEntrySet() throws Exception {
    new ConfigurableListableBeanFactoryMockTemplate() {
      protected void doTest(final ConfigurableListableBeanFactory factory) {
        new AssertThrows(IllegalArgumentException.class) {
          public void test() throws Exception {
            Map scopes = new HashMap();
            scopes.put(FOO_SCOPE, this); // <-- not a valid value...
            CustomScopeConfigurer figurer = new CustomScopeConfigurer();
            figurer.setScopes(scopes);
View Full Code Here

Examples of org.springframework.test.AssertThrows

  }

  public void testWhereScopeMapHasNonStringTypedScopeNameInKeySet() throws Exception {
    new ConfigurableListableBeanFactoryMockTemplate() {
      protected void doTest(final ConfigurableListableBeanFactory factory) {
        new AssertThrows(IllegalArgumentException.class) {
          public void test() throws Exception {
            Map scopes = new HashMap();
            scopes.put(this, new NoOpScope()); // <-- not a valid value (the key)...
            CustomScopeConfigurer figurer = new CustomScopeConfigurer();
            figurer.setScopes(scopes);
View Full Code Here

Examples of org.springframework.test.AssertThrows

        CommonsLogFactoryBean factory = new CommonsLogFactoryBean();
        assertEquals(Log.class, factory.getObjectType());
    }

    public void testWhenLogNameIsMissing() throws Exception {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                CommonsLogFactoryBean factory = new CommonsLogFactoryBean();
                factory.afterPropertiesSet();
            }
        }.runTest();
View Full Code Here

Examples of org.springframework.test.AssertThrows

    final MessageListenerAdapter adapter = new MessageListenerAdapter(delegate) {
      protected Object extractMessage(Message message) {
        return message;
      }
    };
    new AssertThrows(InvalidDestinationException.class) {
      public void test() throws Exception {
        adapter.onMessage(sentTextMessage, session);
      }
    }.runTest();
View Full Code Here

Examples of org.springframework.test.AssertThrows

    final MessageListenerAdapter adapter = new MessageListenerAdapter(delegate) {
      protected Object extractMessage(Message message) {
        return message;
      }
    };
    new AssertThrows(JMSException.class) {
      public void test() throws Exception {
        adapter.onMessage(sentTextMessage, session);
      }
    }.runTest();
View Full Code Here

Examples of org.springframework.test.AssertThrows

    final MessageListenerAdapter adapter = new MessageListenerAdapter(delegate) {
      protected Object extractMessage(Message message) {
        return message;
      }
    };
    new AssertThrows(ListenerExecutionFailedException.class) {
      public void test() throws Exception {
        adapter.onMessage(message, session);
      }
    }.runTest();
View Full Code Here

Examples of org.springframework.test.AssertThrows

      protected Object extractMessage(Message message) {
        return message;
      }
    };
    adapter.setMessageConverter(null);
    new AssertThrows(MessageConversionException.class) {
      public void test() throws Exception {
        adapter.onMessage(sentTextMessage, session);
      }
    }.runTest();
View Full Code Here

Examples of org.springframework.test.AssertThrows

    assertEquals(url.toExternalForm(), urlEditor.getAsText());
    assertTrue(!url.getProtocol().startsWith("classpath"));
  }

  public void testWithNonExistentResource() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        PropertyEditor urlEditor = new URLEditor();
        urlEditor.setAsText("gonna:/freak/in/the/morning/freak/in/the.evening");
      }
    }.runTest();
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.