Skip to content

Commit c810ebb

Browse files
committed
Upgraded validator's OpenMRS core to 2.6.9.
1 parent b5a6cab commit c810ebb

File tree

14 files changed

+254
-141
lines changed

14 files changed

+254
-141
lines changed

api-2.4/src/test/java/org/openmrs/module/initializer/api/BillableServicesLoaderIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.springframework.beans.factory.annotation.Autowired;
2222
import org.springframework.beans.factory.annotation.Qualifier;
2323

24-
public class BillableServicesLoaderIntegrationTest extends DomainBaseModuleContextSensitive_2_4_test {
24+
public class BillableServicesLoaderIntegrationTest extends DomainBaseModuleContextSensitive_2_4_Test {
2525

2626
@Autowired
2727
@Qualifier("conceptService")

api-2.4/src/test/java/org/openmrs/module/initializer/api/CashPointsLoaderIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.springframework.beans.factory.annotation.Autowired;
1717
import org.springframework.beans.factory.annotation.Qualifier;
1818

19-
public class CashPointsLoaderIntegrationTest extends DomainBaseModuleContextSensitive_2_4_test {
19+
public class CashPointsLoaderIntegrationTest extends DomainBaseModuleContextSensitive_2_4_Test {
2020

2121
@Autowired
2222
@Qualifier("locationService")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
* This allows to perform Spring context sensitive tests when Data Filter API is a dependency. In
2020
* that case it is necessary for each context sensitive test to update the search index.
2121
*/
22-
public abstract class DomainBaseModuleContextSensitive_2_4_test extends DomainBaseModuleContextSensitiveTest {
22+
public abstract class DomainBaseModuleContextSensitive_2_4_Test extends DomainBaseModuleContextSensitiveTest {
2323

24-
public DomainBaseModuleContextSensitive_2_4_test() {
24+
public DomainBaseModuleContextSensitive_2_4_Test() {
2525
super();
2626
{
2727
Module mod = new Module("", "billing", "", "", "", "1.1.0");

api-2.4/src/test/java/org/openmrs/module/initializer/api/PaymentModesLoaderIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.openmrs.module.initializer.api.billing.PaymentModesLoader;
1313
import org.springframework.beans.factory.annotation.Autowired;
1414

15-
public class PaymentModesLoaderIntegrationTest extends DomainBaseModuleContextSensitive_2_4_test {
15+
public class PaymentModesLoaderIntegrationTest extends DomainBaseModuleContextSensitive_2_4_Test {
1616

1717
@Autowired
1818
private IPaymentModeService paymentModeService;

api/src/main/java/org/openmrs/module/initializer/api/CsvParser.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,6 @@ public List<String[]> getLines() {
189189
* @return The resulting CsvParserResult instance.
190190
*/
191191
public CsvFailingLines process(List<String[]> lines) {
192-
// Save cached objects to avoid losing them prematurely by other Parsers
193-
// See DisplaysCsvParser#save(OpenmrsObject)
194-
Context.flushSession();
195-
Context.clearSession();
196192

197193
CsvFailingLines result = new CsvFailingLines();
198194
int saved = 0;
@@ -209,8 +205,11 @@ public CsvFailingLines process(List<String[]> lines) {
209205
}
210206
catch (Exception e) {
211207
result.addFailingLine(new CsvLine(getHeaderLine(), line), e);
212-
if (instance != null) {
213-
Context.evictFromSession(instance);
208+
if (instance != null && instance.getId() != null) {
209+
try {
210+
Context.evictFromSession(instance);
211+
}
212+
catch (Exception hibernateError) {}
214213
}
215214
}
216215
}

api/src/main/java/org/openmrs/module/initializer/api/display/DisplaysCsvParser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public OpenmrsObject bootstrap(CsvLine line) throws IllegalArgumentException {
3838
public OpenmrsObject save(OpenmrsObject instance) {
3939
// Clearing object from session to prevent possibly saving it later on.
4040
// See CsvParser#process(List<String[]>)
41-
Context.clearSession();
41+
if (instance != null && instance.getId() != null) {
42+
Context.evictFromSession(instance);
43+
}
4244
return instance;
4345
}
4446
}

api/src/main/java/org/openmrs/module/initializer/api/idgen/CommonIdentifierSourceLineProcessor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.openmrs.module.initializer.api.idgen;
22

3+
import org.openmrs.PatientIdentifierType;
34
import org.openmrs.annotation.OpenmrsProfile;
45
import org.openmrs.module.idgen.service.IdentifierSourceService;
56
import org.openmrs.module.initializer.api.CsvLine;
@@ -20,6 +21,10 @@ public CommonIdentifierSourceLineProcessor(IdentifierSourceService idgenService)
2021
@Override
2122
public IdgenSourceWrapper fill(IdgenSourceWrapper instance, CsvLine line) throws IllegalArgumentException {
2223

24+
PatientIdentifierType idType = getPatientIdentifierType(line.getString(HEADER_IDTYPE));
25+
if (idType == null) {
26+
throw new IllegalArgumentException("No identifier type found for '" + line.get(HEADER_IDTYPE) + "'");
27+
}
2328
instance.getIdentifierSource().setIdentifierType(getPatientIdentifierType(line.getString(HEADER_IDTYPE)));
2429
instance.getIdentifierSource().setName(line.getString(HEADER_NAME));
2530
instance.getIdentifierSource().setDescription(line.getString(HEADER_DESC));

api/src/main/java/org/openmrs/module/initializer/api/idgen/autogen/AutoGenerationOptionLineProcessor.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.springframework.beans.factory.annotation.Autowired;
1414
import org.springframework.beans.factory.annotation.Qualifier;
1515

16-
@OpenmrsProfile(modules = { "idgen:4.6.0" })
16+
@OpenmrsProfile(modules = { "idgen:*" })
1717
public class AutoGenerationOptionLineProcessor extends BaseLineProcessor<AutoGenerationOption> {
1818

1919
final public static String IDENTIFIER_TYPE = "identifier type";
@@ -49,12 +49,19 @@ public AutoGenerationOption fill(AutoGenerationOption option, CsvLine line) thro
4949
// Fill identifier type
5050
{
5151
String identifierTypeRef = line.get(IDENTIFIER_TYPE, true);
52-
option.setIdentifierType(Utils.fetchPatientIdentifierType(identifierTypeRef, ps));
52+
PatientIdentifierType idType = Utils.fetchPatientIdentifierType(identifierTypeRef, ps);
53+
if (idType == null) {
54+
throw new IllegalArgumentException("No identifier type found for '" + identifierTypeRef + "'");
55+
}
56+
option.setIdentifierType(idType);
5357
}
5458
// Fill identifier source
5559
{
5660
String identifierSourceRef = line.get(IDENTIFIER_SOURCE, true);
5761
IdentifierSource source = iss.getIdentifierSourceByUuid(identifierSourceRef);
62+
if (source == null) {
63+
throw new IllegalArgumentException("No identifier source found for '" + identifierSourceRef + "'");
64+
}
5865
option.setSource(source);
5966
}
6067
// Fill location

validator/pom.xml

Lines changed: 106 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
<description>Validator project for Initializer</description>
1515

1616
<properties>
17-
<springVersion>4.1.4.RELEASE</springVersion>
1817
<!-- OpenMRS Core and modules -->
19-
<openmrsPlatformVersion>2.3.6</openmrsPlatformVersion>
18+
<openmrsPlatformVersion>2.6.9</openmrsPlatformVersion>
2019
<reportingCompatibilityVersion>2.0.6</reportingCompatibilityVersion>
2120
<htmlwidgetsVersion>1.7.2</htmlwidgetsVersion>
22-
<mysqlTestContainerVersion>1.15.3</mysqlTestContainerVersion>
21+
<mysqlTestContainerVersion>1.17.6</mysqlTestContainerVersion>
2322
<metadatasharingVersion>1.9.0</metadatasharingVersion>
2423
<metadatamappingVersion>1.6.0</metadatamappingVersion>
2524
<billingVersion>1.1.0</billingVersion>
25+
<datafilterVersion>2.2.0</datafilterVersion>
26+
<openconceptlabVersion>2.3.0</openconceptlabVersion>
2627
</properties>
2728

2829
<dependencies>
@@ -70,13 +71,6 @@
7071
<type>jar</type>
7172
</dependency>
7273

73-
<dependency>
74-
<groupId>ch.vorburger.mariaDB4j</groupId>
75-
<artifactId>mariaDB4j</artifactId>
76-
<version>2.4.0</version>
77-
<type>jar</type>
78-
</dependency>
79-
8074
<dependency>
8175
<groupId>org.apache.httpcomponents</groupId>
8276
<artifactId>httpclient</artifactId>
@@ -87,11 +81,19 @@
8781
<dependency>
8882
<groupId>mysql</groupId>
8983
<artifactId>mysql-connector-java</artifactId>
90-
<version>5.1.45</version>
91-
<type>jar</type>
84+
<version>8.0.30</version>
9285
<scope>runtime</scope>
86+
<type>jar</type>
9387
</dependency>
9488

89+
<dependency>
90+
<groupId>com.mysql</groupId>
91+
<artifactId>mysql-connector-mxj</artifactId>
92+
<version>5.0.11</version>
93+
<scope>runtime</scope>
94+
<type>jar</type>
95+
</dependency>
96+
9597
<dependency>
9698
<groupId>org.hsqldb</groupId>
9799
<artifactId>sqltool</artifactId>
@@ -146,34 +148,26 @@
146148
<artifactId>openmrs-api</artifactId>
147149
<version>${openmrsPlatformVersion}</version>
148150
<type>jar</type>
149-
<exclusions>
150-
<!-- slf4j-api is coming from mariaDB4j -->
151-
<exclusion>
152-
<groupId>org.slf4j</groupId>
153-
<artifactId>slf4j-api</artifactId>
154-
</exclusion>
155-
</exclusions>
156151
</dependency>
157152

158153
<dependency>
159154
<groupId>org.openmrs.api</groupId>
160155
<artifactId>openmrs-api</artifactId>
161156
<type>test-jar</type>
162157
<version>${openmrsPlatformVersion}</version>
163-
<exclusions>
164-
<!-- slf4j-api is coming from mariaDB4j -->
165-
<exclusion>
166-
<groupId>org.slf4j</groupId>
167-
<artifactId>slf4j-api</artifactId>
168-
</exclusion>
169-
</exclusions>
170158
</dependency>
171159

172160
<dependency>
173161
<groupId>org.openmrs.test</groupId>
174162
<artifactId>openmrs-test</artifactId>
175163
<version>${openmrsPlatformVersion}</version>
176164
<type>pom</type>
165+
<exclusions>
166+
<exclusion>
167+
<groupId>org.powermock</groupId>
168+
<artifactId>powermock-api-mockito2</artifactId>
169+
</exclusion>
170+
</exclusions>
177171
</dependency>
178172

179173
<dependency>
@@ -351,6 +345,22 @@
351345
<scope>runtime</scope>
352346
<type>jar</type>
353347
</dependency>
348+
349+
<dependency>
350+
<groupId>org.openmrs.module</groupId>
351+
<artifactId>fhir2-api-2.5</artifactId>
352+
<version>${fhir2Version}</version>
353+
<scope>runtime</scope>
354+
<type>jar</type>
355+
</dependency>
356+
357+
<dependency>
358+
<groupId>org.openmrs.module</groupId>
359+
<artifactId>fhir2-api-2.6</artifactId>
360+
<version>${fhir2Version}</version>
361+
<scope>runtime</scope>
362+
<type>jar</type>
363+
</dependency>
354364

355365
<dependency>
356366
<groupId>org.openmrs.module</groupId>
@@ -380,6 +390,7 @@
380390
<groupId>org.testcontainers</groupId>
381391
<artifactId>mysql</artifactId>
382392
<version>${mysqlTestContainerVersion}</version>
393+
<type>jar</type>
383394
</dependency>
384395

385396
<dependency>
@@ -405,6 +416,34 @@
405416
<scope>runtime</scope>
406417
<type>jar</type>
407418
</dependency>
419+
420+
<dependency>
421+
<groupId>com.fasterxml.jackson.dataformat</groupId>
422+
<artifactId>jackson-dataformat-xml</artifactId>
423+
<version>2.10.1</version>
424+
</dependency>
425+
426+
<dependency>
427+
<groupId>com.fasterxml.jackson.core</groupId>
428+
<artifactId>jackson-databind</artifactId>
429+
<version>2.10.5.1</version>
430+
</dependency>
431+
432+
<dependency>
433+
<groupId>org.yaml</groupId>
434+
<artifactId>snakeyaml</artifactId>
435+
<version>1.24</version>
436+
<scope>runtime</scope>
437+
<type>jar</type>
438+
</dependency>
439+
440+
<dependency>
441+
<groupId>org.liquibase.ext</groupId>
442+
<artifactId>liquibase-compat</artifactId>
443+
<type>jar</type>
444+
<scope>runtime</scope>
445+
<version>4.0.0-beta2</version>
446+
</dependency>
408447

409448
</dependencies>
410449

@@ -485,7 +524,48 @@
485524
<transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
486525
<resource>moduleApplicationContext.xml</resource>
487526
</transformer>
527+
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
528+
<resource>log4j2.xml</resource>
529+
<file>src/main/resources/log4j2.xml</file>
530+
</transformer>
531+
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
532+
<resource>hibernate.default.properties</resource>
533+
<file>src/main/resources/hibernate.default.properties</file>
534+
</transformer>
488535
</transformers>
536+
<filters>
537+
<!-- Exclude Log4j2Plugins.dat files -->
538+
<filter>
539+
<artifact>*:*</artifact>
540+
<excludes>
541+
<include>META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat</include>
542+
</excludes>
543+
</filter>
544+
<filter>
545+
<artifact>*:*</artifact>
546+
<excludes>
547+
<include>log4j2.xml</include>
548+
</excludes>
549+
</filter>
550+
<filter>
551+
<artifact>org.liquibase:liquibase-core</artifact>
552+
<excludes>
553+
<include>META-INF/services/liquibase.servicelocator.ServiceLocator</include>
554+
</excludes>
555+
</filter>
556+
<filter>
557+
<artifact>org.openmrs.module:initializer-validator</artifact>
558+
<excludes>
559+
<include>META-INF/services/liquibase.servicelocator.ServiceLocator</include>
560+
</excludes>
561+
</filter>
562+
<filter>
563+
<artifact>*:*</artifact>
564+
<excludes>
565+
<exclude>hibernate.default.properties</exclude>
566+
</excludes>
567+
</filter>
568+
</filters>
489569
</configuration>
490570
</execution>
491571
</executions>

0 commit comments

Comments
 (0)