Created
November 4, 2010 10:47
-
-
Save talios/662321 to your computer and use it in GitHub Desktop.
A new modification to my concordion eval command that now takes regex based templates
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
<html xmlns:concordion="http://www.concordion.org/2007/concordion" | |
xmlns:talios="http://www.talios.com/2010/concordion"> | |
<head>Some Other Test</head> | |
<body> | |
<p class="info"> | |
All tests are assumed to be run against username <b concordion:set="#username">username</b> and the password | |
<b concordion:set="#password">password</b>. | |
</p> | |
<p>This is another test.</p> | |
<ul> | |
<li><span concordion:assertEquals="login(#username, #password)">Thank you for logging in</span></li> | |
<li><span talios:eval="">Do something boring</span></li> | |
<li><span talios:eval="">Given that we have something cool happen</span></li> | |
<li><span talios:eval="">Given that we have 10 things happen</span></li> | |
</ul> | |
</body> | |
</html> |
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
package specifications; | |
import com.talios.Eval; | |
public class SomeOtherTest { | |
public String login(String username, String password) { | |
return "Welcome"; | |
} | |
@Eval("Do something (.*)") | |
public void doSomethingBoring(String type) { | |
System.out.println("This was " + type + "."); | |
} | |
@Eval("Given that we have (\\D+) (.*) happen") | |
public void goodness(String thing, String type) { | |
System.out.println("Given that we have " + thing + " " + type + " happen"); | |
} | |
@Eval("Given that we have (\\d+) (.*) happen") | |
public void things(Integer count, String type) { | |
for (int i = 0; i < count; i++) { | |
System.out.println(i + " " + type + " thing just happened."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment