Skip to content

Commit 8fc7fed

Browse files
committed
EMMA-17: Update the basic module to the latest archetype
https://tickets.openmrs.org/browse/EMMA-17
1 parent 2f5ab4a commit 8fc7fed

7 files changed

Lines changed: 138 additions & 1 deletion

File tree

api/pom.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<artifactId>basicmodule</artifactId>
77
<version>0.1-SNAPSHOT</version>
88
</parent>
9-
<groupId>org.openmrs.module</groupId>
9+
1010
<artifactId>basicmodule-api</artifactId>
1111
<packaging>jar</packaging>
1212
<name>Basic Module API</name>
@@ -47,5 +47,21 @@
4747
<type>pom</type>
4848
</dependency>
4949
</dependencies>
50+
51+
<build>
52+
<resources>
53+
<resource>
54+
<directory>src/main/resources</directory>
55+
<filtering>true</filtering>
56+
</resource>
57+
</resources>
58+
59+
<testResources>
60+
<testResource>
61+
<directory>src/test/resources</directory>
62+
<filtering>true</filtering>
63+
</testResource>
64+
</testResources>
65+
</build>
5066

5167
</project>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
7+
8+
<!--
9+
See http://wiki.openmrs.org/display/docs/Module+liquibase+File for
10+
documentation on this file.
11+
12+
See http://www.liquibase.org/manual/home#available_database_refactorings
13+
for a list of supported elements and attributes
14+
-->
15+
16+
<!-- Uncomment this and edit the values below to use this file
17+
18+
<changeSet id="mymoduleid-2010-05-25-15:50" author="bwolfe">
19+
<preConditions onFail="MARK_RAN">
20+
<not><tableExists tableName="mymoduleid_myobject"/></not>
21+
</preConditions>
22+
<comment>
23+
Creating the mymoduleid_myobject table
24+
</comment>
25+
<createTable tableName="mymoduleid_myobject">
26+
<column name="mymoduleid_myobject_id" type="int">
27+
<constraints primaryKey="true" nullable="false"/>
28+
</column>
29+
<column name="firstname" type="varchar(255)"/>
30+
<column name="lastname" type="varchar(255)"/>
31+
<column name="username" type="varchar(255)">
32+
<constraints unique="true" nullable="false"/>
33+
</column>
34+
<column name="testid" type="int" />
35+
</createTable>
36+
</changeSet>
37+
38+
-->
39+
40+
</databaseChangeLog>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@MODULE_ID@.title=Basic Module
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@MODULE_ID@.title=Módulo Básico
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@MODULE_ID@.title=Module de Base
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- Beans to add to the current Application context definition -->
4+
5+
<beans xmlns="http://www.springframework.org/schema/beans"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xmlns:p="http://www.springframework.org/schema/p"
8+
xmlns:context="http://www.springframework.org/schema/context"
9+
xmlns:jee="http://www.springframework.org/schema/jee"
10+
xmlns:tx="http://www.springframework.org/schema/tx"
11+
xmlns:aop="http://www.springframework.org/schema/aop"
12+
xmlns:util="http://www.springframework.org/schema/util"
13+
xsi:schemaLocation="http://www.springframework.org/schema/beans
14+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
15+
http://www.springframework.org/schema/context
16+
http://www.springframework.org/schema/context/spring-context-3.0.xsd
17+
http://www.springframework.org/schema/jee
18+
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
19+
http://www.springframework.org/schema/tx
20+
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
21+
http://www.springframework.org/schema/aop
22+
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
23+
http://www.springframework.org/schema/util
24+
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
25+
26+
</beans>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* The contents of this file are subject to the OpenMRS Public License
3+
* Version 1.0 (the "License"); you may not use this file except in
4+
* compliance with the License. You may obtain a copy of the License at
5+
* http://license.openmrs.org
6+
*
7+
* Software distributed under the License is distributed on an "AS IS"
8+
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9+
* License for the specific language governing rights and limitations
10+
* under the License.
11+
*
12+
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
13+
*/
14+
package org.openmrs.module.basicmodule;
15+
16+
import java.util.Map;
17+
18+
import org.junit.Assert;
19+
import org.junit.Test;
20+
import org.openmrs.module.Extension.MEDIA_TYPE;
21+
import org.openmrs.module.basicmodule.extension.html.AdminList;
22+
23+
/**
24+
* This test validates the AdminList extension class
25+
*/
26+
public class AdminListExtensionTest {
27+
28+
/**
29+
* Get the links for the extension class
30+
*/
31+
@Test
32+
public void testValidatesLinks() {
33+
AdminList ext = new AdminList();
34+
35+
Map<String, String> links = ext.getLinks();
36+
37+
Assert.assertNotNull("Some links should be returned", links);
38+
39+
Assert.assertTrue("There should be a positive number of links", links.values().size() > 0);
40+
}
41+
42+
/**
43+
* Check the media type of this extension class
44+
*/
45+
@Test
46+
public void testMediaTypeIsHtml() {
47+
AdminList ext = new AdminList();
48+
49+
Assert.assertTrue("The media type of this extension should be html", ext.getMediaType().equals(MEDIA_TYPE.html));
50+
}
51+
52+
}

0 commit comments

Comments
 (0)