1 package com.atlassian.plugins.codegen.modules.common;
2
3 import com.atlassian.plugins.codegen.AbstractModuleCreatorTestCase;
4
5 import org.junit.Before;
6 import org.junit.Test;
7
8 import static org.junit.Assert.assertEquals;
9
10
11
12
13 public class GadgetTest extends AbstractModuleCreatorTestCase<GadgetProperties>
14 {
15 public GadgetTest()
16 {
17 super("gadget", new GadgetModuleCreator());
18 }
19
20 @Before
21 public void setupProps() throws Exception
22 {
23 setProps(new GadgetProperties("My Gadget", "gadgets/mygadget/gadget.xml"));
24 props.setIncludeExamples(false);
25 }
26
27 @Test
28 public void gadgetFileIsGenerated() throws Exception
29 {
30 getResourceFile("gadgets/mygadget", "gadget.xml");
31 }
32
33 @Test
34 public void moduleHasLocation() throws Exception
35 {
36 assertEquals("gadgets/mygadget/gadget.xml", getGeneratedModule().attributeValue("location"));
37 }
38 }