Package org.springframework.test

Examples of org.springframework.test.AssertThrows


        command.setToken(userService.getToken(getUser()));
        schoolService.executeAndSaveCommand(command, useUserCache);
    }

    public void testForumPostSavingWithoutToken() throws SiteException {
        AssertThrows as = new AssertThrows(SiteSecurityException.class) {

            @Override
            public void test() throws Exception {
                log.debug("\n\nSave Again\n\n");
                School sc = schoolService
View Full Code Here


                "http://factoryjoe.com/").toExternalForm());
        assertEquals("http://www.factoryjoe.com/", UrlIdentifier
                .normalize("http://www.factoryjoe.com").toExternalForm());

        // show that current is unsatisfactory
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                assertEquals("http://factoryjoe.com/", UrlIdentifier
                        .normalize("factoryjoe.com").toExternalForm());
            }
        };
View Full Code Here

        assertEquals("https://foo.com/", UserServiceImpl
                .normalizeUrl("https://foo.com/"));
        assertEquals("https://foo.com/bar", UserServiceImpl
                .normalizeUrl("https://foo.com/bar"));

        AssertThrows at = new AssertThrows(SiteException.class) {
            @Override
            public void test() throws Exception {
                assertNull(UserServiceImpl.normalizeUrl(""));
            }
        };
        at = new AssertThrows(SiteException.class) {
            @Override
            public void test() throws Exception {
                assertNull(UserServiceImpl.normalizeUrl("http://"));
            }
        };
        at = new AssertThrows(SiteException.class) {
            @Override
            public void test() throws Exception {
                assertNull(UserServiceImpl.normalizeUrl(null));
            }
        };
View Full Code Here

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

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

      }
    }.runTest();
  }

  public void testCtorBailsOnEmptyPropertyNameArgument() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        new PropertyEntry("");
      }
    }.runTest();
  }
View Full Code Here

      }
    }.runTest();
  }

  public void testCtorBailsOnWhitespacedPropertyNameArgument() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        new PropertyEntry("\t   ");
      }
    }.runTest();
  }
View Full Code Here

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

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

      }
    }.runTest();
  }

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

      }
    }.runTest();
  }

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

* @author Juergen Hoeller
*/
public final class FailFastProblemReporterTests extends TestCase {

  public void testError() throws Exception {
    new AssertThrows(BeanDefinitionParsingException.class) {
      public void test() throws Exception {
        FailFastProblemReporter reporter = new FailFastProblemReporter();
        reporter.error(new Problem("VGER", new Location(new DescriptiveResource("here")),
            null, new IllegalArgumentException()));
      }
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.