1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.eclipse.it;
20
21 import java.io.File;
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.Properties;
25
26 import org.apache.maven.plugin.MojoExecutionException;
27 import org.apache.maven.plugin.eclipse.TempEclipseWorkspace;
28
29
30
31
32
33
34 public class EclipsePluginIT
35 extends AbstractEclipsePluginIT
36 {
37 protected void setUp()
38 throws Exception
39 {
40 super.setUp();
41 }
42
43
44
45
46
47 public void testDynamicWorkspaceLookup()
48 throws Exception
49 {
50 File basedir =
51 new File( TempEclipseWorkspace.getFixtureEclipseDynamicWorkspace().workspaceLocation, "project-Z" );
52 testProject( basedir );
53 }
54
55 public void testProject01()
56 throws Exception
57 {
58 testProject( "project-01" );
59 }
60
61 public void testProject02()
62 throws Exception
63 {
64 testProject( "project-02" );
65 }
66
67 public void testProject03()
68 throws Exception
69 {
70 testProject( "project-03" );
71 }
72
73 public void testProject04()
74 throws Exception
75 {
76 testProject( "project-04" );
77 }
78
79 public void testProject05()
80 throws Exception
81 {
82 testProject( "project-05" );
83 }
84
85 public void testProject06()
86 throws Exception
87 {
88 testProject( "project-06" );
89 }
90
91
92
93
94 public void testProject07()
95 throws Exception
96 {
97
98 testProject( "project-07" );
99 }
100
101 public void testProject08()
102 throws Exception
103 {
104 testProject( "project-08" );
105 }
106
107
108
109
110
111
112 public void testProject09()
113 throws Exception
114 {
115 testProject( "project-09" );
116 }
117
118 public void testProject10()
119 throws Exception
120 {
121 testProject( "project-10" );
122 }
123
124 public void testProject11()
125 throws Exception
126 {
127 testProject( "project-11" );
128 }
129
130
131
132
133
134
135 public void testProject12()
136 throws Exception
137 {
138 testProject( "project-12" );
139 }
140
141
142
143
144
145
146 public void testProject13()
147 throws Exception
148 {
149 testProject( "project-13" );
150 }
151
152
153
154
155
156
157 public void testProject14()
158 throws Exception
159 {
160 testProject( "project-14" );
161 }
162
163
164
165
166
167
168 public void testProject15()
169 throws Exception
170 {
171 Properties props = new Properties();
172 props.put( "outputDirectory", "bin" );
173 testProject( "project-15", props, "clean", "eclipse" );
174 }
175
176
177
178
179
180
181 public void testProject16()
182 throws Exception
183 {
184
185 testProject( "project-16" );
186 }
187
188
189
190
191
192
193 public void testProject17()
194 throws Exception
195 {
196
197 testProject( "project-17" );
198 }
199
200
201
202
203
204
205 public void testProject18()
206 throws Exception
207 {
208 testProject( "project-18" );
209 }
210
211
212
213
214
215
216 public void testProject19()
217 throws Exception
218 {
219 testProject( "project-19" );
220 }
221
222
223
224
225
226
227 public void testProject20()
228 throws Exception
229 {
230 testProject( "project-20" );
231 }
232
233
234
235
236
237
238 public void testProject21()
239 throws Exception
240 {
241 testProject( "project-21" );
242 }
243
244
245
246
247
248
249 public void testProject22()
250 throws Exception
251 {
252 testProject( "project-22" );
253 }
254
255
256
257
258
259
260 public void testProject23()
261 throws Exception
262 {
263 testProject( "project-23" );
264 }
265
266
267
268
269
270
271 public void testProject24()
272 throws Exception
273 {
274 testProject( "project-24" );
275 }
276
277
278
279
280
281
282 public void testProject25()
283 throws Exception
284 {
285 testProject( "project-25" );
286 }
287
288
289
290
291
292
293 public void testProject26()
294 throws Exception
295 {
296 testProject( "project-26" );
297 }
298
299
300
301
302
303
304 public void testProject27()
305 throws Exception
306 {
307 testProject( "project-27" );
308 }
309
310
311
312
313
314
315 public void testProject28()
316 throws Exception
317 {
318 testProject( "project-28/module-1" );
319 }
320
321
322
323
324
325
326 public void testProject29()
327 throws Exception
328 {
329 testProject( "project-29" );
330 }
331
332
333
334
335
336
337 public void testProject30()
338 throws Exception
339 {
340 testProject( "project-30" );
341 }
342
343
344
345
346
347
348 public void testProject31()
349 throws Exception
350 {
351 try
352 {
353 testProject( "project-31" );
354
355
356
357 }
358 catch ( MojoExecutionException e )
359 {
360
361 }
362 }
363
364
365
366
367
368
369 public void testProject32()
370 throws Exception
371 {
372 testProject( "project-32" );
373 }
374
375
376
377
378
379
380
381 public void testProject33()
382 throws Exception
383 {
384 testProject( "project-33" );
385 }
386
387 public void testProject34()
388 throws Exception
389 {
390 testProject( "project-34" );
391 }
392
393 public void testProject35()
394 throws Exception
395 {
396 testProject( "project-35" );
397 }
398
399 public void testProject36()
400 throws Exception
401 {
402
403 File basedir = getTestFile( "target/test-classes/projects/project-36" );
404 File pom = new File( basedir, "pom.xml" );
405 List goals = new ArrayList();
406 goals.add( "install" );
407 executeMaven( pom, new Properties(), goals );
408
409 testProject( "project-36" );
410 }
411
412 public void testProject37()
413 throws Exception
414 {
415 testProject( "project-37" );
416 }
417
418
419
420
421 public void testMECLIPSE_56_encoding()
422 throws Exception
423 {
424 testProject( "MECLIPSE-56_encoding" );
425 }
426
427 public void testProject38()
428 throws Exception
429 {
430 testProject( "project-38" );
431 }
432
433 public void testProject39_a()
434 throws Exception
435 {
436 checkJRESettingsWithEclipseWorkspace( "project-39-a", TempEclipseWorkspace.getFixtureEclipseWithDefault13(),
437 null );
438 }
439
440 public void testProject39_b()
441 throws Exception
442 {
443 checkJRESettingsWithEclipseWorkspace( "project-39-b", TempEclipseWorkspace.getFixtureEclipseWithDefault15(),
444 null );
445 }
446
447 public void testProject39_c()
448 throws Exception
449 {
450 checkJRESettingsWithEclipseWorkspace( "project-39-c",
451 TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14(), null );
452 }
453
454 public void testProject40_a()
455 throws Exception
456 {
457 String jre131 = new java.io.File( "target/test-classes/eclipse/dummyJDK/1.3.1/bin/javac" ).getCanonicalPath();
458 checkJRESettingsWithEclipseWorkspace( "project-40-a", TempEclipseWorkspace.getFixtureEclipseWithDefault13(),
459 jre131 );
460 }
461
462 public void testProject40_b()
463 throws Exception
464 {
465 String jre131 = new java.io.File( "target/test-classes/eclipse/dummyJDK/1.3.1/bin/javac" ).getCanonicalPath();
466 checkJRESettingsWithEclipseWorkspace( "project-40-b", TempEclipseWorkspace.getFixtureEclipseWithDefault15(),
467 jre131 );
468 }
469
470 public void testProject40_c()
471 throws Exception
472 {
473 String jre131 = new java.io.File( "target/test-classes/eclipse/dummyJDK/1.3.1/bin/javac" ).getCanonicalPath();
474 checkJRESettingsWithEclipseWorkspace( "project-40-c",
475 TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14(),
476 jre131 );
477 }
478
479 public void testProject41()
480 throws Exception
481 {
482 TempEclipseWorkspace rad7 = TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14();
483 Properties properties = new Properties();
484 properties.setProperty( "eclipse.workspace", rad7.workspaceLocation.getCanonicalPath() );
485 testProject( "project-41", properties, "clean", "eclipse" );
486
487 }
488
489 public void testProject42()
490 throws Exception
491 {
492 TempEclipseWorkspace rad7 = TempEclipseWorkspace.getFixtureEclipseWorkspaceWithRad7Default14();
493 Properties properties = new Properties();
494 properties.setProperty( "eclipse.workspace", rad7.workspaceLocation.getCanonicalPath() );
495 testProject( "project-42", properties, "clean", "eclipse" );
496
497 }
498
499
500
501
502
503
504
505 public void testProject43()
506 throws Exception
507 {
508 testProject( "project-43" );
509 }
510
511
512
513
514
515
516
517 public void testProject44()
518 throws Exception
519 {
520 testProject( "project-44" );
521 }
522
523
524
525
526
527
528
529 public void testProject45()
530 throws Exception
531 {
532 testProject( "project-45" );
533 }
534
535
536
537
538
539
540
541 public void testProject46()
542 throws Exception
543 {
544 testProject( "project-46" );
545 assertNotAvailableMarkerFileExists( "biz.aQute", "bndlib", "0.0.145", null, "sources" );
546 assertNotAvailableMarkerFileExists( "biz.aQute", "bndlib", "0.0.145", null, "javadoc" );
547 }
548
549
550
551
552
553
554
555 public void testProject47()
556 throws Exception
557 {
558 testProject( "project-47" );
559 assertNotAvailableMarkerFileExists( "commons-lang", "commons-lang", "1.0", null, "sources" );
560 assertNotAvailableMarkerFileDoesNotExist( "commons-lang", "commons-lang", "1.0", null, "javadoc" );
561 }
562
563
564
565
566
567
568
569 public void testProject48()
570 throws Exception
571 {
572 testProject( "project-48" );
573 assertNotAvailableMarkerFileDoesNotExist( "does-not-exist", "does-not-exist", "666", null, "sources" );
574 assertNotAvailableMarkerFileDoesNotExist( "does-not-exist", "does-not-exist", "666", null, "javadoc" );
575 }
576
577
578
579
580
581
582 public void testProject49()
583 throws Exception
584 {
585 File notAvailableMarkerFile =
586 getNotAvailableMarkerFile( "commons-lang", "commons-lang", "2.4", null, "sources" );
587 notAvailableMarkerFile.getParentFile().mkdirs();
588 notAvailableMarkerFile.createNewFile();
589 getNotAvailableMarkerFile( "commons-lang", "commons-lang", "2.4", null, "javadoc" ).createNewFile();
590
591 testProject( "project-49" );
592 assertNotAvailableMarkerFileDoesNotExist( "commons-lang", "commons-lang", "2.4", null, "sources" );
593 assertNotAvailableMarkerFileDoesNotExist( "commons-lang", "commons-lang", "2.4", null, "javadoc" );
594 }
595
596
597
598
599
600
601 public void testProject50MECLIPSE415()
602 throws Exception
603 {
604 testProject( "project-50-MECLIPSE-415" );
605 }
606
607
608
609
610
611
612 public void testProject51MECLIPSE415()
613 throws Exception
614 {
615 testProject( "project-51-MECLIPSE-415" );
616 }
617
618
619
620
621
622
623 public void testProject52MECLIPSE104()
624 throws Exception
625 {
626 testProject( "project-52-MECLIPSE-104" );
627 }
628
629
630
631
632
633
634 public void testProject53MECLIPSE551()
635 throws Exception
636 {
637 testProject( "project-53-MECLIPSE-551" );
638 }
639
640
641
642
643
644
645 public void testProject54MECLIPSE178()
646 throws Exception
647 {
648 testProject( "project-54-MECLIPSE-178" );
649 }
650
651
652
653
654
655
656
657 public void testProject55MECLIPSE178()
658 throws Exception
659 {
660 testProject( "project-55-MECLIPSE-178" );
661 }
662
663
664
665
666
667
668 public void testProject56()
669 throws Exception
670 {
671 testProject( "project-56-MECLIPSE-603" );
672 }
673
674
675
676
677
678
679 public void testProject57()
680 throws Exception
681 {
682 testProject( "project-57-MECLIPSE-368" );
683 }
684
685 public void testJeeSimple()
686 throws Exception
687 {
688
689 File basedir = getTestFile( "target/test-classes/projects/j2ee-simple" );
690 File pom = new File( basedir, "pom.xml" );
691 List goals = new ArrayList();
692 goals.add( "install" );
693 executeMaven( pom, new Properties(), goals );
694
695 testProject( "j2ee-simple" );
696 }
697
698 private void checkJRESettingsWithEclipseWorkspace( String project, TempEclipseWorkspace workspace, String jreExec )
699 throws Exception
700 {
701 Properties properties = new Properties();
702 properties.setProperty( "eclipse.workspace", workspace.workspaceLocation.getCanonicalPath() );
703 if ( jreExec != null )
704 {
705 properties.setProperty( "maven.compiler.executable", jreExec );
706 }
707 testProject( project, properties, "clean", "eclipse" );
708 }
709
710 }