summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRyan Schneider <rschneider@salsalabs.com>2013-01-21 14:41:22 -0500
committerRyan Schneider <rschneider@salsalabs.com>2013-01-21 14:41:22 -0500
commit164976dcc002c23f94a3583e9ac3c6bff17345c1 (patch)
tree3f12f873afaa066997730413d340d471f4f3c6d2 /tests
parent79ede8f95d7cbf82ca8df9393855e751e54a13c8 (diff)
downloadgitblit-164976dcc002c23f94a3583e9ac3c6bff17345c1.tar.gz
gitblit-164976dcc002c23f94a3583e9ac3c6bff17345c1.zip
Added Fogbugz post-receive groovy script
Diffstat (limited to 'tests')
-rw-r--r--tests/com/gitblit/tests/GroovyScriptTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/com/gitblit/tests/GroovyScriptTest.java b/tests/com/gitblit/tests/GroovyScriptTest.java
index 47d20a4c..2954fa1d 100644
--- a/tests/com/gitblit/tests/GroovyScriptTest.java
+++ b/tests/com/gitblit/tests/GroovyScriptTest.java
@@ -30,6 +30,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -70,6 +71,28 @@ public class GroovyScriptTest {
}
@Test
+ public void testFogbugz() throws Exception {
+ MockGitblit gitblit = new MockGitblit();
+ MockLogger logger = new MockLogger();
+ MockClientLogger clientLogger = new MockClientLogger();
+ List<ReceiveCommand> commands = new ArrayList<ReceiveCommand>();
+ commands.add(new ReceiveCommand(ObjectId
+ .fromString("c18877690322dfc6ae3e37bb7f7085a24e94e887"), ObjectId
+ .fromString("3fa7c46d11b11d61f1cbadc6888be5d0eae21969"), "refs/heads/master"));
+ commands.add(new ReceiveCommand(ObjectId
+ .fromString("c18877690322dfc6ae3e37bb7f7085a24e94e887"), ObjectId
+ .fromString("3fa7c46d11b11d61f1cbadc6888be5d0eae21969"), "refs/heads/master2"));
+
+ RepositoryModel repository = GitBlit.self().getRepositoryModel("helloworld.git");
+ repository.customFields = new HashMap<String,String>();
+ repository.customFields.put( "fogbugzUrl", "http://bugs.test.com" );
+ repository.customFields.put( "fogbugzRepositoryId", "1" );
+ repository.customFields.put( "fogbugzCommitMessageRegex", "\\s*[Bb][Uu][Gg][(Zz)(Ss)]*\\s*[(IDs)]*\\s*[#:; ]+((\\d+[ ,:;#]*)+)" );
+
+ test("fogbugz.groovy", gitblit, logger, clientLogger, commands, repository);
+ }
+
+ @Test
public void testSendHtmlMail() throws Exception {
MockGitblit gitblit = new MockGitblit();
MockLogger logger = new MockLogger();