Incremental work on XML implementation.

This commit is contained in:
Jonathan Bernard
2011-05-27 10:25:57 -05:00
parent 482330d02a
commit 6c36d78b7d
106 changed files with 287 additions and 9 deletions

0
libpit/test/com/jdbernard/pit/CategoryTest.groovy Normal file → Executable file
View File

0
libpit/test/com/jdbernard/pit/FilterTest.groovy Normal file → Executable file
View File

0
libpit/test/com/jdbernard/pit/MockIssue.groovy Normal file → Executable file
View File

6
libpit/test/com/jdbernard/pit/MockProject.groovy Normal file → Executable file
View File

@ -5,11 +5,13 @@ class MockProject extends Project {
public MockProject(String name) { super(name) }
public Issue createNewIssue(Map options) {
throw new UnsupportedOperationException()
return new MockIssue(options.id ?: 'n/a',
options.c ?: Category.TASK, options.s ?: Status.NEW,
options.p ?: 5)
}
public Project createNewProject(String name) {
throw new UnsupportedOperationException()
return new MockProject(name)
}
public boolean delete() { return true }

View File

@ -0,0 +1,12 @@
package com.jdbernard.pit
class MockRepository extends Repository {
public void persist() {}
public Project[] getRootProjects() { return [] as Project[] }
public Project createNewProject(String name) {
return new MockProject(name)
}
}

0
libpit/test/com/jdbernard/pit/StatusTest.groovy Normal file → Executable file
View File

View File

@ -1,5 +1,6 @@
package com.jdbernard.pit
package com.jdbernard.pit.file
import com.jdbernard.pit.*
import org.junit.*
import static org.junit.Assert.assertTrue
import static org.junit.Assert.assertFalse

View File

@ -1,5 +1,6 @@
package com.jdbernard.pit
package com.jdbernard.pit.file
import com.jdbernard.pit.*
import org.junit.After
import org.junit.Before
import org.junit.Test

View File

@ -0,0 +1,25 @@
package com.jdbernard.pit.xml
import com.jdbernard.pit.*
import groovy.util.Node
import org.junit.Test
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertFalse
import static org.junit.Assert.assertTrue
public class XmlIssueTest {
Node issueNode = new Node(null, 'Issue',
[id: '0000', category: 'BUG', status: 'RESOLVED', priority: 1],
'Test Issue')
@Test public void testNodeConstructor() {
XmlIssue issue = new XmlIssue(issueNode,
assertEquals issue.text, 'Test Issue'
assertEquals issue.id, '0000'
assertEquals issue.category, Category.BUG
assertEquals issue.status, Status.RESOLVED
assertEquals issue.priority, 1
}
}