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 WebResourceTransformerTest extends AbstractModuleCreatorTestCase<WebResourceTransformerProperties>
14 {
15 public static final String PACKAGE_NAME = "com.atlassian.plugin.webresource";
16
17 public WebResourceTransformerTest()
18 {
19 super("web-resource-transformer", new WebResourceTransformerModuleCreator());
20 }
21
22 @Before
23 public void setupProps() throws Exception
24 {
25 setProps(new WebResourceTransformerProperties(PACKAGE_NAME + ".MyWebResourceTransformer"));
26 props.setIncludeExamples(false);
27 }
28
29 @Test
30 public void classFileIsGenerated() throws Exception
31 {
32 getSourceFile(PACKAGE_NAME, "MyWebResourceTransformer");
33 }
34
35 @Test
36 public void unitTestFileIsGenerated() throws Exception
37 {
38 getTestSourceFile(PACKAGE_NAME, "MyWebResourceTransformerTest");
39 }
40
41 @Test
42 public void moduleHasDefaultKey() throws Exception
43 {
44 assertEquals("my-web-resource-transformer",
45 getGeneratedModule().attributeValue("key"));
46 }
47
48 @Test
49 public void moduleHasClass() throws Exception
50 {
51 assertEquals(PACKAGE_NAME + ".MyWebResourceTransformer",
52 getGeneratedModule().attributeValue("class"));
53 }
54 }