1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugins.ear.it;
20
21 import java.io.File;
22 import java.io.FileInputStream;
23 import java.nio.file.Files;
24 import java.util.jar.JarFile;
25 import java.util.jar.Manifest;
26
27 import org.codehaus.plexus.util.FileUtils;
28
29
30
31
32 public class EarMojoIT extends AbstractEarPluginIT {
33
34
35
36
37 public void testProject001() throws Exception {
38 doTestProject("project-001", new String[] {"eartest-ejb-sample-one-1.0.jar"});
39 }
40
41
42
43
44 public void testProject002() throws Exception {
45 doTestProject("project-002", new String[] {"APP-INF/lib/eartest-ejb-sample-one-1.0.jar", "ejb-sample-two.jar"});
46 }
47
48
49
50
51 public void testProject003() throws Exception {
52 doTestProject("project-003", new String[] {
53 "eartest-ejb-sample-one-1.0.jar",
54 "APP-INF/lib/eartest-jar-sample-one-1.0.jar",
55 "APP-INF/lib/eartest-jar-sample-two-1.0.jar"
56 });
57 }
58
59
60
61
62 public void testProject004() throws Exception {
63 doTestProject("project-004", new String[] {
64 "eartest-ejb-sample-one-1.0.jar",
65 "eartest-jar-sample-one-1.0.jar",
66 "APP-INF/lib/eartest-jar-sample-two-1.0.jar"
67 });
68 }
69
70
71
72
73 public void testProject005() throws Exception {
74 doTestProject("project-005", new String[] {"eartest-ejb-sample-one-1.0.jar", "libs/another-name.jar"});
75 }
76
77
78
79
80 public void testProject006() throws Exception {
81 doTestProject("project-006", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-jar-sample-two-1.0.jar"});
82 }
83
84
85
86
87 public void testProject007() throws Exception {
88 doTestProject("project-007", new String[] {"eartest-ejb-sample-one-1.0-classified.jar"});
89 }
90
91
92
93
94 public void testProject008() throws Exception {
95 doTestProject("project-008", new String[] {"eartest-ejb-sample-one-1.0.jar"});
96 }
97
98
99
100
101 public void testProject009() throws Exception {
102 doTestProject("project-009", new String[] {"eartest-ejb-sample-one-1.0.jar"});
103 }
104
105
106
107
108 public void testProject010() throws Exception {
109 doTestProject("project-010", new String[] {"eartest-ejb-sample-one-1.0.jar"});
110 }
111
112
113
114
115 public void testProject011() throws Exception {
116 doTestProject("project-011", new String[] {"eartest-ejb-sample-one-1.0.jar"});
117 }
118
119
120
121
122 public void testProject012() throws Exception {
123 doTestProject("project-012", new String[] {"README.txt", "LICENSE.txt", "eartest-ejb-sample-one-1.0.jar"});
124 }
125
126
127
128
129 public void testProject013() throws Exception {
130 doTestProject("project-013", new String[] {"README.txt", "LICENSE.txt", "eartest-ejb-sample-one-1.0.jar"});
131 }
132
133
134
135
136 public void testProject014() throws Exception {
137 doTestProject("project-014", new String[] {"LICENSE.txt", "eartest-ejb-sample-one-1.0.jar"});
138 }
139
140
141
142
143 public void testProject015() throws Exception {
144 final File baseDir = doTestProject("project-015", new String[] {"eartest-ejb-sample-one-1.0.jar"});
145 final File expectedManifest = new File(baseDir, "src/main/application/META-INF/MANIFEST.MF");
146 final File actualManifest = new File(getEarDirectory(baseDir, "project-015"), "META-INF/MANIFEST.MF");
147 assertTrue("Manifest was not copied", actualManifest.exists());
148 assertTrue(FileUtils.contentEquals(expectedManifest, actualManifest));
149 }
150
151
152
153
154 public void testProject016() throws Exception {
155 final File baseDir = doTestProject("project-016", new String[] {"eartest-ejb-sample-one-1.0.jar"});
156
157 final File createdEarFile = getEarArchive(baseDir, "project-016");
158
159 final File sourceManifestFile = new File(baseDir, "src/main/ear/MANIFEST.MF");
160
161 try (JarFile jarFile = new JarFile(createdEarFile);
162 FileInputStream in = new FileInputStream(sourceManifestFile)) {
163 Manifest manifestFromCreatedEARFile = jarFile.getManifest();
164 Manifest sourceManifest = new Manifest(in);
165 assertEquals("There are differences in the manifest.", sourceManifest, manifestFromCreatedEARFile);
166 }
167 }
168
169
170
171
172 public void testProject017() throws Exception {
173 doTestProject("project-017", new String[] {"eartest-ejb-sample-one-1.0.jar"});
174 }
175
176
177
178
179 public void testProject018() throws Exception {
180 final File baseDir = executeMojo("project-018");
181 final File expectedFile = new File(baseDir, "target/my-custom-file.ear");
182 assertTrue("EAR archive not found", expectedFile.exists());
183 }
184
185
186
187
188 public void testProject019() throws Exception {
189 doTestProject(
190 "project-019",
191 new String[] {
192 "eartest-ejb-sample-one-1.0.jar", "eartest-sar-sample-one-1.0.sar", "eartest-jar-sample-one-1.0.jar"
193 },
194 new boolean[] {false, true, true});
195 }
196
197
198
199
200 public void testProject020() throws Exception {
201 doTestProject(
202 "project-020",
203 new String[] {
204 "eartest-ejb-sample-one-1.0.jar", "eartest-sar-sample-one-1.0.sar", "eartest-jar-sample-one-1.0.jar"
205 },
206 new boolean[] {true, false, false});
207 }
208
209
210
211
212 public void testProject021() throws Exception {
213 doTestProject(
214 "project-021",
215 new String[] {
216 "eartest-ejb-sample-one-1.0.jar",
217 "eartest-ejb-sample-two-1.0.jar",
218 "eartest-sar-sample-one-1.0.sar",
219 "eartest-jar-sample-one-1.0.jar",
220 "eartest-jar-sample-two-1.0.jar"
221 },
222 new boolean[] {false, true, false, false, true});
223 }
224
225
226
227
228 public void testProject022() throws Exception {
229 final File baseDir = executeMojo("project-022");
230 final File expectedFile = new File(baseDir, "target/maven-ear-plugin-test-project-022-99.0-myclassifier.ear");
231 assertTrue("EAR archive not found", expectedFile.exists());
232 }
233
234
235
236
237 public void testProject023() throws Exception {
238 doTestProject(
239 "project-023",
240 new String[] {"eartest-ejb-sample-one-1.0-classified.jar", "eartest-ejb-sample-two-1.0.jar"},
241 new boolean[] {true, false});
242 }
243
244
245
246
247 public void testProject024() throws Exception {
248 doTestProject(
249 "project-024",
250 new String[] {"eartest-ejb-sample-one-1.0-classified.jar", "eartest-ejb-sample-two-1.0.jar"},
251 new boolean[] {true, false});
252 }
253
254
255
256
257
258 public void testProject025() throws Exception {
259 doTestProject(
260 "project-025",
261 new String[] {"eartest-ejb-sample-one-1.0-classified.jar", "eartest-ejb-sample-one-1.0.jar"},
262 new boolean[] {true, false});
263 }
264
265
266
267
268
269 public void testProject026() throws Exception {
270 final File baseDir = executeMojo("project-026", false, true);
271
272 assertFalse(
273 "Execution should have failed",
274 getEarArchive(baseDir, "project-026").exists());
275 }
276
277
278
279
280 public void testProject027() throws Exception {
281 doTestProject("project-027", new String[] {"eartest-ejb-sample-one-1.0.jar"});
282 }
283
284
285
286
287 public void testProject028() throws Exception {
288 doTestProject("project-028", new String[] {"eartest-ejb-sample-one-1.0.jar"});
289 }
290
291
292
293
294 public void testProject029() throws Exception {
295 doTestProject("project-029", new String[] {"eartest-ejb-sample-one-1.0.jar"});
296 }
297
298
299
300
301
302 public void testProject030() throws Exception {
303 doTestProject(
304 "project-030",
305 new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0-client.jar"});
306 }
307
308
309
310
311
312 public void testProject031() throws Exception {
313 doTestProject("project-031", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
314 }
315
316
317
318
319 public void testProject032() throws Exception {
320 doTestProject("project-032", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
321 }
322
323
324
325
326 public void testProject033() throws Exception {
327 doTestProject("project-033", new String[] {
328 "eartest-ejb-sample-one-1.0.jar",
329 "eartest-ejb-sample-two-1.0.jar",
330 "eartest-sar-sample-one-1.0.sar",
331 "eartest-har-sample-one-1.0.har"
332 });
333 }
334
335
336
337
338 public void testProject034() throws Exception {
339 doTestProject("project-034", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
340 }
341
342
343
344
345 public void testProject035() throws Exception {
346 doTestProject("project-035", new String[] {
347 "foo/eartest-ejb-sample-one-1.0.jar",
348 "eartest-ejb-sample-two-1.0.jar",
349 "libs/eartest-jar-sample-one-1.0.jar",
350 "libs/eartest-jar-sample-two-1.0.jar",
351 "sar-sample-one.sar"
352 });
353 }
354
355
356
357
358
359 public void testProject036() throws Exception {
360 doTestProject("project-036", new String[] {
361 "foo/eartest-ejb-sample-one-1.0.jar",
362 "eartest-ejb-sample-two-1.0.jar",
363 "com.foo.bar-ejb-sample-one-1.0.jar",
364 "com.foo.bar-ejb-sample-two-1.0.jar",
365 "libs/eartest-jar-sample-one-1.0.jar",
366 "libs/eartest-jar-sample-two-1.0.jar",
367 "sar-sample-one.sar"
368 });
369 }
370
371
372
373
374
375 public void testProject037() throws Exception {
376 doTestProject(
377 "project-037",
378 new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0-client.jar"});
379 }
380
381
382
383
384
385 public void testProject038() throws Exception {
386 doTestProject(
387 "project-038",
388 new String[] {"eartest-ejb-sample-one-1.0-classified.jar", "eartest-ejb-sample-one-1.0.jar"},
389 new boolean[] {false, true});
390 }
391
392
393
394
395 public void testProject039() throws Exception {
396 doTestProject("project-039", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
397 }
398
399
400
401
402 public void testProject040() throws Exception {
403 doTestProject("project-040", new String[] {"eartest-ejb-sample-one-1.0.jar"});
404 }
405
406
407
408
409 public void testProject041() throws Exception {
410 doTestProject("project-041", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
411 }
412
413
414
415
416 public void testProject042() throws Exception {
417 doTestProject("project-042", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
418 }
419
420
421
422
423 public void testProject043() throws Exception {
424 final File baseDir = doTestProject("project-043", new String[] {"eartest-ejb-sample-one-1.0.jar"});
425 final File expectedApplicationXml = new File(baseDir, "target/custom-descriptor-dir/application.xml");
426 assertTrue("Application.xml file not found", expectedApplicationXml.exists());
427 assertFalse("Application.xml file should not be empty", expectedApplicationXml.length() == 0);
428 }
429
430
431
432
433 public void testProject044() throws Exception {
434 doTestProject(
435 "project-044",
436 new String[] {"eartest-ejb-sample-one-1.0.jar", "myLibs/eartest-jar-sample-one-1.0.jar"});
437 }
438
439
440
441
442 public void testProject045() throws Exception {
443 final File baseDir =
444 doTestProject("project-045", new String[] {"README.txt", "eartest-ejb-sample-one-1.0.jar"});
445 final File actualReadme = new File(getEarDirectory(baseDir, "project-045"), "README.txt");
446 final String content = new String(Files.readAllBytes(actualReadme.toPath()), "UTF-8");
447 assertTrue("application name and version was not filtered properly", content.contains("my-app 99.0"));
448 assertTrue("Escaping did not work properly", content.contains("will not be filtered ${application.name}."));
449 }
450
451
452
453
454 public void testProject046() throws Exception {
455 final File baseDir =
456 doTestProject("project-046", new String[] {"README.txt", "eartest-ejb-sample-one-1.0.jar"});
457 final File actualReadme = new File(getEarDirectory(baseDir, "project-046"), "README.txt");
458 final String content = new String(Files.readAllBytes(actualReadme.toPath()), "UTF-8");
459 assertTrue("application name and version was not filtered properly", content.contains("my-app 99.0"));
460 assertTrue("application build was not filtered properly", content.contains("(Build 2)"));
461 assertTrue(
462 "Unknown property should not have been filtered",
463 content.contains("will not be filtered ${application.unknown}."));
464 }
465
466
467
468
469 public void testProject047() throws Exception {
470 final File baseDir =
471 doTestProject("project-047", new String[] {"README.txt", "eartest-ejb-sample-one-1.0.jar"});
472 final File actualReadme = new File(getEarDirectory(baseDir, "project-047"), "README.txt");
473 final String content = new String(Files.readAllBytes(actualReadme.toPath()), "UTF-8");
474 assertTrue("application name and version should not have been filtered", !content.contains("my-app 99.0"));
475 assertTrue("original properties not found", content.contains("${application.name} ${project.version}"));
476 }
477
478
479
480
481 public void testProject048() throws Exception {
482 doTestProject("project-048", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
483 }
484
485
486
487
488 public void testProject049() throws Exception {
489 doTestProject("project-049", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
490 }
491
492
493
494
495 public void testProject050() throws Exception {
496 doTestProject("project-050", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
497 }
498
499
500
501
502 public void testProject051() throws Exception {
503 doTestProject("project-051", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
504 }
505
506
507
508
509 public void testProject052() throws Exception {
510 doTestProject("project-052", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
511 }
512
513
514
515
516 public void testProject053() throws Exception {
517 doTestProject("project-053", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
518 }
519
520
521
522
523 public void testProject054() throws Exception {
524 doTestProject("project-054", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
525 }
526
527
528
529
530 public void testProject055() throws Exception {
531 doTestProject("project-055", new String[] {
532 "eartest-jar-sample-one-1.0.jar",
533 "eartest-jar-sample-two-1.0.jar",
534 "eartest-jar-sample-three-with-deps-1.0.jar"
535 });
536 }
537
538
539
540
541 public void testProject056() throws Exception {
542 doTestProject("project-056", new String[] {"eartest-ejb-sample-one-1.0.jar"});
543 }
544
545
546
547
548 public void testProject057() throws Exception {
549 doTestProject("project-057", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
550 }
551
552
553
554
555 public void testProject058() throws Exception {
556 doTestProject("project-058", new String[] {"eartest-ejb-sample-one-1.0.jar"});
557 }
558
559
560
561
562 public void testProject059() throws Exception {
563 doTestProject("project-059", new String[] {"eartest-ejb-sample-one-1.0.jar"});
564 }
565
566
567
568
569 public void testProject060() throws Exception {
570 doTestProject(
571 "project-060",
572 new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0-client.jar"});
573 }
574
575
576
577
578 public void testProject061() throws Exception {
579 doTestProject(
580 "project-061",
581 new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0-client.jar"});
582 }
583
584
585
586
587 public void testProject062() throws Exception {
588 doTestProject(
589 "project-062",
590 new String[] {"eartest-ejb-sample-one-1.0.jar", "lib/eartest-ejb-sample-two-1.0-client.jar"});
591 }
592
593
594
595
596 public void testProject063() throws Exception {
597 doTestProject("project-063", new String[] {"lib/eartest-ejb-sample-two-1.0-client.jar"});
598 }
599
600
601
602
603 public void testProject064() throws Exception {
604 doTestProject(
605 "project-064",
606 new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0-client.jar"});
607 }
608
609
610
611
612 public void testProject065() throws Exception {
613 doTestProject("project-065", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
614 }
615
616
617
618
619 public void testProject066() throws Exception {
620 doTestProject("project-066", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
621 }
622
623
624
625
626 public void testProject067() throws Exception {
627 doTestProject("project-067", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
628 }
629
630
631
632
633 public void testProject068() throws Exception {
634 doTestProject("project-068", new String[] {"eartest-ejb-sample-one.jar", "eartest-ejb-sample-two.jar"});
635 }
636
637
638
639
640 public void testProject069() throws Exception {
641 doTestProject(
642 "project-069",
643 new String[] {"eartest-ejb-sample-one-1.0.jar", "myLibs/eartest-jar-sample-one-1.0.jar"});
644 }
645
646
647
648
649 public void testProject070() throws Exception {
650 doTestProject("project-070", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-jar-sample-one-1.0.jar"});
651 }
652
653
654
655
656 public void testProject071() throws Exception {
657 doTestProject("project-071", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-jar-sample-one-1.0.jar"});
658 }
659
660
661
662
663 public void testProject072() throws Exception {
664 doTestProject(
665 "project-072",
666 new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-app-client-sample-one-1.0.jar"});
667 }
668
669
670
671
672 public void testProject073() throws Exception {
673 doTestProject("project-073", new String[] {
674 "eartest-ejb-sample-one-1.0.jar",
675 "eartest-app-client-sample-one-1.0.jar",
676 "APP-INF/lib/eartest-jar-sample-one-1.0.jar",
677 "APP-INF/lib/eartest-jar-sample-two-1.0.jar"
678 });
679 }
680
681
682
683
684
685 public void testProject074() throws Exception {
686 doTestProject("project-074", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
687 }
688
689
690
691
692
693 public void testProject075() throws Exception {
694 doTestProject("project-075", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
695 }
696
697
698
699
700
701 public void testProject076() throws Exception {
702 doTestProject("project-076", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
703 }
704
705
706
707
708 public void testProject077() throws Exception {
709 doTestProject("project-077", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
710 }
711
712
713
714
715 public void testProject078() throws Exception {
716 doTestProject("project-078", new String[] {"ejb-sample-one.jar", "war-sample-one.war", "jar-sample-two.jar"});
717 }
718
719
720
721
722 public void testProject079() throws Exception {
723 doTestProject(
724 "project-079",
725 new String[] {"eartest-ejb-sample-one-1.0.jar", "myLibs/eartest-jar-sample-one-1.0.jar"});
726 }
727
728
729
730
731 public void testProject080() throws Exception {
732 doTestProject(
733 "project-080",
734 new String[] {"eartest-ejb-sample-one-1.0.jar", "myLibs/eartest-jar-sample-one-1.0.jar"});
735 }
736
737
738
739
740 public void testProject081() throws Exception {
741 doTestProject(
742 "project-081",
743 new String[] {"eartest-ejb-sample-one-1.0.jar", "myLibs/eartest-jar-sample-one-1.0.jar"});
744 }
745
746
747
748
749 public void testProject082() throws Exception {
750 doTestProject("project-082", new String[] {"eartest-ejb-sample-one-1.0.jar"});
751 }
752
753
754
755
756
757 public void testProject083() throws Exception {
758 doTestProject("project-083", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
759 }
760
761
762
763
764 public void testProject084() throws Exception {
765 doTestProject("project-084", new String[] {"eartest-ejb-sample-one-1.0.jar"});
766 }
767
768
769
770
771 public void testProject085() throws Exception {
772 doTestProject("project-085", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
773 }
774
775
776
777
778 public void testProject086() throws Exception {
779 doTestProject("project-086", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
780 }
781
782
783
784
785 public void testProject087() throws Exception {
786 doTestProject("project-087", new String[] {"eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar"});
787 }
788
789
790
791
792
793 public void testProject088() throws Exception {
794 final String warModule = "eartest-war-sample-two-1.0.war";
795 final String ejbModule = "eartest-ejb-sample-one-1.0.jar";
796 final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
797 final String[] expectedArtifacts = {warModule, ejbModule, jarSampleTwoLibrary};
798 final boolean[] artifactsDirectory = {false, true, false};
799 final String[] artifactsToValidateManifest = {warModule, ejbModule};
800 final boolean[] artifactsToValidateManifestDirectory = {false, true};
801 final String[][] expectedClassPathElements = {{jarSampleTwoLibrary}, {jarSampleTwoLibrary}};
802
803
804
805 doTestProject(
806 "project-088",
807 "ear",
808 expectedArtifacts,
809 artifactsDirectory,
810 artifactsToValidateManifest,
811 artifactsToValidateManifestDirectory,
812 expectedClassPathElements,
813 true);
814
815 doTestProject(
816 "project-088",
817 "ear",
818 expectedArtifacts,
819 artifactsDirectory,
820 artifactsToValidateManifest,
821 artifactsToValidateManifestDirectory,
822 expectedClassPathElements,
823 false);
824 }
825
826
827
828
829
830
831
832
833 public void testProject089() throws Exception {
834 final String warModule = "eartest-war-sample-three-1.0.war";
835 final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
836 final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
837 final String jarSampleThreeLibrary = "lib/eartest-jar-sample-three-with-deps-1.0.jar";
838 doTestProject(
839 "project-089",
840 "ear",
841 new String[] {warModule, ejbModule, jarSampleTwoLibrary, jarSampleThreeLibrary},
842 new boolean[] {false, false, false, false},
843 new String[] {warModule, ejbModule},
844 new boolean[] {false, false},
845 new String[][] {
846 {jarSampleTwoLibrary, jarSampleThreeLibrary}, {jarSampleThreeLibrary, jarSampleTwoLibrary}
847 },
848 true);
849 }
850
851
852
853
854
855
856
857
858 public void testProject090() throws Exception {
859 final String warModule = "eartest-war-sample-three-1.0.war";
860 final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
861 final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
862 final String jarSampleThreeLibrary = "lib/eartest-jar-sample-three-with-deps-1.0.jar";
863 doTestProject(
864 "project-090",
865 "ear",
866 new String[] {warModule, ejbModule, jarSampleTwoLibrary, jarSampleThreeLibrary},
867 new boolean[] {false, false, false, false},
868 new String[] {warModule, ejbModule},
869 new boolean[] {false, false},
870 new String[][] {{jarSampleTwoLibrary}, {jarSampleThreeLibrary, jarSampleTwoLibrary}},
871 true);
872 }
873
874
875
876
877
878
879
880
881
882 public void testProject091() throws Exception {
883 final String warModule = "eartest-war-sample-three-1.0.war";
884 final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
885 final String jarSampleTwoLibrary = "eartest-jar-sample-two-1.0.jar";
886 final String jarSampleThreeLibrary = "eartest-jar-sample-three-with-deps-1.0.jar";
887 doTestProject(
888 "project-091",
889 "ear",
890 new String[] {warModule, ejbModule, jarSampleTwoLibrary, jarSampleThreeLibrary},
891 new boolean[] {false, true, false, false},
892 new String[] {warModule, ejbModule},
893 new boolean[] {false, true},
894 new String[][] {{"jar-sample-two-1.0.jar"}, {jarSampleThreeLibrary, jarSampleTwoLibrary}},
895 true);
896 }
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912 public void testProject092() throws Exception {
913 final String projectName = "project-092";
914 final String earModuleName = "ear";
915 final String jarSampleOneLibrary = "jar-sample-one-1.0.jar";
916 final String jarSampleTwoLibrary = "jar-sample-two-1.0.jar";
917 final String jarSampleThreeLibrary = "jar-sample-three-with-deps-1.0.jar";
918 final String jarSampleOneEarLibrary = "libs/eartest-" + jarSampleOneLibrary;
919 final String jarSampleTwoEarLibrary = "libs/eartest-" + jarSampleTwoLibrary;
920 final String jarSampleThreeEarLibrary = "libs/eartest-" + jarSampleThreeLibrary;
921 final String warModule = "eartest-war-sample-three-1.0.war";
922 final String sarModuleTwo = "eartest-sar-sample-two-1.0.sar";
923 final String sarModuleThree = "eartest-sar-sample-three-1.0.sar";
924 final String sarModuleFour = "eartest-sar-sample-four-1.0.sar";
925 final String harModule = "eartest-har-sample-two-1.0.har";
926 final String rarModule = "eartest-rar-sample-one-1.0.rar";
927 final String[] earModules = {warModule, sarModuleTwo, sarModuleThree, sarModuleFour, harModule, rarModule};
928 final boolean[] earModuleDirectory = {false, false, false, false, false, false};
929 final String warModuleLibDir = "WEB-INF/lib/";
930 final String sarModuleTwoLibDir = "libraries/";
931 final String sarModuleThreeLibDir = "";
932 final String sarModuleFourLibDir = "lib/";
933 final String harModuleLibDir = "lib/";
934 final String rarModuleLibDir = "";
935
936 final File baseDir = doTestProject(
937 projectName,
938 earModuleName,
939 new String[] {
940 warModule,
941 sarModuleTwo,
942 sarModuleThree,
943 sarModuleFour,
944 harModule,
945 rarModule,
946 jarSampleOneEarLibrary,
947 jarSampleTwoEarLibrary,
948 jarSampleThreeEarLibrary
949 },
950 new boolean[] {false, false, false, false, false, false, false, false, false},
951 earModules,
952 earModuleDirectory,
953 new String[][] {
954 {jarSampleTwoEarLibrary, jarSampleOneEarLibrary, jarSampleThreeEarLibrary},
955 {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, jarSampleOneEarLibrary},
956 {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, jarSampleOneEarLibrary},
957 {jarSampleOneEarLibrary, jarSampleTwoEarLibrary, jarSampleThreeEarLibrary},
958 {jarSampleOneEarLibrary, jarSampleThreeEarLibrary, jarSampleTwoEarLibrary},
959 {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, jarSampleOneEarLibrary}
960 },
961 true);
962
963 assertEarModulesContent(
964 baseDir,
965 projectName,
966 earModuleName,
967 earModules,
968 earModuleDirectory,
969 new String[][] {
970 {warModuleLibDir},
971 {sarModuleTwoLibDir},
972 {sarModuleThreeLibDir},
973 {sarModuleFourLibDir + jarSampleOneLibrary},
974 {harModuleLibDir},
975 {rarModuleLibDir}
976 },
977 new String[][] {
978 {warModuleLibDir + jarSampleTwoLibrary},
979 {sarModuleTwoLibDir + jarSampleTwoLibrary, sarModuleTwoLibDir + jarSampleThreeLibrary},
980 {sarModuleThreeLibDir + jarSampleTwoLibrary, sarModuleThreeLibDir + jarSampleThreeLibrary},
981 {},
982 {
983 harModuleLibDir + jarSampleOneLibrary,
984 harModuleLibDir + jarSampleTwoLibrary,
985 harModuleLibDir + jarSampleThreeLibrary
986 },
987 {rarModuleLibDir + jarSampleTwoLibrary, rarModuleLibDir + jarSampleThreeLibrary}
988 });
989 }
990
991
992
993
994
995
996
997
998
999
1000 public void testProject093() throws Exception {
1001 final String projectName = "project-093";
1002 final String earModuleName = "ear";
1003 final String jarSampleOneLibrary = "jar-sample-one-1.0.jar";
1004 final String jarSampleTwoLibrary = "jar-sample-two-1.0.jar";
1005 final String jarSampleThreeLibrary = "jar-sample-three-with-deps-1.0.jar";
1006 final String jarSampleTwoEarLibrary = "lib/eartest-" + jarSampleTwoLibrary;
1007 final String jarSampleThreeEarLibrary = "lib/eartest-" + jarSampleThreeLibrary;
1008 final String warModule = "eartest-war-sample-three-1.0.war";
1009 final String sarModule = "eartest-sar-sample-two-1.0.sar";
1010 final String harModule = "eartest-har-sample-two-1.0.har";
1011 final String rarModule = "eartest-rar-sample-one-1.0.rar";
1012 final String[] earModules = {warModule, sarModule, harModule, rarModule};
1013 final boolean[] earModuleDirectory = {false, false, false, false};
1014 final String warModuleLibDir = "WEB-INF/lib/";
1015 final String sarModuleLibDir = "lib/";
1016 final String harModuleLibDir = "lib/";
1017 final String rarModuleLibDir = "";
1018
1019 final File baseDir = doTestProject(
1020 projectName,
1021 earModuleName,
1022 new String[] {
1023 warModule, sarModule, harModule, rarModule, jarSampleTwoEarLibrary, jarSampleThreeEarLibrary
1024 },
1025 new boolean[] {false, false, false, false, false, false},
1026 earModules,
1027 earModuleDirectory,
1028 new String[][] {
1029 {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary},
1030 {jarSampleThreeLibrary, jarSampleTwoLibrary, jarSampleOneLibrary},
1031 null,
1032 {jarSampleOneLibrary, jarSampleThreeLibrary, jarSampleTwoLibrary}
1033 },
1034 true);
1035
1036 assertEarModulesContent(
1037 baseDir,
1038 projectName,
1039 earModuleName,
1040 earModules,
1041 earModuleDirectory,
1042 new String[][] {
1043 {warModuleLibDir},
1044 {
1045 sarModuleLibDir + jarSampleOneLibrary,
1046 sarModuleLibDir + jarSampleTwoLibrary,
1047 sarModuleLibDir + jarSampleThreeLibrary
1048 },
1049 {
1050 harModuleLibDir + jarSampleOneLibrary,
1051 harModuleLibDir + jarSampleTwoLibrary,
1052 harModuleLibDir + jarSampleThreeLibrary
1053 },
1054 {
1055 rarModuleLibDir + jarSampleOneLibrary,
1056 rarModuleLibDir + jarSampleTwoLibrary,
1057 rarModuleLibDir + jarSampleThreeLibrary
1058 }
1059 },
1060 new String[][] {
1061 {warModuleLibDir + jarSampleTwoLibrary, warModuleLibDir + jarSampleThreeLibrary},
1062 {},
1063 {},
1064 {}
1065 });
1066 }
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082 public void testProject094() throws Exception {
1083 final String projectName = "project-094";
1084 final String earModuleName = "ear";
1085 final String jarSampleOneLibrary = "jar-sample-one-1.0.jar";
1086 final String jarSampleTwoLibrary = "jar-sample-two-1.0.jar";
1087 final String jarSampleThreeLibrary = "jar-sample-three-with-deps-1.0.jar";
1088 final String jarSampleTwoEarLibrary = "lib/eartest-" + jarSampleTwoLibrary;
1089 final String jarSampleThreeEarLibrary = "lib/eartest-" + jarSampleThreeLibrary;
1090 final String warModule = "eartest-war-sample-three-1.0.war";
1091 final String sarModule = "eartest-sar-sample-two-1.0.sar";
1092 final String harModule = "eartest-har-sample-two-1.0.har";
1093 final String rarModule = "eartest-rar-sample-one-1.0.rar";
1094 final String ejbModule = "eartest-ejb-sample-three-1.0.jar";
1095 final String[] earModules = {warModule, sarModule, harModule, rarModule, ejbModule};
1096 final boolean[] earModuleDirectory = {false, false, false, false, false};
1097 final String warModuleLibDir = "WEB-INF/lib/";
1098 final String sarModuleLibDir = "lib/";
1099 final String harModuleLibDir = "lib/";
1100 final String rarModuleLibDir = "";
1101
1102 final File baseDir = doTestProject(
1103 projectName,
1104 earModuleName,
1105 new String[] {
1106 warModule,
1107 sarModule,
1108 harModule,
1109 rarModule,
1110 ejbModule,
1111 jarSampleTwoEarLibrary,
1112 jarSampleThreeEarLibrary
1113 },
1114 new boolean[] {false, false, false, false, false, false, false},
1115 earModules,
1116 earModuleDirectory,
1117 new String[][] {null, null, null, null, new String[] {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary}
1118 },
1119 true);
1120
1121 assertEarModulesContent(
1122 baseDir,
1123 projectName,
1124 earModuleName,
1125 earModules,
1126 earModuleDirectory,
1127 new String[][] {
1128 {warModuleLibDir + jarSampleTwoLibrary, warModuleLibDir + jarSampleThreeLibrary},
1129 {
1130 sarModuleLibDir + jarSampleOneLibrary,
1131 sarModuleLibDir + jarSampleTwoLibrary,
1132 sarModuleLibDir + jarSampleThreeLibrary
1133 },
1134 {
1135 harModuleLibDir + jarSampleOneLibrary,
1136 harModuleLibDir + jarSampleTwoLibrary,
1137 harModuleLibDir + jarSampleThreeLibrary
1138 },
1139 {
1140 rarModuleLibDir + jarSampleOneLibrary,
1141 rarModuleLibDir + jarSampleTwoLibrary,
1142 rarModuleLibDir + jarSampleThreeLibrary
1143 },
1144 null
1145 },
1146 null);
1147 }
1148
1149
1150
1151
1152
1153 public void testProject095() throws Exception {
1154 final String warModule = "eartest-war-sample-two-1.0.war";
1155 final String jarSampleTwoLibrary = "lib/eartest-jar-sample-two-1.0.jar";
1156 final String jarSampleThreeLibrary = "lib/eartest-jar-sample-three-with-deps-1.0.jar";
1157 final String jarSampleFourTestLibrary = "lib/eartest-jar-sample-four-1.0-tests.jar";
1158 doTestProject(
1159 "project-095",
1160 "ear",
1161 new String[] {warModule, jarSampleTwoLibrary, jarSampleThreeLibrary, jarSampleFourTestLibrary},
1162 new boolean[] {false, false, false, false},
1163 new String[] {warModule},
1164 new boolean[] {false},
1165 new String[][] {{jarSampleFourTestLibrary, jarSampleThreeLibrary, jarSampleTwoLibrary}},
1166 true);
1167 }
1168
1169
1170
1171
1172
1173 public void testProject096() throws Exception {
1174 final String warModule = "eartest-war-sample-two-1.0.war";
1175 final String jarSampleTwoLibrary = "eartest-jar-sample-two-1.0.jar";
1176 final String jarSampleThreeLibrary = "eartest-jar-sample-three-with-deps-1.0.jar";
1177 final String jarSampleFourTestLibrary = "eartest-jar-sample-four-1.0-tests.jar";
1178 final String jarSampleFiveLibrary = "eartest-jar-sample-five-1.0.jar";
1179 doTestProject(
1180 "project-096",
1181 "ear",
1182 new String[] {
1183 warModule,
1184 jarSampleTwoLibrary,
1185 jarSampleThreeLibrary,
1186 jarSampleFourTestLibrary,
1187 jarSampleFiveLibrary
1188 },
1189 new boolean[] {false, false, false, false, false},
1190 new String[] {warModule},
1191 new boolean[] {false},
1192 new String[][] {
1193 {jarSampleFourTestLibrary, jarSampleFiveLibrary, jarSampleThreeLibrary, jarSampleTwoLibrary}
1194 },
1195 true);
1196 }
1197
1198
1199
1200
1201
1202 public void testProject097() throws Exception {
1203 final String warModule = "eartest-war-sample-three-1.0.war";
1204 final String sarSampleTwo = "eartest-sar-sample-two-1.0.sar";
1205 final String harSampleTwo = "eartest-har-sample-two-1.0.har";
1206 final String parSampleTwo = "eartest-par-sample-one-1.0.par";
1207 final String[] artifacts = {warModule, sarSampleTwo, harSampleTwo, parSampleTwo};
1208 final boolean[] artifactsDirectory = {false, false, false, false};
1209 doTestProject("project-097", "ear", artifacts, artifactsDirectory, null, null, null, true);
1210 }
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222 public void testProject098() throws Exception {
1223 final String projectName = "project-098";
1224 final String earModuleName = "ear";
1225 final String jarSampleOneLibrary = "jar-sample-one-1.0.jar";
1226 final String jarSampleTwoLibrary = "jar-sample-two-1.0.jar";
1227 final String jarSampleThreeLibrary = "jar-sample-three-with-deps-1.0.jar";
1228 final String ejbFourClientLibrary = "ejb-sample-four-1.0-client.jar";
1229 final String jarSampleOneEarLibrary = "lib/eartest-" + jarSampleOneLibrary;
1230 final String jarSampleTwoEarLibrary = "lib/eartest-" + jarSampleTwoLibrary;
1231 final String jarSampleThreeEarLibrary = "lib/eartest-" + jarSampleThreeLibrary;
1232 final String ejbFourClientEarLibrary = "lib/eartest-" + ejbFourClientLibrary;
1233 final String ejbThreeLibrary = "ejb-sample-three-1.0.jar";
1234 final String ejbFourLibrary = "ejb-sample-four-1.0.jar";
1235 final String ejbThreeModule = "eartest-" + ejbThreeLibrary;
1236 final String ejbFourModule = "eartest-" + ejbFourLibrary;
1237 final String rarLibrary = "rar-sample-one-1.0.rar";
1238 final String rarModule = "eartest-" + rarLibrary;
1239 final String warModule = "eartest-war-sample-three-1.0.war";
1240 final String[] earModules = {ejbThreeModule, ejbFourModule, rarModule, warModule};
1241 final boolean[] earModuleDirectory = {false, false, false, false};
1242 final String warModuleLibDir = "WEB-INF/lib/";
1243 final String rarModuleLibDir = "";
1244
1245 final File baseDir = doTestProject(
1246 projectName,
1247 earModuleName,
1248 new String[] {
1249 ejbThreeModule,
1250 ejbFourModule,
1251 rarModule,
1252 warModule,
1253 jarSampleOneEarLibrary,
1254 jarSampleTwoEarLibrary,
1255 jarSampleThreeEarLibrary,
1256 ejbFourClientEarLibrary
1257 },
1258 new boolean[] {false, false, false, false, false, false, false, false},
1259 earModules,
1260 earModuleDirectory,
1261 new String[][] {
1262 {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, ejbFourClientEarLibrary, jarSampleOneEarLibrary},
1263 {jarSampleOneEarLibrary, jarSampleTwoEarLibrary, jarSampleThreeEarLibrary, ejbFourClientEarLibrary},
1264 {jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, jarSampleOneEarLibrary, ejbFourClientEarLibrary},
1265 {jarSampleOneEarLibrary, jarSampleThreeEarLibrary, jarSampleTwoEarLibrary, ejbFourClientEarLibrary}
1266 },
1267 true);
1268
1269 assertEarModulesContent(
1270 baseDir,
1271 projectName,
1272 earModuleName,
1273 earModules,
1274 earModuleDirectory,
1275 new String[][] {null, null, null, {warModuleLibDir}},
1276 new String[][] {
1277 null,
1278 null,
1279 {
1280 rarModuleLibDir + jarSampleTwoLibrary,
1281 rarModuleLibDir + jarSampleThreeLibrary,
1282 rarModuleLibDir + ejbFourLibrary,
1283 rarModuleLibDir + ejbFourClientLibrary,
1284 },
1285 {
1286 warModuleLibDir + jarSampleOneLibrary,
1287 rarModuleLibDir + jarSampleThreeLibrary,
1288 rarModuleLibDir + jarSampleTwoLibrary,
1289 warModuleLibDir + ejbThreeLibrary,
1290 warModuleLibDir + ejbFourLibrary,
1291 warModuleLibDir + ejbFourClientLibrary,
1292 warModuleLibDir + rarLibrary,
1293 warModuleLibDir + rarLibrary
1294 }
1295 });
1296 }
1297
1298
1299
1300
1301 public void testProject099() throws Exception {
1302 doTestProject("project-099", new String[] {"eartest-ejb-sample-one-1.0.jar"});
1303 }
1304
1305
1306
1307
1308 public void testProject100() throws Exception {
1309 doTestProject("project-100", new String[] {"eartest-ejb-sample-one-1.0.jar"});
1310 }
1311
1312
1313
1314
1315 public void testProject101() throws Exception {
1316 String[] expectedArtifacts = new String[] {
1317 "eartest-jar-sample-one-1.0.jar",
1318 "eartest-jar-sample-two-1.0.jar",
1319 "eartest-jar-sample-three-with-deps-1.0.jar"
1320 };
1321
1322 doTestProject("project-101", expectedArtifacts, true);
1323 doTestProject("project-101", expectedArtifacts, false);
1324 }
1325
1326
1327
1328
1329 public void testProject102() throws Exception {
1330 doTestProject("project-102", new String[] {"eartest-ejb-sample-one-1.0.jar"});
1331 }
1332 }