Skip to content

Commit 144b235

Browse files
author
lkukielka
committed
MOTECH-1450 Fixed copying jars and standalone admin test
1 parent dd14a56 commit 144b235

File tree

3 files changed

+49
-43
lines changed

3 files changed

+49
-43
lines changed

modules/admin/pom.xml

+47
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,53 @@
318318
<groupId>com.github.searls</groupId>
319319
<artifactId>jasmine-maven-plugin</artifactId>
320320
</plugin>
321+
<plugin>
322+
<groupId>org.apache.maven.plugins</groupId>
323+
<artifactId>maven-dependency-plugin</artifactId>
324+
<version>2.10</version>
325+
<executions>
326+
<execution>
327+
<id>copy-upload-test-bundle-to-target</id>
328+
<phase>package</phase>
329+
<goals>
330+
<goal>copy</goal>
331+
</goals>
332+
<configuration>
333+
<artifactItems>
334+
<artifactItem>
335+
<groupId>${project.groupId}</groupId>
336+
<artifactId>motech-upload-test-bundle</artifactId>
337+
<version>${project.version}</version>
338+
<type>jar</type>
339+
<overWrite>true</overWrite>
340+
<outputDirectory>target/test-bundle/</outputDirectory>
341+
<destFileName>motech-upload-test-bundle.jar</destFileName>
342+
</artifactItem>
343+
</artifactItems>
344+
</configuration>
345+
</execution>
346+
<execution>
347+
<id>copy-upload-test-bundle</id>
348+
<phase>package</phase>
349+
<goals>
350+
<goal>copy</goal>
351+
</goals>
352+
<configuration>
353+
<artifactItems>
354+
<artifactItem>
355+
<groupId>${project.groupId}</groupId>
356+
<artifactId>motech-upload-test-bundle</artifactId>
357+
<version>${project.version}</version>
358+
<type>jar</type>
359+
<overWrite>true</overWrite>
360+
<outputDirectory>${user.home}/.motech/bundles</outputDirectory>
361+
<destFileName>motech-upload-test-bundle.jar</destFileName>
362+
</artifactItem>
363+
</artifactItems>
364+
</configuration>
365+
</execution>
366+
</executions>
367+
</plugin>
321368
</plugins>
322369
</build>
323370

modules/admin/src/test/java/org/motechproject/admin/it/AdminBundleIT.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void testUploadBundleFromRepository() throws IOException, InterruptedExce
139139

140140
@Test
141141
public void testUploadBundleFromFile() throws IOException, InterruptedException {
142-
File file = new File("src/test/resources/motech-upload-test-bundle.jar");
142+
File file = new File("target/test-bundle/motech-upload-test-bundle.jar");
143143

144144
uploadBundle("File", null, file, "on", "motech-upload-test-bundle");
145145
}
@@ -164,6 +164,7 @@ private void uploadBundle(String moduleSource, String moduleId, File bundleFile,
164164
entity.addTextBody("startBundle", startBundle, ContentType.MULTIPART_FORM_DATA);
165165
httpPost.setEntity(entity.build());
166166

167+
167168
int bundlesCountBeforeUpload = bundleContext.getBundles().length;
168169
HttpResponse response = getHttpClient().execute(httpPost);
169170
EntityUtils.consume(response.getEntity());

modules/testing-utils/upload-test-bundle/pom.xml

-42
Original file line numberDiff line numberDiff line change
@@ -32,48 +32,6 @@
3232

3333
<build>
3434
<plugins>
35-
<plugin>
36-
<groupId>org.apache.maven.plugins</groupId>
37-
<artifactId>maven-resources-plugin</artifactId>
38-
<executions>
39-
<execution>
40-
<id>copy-bundles</id>
41-
<phase>package</phase>
42-
<goals>
43-
<goal>copy-resources</goal>
44-
</goals>
45-
<configuration>
46-
<outputDirectory>${user.home}/.motech/bundles</outputDirectory>
47-
<resources>
48-
<resource>
49-
<directory>target</directory>
50-
<includes>
51-
<include>*.jar</include>
52-
</includes>
53-
</resource>
54-
</resources>
55-
</configuration>
56-
</execution>
57-
<execution>
58-
<id>copy-bundle-to-admin-test-resources</id>
59-
<phase>package</phase>
60-
<goals>
61-
<goal>copy-resources</goal>
62-
</goals>
63-
<configuration>
64-
<outputDirectory>../../admin/src/test/resources/</outputDirectory>
65-
<resources>
66-
<resource>
67-
<directory>target</directory>
68-
<includes>
69-
<include>*.jar</include>
70-
</includes>
71-
</resource>
72-
</resources>
73-
</configuration>
74-
</execution>
75-
</executions>
76-
</plugin>
7735
<plugin>
7836
<groupId>org.apache.felix</groupId>
7937
<artifactId>maven-bundle-plugin</artifactId>

0 commit comments

Comments
 (0)