PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin-module-codegen-engine/src/test/java/com/atlassian/plugins/codegen/modules/jira/WorkflowValidatorTest.java

https://bitbucket.org/mmeinhold/amps
Java | 64 lines | 50 code | 11 blank | 3 comment | 0 complexity | e3fb87186edb877c341150fab646fdbf MD5 | raw file
 1package com.atlassian.plugins.codegen.modules.jira;
 2
 3import com.atlassian.plugins.codegen.AbstractModuleCreatorTestCase;
 4
 5import org.junit.Before;
 6import org.junit.Test;
 7
 8import static junit.framework.Assert.assertEquals;
 9
10/**
11 * @since 3.6
12 */
13public class WorkflowValidatorTest extends AbstractModuleCreatorTestCase<WorkflowElementProperties>
14{
15    public WorkflowValidatorTest()
16    {
17        super("workflow-validator", new WorkflowValidatorModuleCreator());
18    }
19
20    @Before
21    public void setupProps() throws Exception
22    {
23        setProps(new WorkflowElementProperties(PACKAGE_NAME + ".MyWorkflowValidator"));
24        props.setIncludeExamples(false);
25    }
26
27    @Test
28    public void classFileIsGenerated() throws Exception
29    {
30        getSourceFile(PACKAGE_NAME, "MyWorkflowValidator");
31    }
32
33    @Test
34    public void factoryClassFileIsGenerated() throws Exception
35    {
36        getSourceFile(PACKAGE_NAME, "MyWorkflowValidatorFactory");
37    }
38    
39    @Test
40    public void unitTestFileIsGenerated() throws Exception
41    {
42        getTestSourceFile(TEST_PACKAGE_NAME, "MyWorkflowValidatorTest");
43    }
44   
45    @Test
46    public void moduleHasDefaultKey() throws Exception
47    {
48        assertEquals("my-workflow-validator",
49                     getGeneratedModule().attributeValue("key"));
50    }
51    
52    @Test
53    public void moduleHasClass() throws Exception
54    {
55        assertEquals(PACKAGE_NAME + ".MyWorkflowValidatorFactory",
56                     getGeneratedModule().attributeValue("class"));
57    }
58    
59    @Test
60    public void moduleHasValidatorClass() throws Exception
61    {
62        assertEquals(PACKAGE_NAME + ".MyWorkflowValidator", getGeneratedModule().selectSingleNode("validator-class").getText());
63    }
64}