Skip to content

Commit 8aaf4c8

Browse files
committed
Merge pull request motech#415 from lkukielka/MOTECH-1450
MOTECH-1450 Fixed copying jars and standalone admin test
2 parents 1be6998 + 144b235 commit 8aaf4c8

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
@@ -313,6 +313,53 @@
313313
<groupId>com.github.searls</groupId>
314314
<artifactId>jasmine-maven-plugin</artifactId>
315315
</plugin>
316+
<plugin>
317+
<groupId>org.apache.maven.plugins</groupId>
318+
<artifactId>maven-dependency-plugin</artifactId>
319+
<version>2.10</version>
320+
<executions>
321+
<execution>
322+
<id>copy-upload-test-bundle-to-target</id>
323+
<phase>package</phase>
324+
<goals>
325+
<goal>copy</goal>
326+
</goals>
327+
<configuration>
328+
<artifactItems>
329+
<artifactItem>
330+
<groupId>${project.groupId}</groupId>
331+
<artifactId>motech-upload-test-bundle</artifactId>
332+
<version>${project.version}</version>
333+
<type>jar</type>
334+
<overWrite>true</overWrite>
335+
<outputDirectory>target/test-bundle/</outputDirectory>
336+
<destFileName>motech-upload-test-bundle.jar</destFileName>
337+
</artifactItem>
338+
</artifactItems>
339+
</configuration>
340+
</execution>
341+
<execution>
342+
<id>copy-upload-test-bundle</id>
343+
<phase>package</phase>
344+
<goals>
345+
<goal>copy</goal>
346+
</goals>
347+
<configuration>
348+
<artifactItems>
349+
<artifactItem>
350+
<groupId>${project.groupId}</groupId>
351+
<artifactId>motech-upload-test-bundle</artifactId>
352+
<version>${project.version}</version>
353+
<type>jar</type>
354+
<overWrite>true</overWrite>
355+
<outputDirectory>${user.home}/.motech/bundles</outputDirectory>
356+
<destFileName>motech-upload-test-bundle.jar</destFileName>
357+
</artifactItem>
358+
</artifactItems>
359+
</configuration>
360+
</execution>
361+
</executions>
362+
</plugin>
316363
</plugins>
317364
</build>
318365

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)