Package org.springframework.test

Examples of org.springframework.test.AssertThrows


            }
        }.runTest();
    }

    public void testToMessageThrowsExceptionIfGivenIncompatibleObjectToConvert() throws Exception {
        new AssertThrows(MessageConversionException.class) {
            public void test() throws Exception {
                new SimpleMessageConverter().toMessage(new Object(), null);
            }
        }.runTest();
    }
View Full Code Here


        final Map content = new HashMap();
        content.put(new Integer(1), "value1");

        final SimpleMessageConverter converter = new SimpleMessageConverter();
        new AssertThrows(MessageConversionException.class) {
            public void test() throws Exception {
                converter.toMessage(content, session);
            }
        }.runTest();
View Full Code Here

        final Map content = new HashMap();
        content.put(null, "value1");

        final SimpleMessageConverter converter = new SimpleMessageConverter();
        new AssertThrows(MessageConversionException.class) {
            public void test() throws Exception {
                converter.toMessage(content, session);
            }
        }.runTest();
View Full Code Here

    List cacheControlHeaders = response.getHeaders("Cache-Control");
    assertTrue("'Cache-Control' header set (must not be) : empty", cacheControlHeaders.size() == 0);
  }

  public void testSetPathMatcherToNull() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        WebContentInterceptor interceptor = new WebContentInterceptor();
        interceptor.setPathMatcher(null);
      }
    }.runTest();
View Full Code Here

* @since 08.10.2004
*/
public class ValidationUtilsTests extends TestCase {

  public void testInvokeValidatorWithNullValidator() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        TestBean tb = new TestBean();
        Errors errors = new BeanPropertyBindingResult(tb, "tb");
        ValidationUtils.invokeValidator(null, tb, errors);
      }
View Full Code Here

      }
    }.runTest();
  }

  public void testInvokeValidatorWithNullErrors() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        TestBean tb = new TestBean();
        ValidationUtils.invokeValidator(new EmptyValidator(), tb, null);
      }
    }.runTest();
View Full Code Here

  private static final String SQL = "select count(0) from t_sheep where over_fence = ... yawn... 1";


  public void testTranslateNullException() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        new SQLStateSQLExceptionTranslator().translate("", "", null);
      }
    }.runTest();
  }
View Full Code Here

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

  public void testGetTempDirWithNullPortletContext() throws Exception {
    new AssertThrows(IllegalArgumentException.class, "null PortletContext passed as argument") {
      public void test() throws Exception {
        PortletUtils.getTempDir(null);
      }
    }.runTest();
  }
View Full Code Here

      }
    }.test();
  }

  public void testGetRealPathWithNullPortletContext() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        PortletUtils.getRealPath(null, "/foo");
      }
    }.runTest();
  }
View Full Code Here

      }
    }.runTest();
  }

  public void testGetRealPathWithNullPath() throws Exception {
    new AssertThrows(NullPointerException.class) {
      public void test() throws Exception {
        PortletUtils.getRealPath(new MockPortletContext(), 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.