com.atlassian.confluence.it
Class Assertions

java.lang.Object
  extended by junit.framework.Assert
      extended by com.atlassian.confluence.it.Assertions

public class Assertions
extends junit.framework.Assert


Constructor Summary
Assertions()
           
 
Method Summary
static
<T> void
assertCollectionContains(Collection<T> actual, T... expected)
          Var-args version of assertCollectionContains(Collection, Collection) with the arguments flipped for this purpose.
static void assertCollectionContains(Collection expected, Collection actual)
          Asserts two collections contain the same elements with the same cardinality, regardless of the order of the items in the collection.
static void assertCollectionsEqual(Collection expected, Collection actual)
           
static void assertContains(String expectedSubstring, String actual)
           
static void assertContainsLinkWithText(String linkText, String container)
          Asserts that a link with the supplied text is present in the container string.
static void assertContainsRegex(String regex, String actual)
          Asserts that all or part of the actual value is matched by the supplied regular expression.
static void assertDoesNotContain(String unexpectedSubstring, String actual)
           
static void assertDoesNotContainLinkWithText(String linkText, String container)
          Asserts that a link with the supplied text is NOT present in the container string.
static void assertDoesNotContainRegex(String regex, String actual)
          Asserts that none of the actual value is matched by the supplied regular expression.
static void assertEndsWith(String expectedSuffix, String actual)
           
static void assertStartsWith(String expectedPrefix, String actual)
           
static void assertWithinRange(int expectedValue, int actualValue, int delta)
           
static void assertWithinRange(long expectedValue, long actualValue, long delta)
           
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assertions

public Assertions()
Method Detail

assertContains

public static void assertContains(String expectedSubstring,
                                  String actual)

assertDoesNotContain

public static void assertDoesNotContain(String unexpectedSubstring,
                                        String actual)

assertEndsWith

public static void assertEndsWith(String expectedSuffix,
                                  String actual)

assertStartsWith

public static void assertStartsWith(String expectedPrefix,
                                    String actual)

assertCollectionsEqual

public static void assertCollectionsEqual(Collection expected,
                                          Collection actual)

assertCollectionContains

public static void assertCollectionContains(Collection expected,
                                            Collection actual)
Asserts two collections contain the same elements with the same cardinality, regardless of the order of the items in the collection.

See Also:
CollectionUtils.isEqualCollection(Collection, Collection)

assertCollectionContains

public static <T> void assertCollectionContains(Collection<T> actual,
                                                T... expected)
Var-args version of assertCollectionContains(Collection, Collection) with the arguments flipped for this purpose.


assertWithinRange

public static void assertWithinRange(int expectedValue,
                                     int actualValue,
                                     int delta)

assertWithinRange

public static void assertWithinRange(long expectedValue,
                                     long actualValue,
                                     long delta)

assertContainsRegex

public static void assertContainsRegex(String regex,
                                       String actual)
Asserts that all or part of the actual value is matched by the supplied regular expression. Note matching across multiple lines requires (?s) to be included in the regular expression.

Parameters:
regex - the expected value as a regular expression.
actual - the returned value.

assertDoesNotContainRegex

public static void assertDoesNotContainRegex(String regex,
                                             String actual)
Asserts that none of the actual value is matched by the supplied regular expression. Note matching across multiple lines requires (?s) to be included in the regular expression.

Parameters:
regex - the expected value as a regular expression.
actual - the returned value.

assertContainsLinkWithText

public static void assertContainsLinkWithText(String linkText,
                                              String container)
Asserts that a link with the supplied text is present in the container string.

Parameters:
linkText - link text to search for
container - string to search for the link inside

assertDoesNotContainLinkWithText

public static void assertDoesNotContainLinkWithText(String linkText,
                                                    String container)
Asserts that a link with the supplied text is NOT present in the container string.

Parameters:
linkText - link text to search for
container - string to search for the link inside


Copyright © 2003-2012 Atlassian. All Rights Reserved.