-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from opengeospatial/improveFailureMassage-Land…
…ingPageValidation-31 Improved failure massage
- Loading branch information
Showing
9 changed files
with
69 additions
and
255 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.opengis.cite.wfs30; | ||
|
||
/** | ||
* Provides a set of custom assertion methods. | ||
* | ||
* @author <a href="mailto:[email protected]">Lyn Goltz </a> | ||
*/ | ||
public class EtsAssert { | ||
|
||
/** | ||
* @param valueToAssert | ||
* the boolean to assert to be <code>true</code> | ||
* @param failureMsg | ||
* the message to throw in case of a failure, should not be <code>null</code> | ||
*/ | ||
public static void assertTrue( boolean valueToAssert, String failureMsg ) { | ||
if ( !valueToAssert ) | ||
throw new AssertionError( failureMsg ); | ||
} | ||
|
||
/** | ||
* @param valueToAssert | ||
* the boolean to assert to be <code>false</code> | ||
* @param failureMsg | ||
* the message to throw in case of a failure, should not be <code>null</code> | ||
*/ | ||
public static void assertFalse( boolean valueToAssert, String failureMsg ) { | ||
if ( valueToAssert ) | ||
throw new AssertionError( failureMsg ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import org.junit.Test; | ||
import org.opengis.cite.wfs30.EtsAssert; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Lyn Goltz </a> | ||
*/ | ||
public class EtsAssertTest { | ||
|
||
@Test | ||
public void testAssertTrue() { | ||
EtsAssert.assertTrue( true, "OK" ); | ||
} | ||
|
||
@Test | ||
public void testAssertFalse() { | ||
EtsAssert.assertFalse( false, "OK" ); | ||
} | ||
|
||
@Test(expected = AssertionError.class) | ||
public void testAssertTrue_false() { | ||
EtsAssert.assertTrue( false, "FAIlURE" ); | ||
} | ||
|
||
@Test(expected = AssertionError.class) | ||
public void testAssertFalse_true() { | ||
EtsAssert.assertFalse( true, "FAIlURE" ); | ||
|
||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.