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