From 2b0eae3e208fa108ca6173f4ac31b91d4b8cf9fa Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Thu, 8 Jul 2010 15:40:46 +0000 Subject: [PATCH] o Strengthened test to check both direct and non-direct optional dependencies git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@961815 13f79535-47bb-0310-9956-ffa450edef68 --- .../MavenITmng0947OptionalDependencyTest.java | 15 ++++-- .../src/test/resources/mng-0947/pom.xml | 10 +++- .../apache/maven/its/mng0947/d/0.1/d-0.1.jar | Bin 0 -> 1934 bytes .../apache/maven/its/mng0947/d/0.1/d-0.1.pom | 36 ++++++++++++++ .../apache/maven/its/mng0947/e/0.1/e-0.1.jar | Bin 0 -> 1985 bytes .../apache/maven/its/mng0947/e/0.1/e-0.1.pom | 45 ++++++++++++++++++ 6 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/e/0.1/e-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/e/0.1/e-0.1.pom diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java index 6983bca89e..73649215ae 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0947OptionalDependencyTest.java @@ -40,7 +40,8 @@ public class MavenITmng0947OptionalDependencyTest } /** - * Verify that optional dependencies of a project's direct dependencies are excluded from the project class path. + * Verify that direct optional dependencies are included in the project class paths while transitive optional + * dependencies are excluded. */ public void testit() throws Exception @@ -59,15 +60,21 @@ public class MavenITmng0947OptionalDependencyTest verifier.resetStreams(); List compile = verifier.loadLines( "target/compile.txt", "UTF-8" ); - assertEquals( 0, compile.size() ); + assertTrue( compile.toString(), compile.contains( "org.apache.maven.its.mng0947:d:jar:0.1" ) ); + assertTrue( compile.toString(), compile.contains( "org.apache.maven.its.mng0947:e:jar:0.1" ) ); + assertEquals( 2, compile.size() ); List runtime = verifier.loadLines( "target/runtime.txt", "UTF-8" ); assertTrue( runtime.toString(), runtime.contains( "org.apache.maven.its.mng0947:c:jar:0.1" ) ); - assertEquals( 1, runtime.size() ); + assertTrue( runtime.toString(), runtime.contains( "org.apache.maven.its.mng0947:d:jar:0.1" ) ); + assertTrue( runtime.toString(), runtime.contains( "org.apache.maven.its.mng0947:e:jar:0.1" ) ); + assertEquals( 3, runtime.size() ); List test = verifier.loadLines( "target/test.txt", "UTF-8" ); assertTrue( test.toString(), test.contains( "org.apache.maven.its.mng0947:c:jar:0.1" ) ); - assertEquals( 1, test.size() ); + assertTrue( test.toString(), test.contains( "org.apache.maven.its.mng0947:d:jar:0.1" ) ); + assertTrue( test.toString(), test.contains( "org.apache.maven.its.mng0947:e:jar:0.1" ) ); + assertEquals( 3, test.size() ); } } diff --git a/its/core-it-suite/src/test/resources/mng-0947/pom.xml b/its/core-it-suite/src/test/resources/mng-0947/pom.xml index c75fde27cb..8f1d162b92 100644 --- a/its/core-it-suite/src/test/resources/mng-0947/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-0947/pom.xml @@ -28,7 +28,8 @@ under the License. Maven Integration Test :: MNG-947 - Verify that optional dependencies of a project's direct dependencies are excluded from the project class path. + Verify that direct optional dependencies are included in the project class paths while transitive optional + dependencies are excluded. @@ -38,6 +39,13 @@ under the License. 0.1 runtime + + org.apache.maven.its.mng0947 + e + 0.1 + compile + true + diff --git a/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.jar b/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..e9a33c97559bcb4111cd2cd4d60b2d7a6f130b8e GIT binary patch literal 1934 zcmWIWW@h1H00HOD7dBu9l;8x?zOEsTx}JV+`Tw#DVS(&e+ zpQoE^aEP9-+h^Z1r+vJ2^)B*y>uQ}lbAEG>!4=~NPm6TC&YjTl)^*}wf3hTOikS8R zm5QBnx`TwhgMv%uYONKK;TD=~93)yJd^+eeP{zx+*z3R}zm=7dojYd+Y!r!IKP6`Z z>#{1gk8W*yV)n!^z+8su0e)nc`NK9>hBvWPS3q1yy^Vg-7>=Q zd#;GuEH-mG`T2o~6nleFcsaDJ(Her$|?K91<4Pp$BzjGFol{=ePFcwR^!!u_6w^eqE;+@I^}G&(1NhznFrQ> zW>3h?{XB8wy4Ongn0u$_-RzUtt*D!Rv(zIY_TSt!7bGtHSS&irBsQt1G1#5Cpm#@4(0eJxLHVRkF&7xvKb>tmVBb4jP+{A8W8ZUyu8_MLez zR$#w#@7yzDFH6}zNAH+(e%&QktN9l*xhCIieqZaG9K;ZfI@w_2R>qYL8!-q@DkrD6;UK{~ndDlgif(t!3CXs;^xlH_$aCpwVLXDg=E`=T2c6r??yUexey8ZMy|Ad_WC#?%S z6I1Zw%)czz&Ht4YuT)R0XNKih4sd~^@Juba1enOnfEZNzzzZBme#M&wQ}jWJy`U(+ zAhoC@GqqUsj3d_}0|ABu)d~MMT&TX$5v2P?MM=!&CjXkVv)FDeS>m~HfB5^uA?2Kt zEV_?=@AJQ>(y;2+#)NRSCC0OM8D6=-xqf?iKf4i2*5oa}B%&^{P4V8S!+-nO6BB)# zo<+~=7uUvpm63_ zL10OvI*^2GLn>YoCSaCjpn?wqKo%baGT|n`ib3421{H)50Mh&p$VAhOH%{<53sf*d z0LWwuM$$|M6_YSmV=pLSrY~u1A=zwbv59O2s6Iqbo(L-nfu%Dk0fU}c1H4(;K&G(+ Mp(U`iw`T?M079FV6aWAK literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.pom b/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.pom new file mode 100644 index 0000000000..0d2c1a9676 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/d/0.1/d-0.1.pom @@ -0,0 +1,36 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng0947 + d + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/e/0.1/e-0.1.jar b/its/core-it-suite/src/test/resources/mng-0947/repo/org/apache/maven/its/mng0947/e/0.1/e-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..b4426874e5e1c06f7a3bf9277e6fd17be782a5e2 GIT binary patch literal 1985 zcmWIWW@h1H0Dw#DVS(&e+ zpQoE^aEP9-+h^Z1r+vJ2^)B*y>uQ}lbAEG>!4=~NPm6TC&YjTl)^*}wf3hTOikS8R zm5QBnx`TwhgMv%uYONKK;TD=~93)yJd^+eeP{zx+*z3R}zm=7dojYd+Y!r!IKP6`Z z>#{1gk8W*yV)n!^z+8su0e)ncb&>LnAP7^XDu-evXNOp_`R~!IWgP3i5OHDspqChTP7Z?I2L= z{z!gVn7q`<_qWBnDds# z&K2K6#6EO*6>IvrAODxaq7gK+aN_*FylKYoAHUEklD*D(zhd6&n2#c@$9Q^JHapG; z(^=}TbbVPGSEAZ>rR27*gS#`0teL77F=<{XUD6a3QqRNm)zW*utAFTYib=on z)6G48)}2Xj9Xyz$d)rSn_-lr>H3+TPq-7zj`Lt}!x38RcW5b=+@hr}`Hi2QMTpOct znH__4@~ZQW0oS*lms+qdr1F9=_d1W$l|?TFBc$tO(k@+nL?YEV=B(8h1t!s0K+GYNgDg7EXezW7dYCgSu z;wlfNzTz_Q?B8 z(E9doR?H`@HA|kAEZTj}$!wl0Z-o9*<8M1Sndiywi4Jus+nveUynTOo&p)A z4K|!xSM*^`iNv0+B}Y3&FG;wZ3jA*RZ5!jR|I@d5N^{KGJ7IfgMd+hrt6!=ZZYuY= zb9h1Rw~+Y{WhA1EOs4%6`^yT;;~d~Z>LXYB&SGH3C<9_pi3KmDAbA{bwoTOsWsriR z{DRb?lFZa%(K83R4jJ$;T&Py~FK}b;66cwGWkQ0i{_ofyiS2I6cE8T|r~2!^imR^8 zYA3BOeReLtX`&GFH{?awy(8?Ke6wFq`(9#YU$yF{(V=CTUkyugbeg<3>RjL0eNr+q zWyX~=|BwCHGt1J#?wu5i=gs{oC+t^n#0PjYGKnzbE^~oC0s;Ysw~inh?m2`u>}4=W zF$gSaR0oo9ZAc|D!UW9X4^&n{0LbElKqlM-Sjmao)u6Hy0zjJI0hwr;@kR+gXMxI6 z2mqOE!AP3Pppq5lYV2hz%=9IVEhL)_EoqUh09B#rsS{zvQWjF3kD68kyjj^mrm+K| NC9r}h0#* + + + + + 4.0.0 + + org.apache.maven.its.mng0947 + e + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven.its.mng0947 + d + 0.1 + compile + + +