-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Measure duration of steps, cases, and scenarios (Issue-#13)
- Loading branch information
Jan Schäfer
committed
Sep 7, 2014
1 parent
34cbe84
commit f0c8fd5
Showing
31 changed files
with
327 additions
and
83 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
jgiven-core/src/main/java/com/tngtech/jgiven/exception/JGivenInternalDefectException.java
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,14 @@ | ||
package com.tngtech.jgiven.exception; | ||
|
||
/** | ||
* If this exception is thrown there is most likely a bug in JGiven. | ||
*/ | ||
public class JGivenInternalDefectException extends RuntimeException { | ||
private static final long serialVersionUID = 1L; | ||
|
||
public JGivenInternalDefectException( String msg ) { | ||
super( msg | ||
+ ". This is most propably due to an internal defect in JGiven and was not your fault. " | ||
+ "Please consider writing a bug report on github.com/TNG/JGiven" ); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
jgiven-core/src/main/java/com/tngtech/jgiven/impl/util/AssertionUtil.java
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,27 @@ | ||
package com.tngtech.jgiven.impl.util; | ||
|
||
import com.tngtech.jgiven.exception.JGivenInternalDefectException; | ||
|
||
/** | ||
* A collection of methods to assert certain conditions. | ||
* If an asserted condition is false a {@link JGivenInternalDefectException} is thrown. | ||
*/ | ||
public class AssertionUtil { | ||
|
||
public static void assertNotNull( Object o ) { | ||
assertNotNull( "Expected a value to not be null, but it apparently was null" ); | ||
} | ||
|
||
public static void assertNotNull( Object o, String msg ) { | ||
if( o == null ) { | ||
throw new JGivenInternalDefectException( msg ); | ||
} | ||
} | ||
|
||
public static void assertTrue( boolean condition, String msg ) { | ||
if( !condition ) { | ||
throw new JGivenInternalDefectException( msg ); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.