Package org.springframework.test

Examples of org.springframework.test.AssertThrows


* @author Rick Evans
*/
public final class ConstructorArgumentEntryTests extends TestCase {

  public void testCtorBailsOnNegativeCtorIndexArgument() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        new ConstructorArgumentEntry(-1);
      }
    }.runTest();
  }
View Full Code Here


        final MessageListenerAdapter102 adapter = new MessageListenerAdapter102(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

        final MessageListenerAdapter102 adapter = new MessageListenerAdapter102(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

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

    // simply must not bail...
    new DefaultNamespaceHandlerResolver(null);
  }

  public void testCtorWithNullClassLoaderArgumentAndNullMappingLocationArgument() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        new DefaultNamespaceHandlerResolver(null, null);
      }
    }.runTest();
  }
View Full Code Here

    String string = bundle.getString(MESSAGE_KEY);
    assertEquals("ned", string);
  }

  public void testSetAsTextWithNull() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        ResourceBundleEditor editor = new ResourceBundleEditor();
        editor.setAsText(null);
      }
    }.runTest();
View Full Code Here

      }
    }.runTest();
  }

  public void testSetAsTextWithEmptyString() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        ResourceBundleEditor editor = new ResourceBundleEditor();
        editor.setAsText("");
      }
    }.runTest();
View Full Code Here

      }
    }.runTest();
  }

  public void testSetAsTextWithWhiteSpaceString() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        ResourceBundleEditor editor = new ResourceBundleEditor();
        editor.setAsText("   ");
      }
    }.runTest();
View Full Code Here

      }
    }.runTest();
  }

  public void testSetAsTextWithJustSeparatorString() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        ResourceBundleEditor editor = new ResourceBundleEditor();
        editor.setAsText("_");
      }
    }.runTest();
View Full Code Here

* @author Rick Evans
*/
public final class CustomCollectionEditorTests extends TestCase {

  public void testCtorWithNullCollectionType() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        new CustomCollectionEditor(null);
      }
    }.runTest();
  }
View Full Code Here

TOP

Related Classes of org.springframework.test.AssertThrows

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.