Package org.springframework.test

Examples of org.springframework.test.AssertThrows


            }
        }.runTest();
    }

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


    public void testDoesNotContainWithEmptySubstringDoesNotThrowException() throws Exception {
        Assert.doesNotContain("A cool chick's name is Brod. ", "");
    }

    public void testAssertNotEmptyWithNullCollectionThrowsException() throws Exception {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                Assert.notEmpty((Collection) null);
            }
        }.runTest();
    }
View Full Code Here

            }
        }.runTest();
    }

    public void testAssertNotEmptyWithEmptyCollectionThrowsException() throws Exception {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                Assert.notEmpty(new ArrayList());
            }
        }.runTest();
    }
View Full Code Here

        collection.add("");
        Assert.notEmpty(collection);
    }

    public void testAssertNotEmptyWithNullMapThrowsException() throws Exception {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                Assert.notEmpty((Map) null);
            }
        }.runTest();
    }
View Full Code Here

            }
        }.runTest();
    }

    public void testAssertNotEmptyWithEmptyMapThrowsException() throws Exception {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                Assert.notEmpty(new HashMap());
            }
        }.runTest();
    }
View Full Code Here

        map.put("", "");
        Assert.notEmpty(map);
    }

    public void testIsInstanceofClassWithNullInstanceThrowsException() throws Exception {
        new AssertThrows(IllegalArgumentException.class) {
            public void test() throws Exception {
                Assert.isInstanceOf(String.class, null);
            }
        }.runTest();
    }
View Full Code Here

            }
        }.runTest();
    }

    public void testStateWithFalseExpressionThrowsException() throws Exception {
        new AssertThrows(IllegalStateException.class) {
            public void test() throws Exception {
                Assert.state(false);
            }
        }.runTest();
    }
View Full Code Here

    assertNotNull(indent);
    assertEquals("no", indent);
  }

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

      }
    }.runTest();
  }

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

      }
    }.runTest();
  }

  public void testEnableIndentingWithNegativeIndentAmount() throws Exception {
    new AssertThrows(IllegalArgumentException.class) {
      public void test() throws Exception {
        TransformerUtils.enableIndenting(new StubTransformer(), -21938);
      }
    }.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.