1 package com.atlassian.plugins.codegen.modules.common.web;
2
3 import com.atlassian.plugins.codegen.AbstractModuleCreatorTestCase;
4
5 import org.junit.Before;
6 import org.junit.Test;
7
8 import static junit.framework.Assert.assertEquals;
9
10
11
12
13 public class WebPanelRendererTest extends AbstractModuleCreatorTestCase<WebPanelRendererProperties>
14 {
15 public WebPanelRendererTest()
16 {
17 super("web-panel-renderer", new WebPanelRendererModuleCreator());
18 }
19
20 @Before
21 public void setupProps() throws Exception
22 {
23 setProps(new WebPanelRendererProperties(PACKAGE_NAME + ".MyWebPanelRenderer"));
24 props.setIncludeExamples(false);
25 }
26
27 @Test
28 public void classFileIsGenerated() throws Exception
29 {
30 getSourceFile(PACKAGE_NAME, "MyWebPanelRenderer");
31 }
32
33 @Test
34 public void unitTestFileIsGenerated() throws Exception
35 {
36 getTestSourceFile(TEST_PACKAGE_NAME, "MyWebPanelRendererTest");
37 }
38
39 @Test
40 public void moduleHasDefaultKey() throws Exception
41 {
42 assertEquals("my-web-panel-renderer",
43 getGeneratedModule().attributeValue("key"));
44 }
45
46 @Test
47 public void moduleHasClass() throws Exception
48 {
49 assertEquals(PACKAGE_NAME + ".MyWebPanelRenderer",
50 getGeneratedModule().attributeValue("class"));
51 }
52 }