Hi all,
I am trying to make this sample work (
http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CreateAMessage.html
)
When I run this as an individual java file I get the correct results.
However I need to use HAPI in my module and hence I am trying to write the
createMessage method in my service layer.
But I am getting the below error.
Results :
> Tests in error:
>
> shouldSetupContext(org.openmrs.module.hapiexample.api.HapiExampleServiceTest):
> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
> org.openmrs.module.hapiexample.api.HapiExampleServiceTest:
> org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
*Contents of HapiExampleServiceTest.java file*
package org.openmrs.module.hapiexample.api;
> import static org.junit.Assert.*;
> import org.junit.Test;
> import org.openmrs.api.context.Context;
> import org.openmrs.test.BaseModuleContextSensitiveTest;
> /**
> * Tests {@link ${HapiExampleService}}.
> */
> public class HapiExampleServiceTest extends
> BaseModuleContextSensitiveTest {
>
> @Test
> public void shouldSetupContext() {
> assertNotNull(Context.getService(HapiExampleService.class));
> }
> }
I have attached a copy of my pom.xml file as well.
Could someone tell me what is that I am doing wrong.
Thanks & Regards
Sara
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>hapiexample</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>hapiexample-api</artifactId>
<packaging>jar</packaging>
<name>Hapi Example Module API</name>
<description>API project for HapiExample</description>
<dependencies>
<!-- Add other dependencies from parent's pom: <dependency> <groupId>org.other.library</groupId>
<artifactId>library-name</artifactId> </dependency> -->
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-base</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v21</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<version>1.8.0</version>
<exclusions>
<exclusion>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- Begin OpenMRS core -->
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.openmrs.web</groupId>
<artifactId>openmrs-web</artifactId>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openmrs.web</groupId>
<artifactId>openmrs-web</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openmrs.test</groupId>
<artifactId>openmrs-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<!-- End OpenMRS core -->
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</project>
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel