Examples of AssertThrows


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

Examples of org.springframework.test.AssertThrows

        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

Examples of org.springframework.test.AssertThrows

        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

Examples of org.springframework.test.AssertThrows

        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

Examples of org.springframework.test.AssertThrows

    // 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

Examples of org.springframework.test.AssertThrows

    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

Examples of org.springframework.test.AssertThrows

      }
    }.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

Examples of org.springframework.test.AssertThrows

      }
    }.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

Examples of org.springframework.test.AssertThrows

      }
    }.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

Examples of org.springframework.test.AssertThrows

* @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
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.