Incremental work on XML implementation.
This commit is contained in:
0
libpit/test/com/jdbernard/pit/CategoryTest.groovy
Normal file → Executable file
0
libpit/test/com/jdbernard/pit/CategoryTest.groovy
Normal file → Executable file
0
libpit/test/com/jdbernard/pit/FilterTest.groovy
Normal file → Executable file
0
libpit/test/com/jdbernard/pit/FilterTest.groovy
Normal file → Executable file
0
libpit/test/com/jdbernard/pit/MockIssue.groovy
Normal file → Executable file
0
libpit/test/com/jdbernard/pit/MockIssue.groovy
Normal file → Executable file
6
libpit/test/com/jdbernard/pit/MockProject.groovy
Normal file → Executable file
6
libpit/test/com/jdbernard/pit/MockProject.groovy
Normal file → Executable 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 }
|
||||
|
12
libpit/test/com/jdbernard/pit/MockRepository.groovy
Executable file
12
libpit/test/com/jdbernard/pit/MockRepository.groovy
Executable 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
0
libpit/test/com/jdbernard/pit/StatusTest.groovy
Normal file → Executable file
3
libpit/test/com/jdbernard/pit/FileIssueTest.groovy → libpit/test/com/jdbernard/pit/file/FileIssueTest.groovy
Normal file → Executable file
3
libpit/test/com/jdbernard/pit/FileIssueTest.groovy → libpit/test/com/jdbernard/pit/file/FileIssueTest.groovy
Normal file → Executable 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
|
3
libpit/test/com/jdbernard/pit/FileProjectTest.groovy → libpit/test/com/jdbernard/pit/file/FileProjectTest.groovy
Normal file → Executable file
3
libpit/test/com/jdbernard/pit/FileProjectTest.groovy → libpit/test/com/jdbernard/pit/file/FileProjectTest.groovy
Normal file → Executable 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
|
25
libpit/test/com/jdbernard/pit/xml/XmlIssueTest.groovy
Executable file
25
libpit/test/com/jdbernard/pit/xml/XmlIssueTest.groovy
Executable 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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user