PageRenderTime 23ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/plugin-module-codegen-engine/src/test/java/com/atlassian/plugins/codegen/modules/stash/scm/ScmRequestCheckTest.java

https://bitbucket.org/mmeinhold/amps
Java | 56 lines | 45 code | 11 blank | 0 comment | 0 complexity | b39eb9008d56f45e04dddec5bc61a83c MD5 | raw file
 1package com.atlassian.plugins.codegen.modules.stash.scm;
 2
 3import com.atlassian.plugins.codegen.AbstractModuleCreatorTestCase;
 4import org.junit.Before;
 5import org.junit.Test;
 6
 7import static junit.framework.Assert.assertEquals;
 8
 9public class ScmRequestCheckTest extends AbstractModuleCreatorTestCase<ScmRequestCheckProperties>
10{
11
12    public ScmRequestCheckTest()
13    {
14        super("scm-request-check", new ScmRequestCheckModuleCreator());
15    }
16
17    @Before
18    public void setupProps() throws Exception
19    {
20        setProps(new ScmRequestCheckProperties(PACKAGE_NAME + ".MyScmRequestCheck"));
21        props.setIncludeExamples(false);
22    }
23
24    @Test
25    public void classFileIsGenerated() throws Exception
26    {
27        getSourceFile(PACKAGE_NAME, "MyScmRequestCheck");
28    }
29
30    @Test
31    public void unitTestFileIsGenerated() throws Exception
32    {
33        getTestSourceFile(TEST_PACKAGE_NAME, "MyScmRequestCheckTest");
34    }
35
36    @Test
37    public void moduleHasDefaultKey() throws Exception
38    {
39        assertEquals("my-scm-request-check",
40                getGeneratedModule().attributeValue("key"));
41    }
42
43    @Test
44    public void moduleHasDefaultWeight() throws Exception
45    {
46        assertEquals("150",
47                getGeneratedModule().attributeValue("weight"));
48    }
49
50    @Test
51    public void moduleHasClass() throws Exception
52    {
53        assertEquals(PACKAGE_NAME + ".MyScmRequestCheck", getGeneratedModule().attributeValue("class"));
54    }
55
56}