From 92e52a5389d1126db20f5d50f0bc781f44816d48 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Sun, 25 Apr 2021 20:34:34 +0200 Subject: [PATCH 01/88] Changed release script to use branch wicket-9.x --- release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 19a570b29f8..a2dcf5929cc 100755 --- a/release.sh +++ b/release.sh @@ -279,7 +279,7 @@ git add wicket-$version-released.md # the branch on which the code base lives for this version (master is # always current development version) -GIT_BRANCH=master +GIT_BRANCH=wicket-9.x JAVA_VERSION=$(getJavaVersionFromPom) From e3024d682ec3148dafd5e7aaeca7a3fde9f609f4 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Fri, 30 Apr 2021 22:35:01 +0200 Subject: [PATCH 02/88] WICKET-6883 updated chapter 8 to reflect page storing changes --- .../src/main/asciidoc/img/wicket-cache.png | Bin 38486 -> 16844 bytes .../versioningCaching_2.adoc | 21 ++++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/wicket-user-guide/src/main/asciidoc/img/wicket-cache.png b/wicket-user-guide/src/main/asciidoc/img/wicket-cache.png index 0a96e1265dfc73d8c015012f626c18e85daf5472..e7adbf8e007248c290cf02ed88a4aefcb7dc569d 100644 GIT binary patch literal 16844 zcmeIa2T)Vr-zOX^iUk{}RHaH6q)4|Rgx*4E0R?HHN$+6!p&|kjdhaa(A|)U#C`uQQ z5|A3Clh8Yaz70M?pAKr*3RyBE*>i<8WbUrTM+1zhXy_=i(}panmZgVYu=S7Lxr~^gr9z>-x){7 z(HHBWC6NY8=$`ZeG?TJ}zP}4@XIyZb*YL&I!QqF|8t2wa;c57^$oDETbN&r;?%fK7 zlx=F-O6l2i=gwUPvw%!kbW7pS(f)$`yl|YIcD!-&7z6EizVVQtl(Ow#FrlL#KsZkO z=));GIn$Z;n11nzPBV8k?KHY3xF+qwE2Ed1^99e@)J;yyL*2eq=|{;gOl9-ZEpMLo51nv0t)&%YD zR}U|((oVnKIs-%tfjql(Ql56ad*;8I^nYXcZpKOZU|t4qifZso+e8s5ccV~cPHMf@ zLlLhY%S{kjDI8t6`g4D4XJxGC2i?x(m#l)2cmK?fkB#{4PrIhD`|2$hIdmvm7R}!LK26>y{E>Y% zjO}q;@$H5MOfH^Jwl^lHV;&&zi`eghwF^Uid~1d*kSEQGz(!uR-j|iNKWt|+9HCM< zkPjlYOzHzN_q|p!Jms|8nwxpq1^xRTYM|HvZQ(!b3uQ`F|o&4Wi-6Ree8?E(~@nMf`?S-!*y5K%O<9VSg3OC|#Aq zyf$SZBUjtH((60+b@sY#V9Tt<gvOHa?rB!D)?Blu%!2_DE%29cH#`=)y-oJ-x?yy z)gM{6#weqvy%*m2`WqP~1f|QGJ2Atf;9b`QW)dIbmzWoRAC4IYN?_qy*5|C_xT&(w zV?NGlW-D6kChTx1RA_@+3g5t`7+X_}2-U zP3b@-$iA;1n*tU3c&WF5T_^;+)E>l|$Gxwu4>0L3o1X(FG(A$8+0N8nlqI8&_N{j_ zskEyk_=kRdPu>j8X1-U~Q0JCwkaoUHAWhoTn#45y1nkuMOe^Ph^w%I#_qKFR8S(ydR2;70jT`3)+cdmf3YU zRVTI1$jnSL*saC&(&K4L`q+}C=|qC2I@5u(^TxrDe)x@k^>Fm{cw0kh*!uSG46M@N z){WDLH}#v_YG26YYR2~ zrkOP_Dh^6>qAPp7XjIjEKM&_@2e?RmX`qKEvWS3KamH&IyNNQif>!gFe zGuAt;#iun#?vy%QaWX2`aAJl@(fxC}bGX2%#Tk_oaEczIa`acgFl*Gb+uNgCr7Dex z*2Br7a+p1tX;;*urRuruS4y1F7H#TbbKM3H9=wu2cfAkRpq?b|T0w&I=dlc8jo1cX zh%dOO=b6+7M7hm&oQSMF(J8NWzyanFE7j z!UGg1;?@f)nuq@EMZ@C#&a9OEgO-Z3v?x!L^A#R1Si3=kRWT2>*d?L(ojtzJ32KL@kN0n{&L~G~-LjKB70_Iklg> zQK_4jpYVY+$732Xsur&pJy3FRPb=~qWaW+jD&zno@4JXSRv*B)dXU(g)0uHTu^fsD zN*6aDkt)^=mkr+<`@`=BO;ANu_)}~Gw_Q(MSR7Lx=jlj%{DzwrLHhWP3XIjIIy!1A zd?^gXEx4Us!J$zdv`H-{mirVPU7>RQx@^F+$nE9fyerlMPfdsxrUUjn5yAop{KufZ zz{Ev1R&FTEfKar{$h&>d#yhYg6Vp@ljIh^_l!19N(4Ng!yD7foy0{t?&T;R_kb)a| zE>S(^w!R_sFPB<+Wl4UBdysxxS*$_rcNM0V@h>)scosS3aP!kmzdv8vt0*dFGnKX@ zzayZD6*%;ubB?2oo5Q}SQahJ-P}me63Jk5byQZV34azbo0^bvmBxKm{RL7_QV|$ zgZVcm8u&f>@mv~Bv5t<8*H~F|*zryketV5~x{W=sZ(AMB8}t;ETrdWOeaPlFIJKEH zsrD)8-@mp~!!t?Z{<-Z21p@p5{S{Unva(-Y;%%r>x{7!O1H7B2%>DaFDk+zA&#pq5 z<8s(kU651#@@zPUS?o*v;u4#L*E%ZX^ zy!r)Ak~J?5S7d{?bI=3G3=Y0-vEb%N_Hp=I^tegwr1l;~DJI#p*DkfZ;K|%vQ~66V zCzGm2ApE&`czleWI{vNp*-3_Pbo_Vj=yZ}}%XeW_de39Ge`Np{YU>&|&*tljNli_C z^XB;0MkH5^cx=FN4T z-@oeyo(}IBBt`^~?b<`)`);ep7CRp5i9%!11l{!4*#`L!H|`KAkz8~FLP8qE$Yke> z-l!NwE2axK6^!+EH|qyui;X&2mvdJA|KU6g*b?rW%~}_kdyE3!q8~4kqMM8K{PkB0 z1*}!VZu(@d#!QLzIokywLME*L_GT#l=3%t*S2;hs^h!sgTzVL?t)=R{Zw!DaPiZPZ zn^~vIx$DvGtbAM#TpFv^1a>hSHF73-Kx7aAo@wK+34TEvse3mrUW{N~>#MK}dH=_p z&fm)!22Z!4h1$e(gZzkhzjWEjuq8!mBkM9ZKVn~FKWNkg+8cA$iW?ewr562SNUg?e z2Gx}!Z{ti^{jRVyj5jtepVM0oNOMu>s(>Ep>*!=CF8?ObhI=M?FdsHp6c4u$=Hh@L z2@a!r2>d}a=QloRl9{slKNjiISVUl72Qe(*RM>n|7=%rsVueFN1X6bvAQ(D+AV<3G z#V@;_`#*Jg)E3d;rS02l0%yPd1(1ej%1;tMGW`{KROt3M%z{;}j)=5K{75LSq(##1 zG{v6yRFj4NHLh9zDEjNdncA{}g=W6z>PnYctJl>~L8*65K!op)ZaG9XHndh!ifTKK_Cp|YDH`9(O;_^hPPtArXa46>|U(!pmL|jP~2hbKDxf~8@HkP5gbw61gFtn zWO{aXG@9Vd9o?4WZmVUosGe}A6g=^H>C&IStD-%zn8EN(quh4bMVIU0q9f8J7P^*j zX&%)H$5QI_+7DC?udrgNUwCJ^8JPL&R8vw@NRuPXa(JOXn)*8B2ig3$%VzMUF#z+v5B9S*q-8aaaJb zt=r=IEKSVF%Wj!=p!E-rSPZNpCH3KV#~jf`o?7&IkzSRJX% zQfA~wiH8mIARrD64J96>@D^|Rhn`z;Q{-M~?|9$aAgizqyD4rH$Bo#kwJTL9>z-Y2 zTE*`NZWV(63oMa)+{_HF4c>E=U>?r6u@&q3#Io5Bo1Tg0TIYh2|CrHDJ!LR#@3)V+ z^}2kZ*sN#_AP%3xbzOGBH(*k|_44rplD30|Qz|s9jLKKdZ6}bC54yF6zt|Mk1Z;(K z+s||?B;rWYVe3Xg@uIC=U0OHCR}*d8QJTPW#g1gOl&Wg0w&vu+^Z6pE<^NhrfJT-9d>wwvjygI>j;q{Tqgyk9}oJX|w zx7^TZ2ap?RDR)2MZ+0fN#(tssEz@m90VzL z5uE1UIY0glmN!cn)peVLD#?j=A$NWJ*b<#BxBBD*gwPLZUYa_jcaIV@xu zn}{FnRN==TNf@3DkN7}Yp1k+s_g{6xINK6f;)3W)x5bNG`<0|g9>Df4g zhzKp$ZS%>-+LXu--E&Dqo|#UIR^$;bUNGw^pV5KzXQEVlOT z9DxG^=K1@rzqf>av*iZv#%;^j3G+3c8-7J(AHt9KJ3LT+&OJJA$Oneew{#O0qE>N^ zZeCtJvs;3UtgJ6^!P}eZF!TdIz@nbU1g0watKmBQNh9N_!j<{z>CnK_@3HrNX4acp z%>|&${rMPV{7(OneoN;FNJ$2zNGF0*|Kto=v~FPr)u{4I1aUvRJijZ(Q-&b{r6GerGhr3Pxx@xUZz5Y)0u+&R=x}$do z&@kG_j_X}dhv4l7_M7uPCopsMGhJ{U6lY+?Q#)1F3d5dHot~fXmnP?|Ms>L~u<)_4 zuu$*2Ww4Jnu*|G+3LW+Bv!=@iJ>iRB(~EPI5zgx~EHt(N*$+5xqMDL~Eh z#l4e|TZ*7cb3g`+yNgu!@KHzE?*&-e-UwjT)5Xd~Qk1fJ zHiD~67+sdul~FlnzTshxp>sAP^foT?6J_caLPtxPwJ!w}qxx$dlS`^+_suqBM0!R`L1G?*(E>~ zlU9G|Y*2!>0#rs@_U0TOdJJqrqZH?m~!)gIkZIP4*rle2M^PTR? zs%&TKDmqo3C*ZJcwqLgL+ivh^Y1I`#b3>(Y<{VHJE40GYpb?oFw4&9MP{h`c9Hp$~ zC*n#StEXEdDHNCZ7tqlQ|_v~qBqL?w5+LIw~4S@Xv2rda% zYHRHOF4`M%Sw=zQxpbOZ7?pLWK`4 zf}PjSpsGSib2F{471mo*wcGS_J{kr?R`HitAvYcYy(HDY2&)NJFsk10CH?tJt(o;U zo)IAYK8Th3)i;@yy%A59L>`>?WfB2YzQnF&;DUH!V}F?wpYWK^H{{t}IFELe+Bw4| zo#?nF8vLhWX_ahOJ zvz`a74`+mRjFb*#;T+!cAghbjUmWjO8B8O#zYwQsz)&A*5ijO$SUl?XBs{4~U-jh| zfcW!3lT+SPYgQS0QlgLC@wBMJj@y*YI0UVXK^ zy4_B^5y-a^!>@rPe%lZJ1*-3zt=}yiwm+rg$h#Ld=%bH#S|ZsEexRFZ*^Dah4(%7+ zjrZSN#lLy`c4{%G+PC2d?c(n}(5zrQ6a%J1pJR2gyR}0;7=$CI@Nqa9Dw@3rr+ko zYeP}fOT^p*E|BmrZ-!9w*|OFETD}Tsm>0B-|7Q&`(9o6eJaA@eD8%q8lM~-TlgpvMzUn>$+s%s!jAQ2R_aX@?~2g+KD#TfYFxEw z_*Csj2KHm3?;Mw|3K$OhW@hiizBA-3HoXlFd6im(;EET`WI7PM1AX~#%l*pSjE-%h;p zDRV#4wO%X9zC4vr9?cbOk5wrD$k>j_$atoiUS*a`#tr^1)t{=>03s2!%%i2bQdWR>*a>q>i5N-|K=qXH$`XM=Xe+QgX6RZ4{X7U0E|K#-%r`V8BfN zCA(E-;JUZi7yo!ak#;7+I@NOfJF3EIr5_Tb8mZ;B0yhZUsaH98@UX(HG_*;HPs;Yq zYpg=iZP)Sxk3&{19@FOha(z)5s#mG8K>U-ZX6zCxVyMH9;wc^WK3s?47Gxh(cSsp# zEn3GkSl$c2p`_5Oi*t}(X|3u$Gb1u$Bx0=2ALfmaTlyf z9jbZIpmWlQMslr&lzn}F9{H6j<%W!Fo@1|HVar6R7)iR)&}F#L9%))r-TMoE^JBk3qhoGtxyNJAWlDX?_*ZIIp!(nJR!^miF6lK7U<3zB z?p{sc*syS|LBkllT_-0GHB(X`z7;4z?k0#S9fQ2`eo7PP=i3M*w71ThOx(>KQh>Qp zaW6gwaY+BMq_kfcfqg})Q%mh|tblf8sRoUG^@P*RvHBg`*6*X0XCBl6Hpb!}lV}^E z7;cyl!l3JHiiG!qY;4g+Xo*>awR5dA**UgoL`!|p8J5(~Z;%-ie~>Oun1?oC49U*) zXU_(b{cBt)B_9XuidXo4{oYfD&miukA2&Zq+6loJ6d=zP6DwOtl9`#jG%XoA|0(&H z`w{I+MbZSzdmv>2Boi^-_UUIx$Dl!uiD3BN9>ZAmj!teEV@%t%ywJYutr$NCHhC`- zltF`^ugv{F4o&+@QTPUBL1{IVi6r`Fc950T&)o$yp(c62d8pViu~#rK$-tz}uUtTC zPotsB#IdJx>G}ymnS1b(qK}zOxwT>Sm5{AX<5#>|78&c|vh7D}eMURNQ1`eZSf}Bb z$I5pu7*mD1zan~B!RJMf7jQs>Y-@P&Seg3GzG}fp6{aO6H@)JTfb4CH ziph+qh>f0@4lRy=RCJ3W2^AX3*~d`3t~^6Kkwc5 zz3TB|inTahS{J^JHHemt^_-aJ4^(ihtET?3n42F+r7-tT>8B1?>Im9I5Za2*_19aS zQ`ii4T${lYKZMd>khI@uY#YWMOz83u{@=9#(!~c<6~uV0*?7o?{myHv;Tp;}QwNs2 z>$a))-F1tZ3H{+e94dmwpCJC=45C%G3DNo8gaz_S(WCyyM=i2J`*mJI$!MH=GdXhY zv4>?xK(1DzMsnp!`I!u{9;a`1sr5d}Tp()XDs)uXY~M$W)*H}H>**qa8$d$-`A5L` z3LGW`Ghm={n1RnC!8B%rdW6bP=%{yB)x+6Wm2>o!xkkSR!u#e# z;iQXg~Buy~Eg7 z!=nB0&`hiRR)AFdrN?5p)Sqs6iFV5)cXSb_>dy2ppJ?HRcAqdWfMq8!Z+qJ2YNYj# z4s>-HdSYT@xx*H+#1`Zp;nsQj^Ps|EcvDIAZ73-4t>7EjsO61~jS^EW58IRYQ+@s8 zKG|<|6da>DexgGW{?ZRz0ha=0~a*He(DsR zI!Zi8vly%BkUI=(PXIM>TSEokeKX+z%ED@BIgMR&$8HK_fE#$a<=I^VL|e2ibnFVC z;SO-a<9sR@sxZsD_iwZLx{a4G=HLB7e!qa45q*jZ61sII$?n`C#E~20%Q@VI55wup zs;c^Wai+q)S2edNk8g$yi;sao9keKJl{o5#2GU8grX%*~%(3*InEC@^7w~J1C2@h!iVNu*Rpf z#p(*=RvM3ot055fugFI}^G8NuaF?Dh9QmaFYIQWl)thZZUK?1gtoIt4n_s2vw9C@H zN%o?kv0?JJp1$F)fmn1qWO8A=sT{Q@zU%o2f3>?WiM1&77m4O{;0C3a~nfiysKC?92sw_j>mb- ziy5%_oe#8ITOjjvNn$URehuDw;>Q9wJO6UpSz%K?DAKSBO~B_kmw=9J4brIm&3dd$Uio$GJXYbo0dUa7 z#>RZdiz|J`m6a}sjVa*CP?W>uKf`x}v%Hp-(76tkc2nDd!_`M04u{=UA0J99>j&S+ z0L&ALlHc%|-;MJ%skN?(!;a*2%I!Gp?K_#^gOX2!qCKI!nct$sF^XN(vO?5yc#;hG zC^z)s!|#Ta#qo7TORh=XbBe+wLI1e(E{^b`XXYC#$^C^zo~GUo3rWHP34@P=ONMj4 ze7TDYs{X3xNC}Ua_ z9xFn9+FY}8rpMkzJS2EF@m>zW)`?lUC+-y;+^RxT8d5%!}@nhb>yE@LC(snKS|4ib!}b=9QWsOYJ}E9q zYG@+iQgnCuR8$DXCcyCz14ReFi8a{m*UgY*rd5j5w)AtTDksy_qdxr(abakP7f~7b z6tx_wei>&Vp#KZWJe4d_p!+Ztf2gHC;Mh}T;n|-BOP)^o2EE{57?2;7{i8|db#Ia8kuC6^i?rG;IR;rdca(A(vX-H9n1afI-n))3)zo?UWt*KIK-ecyt1o90`QGO= zT!;9=p6PsEk8?pEk5v?pl=2hC94bF(R6%`0> zvLS75c{2stsHHzuI==|I_?M5lprmc3hK7fcJ!s9@Q|9K9{;s?A&-dJ|gRMARc_z)j zw{}Hw;|>E}^!Oz@pBt66|FQ_ z(i=j5>D(8itqYJ3Z2wZdVtN%Qe;4nECuAu8XfajDI2i7fLk?9p08E#g6swlF5=vT! z-m9+W)x%~g*#qD|yZ!z9ZBnmyj#gTIfm&`@V!n&)pAiS*-{_?Kfv=U1XtUnyfX9ma z>d}nRSUj(9VIyAB{kxib!KW`Tm3=bSekD(ZukZor1&W4FV|9VrseX|qPr*{qkOtmfiPs5QUNsml$g1cXsZ~uk~G*IIQw@bJfbA=lQYX9%j_(G3X#@ zA!1skNz_ib4W$pT7I4(qk0?B}_-6-k6pa-!l&{~Jh#C%-c~Z4J3NLQYwIWDEZh3(g z9nEC$DM@Qnw{S;pAD(_nF9A?iXJ4XlI!&N@S!pw#h)V`&i$8dIF-hU?%H_|~&@qW1 zBhkG8Ndrj}uUKI6>#cFn_mSy6xMXjDbKbw(UVh=Mlmq93InQE%tCI2y-D3s)ZN`G< zvA~+!K*l985LHnrSML`FS8X%jpS>Pi(5IzLKdm?1&+iF{5Dl$C&8|Awxe%-H`M2wp z`j+3eY>w1fo8atg>F2t0!-57qXWyicnq9SDZw+FK)b>elW?0Eh60Ths>4}zfZ9eYn zJKGaWuJTyy_XV2nT?`$_Rs(72vrGDAS-15fJzi}zdgfybw4p~A_`aV9vbZNY2#%-M zgjGBVinzD*^YG053TtE7` zCRNHMu~|Erk57dTxDb0b-U_X^U`ZM+DWt)C_FR^NmxpF*aX&TXw%G<~s58_0t#pYj zJ;X=p#&^JDddr?)pn+Y`P}CVuG2Yr;xJS$J+g@I1y~?jPnm5po$u=FGl2J`$0Q(Ea z1oJVjOKPCtSYbVPj7NPk?{>W`4N0oaPdYlA0-{nWdSSq^I4OBP_^?|8S@6UgY}-#}v?Dme5Nw;HM?9dY{WV7lm2o|K$0$ zr*ef69Q3%=E!o?U<_$@E_@BU*Yn}%7X@=!}GN`_y>_HmkVN-H9x2`*9-}fec%bxsh z){D>{|GR8KskK%|F;(7Q7hodz?0NeNmn{uV3K2p>sFCbSJxQIlmZRQ|pEw58H-Zke zVmo}u?OUe9{_|hg=h{n#uD%C$fnVtdHa_dvXkIOry)vCD9s*rr@oBNu>xnPaG zWQ}#CrrZWq5y(o*-UR|9C*2UNo|%{%@HtOpoJ-Es-lzrj=|8Qn)&2jzz7~A_|DiRj z|MA-5f6u!&(pJ%4QhM|_O;96`R_0n|A8Ix9+7;*1Ysf0@qu-Z$e(} zw2t4-bempcC0avv=`OFnI=aik!vFmEp)>^YbaPQzH6R|)(bdk2yA0*!<+|@GLTOc; zZ~ia4x|Q(ifb$r=I7L(a`Txd}=zq_&|2xAcI1Dql=!d2cczP`^`sUs7kF7?p)N1)h zj)$)3O%YNl$7*&~l`DozM%|R9WP)|m#r%oxFtMH6gWJ592j|OQecly01-bNidkq1B z9KdI~;+{B%vI$oz__K31uxR5vrmR7)!Pxx>4(&wRgyqvu!N*O`#k4j(jF*!9SDkEk z5Uh`WAb)d5lOHA!)rF*lebWgP3&`i~R>;*NI>UdUji;Y={{vRIUy{U&LB7%PzK%`} zB3Y=3bZz_X-q)EEp|p5IAz&T+o6GW$U5JeA9|8U0C$gS@qnwEhI%$j0PD*2A&RQ_* zAnHQA=jybAjNDMi$h}y(5==in_fb5=unk3z^OyPG`g8jF=kxh$y?(PqXn&oTm#0&zwg{GRIU3K?_JY1o``(Wc4tZbgw$T&=Ou*9%%d@#J zoV5%CTc&GHLh3j`sQE^B=l;(ehpM!;=BMq4Y7=M9)5D4*Fa*zeEjC3@3-dia0qe4p zCN*ni?GIWQXGv`a##U?8}3+;hizGRDETgd#YF=A9sJw zaC(XEimty0#r&1pbys-h`I6zfxp(L)i`<#y18%5w-Kb=iidgmi5y3)C^wZ5dd0yde z&1ihAX-UD$x61ogLjY_3p{caSbuMxL(-6i@IDX;p)B~vA6w;UnsxEC_NwWIUMP3iS zl9Mzep7aCZK?yIMxD-vIl)$Q<%X#i@Dlm4Y>!Bn(|JpM;e^K?1IH+Ik0&-?_Ud_i- z?Hfcag0m)1=@+Vw$JF?2h0>lORWIEFaDFPC)8L@hwg9kAl0oa8Bff`8cgg=G1(tr# zLTF&sA>SxJ&aguQo|&I~haN0Y@LLx$Dkjb9ypst1MQNr6J;GEWV9_LF$)#F1wdu)Q z(BTToJCdh~Ao1Y{Y+SCmEJs@iy3SUCkX})Qi*jg(&;J!>NnRD*XWMt_`_yDhtR6_{ zFW<&G{7YhST3E(tO!A7L8PEcFxxQ9@6@z?BUPi&sYEASxz4L`CvA_fC<*t2#IccZU zb>tJJLPDVAV2m}MxMuv|!*F1|^0@)C{=w`WsA8Y zC}Rm1N1maPko0a!q=aqJ z_g(6sCw2Q?t~#3{>3Sde3S{;0?i)JD+H~0ST7$eM@i2=JlBgaD)!@)rbd}UEADMSv z(7~DG#x?X`B@UE7{q-=>9+W|;kIB|vMFx;RX(x9MtdaFb43<2unpsLzBkr7M@J3BP zbHTK|?Pyg9>5wCE^!aHae7K>Yzg^#yCFUt;GmwA{!ziaNt{8NadAk$~O?T29Cgzld zn98B^j@ZH<9sItilS$RnMaSPhqJ8PjUhdwAw^c&yotLg4dwau!)Fw#79cP8&j&>0WzDz<;wUpnwz&w7x>I&%u%Op{J(2O$W zK2=o7s1Gv+&$YR^Ch=Yl>ZbiSi)1aXiUMZI$v-=I4AgEoX|Yr$X!&&|$5-n$GH^V< z1Bq7FW=AKdUrXH-g@GR}uh9ma#ZB?^XJBd}#2=L_M!N>J^(rfBsA1_YYr;TVkCvu` zO))Nr5h-p)_n6XSkD_lu!P1sZ>)PW$%H48=jhaAFVsO1$V(~VQ*8DA( zZUeu|H_%ga?Cs4@k!HeSj~@T1u-ssDuNC%pCLLy9rk`do%xbp`Xr_Eq)H_$x znhjsoU6P+XV%ov;(C5B`F<)&E2kc>5H7a=|LF2is+dh84xnW-`P^G|FBpWvJ;qv!0 zpp6S4(RF=^W4F>A6U;kEVrL(I=Vgrc|SFHNKwURP<6z**t{6~8Q$#$FHz_9HWKUpCuTTFm77Ch*Bfu2Y;>~ye| zCSGNNbCNoAJ(o>Kl=}yB{0yls`(naFFO8j8{8Uj)#kJf}B%+&Zfcmsyyako>Yk@Pp zIpHUv2RX9je=G^V`^k&Fu6P5^PVU9=(fd57zFhyaDGa@7k;r~9TVv(L27!!=0-zG` zfR)V=#_d9{$!ugYt{G>y@KnkD+r7j_?htK%%)VPwTk8{z`T+K}>s0tq%j%Hd^XJc* zf+Oq|P!hA`Nt)$@=$|7Qj36v?d3)^k2hyhL=@6}LMTz~StLbu8m$)h#*0wF|BB?*T zdP%?T8PZxcT9xc&)(2u7&&#sD$*uSpekaaYkx6!PP`03@TK?O|n~L#>_s*D}IkM-* zvinS1n!$KlVSirGMaHh^M<4}a6V(s#E#i5BDj&2cU>yyBJ?}x0gCpZjwSH?eZ-8#t znW1~tAbq~@3L9wTGPa2LoeDDEdQ-2-QiIQy>nCJQ5T&{)-O8k!h;@f)b7*gEt{H$F z=TM0t@C8m-ZQR9 zts+gzZLyWtSb5V_!LSV24#Vf{x5bM~j)3J5!^~fF&kJ0)^)LPtpbV@GGpLc|u4k`C z&0Gk67dblZ@7rzqLcO2veS$>rmNI4uwYli~;n5>uO7P}=RXXkQ@;^*{el_REGY@dr zNq>guW~DA}SEBXBqD}B-&t@896GFPGLcdBo^$e>UQb72Ktr|GaSWy03{x}a*6Zu45 zz0c(=;K_FYATj)_ zweNo{=FcXZ{(p8A&}UcF@$!AZ<3epw`PV_xM5sS$=ZB&~ z0BZrW^$)m=qnQE*WS$}bjL69xJA#()tW^u3_!CuRk|wz)<&*stegFlGI}Y*j0(bu8 zh`g;LujzOA7g(BTUxBNzDeXMq3RbWzZJa)F^uTG<^D#<@>3mcp2lSFD!el1a)KX=O z8K>fKxbNQ+1+p+rLeX;^XuVJmrgK9vcM?n%#;zjwc$KKt%czgD+J$Du(RJ<(JHn4RZ&CpPWa30Dr~Pq6?UqI@15x)TcGdrzU!`b9cx{QpOq`$^Y|bG>_yb6RWzm9My^KOgAs<&-VnjaSjo2-LPb|Xe;>|Mk(NSfX!3#_7V~U* zT0A7ge(pQiyD0ys&Mf%k;FAb|HcFYj5m>#DF+#o5;f>UWY3LQZgI9X%3sstu0frr1 z<;n78Ul%~Uukj)$($8v@WR8WI)bWCHZ{)p5brb-*&7hF5)zq?A;YEQ76Q}b(&Ddh> z4r2hm5838uz?{_bN|LQhsV;U2lizntWh`{E@c`=e)o~7Hr0vPB#Pn=+M6*U>ml>0Sec2x#BQY6c~udK`XE7gn=F-FLB z&^9PHJH3S3!*B%?pjMsOt>h;!W+N5DW$+JWaPzCgT*%7e;@Vo7?kl%Cvs=fG6w2e$;TZO0iAoD7 z2AHDsz zI)O&dNyw8ffZ8vG&t-u2Gy@&5e!wIDZAUJ+whuv|NHd+nQhenL&+bx%tg2+pJ}{%{)k+3 zIVxB6TED7+j@xN1l$G*_H&+DFHlhuc7I z{qqg1{5f-*w$J;~8L+$i)urQLBl>^;W3g>^$mTuG;*wzMvcid1ws+Y~!pY-;ui|-E zpJg_?>i@XAnRe{ky_;}`Bfn?HC)tJiDGc%Te6%%0)o;N@^GlCt<*$D((KeOeJ_+`} zKREOHKi0>Viwe)2BiF|16;FD!3h)wgm=Z>$O#Ap-I5tQ+J5XduML#)3j?anuUm*&Q4+y4*SxCH;hzW9IA z%ngoUyJCWu_lOnkR|@!$#V~>nEck4l5~X&3pW34C0z%A0sE8C6P12nR4A{x5q!f1C x0=K5wxZ_LE=uCx_IiTUY?(D|k@LyQh&J%Tbxr0mY8E`iQs;u>- literal 38486 zcmd42Wl-Et&^5Za1PB%^xC96g+%b%kMgRa`8UTRrnAxT* z@IHZPA}c8dc>DLt?JP-rA3<@H(sls=KH&U&!vNAV3El^hT&3m3kv33qKYk?+izqjF z_Xv;{`>y7>dY0wkt2fwqKmA*`8B%^{p`CKD>C=mVmbNKNhXOM@GXBBqn0fSx#;dHu z6*=$DB-q|A+6U6a$StkWxNutC1hHrD7Ivo@Z$hJnvD@|+_7#$7uXmZ|W%rnxXCEPe z!}%Xeltpo_MPOn5ALGTJ6U<2aXL`<<02WZQyxc$ghJYx*HuT0!6hkWLyl*0FZt~Br zcz?nqB`5P{P2K1CKIaJKI2@#NnkUi{w)xl6aQu(I2j5<(FSyo}wE0Qz4lSIXkWdxx zo04g56jNcuKN|&os2IdXfky=PeS9V}Ra@e4xwiXX=hA%y?4E(jhyie9>HPmU4qmyt z|DARoHEy%~Kk;MC2?EEA$j+1ao_-w*QPK-t?;$4m?O&l!T^LUNMo)oIeS&PwSV(D4 zJtoxxo5ZGGANx~>o(hRoLgSV=$o5P_Cth+&4@HZf?goj+`XE$0!|P~iz7rR3{&-(< zsKb$?Ph_ZZRS>}x1o!EC;>t-(lyT9lh~aO2>_QE=HawV%o)sHkqSle#=)QfVWXXc1 zAj`9|bmpQXhka%6%E=m)q~Gi&M#^k8a1cdUBO*`}BZW?dTY2z^!5g(nV-F$m7zQ4%x9E1BzaBC}Pdpd?TRvg8-+yRQ5M_Q|wie~?tmf+crwS*1QV zEKdc=^rz+he4$8Ata7iIfPv#th2l6A8(p!Qwt*DMr25fy-)^4_ ze<(4+D)F^=OsuKY$zWX;a4jTIx?l{KnlwI&7~Hs3~Tvv2}; zytoeoDe#_q&87O~B(BTTueh4PdwxxME-kAon{75); zj*8sfvo$>L_c|?-*yrcUOjp7^sAjaXXw*I5X>%uZ$+YSfvf(jj#Xw}~F#mRBgvPV- zTUk#p6I=%+EB+)wPV9Q_bK5-5HP>#Koy~Mg)<@yX;{v$SYw>>hFfHijI#u(=J@-)4 zu!I}}dY069efgQHsDCqHia#yLF4E^Tlm1DuYl(9=^QrDTYz*mbzVPd#?`XC znCkeL7)djAJ_j-@rp~#LOyrWS-;z`4Kzp;~LzO1{1`59R)oz~j-}qr|znV7(gcRrx z-*Sh#z3ydw^D`t6-AAZ82b()A6*JzCcIeG>JQ@!PMH6j*`|aM}Pg71ys||ar>=j&Z z4?i=dVK`7yqVG2DXQ-2TIv_PXx{6{8V04P)z4y8VYl>D>xQ-%Q3q4QWg8WUI+E0 z<((p4e-w?cFGS1m-Rl(m6lPd+YR996Ln16a&pAdwzJm}5;{6YkjuTCEi6fXz1b{dq zUB?(es_v@r3m$`z(^Xy>ot$_Y3Oh{!3tNzMl3q-h#0n7U&DLOJGW=Vx6ONs;Vi6Dm z5)T9+Q^K0g|8Ps{+Jg@jbI?;jsuf(ezc_sJi@z z3E-%M=wyjiO(MVFhu}r4h%ULxm!SQ^r;eJWjDjx+va4OK>RhC!Qrl7sNlQ{DI&;^JIU0%0rhgRFR8ULk_+>55z5m(0MVNnyG zLHCxBODPqti%}jjiPYmMXIY`Ah;l3|par?8p@;Pm?S(l`U;26}ZzEH{6BLCOA6q(G zMpHOvk`Ek2E5aS8mn#!3J^HPqzUPG+N*u97{GO34Ho!i-a)Rf4a_Q__VG9N^^C%_j z`&!q~I^ngc5OSs9Y|t_`=W*p%V}kN>LPmoObB3@GiBGJip8hs(+2&DS5ZCl=iia6;&IJEm7wL~yG8EhZ|#@mJH3&j>I-h*EM;CMT8I66r^Hb0 z-=x;doz8phPd4r0>RWf~IYdlTwRiqr-bBKl@xNF_6mX-f%bA`O7P)S&#RHpL>Y`+6 z6$yD6Bb11$_3kzot0dQ+#fGxt-kOGXNj)HNstLUSg>7_)m%vE4Vcj*q^dmWiX+kd3 z*JVBBh~t0}N)kzp?p9{4CdXH)gZ)_1WFcOf=Ic5HDpi_&`0&hcKnFun*%INP+lI{i zQTE~FLT9xS(RL{@gZa;!E8h7T2OGQ;!R!RVVq^hS-lg?d_oD^LCGF^z8pg-#UO!&t zFr++JeSD#|r*XG2ZI460Tj|*_1I36wR&Qu-tsj3p?il>7!r}dV?X*G~aROq_rDV?S zb_Y$}=$-}>&Q*7NKmXZhU!lS-3~YNjU999)SK2yaJJ9DY{P4sVWqa27QBIZy5rLPJ!C^f- zh5=(SJ5!s5DsDK=_V@VyUcc*f4llvNGb=gl4h;r@BQ}1i&fV21|82I_DXNP0kX3Zc z>>Zf5A&Gw@m{T+3YN0nehbAAy!Zj4RGTw+pd`$--Dd56bWy593*JO?TBjuU&K zPY0@~^8*7S-SPzF%(KNzibBoS9^$fbUsst*;R}vdyPtZZZ6RImqbzur9+@`BQO6?J z*>f?<^rmST;mEa{rWFPTt!*8R^$cUkrP1|#s!etz9$+|bePuC@v3ZfFTJTewZz0I@ z>2v?!=58eK?^gD81biKp6n*V`dvjP9q)ZW7+&3k1p@*jUy z=uQXj;eLcMLIy}7-*BFJKNZFB+xoOUy7r-&Y&4pCXv^$JZ;``OX1RrNIoKaq7_f43 z$ABm$Q{S#eI~(OYVSa&wNMnM`PqPI-ICMeUSbtX6lf@8AQci|(2|$-P!=mH4<>VCI zGTXsKy-KhfB?@l0Lue);?K&BcJ-e~=DRAvvTtyY^Kicw;r(C8-BD|r8OF3Ew%1gWG zwBKx`t^Z8u^2`Q%!Dnn+%Z0*@ZzujgG%< z^jG;h%{z)n6%{t^CLOtk==bbh`s?Tt}Z57V8d^qgSLu@5VuENn^;zNCi z+&dqqF3)Vg=-LsR22&9XgZQ)xPcQhVtJk#_*1)RhHWydtOg<8px7o+=II&iK3!hVJ z{C#{xZEOC6S5yDeuF`y#>3u4?G%atcGq5(lyjW&461{nwqEtdRS&W9PTyE%h)+pb& z0p7s+A}tmp;kJ@hXQ{i86}QRCwjmMl^VA)@UYNv(XV}b>Wpg=v>1}EL(1fl(nCQ^% zf3KY)Vm2cJD$_7jgHwRm+eAlNi+k(gkL@RA2GzknIzNm)M(jb^3Zpi@{eFg~oj<6e z!NLwr!w!P>F;Oh<70y@ZXnCT}c*QX=5UQMB>Y2ORjl20yikV-Rc75XpOuE|8nY+5q zvXT)aKl(YDaFvJPFy3yGIQ)oh8Q!`O30ywiEAeiNbMQSb!Wl}V*=ln+EHxw5YH-?v zcI*3Jb>cVavwB&7E59Uk38W1NjG(NJT4t~6C^N_bkDfdf951B`vLrRTuNK!JKbT1k zw35=fK$|tOpI-)m&sE>YwIBP*6dWD#Drzi-BbVN4^V!XJKW%xtUWKb+HDm`n2)x~8 zW#qgHUOqp!VTr{|r|F(a9JDRaCVbhv8o@6_aS5AlyId=~ zUlwjULz#HoEO3cRu>ba2NdgY<7)jUswpHiW>~NnI_k5R$){ZREVm_V0{Oq?RWa&M+ zpI^tSxvriT{01H9veCPkB%2!fGy09?T59}t$~c1L`kv98%b{(tnZ^9N+iD7v4jf$S^1iX6{Ww$H z2@&Y*cpe;fU7Ch;Gp0%k3`58<4QzS+XYpgqhmv9%P-J>PdRUc>|uP*Wl%ED?ICGWtfbq5&xXE!Ted)TaP?CS z@m_;itkBI;mfP#~;MU_IdXWZvzhN`@AeH-vmkTthR-3+v>m1hhC~{c%N!OfDtmm8zek@5g zgR&@z0EZ-e?o3m^L-*}ftm9(Hc=t=EHB|zOTKn;3H-wiITq7@KRcie&A1<}TaNefypta+ap;xgk~Y{)~4RIa=OC6JW;T4?q>hSc^}u z!V#K*+~~l|JAKI;FX4yRO5&2ipO=I%h$=P;8tyRNdtyF0ilZaA0qOl9MZ))PrXeWe zlZiN|S};Wr(dCW%{Q27TNhFRjZ_yv4=gj|LtRR6*2cJH59xwTyo;D|2tn$JKT<`0W zN!)-GtA$<7<{M`DiwByMN`>5JJ-U3RCpa+ZM2{*q^|nfjnF;uR3@tNO6sz_`>q0up zE+=J_A*g=^?p9_oW4&z4eN01b$8Mq|_9NO90t=@*z7k<{EJSCLD$ne>UShz&i2R|Y zX(y3rc)7oHgUo+0t?u4?WjMr-h=w(}Qa5}ea(#O~R( {gFv_|R6=N_J@@jYqx#QTP?7^FIgirlUbu+A&V zsWFUGyM*S*)#4uO^Sc{i?p4fatr}t530|;CTI-}92?zo7n~PKqooin)+Rs9fs=I9p z2MFM#x*ldE8z8Tcx;@7w4gX2th!?Mv7T;_=w0K-VJGbF04-c z>O8SRd53PbO~M2T;fux^gX9S~xSs2Aheo=*?k>-Z8@CwMu$b|qs`3+4mB#^FW`?O^ z)|mK-hVh!?m_Aaba@CE1UYv2u-s?ZCw;5Y4#yiOE0f6J|jIMHbAmsRkHr9@x@1&Z( z-!i4mgRE?|so1Lmk?2%)6D<L;N?;y7D%xqu_*s=;*yMlx2^l;W@tKkfs^UXO1TAzSszEv{N?anh>#~@6Cd1@BB;bp_IfK9Yo}gptL!baHEW0afbAzjyLb;f$=st1@C+YH%teNEKg3BDd(sc_8 z&veUgaq0Gq*mL1ke~9(_ULgp8zyI;eOga^cg(#YUfeV||4_Ri-aG}%w3#$>#ZL$ZmOuo{9t1TpTAw%kOK%@~$jaBr*6(iB?0anB-}mhZWr)vpVQwcZy&+?L%_JTs|M!pr#qZN6F- z+u?|@e%e*og1SsX>0BS5rZ@1)IopkI>Q=>I9Uj zhFt_rGds`r2Uqh9;BNR1``Bz#j!>hA$BSS;Epm_6gl;>~kkM4n|9F|>?YQJ=Cp6Ch3Q8C`BCp?G0rfo^j_GfIObZca#b+^xyn!` z12o6CvcMkb2Dx!bc$7~LKShum-Z2DTK|YFeGz2aR*NgJlCM2hNaTd-3d);ok)nBe? zZ%?Qw0dPZqPny8n5YdVI4-gT31N5iL-D6R ziRf25g6fDngXT*~2RDwcyZz?P1AD^3ISaXTK~pvB?D4UW&c3A@f>4`J%+O4{%VAdl z*6!(_w;y0J*qK`kW&{=mq06I>IfQobRA;B`Ax16^Vg<1}y7Y97bAHNvMd z6OP$wr+*98@r)bq>^*)Y(G4T=^^TpRH0c~_f5xE^GWM$S?w7p)m zo#+lLHnUA?wpL@S41bbma90)OHIytzSo8Tb^QASBI0R#P1ydzb)zMUOy}DM!(nC(o z#-sCcZ?9rxB{@Zu!+W)ZFV(ra#px3=miC{bwktCi7h6kPSzAAST@R%t!Zsng`B7m9 zKO;0RX~^+ktQbbg|mUa{5>SSlMoKSAoPO zJkDmZFJx>ur4N;*kFdBOAlI_VC44;fFW$X1?y{ouAieW`fHe z1)I!5cx(tDDDU*epZi-T15=C#pBJB12h*z9Yo>VXy&+lgjPZn$^+^ZPE3GMLOr767 z^DJu6o1wXCwfokd*Kd}|u%%{W)WbsN6d1naWWPt3|mJJ755FIw~ylESuU zAo<_>a7`3jKo3v$dt#(GMJo75O=2QM81r44E=KRc`L&dz&cL5otpQR5t@Dvfj?DIrzY%Onvyc>1YVCe zO?|j)2vhw|#XiglM@sz~NeV|q3)uTzeQG)BIHJ%@7s2*DH&oy%o9xwTd39+^(6@sr z|8BwFZ*PQuS{8x526!*)GGrmM4=eeXAW{Eno2VDyWzaOH#$9R*P?tW;JSMb_y(88! z#7W~)IIq(2(32w5X0eT4_^TcY(j+bqQQsEmu)~Tcg!@RDvi};Z1}r)N#Gml-H_tk| z(@KWX;fUqNH~BFO*ZP`!Nx5sA$K!kQ7CFjU|05w{42~H0r$ot!T60ZFtI-6b*Idhy@5TDJf5%|BLs;F zd+vxgJB&3+UqfNrn#a?kEzvQEb2Las3MK4Q3MHVx=~%0h*43CSGFRN~F2t5J%d6_d zR?w-kZr5=kzToCYGDY}R!+RAjQL=DIk>i6kwEI4TnO41X_Hqxz&{V@jsLD|@5i!(F zf|9^W$!`veCh!3W?X!Q#%`PjBKH(F`XiUpjEgmL!dyLu20h(5pJlxNW^@ml&l2$k@ zL$7jF>-@c@M_d^&8hO#MOkb_u;@>=T!fj-FK4aVE+r|G;67bXl7?-c!pmZD>D%65YHW|i6hDKK7C zO(**+*1@`#NI13L&2CM$!Nwtdc9-X+d4Vh{n~RGIdxFW@>vg+oBMICnFFc;GZI&kv z3L8^?-5vTL?rV?m+#xm2^1uaStUV;iTg)y;D{>mQhM$FTPwDoQlzZ!0VEK#shF`B0 z9WF*FWu6kp{F1xf%bH?$+mn%Bcoty*b$$jp>|Buja1)acs3$MIivVZcs{l_A2#WK+ zJL;b^Q^;*>*HM4(>-nX4I#2IY+&*uv&l9U~=*yAt+V={^`R)zBwK{rZG%dQ`y3#Xt zjS^#%z~I_dPn;E6*_w))`bkm~MT7+H7_neS{M2=?@;^Utv%Pga#$U&G#USX$08Hs@ zkX|!U%x`%bt%WWvExJDxD7)fCXL;?te0;qIp6ls^Y<>gER&8x#?)j7Mt5Lc>eqPLh-!aey244;Ri!r zWX+AMB1b-4Q8X)nQb$~Z9v#UQ+i;Cspv1KizTpE>!>}0b*H;Dfd0)f;xu~x;Qi&Vx z+LR;jy+hf*il~j5_8r{+CCSXZty5R?$Exxtc;zOk{DEN|1}Uymq}5(0{8{kjKq8K0wf)B_z3?ZqD7(gli?U8;;g_Kg z)7|ye8V5qxG{PfJBUos6_iB{L#M$f`oj3vR;7k; z_c%E^@@WbR>iL5O9%XW=N@;N%%VH#(SP0MqYAuXYr4c1x+?lLv=vyK^cSeP;CXMW6&a*MXlRwupIRIdR5`$Jskl+0Q3Y9QS%N{t$4ka zotI*5^$Z4hnB&G|r0)rPTWuBlZLliTtyU&1Hd(H$ist1#F-!4Wkoq2zjT?IIbb?E8 z4e-1$%7~&uIK(ZRa3%9Q5di?vC3Ip)E1`%@3n(m0hX2%nV%x>Sbq1F|xE zx@LC+*a|<{9L`GNtBAUAMg8MimLC#_g_n3)Kia-C?q*s;XO zUr#$RN}KK!=w(3J`i>MZg)gd;c{<3dVp3;pSmbSlX>_%3tr`B8NmXSuG2fwe5dZRi z{dz$dWS3l}@olx?ZNYNWcc(SkR`KgPCcYc%5GIVs_I276^6&@PkAaE&&EV>DbU2m` zqaHxjiWeRYw#}+f2k($>C2WbCX62S|DNUil@>B@u7Zt(Dt&QGplBq8}X+y5?K6Ez8 zu7t_|_&0C+3w?j)`s-OA!2{(n#XX^ zAWmkf(b~Jg5&~5m2(?TyaGKn= zb*Q%YJ^#C^iR%CkH|FKSzRBjRb1)57Vu7SH>nBcH^F6T`XA;tI#U+QU+z*s%8t|Xc zYd!wd*6x@QMzb)o@|}u4#ZzDC)~bDO)%1=#u%yvtIke^TvI9wv|M_WJ9M{A?Nq%eg znacNKBx8C9Msa7hy`-cluJyH=FlL%m=Wh3dpBt4dn;7T1e!T}I+rn%AK(?D@N&1H3 zTcSy{azgF>W)bachxhQ%(ko_p4x7NrSGrEOPrA2U72;9d&Y)5=tf?#^2_r<8)L1zW z5`Jyng=#tJ#JxN^UXRo^ona2P( zYHuJwmGWV;ma5Wwo!B#8J;HBo-ZOu2eN5_iAF6*U)6+JZf*ES=Z9_kqjm1~1e&Qd~ z)!+Nk>3x`Fmw(D9DzfoQ=5Rt`tucScGb)YmvM%CxX@#f*rzt?p{bTn@toHC*o9&A% z^SxpmQT6~O32pNkN{MzZ4e=KHD1ZGBW2c+M3;WYj_pP&`sI^mUmZon>?Ae-@th1#d z^x)LR3%p)tWx=9*TzM=#-0XS|e08e*5hAJfOd^jyd=eCpFph_DN1p@}V7}aE{X2te z>4*L+ZBg4u@XUE=KYH59FTdA|pPNo5igmEep|Rh9Fyn$hHMaz*f{)OU^8#;4A@qi` zrMvTHw9@d5FH4cL`@2T(Ju}tB-~4zZ7Q8t+ay=_$6s)v7_URFZ^A=_%;8S}>oC6RP zpjjl~Fin?z{j+95pQWBUm>Ufs8WAdLEVN^_+Z%zP_x@DAXm8jqSgDMuuT7)5$!*_lA%Dnx~|sqy`soGSB;X)w(bVZvR;6XBoy~eShOpCkQth z&sxs9w9N41HJxU!^X93!n(^alNHd=b`<2DI`%QxQUKEMk66YrSHralodz*QaaSK^%^Og*cJfAS8QT?GSV7%Gkgb?(dkfmIF&)q1PQL$H} z?kG<(LALp9wZUilvyZ5<4C7SgjLQ!l--8bA2g>h5Q}#@RO2IVA@?)6erxh4(1bh0# zKkxO`=!>8ZkHs{WYv-n6n?AOxa*mcUEoXT}gbctNkc0DplS)2aq88gc@4s zb6#Z4&-H`e@Nx{}6MR&E@^9hCAtaCiFYOu=0PZi2-naa#g zV{iB|I{fG`xs;kp;?i2K7a2g)OpQ?^XbCX*!SM~f6ar@M)tA4+2Cj`g5A`Qy?MF>DPo&9Y@Q=yxe8^tMms;vf;E2H4*&(n{LJd&=RLL$AJ#A3>c#Gj z&2*L_;7f7J$fT7$^yJN%;J$DJ^2w&o^m?$bJ-i{a%Fp?&V9-scO zg<8MU6x1pPZcfEbH)19`kK`t&q>=+E>Z}YU!7BnSou<%q&TQjrH+l`}HP%#F6BumwKa;eq5NL5lJsPZ0Pt zEljLzA@q1xgC`yR-*Ya`ca|ijoUJwd=%WrhmtxD-=)=du(xjxE3<@~W;#;@o#wRsR z1%q_?L%^>;T85gb!kFrua9+|)Yb5V!;q;&Vfc|!@YL8_y{%ypA`dhS!;PT4M9C)sh zu$6Z-!Ey8JSEAmj+w6f}1Qc%PQGEVyV9?7{->h~s zb}=?QEh~pU)Y}{O^-pO2;EroaF|Szq@*>`ravUuF>T~zqTjK&N^b`neQ2TrR!2pmF zJ`mJ1AHD^-LFoUARTbM{_pymH6T_*xBgl?H2~i5!Sf=L`daJ23YN9ADd#gq6bORsr z*w&`g>FceaQ>RLP`Rj*ONLxFf-^@Mp`$HrXIj-PCl->cepsbZ?6T^H!5TC7(BV2hD zol0`vz(EUf;9VfZss8{aCZ=R>aI_TF6}c`171E$YQ`ChwR~0aqDh;jFp|a}>hz9kx zO-{ca7KtL<`GfLWO%t~Z+Bz5Z_X1hpX@JeudYlfc*H}eVyJYF_u)741g_as#TL5+R z=MP~%5bdR(;$^S9fSAtT#oT-Z>h`O=G&Dv?E8Mog@!ZVh0l;!NI!hS`ZZE_S0xF&k}Enb zH+(tk#ctW|gRazQ0-Z$jxiIRWB7#CCvtLLz-`v(^qA^mC^SaM-;_;;3iZm^&0bu63 z*DE5rh1cI9E}QKx3{04@4;4*akHWyKDet2$r0S`Z=)4*u)>bouS;36NwH!9Y^p+6C zN5GN*oj9fM%r;d^unE^Kzm~vV`|BS`(Gf?9NSBvw?eTQWE(req#OU8%rrQ<82w*Vi zdH)P4>*>1wi5P_bJaw!57VY`YiAMml6sm#Vu8AoK;mR)&WF3fG5AP&5mv^(At3JDV zyE~zcMWOQ?x}aWFdS>GPy%T7?T)zg5{3eL6tGD;9z5;1XzLM$pAO}}~e(n>?guklr zfx;rTF!7*|xGa<<&7F_lS;hE_9mQ#L$4HYG*}CAcCMc4|Dn%tcNWEH2!E&KFFUs!k zDerd3bk&39M4*%i*tUArJ^HiD!o0P%hJ>3D*}B5JZXxZTTHqT6CLzm)<7CI_IF9tj zsRQJrGjV!v!kczDHGGrs6Uaf}8k*B>uvPL2c$wic+vB-KUYLVUKpB8#!{6$lE6Rv6XKR@0qLjf0c;v(`9<=3K&#%X9l ztcW8h`P7(3YMSaX{_x5&!sr9|)4T@QUVoF)6oesZgbNNl&ic0j-zcL4dndj_f2AQ+ z{PXxe^8eZpP!uY^hX%+rW1si*J4hhe&&);E^2#{c&rb27(%HbgMQq@nXP@VZA}1o! z={#!U^%$Nk)d;lwcqS}_)ASa7#jEerC1w^cHH z1{15a_|X(`Pb@B3bcjP8{n)BLoKm`@1%J)^i>Og-HZvvKJDx1LY2X0{c5*;;9iAN; zQQZ=Tjfxph=iJ7;tY`JPBpk3~VHQ^Rve?s`!2=e}y)=WQ8_ zZHv!XV=)T&_u1l)Krt$gej&2}z7z2}J)_eHs-G$>N?^~?;IBEqC%z37g$M^v`lOIq zefEKW7=z4`LPm69^&4VN&v+lfNYgtS`nJ0m&+bfJE~~*DiR;R9wz~dP==^m#DMO#EG@BqnP|3Hoyo%@*ac;$*n2cMTuM}9X*d69J zx4d#Nt`;<8Bp`>uTlJq<15-guaHrW%?liBfR##lsn953(0dkBWXMu2H0-_@TED|v+ zTrMsLoR!HuD;;`J4-ArJNiRi8iYI+1i?Dt!=0cjp6Afh#);2OGV5}!McWxlv`I#&h zpcp_t;PVz8q|loi4HGGVoUgvGL{%pauN_v37)0aK!jQpEUe1~Y17Hz*CxnS$lKY=H z{Z-xl3WY^RPDgZA8f)Q;))&dS2T{joU+a>8BfYMP{CFhwzKW5N(%&inN0Be@0J#7T z-bbVfp~^BsQ_!JHO1hH|9IQy+Au_&_ot6BSWK^DPWZ(~KnG<5wfv61DzkApix5;R` zI*!Q5BGaS$qGetNjgs4qR6azv9?r5qrmikt764cyM!#`n(Cuubp4oqWF`#jUvwE9G zY7$0E!v$z{SnV!aFdBT~ffY#oTQ8g#2ppdEUO|zt00eo<%fDe#zsRl+v&$MplVRbu2ZB1* zA4WM(8Pf4nX<}R`R9p}q|DF8!D4`=*Rt_6$=Mb#fl9JUg(-U>6+^%YB$;^{!bOXB5 zVzC5Zx9KxG^uw5!X%xGs#n2ZftYn;e=UGtnIAO{_o=o6g!{N!WhnvZ0h(q)um%REH|6Rw%Zi|J+WwZba8e#{46{zl~=;q?!=MlY3 zLNmwy!6&rBp_z)$zcIt}Ccrgae zxNXV&P)#fxcx$(z*V#pTeEaazbWTiy5LJM#tJ5bv)-A-lVB*{<1=oC%QM$OtXX?=4bD8So9m<=0NN_0d2)6GWmq<>DYS3;tt!Z+fqkkXGl zYKIQ?8%`Ys)wJaoDiU?J*US0R#{%VuaAIP3$7{7k&h6=5)9b`}73M&DP5b7r?Pou| zenW?f*UC~HuLO{4m0rrKBOj|D$y2iu1)S8He!f{2hZBhQ!PRh(ItaL~dX&>5a`_l* zT+KUqwQ8W^nlP1YZ34>^#-GOeG8q}dez63TqMmK|dj=Q>7JW zd>e#y$?|ly&KjDd#6B-=O2ccClsF}_rL*^*L67a+=lm<+#?i10O;QL7Dqa*Gxc@PR z7PZ^);GO~1T*Sn4ZEHh+m{P&tq5leJv(yT!(aO`|C3GwyteS|EUA7Ne5M^82cCwlp zSD2i1I6aaY2-4D>bl9pCnm={`#|-=`B`PkQhoti!jz>jCF#-g*Agj7V9+SNs3yUwRo6mCVCMYzDd7$Iha04+aLOP1gA#mF}I_Yvu-pRX+BMm}d?&|TEF znRe@Fd$bI$?JlMD1b!EwufD_?Bkl5CcEk@u1emmd=j*b1BNme`h9dFfkUEX!Y4sA; zn(BN96d@$)hnU-$?jfuq7-_(pE4Ug`8^L2vF^0HuY>JeitHYvH`TJe9k2Z)G0zJ2HAI3#Fe09-8h5Gc3;d_;pWm6AbOB?;(o^wNQC*IM zN7}rU0M-t$?cKbMamk+=;|CN6u?8s}j)rD`(Sr+SLr!mn*bqL1*syF>psu^CX;w2$ zZlH(=lCBDPpT3~GuBCM3`=2dQZtxludQ-(D*n9pbma^Ma1y2 z_4Yig4?m0c90I5ye-zAN$QH=B6C?)2={QB?`S4$oy4P(XTcg&?J*ZUw&r7m|ym znfco8CLutp6gvMV=;J7>%ae=qy95he@4QXDVEE-KB_A!G9F}F(zvG0tqWrcw^wE_( zNyT7dT^G2LZyh&r;fM&Jw3^v_iWBH6E84_AQMFdf3tDK~G3w`Ro@_6X5<$%sXJ{hx z_m!2E*X&V@KPK1O&+NQ`e#>}_(Uuk~2tbx8yb_y?49~{3ui;ztEM>wAKk1lE_&xil z(fwJ`f&R}iF7gb2MvkF}uc_Pg@j1c4%yv;2s2BcEg(k^6K4D|LaPp>= zjc%utALGSZ^*}Wt(|zwAg&sLXs_w6**Dhzj*PZB+VHQ2nPM3TJhG1j+u7kVn$t+gC zy(n_8Qzj!O2F$O3)rV$HhRv#*Q7YQk!`?pPz?&wH?zWwg^hU`9!P~IIL!Q;RxAV?6 zKPIzFu;#k1MQXhDPS2vfWcG&g+iGvp%tLkEXd+NE;j+^ZB2?Yp{rtD@!QG@$Md=ra z=Qk}eEGB6O=iAHf%mzvPb%bhm3mbQEn33jMh3(fx`{mPvkQ`?Ekrb?Vsi>G4di(g3 zp7lpz4xkR|v8~|EKL5f~EU900`8Fs~ADg$G=DS!tm%Y&A&*NLmD%SP9bv5(~sN65_ zAa`?|TU5~=@JUHIFIhF%?=v^4rv+%nfF$HIt(?4K8lRfmuKI@8-Ty<~IX_qSgx!9} znAo;$+nLy&*tTs>Y-eKIm{=2MV%rltx%u9@RrmcD-a5bSs&lG$cb}^6=UMBsf|vAi z$Y&$`CrU&WE_rT3{$#qzoj^lDeSf{m+w6UD>0|Y~$*Y~5KoP#auhR8?s(yTs5W61v zcFRI0CRAN?Q)<7UYQ1|-i^0b>MqmE>B8&D%^*=AQFw6>$(ZJc)IUUJOf%O7J+}Fm} zsBkUm{6^!&646@Q>ZX-*?j?AIQ|{-%u%xWYrWH=Thh?tTSTIry?xw3z{Y~EPxeGd4 z>5QcDz`yr{mFU*;UZHa^y*^_(d*4Hjkg-ynogT* zrcyN+n^oP9pZu=1<`l7$`24G5fpZ_rtgq^MH=VSH%C?Uv2G#s z_w-KUvO1r>q-Jn*s^3hd)L-po82(1sB1bOtZv8h|u)UZ$UE`sNuqf#ioGq4~fIK{$yWQxvRgDsU|v4PhC+3&74bDoa^6U8%IiE^B=of&bM!0wVQV9 zKW~S2QFzV82B6$iKTRiQ1zD5rvYEzwKZ^EP6?NS@8o9Ens=m2E+^wr3lyUp?G%;=5 z4h0bZL$W=uu)Mr)zromFrpE&gWJ(Yx)?J!fI}L4BRxq7_`;R+lE5*Fm;%CG-_b6}x zZ;2uI_}0$rT=6zgsoi*qvRW5$GJ>VH8_Yeeye_g>-~j?-BNi}y;i8{)HlLh z5u^zFqe!{x-wtzSf?I-aF|l9)U2x$^So{hXen*-k2dJz`v|nNp=&|`44;Q-<-X7+Z zw!|+%it5N3{g=i=OY-Fq1`W1Htn78W#GEeF93 zJoMx?${f9&%K(Ts%)&a2sv$R`D+`o?yA*7HR#j;A9YlTnQa+HO08;K`I(0|WS)A(4 zbeSof=Td(*!+!V=w;f&La}LuZflIlY@p=^6eC!pd@X9m{mmCe}RfWbtApZHB!@>;* zj@#~GyF2Y)=e^}qe*U4!IJVT&@9Ciz`$oy{HhmoQlzPwhxMV~3wz_GGYfURrN;lQ& zR7R-lU8PL?tYY@DKhB5C1RUkG-t=tenvQf7iDF=gB1!*K{Bt;*Yxf#4a)mEQ&s`uM zh2HtuWT~Py5u_Emr_e&ce-V6r+sn?#IU)i8Gbs$SaUCuGE)uJqYNIV*hRgc$Awril ze&5fwdN%}+o4E^y+y}mP=Rfrip{UN3L;#cMj=h)3Z&GrMTv4I4tYK|=dz}?5n@6i6 zmHkxsaL%T%yP&b38>}6Q@@3CzxMFwwwe}U&SSgu5EDok_rs3j+%4+MUm*_jc;TJA{ z#uk7hE)1PhpF|&`p?kwI0W1;%4Rs2fYsQC{+7(o=!EuXw@Ij=8Qa4Ocj5l@HIBfMa5#06rSq(carjRaZx~n+4ClS^x-~* zo$TZ#be>Qv-p~{daAM4RlziV{thu$-^E_{1RtZlKOHm72Eu$^v^BMZL;|2~1VaZyk zHsQC4!|lN5;GWP~+u*ykb9i|-xAlY9Ot>HvEP!nUk&unxWwC%_Dcl;|1CGFQ-KXiK z$$HS(T`oP#78w9^xpTD&dv?~=bXv}>b38>qnr6qaCAASREYC7`#*VnaOC(4oA6tyQ z%*G;QOZ$AFtU1(M-Am&9c5|Oz5F7zr>M!R=D}^ZoDgxgkLY7+|36H9H5liWzgcvLwBS ztGufyDntFgOVt_CM+F9H+2z0~DQ zOMeCzv2h!_+)ha^IDy-qe7FLs^)WL;MQ-YWr$kr7#L#Eu(-1R=Q39eaks(;a%}XVC zTbjfR!On7}@Ti|P&?3HQ2#{1JrrPu@Fpriz*}c=*Ah0J0Q-+J2wOmc-A&er(fLQ5K z2cz!&Qs=O|0&!nqxb>T!fbD+aTs=b|St@jUOi&@=$G-SD7E7Q(skS|mP6qAy@v41u2Y>4-JsiSKE~ z#Ox)?2EXY?f{E_HX7zoF}ci-?UF<#lsY<8N7ab{o~h@|a& z+Efyo-3b;3SENz6Uv#%3pZ_*oq5}~mgamzq@H*-^09zCoHdPabl=S^Z!aMt>yhE?s z%O_fYbg8}sBYG~;9IiD8nY#AA)$_iAdqBdQj3F1MaNF@G4ecn5cO{QEZ!$520RU$b zy=K)29=usrGC=A3cVZumS#mm$?fQap`;oxjvQh<~6N7hyM1>s|fU{{VrQolpnbFes zXNqT6BY1*GS5BH2kNHdoA==S%v+k(k2u}_eS4IwCX67fC1M;tvwBRDsjatcM#>?|@ z7D0Y}n=l!~c@Hxh9hehOT-Key0+VksG1c4^0V56~D#R$SIIXa`us(%lYkBzF1O-Nu zl!)@GxusxBhIG?f7WVtxSQ)}##(zDLnDKy%{AU@*Jyq0iAt_mp8~M`k!Fdp-rcSXR zM5-E#x24-y0SqyDI(#MLSJu`adwZpyi1fupHw;SSG%)6s=OD0D@kAOn z5=p2_gSFXEs_s=JM(e*EZN}^fY#!iRL|BX9#XSlt*g}I_XkYJ#?g`CAI-68L#y&tZ zwhpl>4PLZW584a zYt^l<0#}!}^toizfx|9@LLPVLZN4owg1!`^dGGQ*77W$X_88C0?z#FDL`!k-bGlB` zLkQqMt%XO%_o;o~t9~5Ks62$m(qjfA(p|CEJ&R!j=W@>_-xvd7NAXgs`$d)p0IXdg z_LaX&$69nLK_s9M-U`q04uX7r$II=|or(u(DRuN3s3^`6fWZtp793U=c$aEMl@E#7wc_NGM-mH;u;uaajqIE|qvL(yq=y8(2iv{&B3lt$UCX_0$2vxSs=li^(P^_>WJSZyMH2jl z&$*VKQxv8_{yoEPbu1>8I<2?T649k%(lJaGi)fHOKer=$^^)xsqhnxDBP7%=H?8j=C$_lo1X6RmKvtN33i6F}p%%#{ z)(Yp~=>z^WeYr1N(DBgua-nqT@1-@2BuP(oR;POHN)BJ)`K!A^W*&o*ni?_;Sjp)Q zYYvD3;1)iF5MwO6lw23cGQt~DFxekqRRJq@2oVk#z>Nn-l&c#E%&56h=;x++*!^P; zeCqic=67~IjX-A@69Y(60ayFSh#24WM-U-SwgIMihcILnY;IC`qIi>^iww@ARLAS1 zDEs=}OJDU&<;ev1v*)@7+aV~25>G;Vz-F5` z0y=CHGX}CeK7o$IcH_1?rPTOgztSwOt%|FiYCb2+F8uF{px|0Zi{K9n?Wfw%dN0c|PqaFy+`-Z_5-JZla%IVo+gz5ZfO>&@Y~_eEQ88XcNUAM2%* zwdy!Ry3`9k%KTM=g5bkV`7eVpJ5piVL%M- zj*2J1rGyL4U-p*Try(V+x*--=9Lnl-9SMF8hV+6qPz1n5p}>S%+L1bhEMe-ezKQ{l{nE|{!AaV`{^kXu;n%6&S%ibAZcbF4td93u~ z3bU6`zQjaw1F*UMb6;=(G;mN#`Id`vn@#;CHQ$OG-f13nJ{}&mMEV$RRwuuwW3|TY zRqUfEAQJ=+MD4y=$}R5Uv_b(So|plJWKOeB*DlL>Ac;@ijxv+lp<;!plr-{Ef~ zh~+AfeM0OEPuiy)h2=D`1Q~mBTRta-sbiF|VBp}@jEcSu?HSGtS}aH9gg+jauJmtP z13!Db?`!QRn`sj=AL4wkBiev~GIv*wK>$gMnZ@G0Fsa`p8WQwu7k+Ke+oi^j%JPfTAC7&vDhB=c z(f_IayOb>3?LgRu&fr_UT@x*KQ4^9urd<9)=_f*PD3s^yNtyWDVm&<>s*8ybp;(>6 zyITKEBvabo)(4OShbm}r^>s8UG?rW`pmE>2m{!L4#^sT|E_s_H|3oQ<)4;r{WrA ztHsv5d@jO@7D(4@rdSY1l13jybMlXo)HKBc(;*H0hd#!SH1KPWBTixh|FBNMMUV~{oGD&&K#cM*6!-Gxe%Qu+}PUPaA_*7oW^opeAD0L zGn-wG2{J)uV?RgCyIg<<8K-hcO`r~<`n-2&pi{|HFG-oPt2U?;eb?BRB3K+ zN>QaV0}+TYAgw zb$aVGW#2`HQeQrOCr8=Td3?OM@Qsnw0tz_^Dz`LeLBzRLoOI*9DWrWhpXU~&Ez41s z+KPKH{X&3U+KpA;H6A)RBARB)9@5owAyQLeLL4y9y>pR%YkQS z9=h`NjwJOA>8YneRcp#0X0ClmVqX(vA*r^(I^q6d^E_6>PXhrt*zDp)Ll}3t>Tsvn z3W9-5Uf7cBSMI1&U``WO-K>ZrEsz5x5bOlrMq1rIz2q9x3T>RHveOG& z?rgU7){sEs#gjdYI-eK$^)9-#ooY5t{?TO{T=8$T+j;95M+DLphK370u3cr9DZ85Q z{DYtd2x)H8n5u|eMGEfkey_U6xrGLTNdtxIX@uVQzZiVe87ROEj8^_7?_{J-fu-2v zo!&7ch=GU|-nlXOTR$?U68>3jye^+fdWnn{kp&3#UsTu9Z{6P>NG>gf-4ztI5)%n=9U_XswbHK8{4-NcltFZM zdPODs_)ax`@}hE}be0^n-(Z7XhWry8{CXof!mZT%A$g%y{f>ZtQE4NMGmZ#w!1#DN z-4MJwOHa2WFX$1K#C7+)(Ad;uDIJAOrZ5{Kt9iS~`J7i_V-Pp;ySj{02`9VX@VfQgR7qAY>IKinrQxz&viO&YA};ZJmE@slDX#dg-AlS9Zb`CTgkm$iX)y`Tihd$QX|* zmZ96&EZ5UnUdTQswJ^oo26J7Y>2zm(7;U5DahH zQw6CE#7Qg;jzv>yH+sQMPlMZ?&*=Ra*{h1&jvfc9Z&>K0R9;#E~1M{ZcOks)A#QFCAYE^hz4w_9thJwMNk zPc=QblX}t=|1(RF?WK1jg$)eO-coG*=rv!d-}`(O@esCjih};QjB|Hqd!^HQ+~PLu znheky{)6MMa*^x)p!TK=GfC&733s6Cy3ycO|sa#11DyByvu9qU)0ji?gpp4TIy0ZHE1ty_bcu{PF35V z4$XfJl!ZU!oV(;`Y4p9l_3dTcEGy(V3SFD!t_b4b^OzpuJUyii0An~fm&0{Mk_+DD zhHuYZjsr(tfGQ+h`cxHZ*cSKN*1g>yR{Qf4t`xoVdRXnUikCa@l;J1rJ-gh@9Whu3 zyR<-JA{Kjvwj%aS0Y36IdP>OYlHi`?uLc3-7n=3kgD0n*_039yh(O+S^*w=fOr>7h2{#yj>Cf-`on;IAx^w@bR<0=vMw1x{( z*w+KnJEpuepQ}arf4I#C>+FB9+I$JHI7fCtpvp=hNTSNf9-1nm<}hc`zyPfLy{O8P z_PM03_1U`9?sIwF#jB3hW5uB}+F958;NMLOJCqxqfE(RG;I2{T9)fD$y&Pn8-&OE$L&eJDXxW&qo445DB@mBdLpwuYh4&g^)z$A?$D=Va;cFo1Bog ze)HtD{(HsK@WU_!mCsIcEd8tZjop(k1UUdS{rSPPl6vlE?EU@{OV1B`Am*ugT_=ed z(`A$_$pW{nE5neNn4H?=BRLQjTg?yK$gM{jbwik$<~}r-ErKgE>BCY%`SWQudGzK& z&HpTtxzc$uqENDipvA-{Gu&7R+aVXXCNJU3Giju;_i|6)tt1pUJ^82W_HRO~{KR;j zfsxWoqSqsSV-7bwZ-utLMeR?W0?{GEoL zWiF>XTh))HeKl%E9T^!3A9ur(U1a%O=AoHj09XJW&{}xm=7^FyO{oRVAYAarm zm6Y=KK}W_uD>cXT_XpE#Fbg1rB#F`1FsCUl$Hc|GXi5wX$L%@3n<2PQtAWS&J{|=b z>WC4YoRHx(Ava*3lVm4u0{s1z9p1yl>+inN8J?x@)yYxCx@m;3#c{JXFS*XQi6OYU zKlQ~%G{7u;T~a_-^MUAkh?GYZ_;91Rq6RR9bSV~{GRaS zF8_w1kRfRL6vRgW2MZpkEUxrI(qTp>;z>!9U-C?9rCAKXrL#Hh9)IrIo{eWcoL6h2 z3zv@Y`~IEe9URctDi?F%_?2f2=OTVDsVQa*p!Km>9<~vB>e^qGtu=oxcL2rU_|npi zwb_0HG5y#lc*kt@5F(hRf5z)C`3QCgVH%xG2O^+EOk+S-&Gb2DGfq9NCEt5;B-J6P z_ab=NO|P3-?Q(xG31ooffI!JEfgzLQ6)|mxXROYlmYt+hFgpEOgJBw;tdwS8X6n&u z>F$0{IhaUYcP%ZU`gF@pV++}{ic{ywe9&bkMi=mi`Ij)jM*i1h{0x(x`{Ysq zp^JY$MN>w`KAhq3@Yk;vLa*)iy^(WP4j)?m`!Mf;3gS^}2AK+#R4xFP=wCglj=gtJ z4XN?vp}pCoE2Q@TPtq^dR`x|=7;uzoGLYidBh8--T#3V`k@=Q68{P24^-S|AJKF&) zMBwSGi|D8DmB_J9h3V&RCZ1$*%)?ktA>yQR8wEXOHOxl!-^Uod!@?0=?%7?$s<5RY z2(-ii(!UEh$8p%B(I*+wD?zKPJJwOs1C2S<7;(&DApr$V?x8+P^cBHFG~Rfrs^O!E zqmlVfUU6<`7^UVehkci{CdmG3-dtjMdp9<7p1h+d8sCWEJ%TU%$O~~Go!lz--L#eU zP$XYP4N*b!?_EN@2CSr*BdENxTh2|Qk$SC2a|0|lHi+#t;VV_^Mx_zB$B1=yy?r5m zaCcn99a-zl9ol^S#Pc^V<1A!W`tGQuf}c40J45FC?(jLBXOWdyLEo)gCp+(o87hk9 zt~V@@Kr_pr|BLfi#poA(&B>&=g&u2PZ?A!V7YX;^rM7`f=G*U!rlULSz>okO+Y@1P^t(>lm5V0LlvBwnm%%kpk*h02cLJ-G8Ts0|`2wH$MFz-@(1q7-`Nedu z%g4>DGlNW;)Ms7n$#-w}GRmrQNa#d^*6|bSmZ#Y&u{uj|QViR(*ry`xNkABBoj|fi zlBBBl2?<0vHe}7K=%cKJv|f{LsqqRzL;M=JrHr7^+uhXYRVt@Q3qiez%&d zBl~!xMjE!L>+GyROj1dVN_rNfuz2zo-4G^6n|Ix>!k}hfNwC_3)IR_XFc71`ePiBk z{H8KLJt>B`0JX7%dJ02ZP$tYhWtB3YgfEQ&3K`q`>XrBCk!JKIighwUVQh1_%CfhA z9%6p{*~7M1g3R#?({d++Ilj8~(!y0iJ3b|ELcrtVvk}I4(yZQ2uia|1>4fyVM7^@7sx1#>p}xB#~ki)vsd8;vDY0-vQ)!2&`D&Q{Qy0 zKl)r{VgezjOs1dE5SdcjWTKL8Vd*@t^Hhd~#;5*F#tD-5Xi8wCFtf69I};Id>BvJW zE1xFs`*EZ8vo>)}MCk!=RCTxgZzGS-Ohi*;t*o9xet>}x)JB~cHBnyTp)|Mt$e=|C z$xXRs?t=3m>lAylFoVgdm=Y1JCH4^(>Qv7nED{#-K@6PCaE4FFoMD_;nCK)s$?mHa zvVRlNk%^8IWMw{U^Z>V8lXd>D0KK+0Y*LP;bd*OTYt~`FgPN9?^-R`s_zcef2Zh6L z?>Qu_A`7{0JCW7l)sBPa9j)?2*_RDQMpM%>T z7WL@+tA>iReL~MHkO7H{>IS^LAh9y>9^#EoQ_8G8u}bpav%E^QK^3D$xpm#b*Oa*a zNsL;~ufJPPon;ZBn0pO3#jwHzC=2a=cWQ^!&>lvyW54z``MMU<;~GW_y2m?0oq`=n zJ9;ZmbLf$v4paTB*}u+xg13nwCSkEpt9_F)IDb+?y}ghM_bQiV;P_%Zf@6DZyzo|t zvKbux!tTPtwU1mzvYa+LW{cDTpT^4!y8Qs>`#d@l*w40i{73mt4dpuE7*PtBGW|N? z`D04-gx^7K@452aJl7{~_lUgBfZ{WzeCtTqoLmHtCy&*tf5s;s1Cy$pm3t3@kpHQ& zvC6l`bhC9zcl1YmL|B3G;jct3UY)Jwg&DRneq9RlIsLY$DHCqhOlLxGKN!D&UBdiB z#YL7}C&hTaHlfVlB-u&Zq6Z4XeRl&^QSZLKNH}u;#Kkt5Z?|%kKgU zDjj5iK~472r#x7SEFmrQ@ob$0MQh)bwV{s^*!g<$+5ALJ0Yp+`Zq&u(+#Qo0MLx=_ zR+czF?F)T%#5=|-oXn@>qQgs(!33B{YRAO;v)6l)4Q1z_5~)9*hFlCF%UsG1h=^?8&wHWV=OaOInEZhCPB;stmL6TCWu&u(OBNUaoUl=p$+Ihz6~10 zfG{d_y`8FQu*}?fw7Jheq*0W3_aqB{>CX#3BW59%bjv}anE$1XjSQ@maM-?IA#vuG zJbt>?A3U$emo;CHHkje}G%=To{%^G-{nobu5ddQ{@TfQaFDU2PL>SV5!C)CG6L zFAO5!RS)r>RqAF0xwI5y`TseDP=$~j8f4^IaJzq^&+~t- zLEkZ2&#iM=% zkLeEpAu{X(K}tOiV+Nw~!HS@t#vstXoE^qQOaM5<FkZDb`qb9qs6p;G3noD>HbsFqV`|okCQQ zHqZY&qu&suMSwNPcJaOE9${YTed8^Vy*9!Fy|a!Yo$n#n9cA>ha_Hxvxns!YQSR8=A#q$zA6b z2A#3DI$xDg{MM8D%~n?Ol~28W1#TbH`|T0h7Z>cWK_3zbQr1r%zt)v z-@tcG4UWkw^38leOZZ>MASKX)uKm)7umm}>TSuC$%&YEB)8}Jyo;`=Y8d&VRD)Bq& z&-bR6w%x-|kvqJY;uMFcZUHq2&)u#y8b5Dz)PJ=lb@s4t1}N;7aRmKlVs~3o?hsSe zfcf|Q+XLd>IUJS zUnzmG!D>2fBrqYxK<2@~aM0{$beRxnlK>{J0S~U*#zgpTpLCBKDCxCNLQ-YZ#6p(>O2pE17-CNi&V#1O+S7?z$;cf^_-7!ebdm#T>6imYG~wx`L$)m`n=kw=N?UJZp7CC&c}zVGJT- z>ijb*&r0UA1up<;d9~Y(9AhcvVb+M7F%~9jBE>Aw83!&z%I{ahC=~?jfFdJ5$C{H& zWc&`#gY~OB=}|(FT_`?%q}sfV3NsH=yu@Q@Z{zs8%9r5Qn0Bj_=w{)9*(nhY1e?W# zZkB{K*2U#|6S@M9EQ5mb?1UpM{z;%73j_<^al>~IQ(U;jG6UxsDR*zcq5$Gqoe@SX zayS5qLMJ9hb%2z4P`E@LRu5-hY2;cc32L49B&}Bfq`V@461NS(2&{wFI)tH z1nDl;uSzs*qHI#)Jsj`Ax7e56esB8e%cG}XGwjcBR94J$>Wl>TM@1n+UV~BJQ}<_v z_Z5$m;#>>&XC#gk6{U2-mqA|ssp4E;;}fHqW@eU@O2t^}T4NqX7gmr`Duxe?$}^kv zBQY;f5LjZMfojL_I*L%(k@AYRqCN%4D;B02>2q$Ok`!PSO69nb@~_l6!2vG4ifcom z9=1B1+}7`B5nrvi<-BZs%Box_w<& zvGVJEzjiNeI{t73mo-@d!7uiGBeWq$c<%T8QG5ttzJ%W6cs}#KqU+p>z??FgwCRI_8e|S(17CW$k@=aN)0KZ;1f1XQ^a)*CGBJ zcf`_-f!RX2Yj-%OC8d*|lBYfYceb7J+u%&BGwE%VOWggdSq@unQ%~baL#cAbJ<3Xv zTrP(0=;qZ7sc}FEw(r~v{@-e~xq69u?tm`2JT3;GdGrE^&<=uIBlkojTQd z87i=xh6Nkbho+hLXwre~NaB_`(&{zCHFbIdUh>K%Hg^wjrFF97N@iWkKW8ZiV(YO%nbc9XHj?+Y!Y z)-}_-w}6&GjNi`-2Ig>5X(|`m?6@`PxCRi`4TfLBBZswE=3^U&be-7yjOk z(hUW|xfmXtN&mb+*)JTOqa_&wb<0iV#CQBCj7{pD>)-Wmlfq=th*Ep#zWT%f|Stw)0{QJwkW4ku~0*GuO#m<`mDHz@o_U9H&1MMN@C4;+RIJiPAf@7rlA}I z#qIpxo0`GZ5)LU?j{bGWQGHIKDq8ztlvG1RPU*oP^eO!o=eYsjTW7c_%Fl!6U#$v_ zV~wKv)6D01Azl5O1F4G>{F#!UJGw(dtcszW`qD4AAiq^mw7gsg#ihK9y8QCaKATZr zHQrTJ_E3Uqe_w~IXfjc}6=y&~4*h|mXYB1yYPz(Kofqqmsk{4{uj$l0rTHz2+KrPB z@$QAkgUzg)<(WN!VSE0`Ga5Z6t!T!cW#xsnt9!F#9d+B*wo)j2yy{=S$`}YFac$R3pbeBAnP`kIl=22P$7+9L?qL^zyn1y$`le~$M0 z>Bmv@o$Q2!iKwbl1g#}@D2iAXqD}bO(Q@^2z6u7M+L-bDzNehC^`G6wXR?tDdT3*g zO5F-vJ_|4V^UCwKo3(#pi*H2lkiT-)B(!ol=oVXwqWlelPU~2lqnD51|NB=6g#nYf zCF_ozh?|aGzJo7!j+MO9(|=~1RqiKEx@}BcK0Jm9^ttvkz7CzXMHf_5`t1Ymk7z^V zU;yM-JtQsZ$Ep=!LZy#ukCLCFz{vp2k0{n z=iKAFeCz?!rlGyJ0rt}MAaK74slDh=KL2v%@*rizW8d333i^knMTrPLDQ~@rfFTj} zD@?n5dNscnx8kvWd!;B<1`Hr8{8(;VatS9j$OwdDW1RbbZq;|U&9#_l5-IeD%>=k+*9Z#~*a{9404HW_nx zx#(RJ!K5)Bjt}nI=*DX*9q<3a4mkE~VHN`r-C7M0QJs|-Wz4Rg&JZ&|F zSvMF+)OTY1*LNWHBovaV&P=lRE#EQ4&}0RKYHutQm1}$55EhJ`tfw{4`EU?}9wEgG zC=3A+P4l|A|Ly*>{paG!l6&Z-8z|Gl7YF`$bT@(Lbks$t)oTTMZ-wIA@*u!M6mB9u z5)arObFvn7Yom$Y`>gX{;(*u3fy&@q7(2_CsuXBSvV%8p`I=ft5JuUDCcH;&BEw=q%cbwWQrF(+mr z>#e&o*}1iwALBBo`i2b++0!5ty*H2EFTO$^klV1;PwbVM;gvIRhab zBWv4aq_f@F7TOK~C~(FYHpG$Oz=!()4IWbJZGaH5_55fA19F35#9+a~sBDnm`n`7jO>A=F>#C&qpsi=Sz zcs;rp7H`~NVAsU~QD|7eAU2;P;Rg#5%oG9TK0lI%<6va*I0?*b|7-&L{mnuc3y|`x z=N^KiI8eNP4eq`rDInJi#HeX%b70?y(Lw7=h-`Ya_lc|OC~O|gNo&HXjtjaZ!vT9(2LAjv)! zK~Miozb&l}ZjwBcv0XntZf3m@{3tpTt2Vu;pII6<6cZ0NE`apZ+gRzW!otE4Ne3?s zK@0PHj<_E0oH}?N!U)KmpF6ZgD3$Eot?2PCwN8vv{{2e9r67w#YG`s&m|zAn0~Kq` zm3akv9Oh8=>47=|o-jNDe{F)7=U^yGze0>fXBu=>F1c8$&dZ_tJ+{!JQ2j@9D*2H( zVb`J{;}Q|gi4sWPXiLt@H{3jXDK>v*6eD18v=Iz0_fss@&>RD#pI8>}o@6q|3@%&7 z2msg?`@s>qh?$IZ13>4cHi*6NSAu=M2c9lth#1I5-v}E}^W94U5^s*sF`g`NfZ?c! z1TZ7@GYa!BD7G<`!2rhe)sp7vK$+FoCz@?*U_Y?vh~`8M8#$H^7Z+O5Ih7hRmkLLu zw^G0uH4H95q8$J$N$9xwRxS-p!QB1^h*3xugnpQTzTIXeLeN~pg#UyC(b}QA60Cag zud2VQO2Nq*B2`N@rPcJZJYI7LAK?;oNbsa$L-`x;R8>3G(Q;^Wf_;p0V~8?~RK{#> zH>qt&yG8SA9zw5F)SAMn$gaZM)xViGr>tH0ktA6d$_yvjueSM)BGKN8FFZR@98TZK*b5V^aYsNRy z1l{?DyRns7raf($j0^mu47%`Gbr4a+R?2341-FFsd_A z&09G%jQT*xKl1S}-~T%eDl~v(e;%VECj>wT2#JH||DuH4#!3z-;Dn7rU@$N2?86EP zHlG-2+oU>0(^V$|MaNp^uebMWJ+k7ZYU&LM7($f$sy7E1eJ{Mtblv;M(oAZH!?W#DG$wFc- zLqHINqJH>$yW^ONyB>nP`C4~+Z*88GXxW%bx*-J#0l(n_7BwqS z@Y$>Ir`T@8S$?tlv${g%2zn^0k<-`wQ#_|~Om_XpABMF^5@yr%UGvzk?8yZ_$y`5# zTt4?VWb@{A&YtG`7A!A)06^!K786#Df4@BaSBPHE*^-%+N@*`U@rJ9+o`9HVSE3oV z&+0Tw55I+T62{X4VCL4h$daTD46Kz57Bbq!G78LaTo~-PSF?CH`B_zy{2WupNXk;v z|F9capI7r%xZdVOU`EC^!5&#I&KNz&Hd0V!i4idDMmDSBxsR|d7eH9LX!vX2Gzu+| zbnF32JWk0m<`_b^NLiBD(r!mcn;K6VM^7v%g3zwze1TC){Kv#$P58CjRX#~leh` zBH*l+UDxxbQaQ<}MGpV^N|b6Z3|;!?J6(Q?BeI1Pe5g=e%rA3$`#bvH9;mPyzj{V8 z9jtQYk;BlKd5T7lsSH27=VbP8B($ATrfhxK?r%e3NzO-fG&7HT{4HTvTz72C)N4Vd zjzW(%L@|v?=D9A#^NvQXuVcY^2-)1QIlxy_PT;+IJM?V*%kS$vG5X!om-EH0;?;up z_ftcQKE8(IgznmCm^6MbPCJM7g?cIT{D+h(*W-a>uJBaj)rzaNaTe-kfZ>UDxO47bPCWKZXM}Pm2IK;yR<7QT_R%dCe%tSd4bWGzRN_S$Cj-5{h#)( zE2;^l-Nxeq5s=>WPy_`9so_A7s*r#Y5NQDnMM~(s*WfQbQbd7Bje>}Dq=XKa&>=MG zT_6y8fM6)0T+V&F5BKe^f33ULeVT`F_L}+j?3ss|HQ%29sRs`aE3=_kaH^g8++Uqe zQZ=}!AsH(-w7IH*g#3;C)IgHrY2Z+5vX#Hte@Kcyq21T-zPhs&3U7Pq{Jqx7f(>eD z{RcBJkc!I%$+~hO?8oV{JM=T-ekRYZ883K-Px~Z<1`f+KjulJ7nAq8=(V(z+54!SD zK}#Yw{O|plBaQyWxNW;H&vs?+amJne#Mn^J+7WpX#Wo(h-b|1xS!zgBqB;tW?ZiwE z*uAXKX`kIsz2RCbqSBo8kTA$AoUYMTiDnCFeyyTTTjTby;rG8##Uyd~PxTHqy((DDD>-&Zq@n7fdD+b}(t5`zx(pYQ(u# z56oEQ882(9BV^^(bq){^*4frmZZDTiJ+gXM;s{h0HP<`ED*S&}1-&ZlbJIo!AYBJ6i_1nVe+Q3T zf0qm2-rm0Hjx#cB83ulPmOsgP*>Af){(B-vGh`l>8xk&HRgV@Ke4g+~BAy4QQwXE} zz@VEdI?EOvO5rfyqqjX+*d>G2^YQ2?Q{ASzAe+eA78Bn|k7d$?nICm~z=bV9m2LK8 zT5?r}Lkiu^X_@c?e42h4`OFF>V97hP;J7o*hg=VTo)+BQlGCdrneAmwt~OY8*G3*q z?$iY4t^X@(MAzS+5?KCKS*^@KR0b2G+VG`qrg3qm<=$a8O>eh}LMaw#es8NP@b6F< z`7vayS~ZAB%H6tCa;h1!iX-S*F@wNBtL$}%+7l~lYq_Q6H7M&sOT+r$NtCm@*~jCB za+}5(J3`6Y?ardi2l1SS5Px&^X;B9RdsvDumr$Ov&wv?Hbya!q*+D|KzeS$033u?? z#&O@grj6a~_ed7j^rDWX2+@#z)E?#BzF2Cf{Tp9|cIrn%B4gigD8%E^>>x^)GN>6s z+}-n$5)laPExVJg8sLh>F?OL5MNZVv8bW|@&eYbVQ9*&pO;Iju@505yi7IMiXN=9| z#gl{7QpzrENcZ3#2?M=2^($WdioM-V?%kDiXJEe_>X_vBdE_B~$`&{K$~`%@GYecZ z(eM@n12orTt=I&VKExq0ZC`4Z6L>B+C~9N4?A7Yw=07ntHmChlW|Bn^>*FKoVy~S8 zXRjx<1TGjQ0=?5fo_4b)l8*I(eh3(Is`gx1Z3>8QXms98)wNPJJv$g&57ZhWjM3Y<2Y405dE)V4APfFU2a;+MgL68*V8&ZnxJ{_M?W6g`ds5$WxRxs~*q4tVY zr)N%uY6yFBty;DOL(S0(duYn4X3-w=ZUQ2#(pB^kS+cG=XxC9qffNs`9c;`AKZu#? zo78T(pofdBhKY)jqxIbCsXtx6OWW7nQ4sg*PhA_bym`4l(s!a>_R@O zg9uWD8!8v2;6EJlfq2w{g??<0SGrifZs!m-Fx#+{CH{(%Yk7Jf<)c+2&wjI!pZIq1 zEiSoetZ6GjKq|JGtl2xs%~fP(zIKah)IX25Z*P0Qt(A(2)eY#9{!Nf1CM2w>9g?S{ zvcO`H6XnJt4IUcA9s}u6Ww0Ui_=W%j1C`ry{1EA~zbpX(E#&y(Y>qpuuY5dq;3i*P z)Nx?gluAHKt#bmoU%*6)XAwv`{YLJOZ8ZO~AJ*5fEh=Q~?QPXsIZZEYX)bWy)_il) zAQ5`-sAF|Ko0&smjN{!p| z)cCB@qM|vdEijKN*7t*jwUK+sNzuoMP@cJcYTqtrtXrc*IGpQfD_i+1H#UAn;z^4q zFnl3p>^4l*o{eV1=KGgXrgP%wZ5L9MJSf9#wtR=gq^6=&gb_l=Me1yT>UQW4v`hl( zh9wAxz2?9HhRI`#q|&GYh(^7~LiMGghZcIbB4cJM{`97i|hg6Y6_Ly zd!>S8o3L#&n68-ES&-!Zd^u4C|_%la+1^3<}hU2)f(86bTA+q>Sbr zu+nQPJz%x(#we`(N{Wt2D`zMz17!($;J=PN=9oo$FGq0rp@;GJTUg6<=aJgTUieZ? z2t&;$1$lDeXRaJp{)w}^aQtPEnIrsTGRVkS7rC51J#rlZF-2)he1yh=y++=THNm~# zrD;xpOm!cNiun}i^yn1r_dZ}lQ3lNAB~1K-V{9IN10zq(3a@1)!8x)f9bWtQ z9_*b`oSE)?I6qtuO^IdFyBPU#h9eXUev}Qftg3C|TnM);Qs&8le{J$WPQ)8|zu|Tx zopF{8n#&JJTvZ^mr9Zi+nO|1Y$E@=_CK2Y!<#4fMPs*yj_b31!Q^^4hJTE4*cN3i1 z+v3F26OZbPGtM9*w+1-Mdw}zO{tvN#s+9sP9BnNxL7rXH^NN8vEN%-E#(YZQjHydImcVh9~OAoJ_p0yB+>RvhbIS#A354B0U$MbB21sH{A z0?BYBcN6@w8Vkc-@x$pY&=H;H?il90uxr{q&aHY}CEX-thY=aByF&6&yn;4;Tp})F zO`Uh?RZU_!l7|QZpO|{MDq|1CE%)f-Sl}pLA&e5QfRc#{&$Br;;B1K8Bax)H?T5)u z8FlA*C!S79L#E?i*IHj<)ps)tE}xGRF%`}Q+tm3v@e^=Yaw@NiZR%6InsTkT>FDn( z=UuoGHW5yFSOq^TJ!_EoiLKtLZ`Lao)|>Dh0bMXMWM5sKOFu1wR#fMkZ+vP+X^+T( znKz&O)0ooRc(@EOp)t+xHX?x@#!jeHM4?DYH!jGLbv^t10^D>!)ttHRKabTmdzikE6hQ`xOg zUFo8tA|E>Zsn(RZ(Be;JnnnlHU6Vl3uju%NX}`Q*yYi@Q3`&b=D1;Q$ z_9q|t*V>EC+HZR(9pqr0>!m_6 zF7!h)YeV$4C(Ly21Fs5d7eZTVeVj%(i9~h4jz|T>iCn zHyiMNP(VSzi$H z;FB4{3yWBXH_W<`1MjW)#m;miudhRGYy@w1pG)(V3z(4vaUE=^W5HaCdw`0C$hzP^ zolA$Oi9L&+m5P*{u7tOPja=5G&3RAKZ2;hjQmg|20NA;ka}5BfjtHc^s<*|o{QrUf z6O<&5kJ2b0=#n=#fB-<~AD$)D`*(9LX(M~&ZSB1Exc>zFvUSL0W!=~?$U0>i3cnub zxl0YN`&yuV4X_7&scsCZ&ynmbWZpm1hg!}DBK@v@UITuy3kP+^Yex&*>mX}&;v@T& z0mJ=wGu7PJ>u&)7pZPju0f0CDS8@jcW}Yfv2LK#z>|eba{Cfh$1q{P^;NXTouSTC= z&)yfu>%d4QN`N=2kvbpKLmGG#HxpP9(mN_C;T~F&4@CUw0dM#TpWJR_j6%)(w{s^u zs~#G|%#hznd-0Ea^AcJK*GLgrw)!p7b^-YiL?cm2+6?K=bf-012Rc-” to store pages. The second level cache stores pages into application-scoped variables which are identified by a session id and a page id. +By default Wicket persists versions of pages into a session-relative file on disk, but it uses a two-level cache to speed up the access. The first level of the cache contains all the pages involved in the current requests as we may visit more than one page during a single request, for example if we have been redirected with _setResponsePage_. +The second level cache stores the last rendered page into a session-scoped variables. + +NOTE: Scoped variables will be introduced in <> which is about Wicket metadata. The following picture is an overview of these two caching levels: image::../img/wicket-cache.png[] -The session-scoped cache is faster then the other memory levels but it contains only the pages used to serve the last request. Wicket allows us to set the maximum amount of memory allowed for the application-scoped cache and for the page store file. Both parameters can be configured via setting class _org.apache.wicket.settings.StoreSettings_. - -This interface provides the _setMaxSizePerSession(Bytes bytes)_ method to set the size for page store file. The Bytes parameter is the maximum size allowed for this file: +Wicket allows us to set the maximum size of the file used to store pages with setting class _org.apache.wicket.settings.StoreSettings_. +This class provides the _setMaxSizePerSession(Bytes bytes)_ method to set the size of the file. The Bytes parameter is the maximum size allowed for this file: [source,java] ---- @@ -110,17 +112,8 @@ public void init() ---- Class _org.apache.wicket.util.lang.Bytes_ is an utility class provided by Wicket to express size in bytes (for further details refer to the JavaDoc). -For the second level cache we can use the _setInmemoryCacheSize(int inmemoryCacheSize)_ method. The integer parameter is the maximum number of page instances that will be saved into application-scoped cache: -[source,java] ----- -@Override -public void init() -{ - super.init(); - getStoreSettings().setInmemoryCacheSize(50); -} ----- +NOTE: more insights on internal page handling will be covered in <> === Page expiration From 1926d1458da99136daebd861e52e2fc71bbe44db Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 4 May 2021 16:53:27 +0300 Subject: [PATCH 03/88] WICKET-6884 Trigger build to rebuild apidocs From d11d98f774ee8ced875db34e7ba5c440ceed7545 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 4 May 2021 17:12:57 +0300 Subject: [PATCH 04/88] WICKET-6884 Trigger build to rebuild apidocs 2 From b6dbbaee1bcb3c1fe66a6d4c28b46be11ceedfa8 Mon Sep 17 00:00:00 2001 From: Johannes Renoth Date: Tue, 4 May 2021 16:28:01 +0200 Subject: [PATCH 05/88] Add scope = col to Columnheaders (#468) WICKET-6885 Add scope col attribute to HeadersToolbar (cherry picked from commit 41aeafa9928f4717cb189931243815399fcd5e09) --- .../markup/html/repeater/data/table/HeadersToolbar.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.java index ab37e178dd3..c7a39710b9e 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.java @@ -111,6 +111,9 @@ protected String getCssClass() if (column.getHeaderColspan() > 1) { header.add(AttributeModifier.replace("colspan", column.getHeaderColspan())); + header.add(AttributeModifier.replace("scope", "colgroup")); + } else { + header.add(AttributeModifier.replace("scope", "col")); } if (column.getHeaderRowspan() > 1) { From f0cdafda68bb953889671440af762dbca5f629a3 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 4 May 2021 17:33:46 +0300 Subject: [PATCH 06/88] Fix index of a list item (cherry picked from commit ae7a254f112bd07bebf09a7ab2c8725dd4af0d64) --- .../main/asciidoc/componentLifecycle/componentLifecycle_1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-user-guide/src/main/asciidoc/componentLifecycle/componentLifecycle_1.adoc b/wicket-user-guide/src/main/asciidoc/componentLifecycle/componentLifecycle_1.adoc index a2c778ad99c..45df71c6bd2 100644 --- a/wicket-user-guide/src/main/asciidoc/componentLifecycle/componentLifecycle_1.adoc +++ b/wicket-user-guide/src/main/asciidoc/componentLifecycle/componentLifecycle_1.adoc @@ -6,7 +6,7 @@ During its life a Wicket component goes through the following stages: 1. *Initialization:* a component is instantiated and initialized by Wicket. 2. *Rendering:* components are prepared for rendering and generate markup. If a component contains children (i.e. is a subclass of _MarkupContainer_) their rendering result is included in the resulting markup. 3. *Removed:* this stage is triggered when a component is explicitly removed from its component hierarchy, i.e. when its parent invokes _remove(component)_ on it. This stage is facultative and is never triggered for pages. -3. *Detached:* after request processing has ended all components are notified to detach any state that is no longer needed. +4. *Detached:* after request processing has ended all components are notified to detach any state that is no longer needed. The following picture shows the state diagram of component lifecycle: From 2638b55f2074eced54eb9a7dfbf42efab5e2ecf4 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 4 May 2021 17:47:46 +0300 Subject: [PATCH 07/88] WICKET-6884 Trigger build to rebuild apidocs 3 From 67ca0e8b0757de2a4a009109a4db4bfabf8d4721 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 6 May 2021 11:49:40 +0300 Subject: [PATCH 08/88] Update jacoco to 0.8.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 673b5a8fbad..bbe83c6afa5 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,7 @@ 4.2.3 2.2.1-b05 3.1 - 0.8.6 + 0.8.7 2.10.5 1.3.5 3.0.3 From 734f598f2feaed70dd8d244c5d5e33de2a38523c Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 7 May 2021 16:06:04 +0300 Subject: [PATCH 09/88] WICKET-6884 Trigger build to rebuild apidocs 4 From 4b23b3ee7b3b89326e3457d3c33ec6422766da6e Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Mon, 10 May 2021 23:12:38 +0200 Subject: [PATCH 10/88] WICKET-6883 updated internals chapter exposing the default IPageStore chain --- .../main/asciidoc/internals/pagestoring.adoc | 39 +++++++++---------- .../versioningCaching_2.adoc | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc b/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc index 4bb85b97606..b866f23134e 100644 --- a/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc +++ b/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc @@ -9,42 +9,41 @@ image::../img/page-storage.png[] === IPageManager _org.apache.wicket.page.IPageManager_'s task is to manage which pages have been used in a request and store their last state in the backing stores, namely _IPageStore_. -The default implementation _org.apache.wicket.page.PageManager_ uses a chaing of page stores to collect all stateful pages which have been used in the request cycle (more than one page can be used in a single request if for example _setResponsePage()_ or _RestartResponseException_ is used). -At the end of the request all collected page instances are being stored in the first level cache - http session. They are stored as metadata in the http session and passed to an underlying _IPageStore_. -When the next http request is handled, _IPageProvider_ will ask for page with specific id and _PageManager_ will look first in the http session and if no match is found then it will delegate to any further IPageStore. At the end of the second request the http session based cache is being overwritten completely with the newly used page instances. +The default implementation _org.apache.wicket.page.PageManager_ uses a chain of _IPageStore_ to collect all stateful pages which have been used in the request cycle and store them for a later use. -To setup another _IPageManager_ implementation use _org.apache.wicket.Application.setPageManagerProvider(IPageManagerProvider)_. -The custom _IPageManager_ implementation may use a custom chain of _IPageStore_s as needed. +NOTE: Keep in mind that more than one page can be used in a single request if, for example, _setResponsePage()_ or _RestartResponseException_ are used. -=== IPageStore +As said on <> stateful pages are stored in a session-relative file using a two-levels cache to speedup the access. This process is made possible by the different implementations of _IPageStore_ that are part of the default chain and that will be introduced in the next paragraph. -_org.apache.wicket.pageStore.IPageStore_'s role is to mediate the storing and loading of pages done by the underlying _IDataStore_. The default implementation _org.apache.wicket.pageStore.DefaultPageStore_ pre-processes the pages before passing them to _IDataStore.storeData(String, int, byte)_ and to post-processes them after _IDataStore.getData(String, int)_. The processing consists of transforming the page instance to _org.apache.wicket.pageStore.DefaultPageStore.SerializedPage_. This is a struct of: +NOTE: Wicket gets the default _IPageManager_ using a supplier interface called _IPageManagerProvider_,hence to use a custom _IPageManager_ implementation we must register a specific _IPageManagerProvider_ via _org.apache.wicket.Application.setPageManagerProvider(IPageManagerProvider)_. + +=== Default IPageStore chain + +_org.apache.wicket.pageStore.IPageStore_'s role is to mediate the storing and loading of page instances. The default chain of _IPageStore_ used by Wicket contains the following ordered list of _IDataStore_: + +* *RequestPageStore:* collect all page instances involved in the last request. During the detach stage, stateful pages are passed to the othr steps of the chain to be persisted on file. +* *InSessionPageStore:* with _InSessionPageStore_ the default chain keeps the last rendered page instance into the HTTP session for fast access. +* *SerializingPageStore:* _SerializingPageStore_ turns page instances into a more serialization-friendly format represented by class _org.apache.wicket.pageStore.SerializedPage_. This is a struct of: [source,java] ---- { - sessionId: String, + pageType: String, pageId : int, data : byte[] } ---- -i.e. this is the serialized page instance (data) plus additional information needed to be able to easily find it later (sessionId, pageId). - -When a _SerializedPage_ has to be stored _DefaultPageStore_ stores it in a application scoped cache ({sessionId, pageId} -> SerializedPage) and additionally gives it to the underlying _IDataStore.storeData(sessionId, pageId, data)_. The application scoped cache is used as second level cache. Getting a page from it is slower than the http session based cache in _PageStoreManager_ because the page has to be deserialized, but is faster than the underlying _IDataStore_ which stores the page bytes in some persistent store. +i.e. this is the serialized page instance (data) plus additional information needed to be able to easily find it later (pageId, pageType). -The size of the application scoped cache is configurable via _org.apache.wicket.settings.StoreSettings.setInmemoryCacheSize(int)_. +* *AsynchronousPageStore:* The role of _AsynchronousPageStore_ is to detach the http worker thread from waiting for the write of the page bytes to the disk. To disable it use: _org.apache.wicket.settings.StoreSettings.setAsynchronous(false)_. _AsynchronousPageStore_ can delay the storage of page's bytes for at most _org.apache.wicket.settings.StoreSettings.setAsynchronousQueueCapacity(int)_ pages. If this capacity is exceeded then the page's bytes are written synchronously to the backing _IPageStore_. -=== IDataStore +* *CryptingPageStore:* page instances might contain sensible informations, therefore it's important to have the chance to encrypt their content before persist them on disk. _CryptingPageStore_ encrypts _SerializedPage_'s with a 256 bit AES before passing them to the underling _DiskPageStore_. Buy default this stage is disabled and not added to the default chain. To change this behavior we can use _org.apache.wicket.settings.StoreSettings.setEncrypted_. -_org.apache.wicket.pageStore.IDataStore_ is used to persist Wicket pages (as bytes) to a persistent store like e.g. files or databases. The default implementation is _org.apache.wicket.pageStore.DiskDataStore_ which as its name says stores the pages in files. The location of the folder where the files are stored is configurable via _org.apache.wicket.settings.StoreSettings.setFileStoreFolder(File)_, by default the web container's work folder is used (ServletContext attribute 'javax.servlet.context.tempdir'). In this folder a sub-folder is created named _'applicationName-filestore'_. +* *DiskPageStore:* stores _SerializedPage_ on a session-scoped file on disk. The location of the folder where the files are stored is configurable via _org.apache.wicket.settings.StoreSettings.setFileStoreFolder(File)_, by default the web container's work folder is used (ServletContext attribute 'javax.servlet.context.tempdir'). In this folder a sub-folder is created named _'applicationName-filestore'_. This folder contains a sub-folder for each active http session. This session folder contains a single file named 'data' which contains the bytes for the pages. The size of this 'data' file is configurable via _org.apache.wicket.settings.StoreSettings.setMaxSizePerSession(Bytes)_. When this size is exceeded the newly stored files overwrite the oldest ones. -=== AsynchronousDataStore - -By default Wicket wraps _DiskDataStore_ with _org.apache.wicket.pageStore.AsynchronousDataStore_. The role of _AsynchronousDataStore_ is to detach the http worker thread from waiting for the write of the page bytes to the disk. -To disable it use: _org.apache.wicket.settings.StoreSettings.setAsynchronous(false)_. AsynchronousDataStore can delay the storage of page's bytes for at most _org.apache.wicket.settings.StoreSettings.setAsynchronousQueueCapacity(int)_ pages. If this capacity is exceeded then the page's bytes are written synchronously to the backing _IDataStore_. - + === DebugDiskDataStore Wicket provides an extension of _DiskDataStore_ that can be used to browse the content of the 'data' files created by _DiskDataStore_. This extension can be found in wicket-devutils.jar and needs to be enabled in the _init_-method of your application via @@ -81,7 +80,7 @@ MyApp#init() === DebugBar -Further insights which can be valueable during debugging can be retrieved using the _org.apache.wicket.devutils.debugbar.DebugBar_ from wicket-devutils.jar. It's a panel which you simply add: +Further insights which can be valuable during debugging can be retrieved using the _org.apache.wicket.devutils.debugbar.DebugBar_ from wicket-devutils.jar. It's a panel which you simply add: Java: [source,java] diff --git a/wicket-user-guide/src/main/asciidoc/versioningCaching/versioningCaching_2.adoc b/wicket-user-guide/src/main/asciidoc/versioningCaching/versioningCaching_2.adoc index 67d35d1b672..a2e1887fd68 100644 --- a/wicket-user-guide/src/main/asciidoc/versioningCaching/versioningCaching_2.adoc +++ b/wicket-user-guide/src/main/asciidoc/versioningCaching/versioningCaching_2.adoc @@ -113,7 +113,7 @@ public void init() Class _org.apache.wicket.util.lang.Bytes_ is an utility class provided by Wicket to express size in bytes (for further details refer to the JavaDoc). -NOTE: more insights on internal page handling will be covered in <> +NOTE: More insights on internal page storing will be covered in <> === Page expiration From a30dcc36a9e66c65ca08f0ba03e670c234510907 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 13 May 2021 10:00:39 +0300 Subject: [PATCH 11/88] Update Spring to 5.3.7 and Mockito to 3.10.0 (cherry picked from commit 65c208e85d9f42d19db49f46610d6b8daaf79a09) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bbe83c6afa5..04c2ee8cba4 100644 --- a/pom.xml +++ b/pom.xml @@ -163,11 +163,11 @@ 6.2.0.Final 1.7.3 4.1.19 - 3.9.0 + 3.10.0 3.2 1.0.12 1.7.25 - 5.3.6 + 5.3.7 3.4.3 3.1.7.Final 2.3 From 1d91c33fb40eab3aae0ed79453d398d8946bf0fb Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Fri, 14 May 2021 23:17:22 +0200 Subject: [PATCH 12/88] Added a paragraph on InMemoryPageStore --- .../main/asciidoc/internals/pagestoring.adoc | 35 ++----------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc b/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc index b866f23134e..31f0c059528 100644 --- a/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc +++ b/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc @@ -43,40 +43,9 @@ i.e. this is the serialized page instance (data) plus additional information nee * *DiskPageStore:* stores _SerializedPage_ on a session-scoped file on disk. The location of the folder where the files are stored is configurable via _org.apache.wicket.settings.StoreSettings.setFileStoreFolder(File)_, by default the web container's work folder is used (ServletContext attribute 'javax.servlet.context.tempdir'). In this folder a sub-folder is created named _'applicationName-filestore'_. This folder contains a sub-folder for each active http session. This session folder contains a single file named 'data' which contains the bytes for the pages. The size of this 'data' file is configurable via _org.apache.wicket.settings.StoreSettings.setMaxSizePerSession(Bytes)_. When this size is exceeded the newly stored files overwrite the oldest ones. - -=== DebugDiskDataStore +=== InMemoryPageStore -Wicket provides an extension of _DiskDataStore_ that can be used to browse the content of the 'data' files created by _DiskDataStore_. This extension can be found in wicket-devutils.jar and needs to be enabled in the _init_-method of your application via -[source,java] ----- - DebugDiskDataStore.register(this); ----- -The debug information can be seen at http://host:port/context/wicket/internal/debug/diskDataStore - -=== HttpSessionDataStore - -In some environments like Google AppEngine it is not allowed to write to the file system and thus _DiskDataStore_ cannot be used. In this case _org.apache.wicket.pageStore.memory.HttpSessionDataStore_ can be used as replacement. This implementation of _IDataStore_ is not persistent and puts all the data in the http session. -Wicket comes with 2 default eviction strategies to keep the size of the http session reasonable: - -* *org.apache.wicket.pageStore.memory.PageNumberEvictionStrategy* - specifies how many pages can be hold -* *org.apache.wicket.pageStore.memory.MemorySizeEvictionStrategy* - specifies the maximum amount of memory for pages per http session. - -To configure it: -[source,java] ----- -MyApp#init() -{ - super.init(); - - setPageManagerProvider(new DefaultPageManagerProvider(this) - { - protected IDataStore newDataStore() - { - return new HttpSessionDataStore(getPageManagerContext(), new PageNumberEvictionStrategy(20)); - } - } -} ----- +An alternative _IPageStore_ we can use in a custom chain is _org.apache.wicket.pageStore.InMemoryPageStore_. This implementation stores pages in a session-relative variable which can be limited by size or by page instance number. === DebugBar From e58168902a7817a80e92dc5224a698147161224f Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 18 May 2021 09:55:14 +0300 Subject: [PATCH 13/88] Update JUnit to 5.7.2, frontend-maven-plugin to 1.12.0, Node.js to 14.17.0 and NPM to 7.13.0 (cherry picked from commit 8fe16675988de1071b3b3c1c0b8707ecb22d3f79) --- pom.xml | 2 +- testing/wicket-js-tests/pom.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 04c2ee8cba4..3b650a4809a 100644 --- a/pom.xml +++ b/pom.xml @@ -156,7 +156,7 @@ 3.1.0 1.9.0 9.4.40.v20210413 - 5.7.1 + 5.7.2 3.0.2 1.2.3 2.2 diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml index 508ce1a3a92..0d3f3b0e1a2 100644 --- a/testing/wicket-js-tests/pom.xml +++ b/testing/wicket-js-tests/pom.xml @@ -91,7 +91,7 @@ com.github.eirslett frontend-maven-plugin - 1.11.3 + 1.12.0 install node and npm @@ -100,8 +100,8 @@ generate-resources - 6.14.11 - v14.15.5 + 7.13.0 + v14.17.0 From 5829f869afa828b84417a79d62b0d30e0ea4445c Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Fri, 21 May 2021 23:11:21 +0200 Subject: [PATCH 14/88] WICKET-6886 make methods interface default --- .../markup/html/form/ChoiceRenderer.java | 16 ---------------- .../markup/html/form/IChoiceRenderer.java | 19 +++++++++++++++++-- .../form/EscapeAttributesInChoicesPage.java | 8 ++++---- .../examples/compref/DropDownChoicePage.java | 4 ++-- .../examples/datetime/DateTimePage.java | 3 +-- .../wicket/examples/forminput/FormInput.java | 6 +++--- .../html/form/palette/PaletteTestPage.java | 3 +-- 7 files changed, 28 insertions(+), 31 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java index 96e4fb29709..5a52fa6f9ed 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ChoiceRenderer.java @@ -154,20 +154,4 @@ public String getIdValue(T object, int index) return returnValue.toString(); } - - @Override - public T getObject(String id, IModel> choices) - { - List _choices = choices.getObject(); - for (int index = 0; index < _choices.size(); index++) - { - // Get next choice - final T choice = _choices.get(index); - if (getIdValue(choice, index).equals(id)) - { - return choice; - } - } - return null; - } } diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java index 5fcc14ee6d0..3e47aaa9470 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/IChoiceRenderer.java @@ -55,7 +55,9 @@ public interface IChoiceRenderer extends IDetachable * The index of the object in the choices list. * @return String */ - String getIdValue(T object, int index); + default String getIdValue(T object, int index) { + return Integer.toString(index); + } /** * This method is called to get an object back from its id representation. @@ -69,7 +71,20 @@ public interface IChoiceRenderer extends IDetachable * The list of all rendered choices * @return A choice from the list that has this {@code id} */ - T getObject(String id, IModel> choices); + default T getObject(String id, IModel> choices) + { + List _choices = choices.getObject(); + for (int index = 0; index < _choices.size(); index++) + { + // Get next choice + final T choice = _choices.get(index); + if (getIdValue(choice, index).equals(id)) + { + return choice; + } + } + return null; + } /** * Override when needed. diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/EscapeAttributesInChoicesPage.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/EscapeAttributesInChoicesPage.java index a6051fa816b..cfcd0064d58 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/EscapeAttributesInChoicesPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/EscapeAttributesInChoicesPage.java @@ -16,13 +16,13 @@ */ package org.apache.wicket.markup.html.form; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.request.mapper.parameter.PageParameters; - import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.request.mapper.parameter.PageParameters; + public class EscapeAttributesInChoicesPage extends WebPage { private static final long serialVersionUID = 1L; @@ -32,7 +32,7 @@ public EscapeAttributesInChoicesPage(final PageParameters parameters) { final Map fruits = new HashMap<>(); fruits.put("apple\" onmouseover=\"alert('hi');\" \"", "Apple"); - IChoiceRenderer iChoiceRenderer = new ChoiceRenderer() { + IChoiceRenderer iChoiceRenderer = new IChoiceRenderer() { @Override public Object getDisplayValue(final String s) { return fruits.get(s); diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/compref/DropDownChoicePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/compref/DropDownChoicePage.java index 78931cb797d..250e4c808fd 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/compref/DropDownChoicePage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/compref/DropDownChoicePage.java @@ -20,9 +20,9 @@ import java.util.List; import org.apache.wicket.examples.WicketExamplePage; -import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.util.io.IClusterable; @@ -84,7 +84,7 @@ protected void onSubmit() // like the example below. Don't forget to check out the default // implementation of // IChoiceRenderer, ChoiceRenderer. - form.add(new DropDownChoice<>("integer", INTEGERS, new ChoiceRenderer() + form.add(new DropDownChoice<>("integer", INTEGERS, new IChoiceRenderer() { /** * Gets the display value that is visible to the end user. diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/datetime/DateTimePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/datetime/DateTimePage.java index 3548c09c088..e3e0b9773bb 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/datetime/DateTimePage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/datetime/DateTimePage.java @@ -39,7 +39,6 @@ import org.apache.wicket.extensions.markup.html.form.datetime.ZonedToLocalDateTimeModel; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Button; -import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.FormComponentUpdatingBehavior; @@ -211,7 +210,7 @@ protected void onInitialize() /** * Choice for a locale. */ - private final class LocaleChoiceRenderer extends ChoiceRenderer + private final class LocaleChoiceRenderer implements IChoiceRenderer { private static final long serialVersionUID = 1L; diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.java b/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.java index 0ff46811f15..b2e5fd81525 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/forminput/FormInput.java @@ -28,14 +28,14 @@ import org.apache.wicket.markup.html.form.Check; import org.apache.wicket.markup.html.form.CheckBox; import org.apache.wicket.markup.html.form.CheckGroup; -import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.FormComponentUpdatingBehavior; +import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.markup.html.form.ListMultipleChoice; import org.apache.wicket.markup.html.form.Radio; import org.apache.wicket.markup.html.form.RadioChoice; import org.apache.wicket.markup.html.form.RadioGroup; -import org.apache.wicket.markup.html.form.FormComponentUpdatingBehavior; import org.apache.wicket.markup.html.form.SimpleFormComponentLabel; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.link.Link; @@ -222,7 +222,7 @@ protected void populateItem(ListItem item) /** * Choice for a locale. */ - private final class LocaleChoiceRenderer extends ChoiceRenderer + private final class LocaleChoiceRenderer implements IChoiceRenderer { @Override public Object getDisplayValue(Locale locale) diff --git a/wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/form/palette/PaletteTestPage.java b/wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/form/palette/PaletteTestPage.java index 59a0357f9ea..ccb62c00564 100644 --- a/wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/form/palette/PaletteTestPage.java +++ b/wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/form/palette/PaletteTestPage.java @@ -19,7 +19,6 @@ import java.util.List; import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.CompoundPropertyModel; @@ -45,7 +44,7 @@ public PaletteTestPage(IModel> selected, IModel> all) form = new Form<>("form", new CompoundPropertyModel("WICKET-5086")); add(form); - IChoiceRenderer choiceRenderer = new ChoiceRenderer() + IChoiceRenderer choiceRenderer = new IChoiceRenderer() { @Override public Object getDisplayValue(String s) From bf4a90185fb8be2ceecfaeb3fa1003c166fe7761 Mon Sep 17 00:00:00 2001 From: Roland Kurucz Date: Fri, 21 May 2021 22:04:04 +0200 Subject: [PATCH 15/88] WICKET-6886 LambdaChoiceRenderer with unit tests --- .../html/form/LambdaChoiceRenderer.java | 131 ++++++++++++++++++ .../html/form/LambdaChoiceRendererTest.java | 90 ++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java create mode 100644 wicket-core/src/test/java/org/apache/wicket/markup/html/form/LambdaChoiceRendererTest.java diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java new file mode 100644 index 00000000000..79070fa7a72 --- /dev/null +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.markup.html.form; + +import org.danekja.java.util.function.serializable.SerializableFunction; + +/** + * Renders one choice. Separates the 'id' values used for internal representation from 'display + * values' which are the values shown to the user of components that use this renderer. + *

+ * Usage: + * + *

+ * new DropDownChoice<User>("users", new Model<User>(selectedUser), listOfUsers,
+ * 	new LambdaChoiceRenderer<User>(User::getName))
+ * 
+ *

+ * creates a DropDownChoice of users and the display value will be looked up by function + * (User::getName) and the id the index of the object in the ListOfUsers + *

+ *

+ * + *

+ * new DropDownChoice<User>("users", new Model<User>(selectedUser), listOfUsers,
+ * 	new LambdaChoiceRenderer<User>(User::getName, User::getId))
+ * 
+ *

+ * creates a DropDownChoice of users and the display value will be looked up by function + * (User::getName) and the id will be looked up by the function (User::getId) + *

+ * + * @param The model object type + * @author + */ +public class LambdaChoiceRenderer implements IChoiceRenderer { + private static final long serialVersionUID = 1L; + + /** + * function for getting the display value. + */ + private final SerializableFunction displayExpression; + + /** + * function for getting the id. + */ + private final SerializableFunction idExpression; + + /** + * Constructor. + *

+ * When you use this constructor, the display value will be determined by calling + * toString() on the list object, and the id will be based on the list index. the id value will + * be the index + */ + public LambdaChoiceRenderer() { + this(null); + } + + /** + * Constructor. + *

+ * When you use this constructor, the display value will be determined by executing + * the given function on the list object, and the id will be based on the list index. + * The display value will be calculated by the given function + * + * @param displayExpression A function to get the display value + */ + public LambdaChoiceRenderer(SerializableFunction displayExpression) { + this(displayExpression, null); + } + + /** + * Constructor. + *

+ * When you use this constructor, both the id and the display value will be + * determined by executing the given functions on the list object. + * + * @param displayExpression A function to get the display value + * @param idExpression A function to get the id value + */ + public LambdaChoiceRenderer(SerializableFunction displayExpression, SerializableFunction idExpression) { + this.displayExpression = displayExpression; + this.idExpression = idExpression; + } + + @Override + public Object getDisplayValue(T object) { + Object returnValue = object; + if ((displayExpression != null) && (object != null)) { + returnValue = displayExpression.apply(object); + } + + if (returnValue == null) { + return ""; + } + + return returnValue; + } + + @Override + public String getIdValue(T object, int index) { + if (idExpression == null) { + return Integer.toString(index); + } + + if (object == null) { + return ""; + } + + Object returnValue = idExpression.apply(object); + if (returnValue == null) { + return ""; + } + + return returnValue.toString(); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/LambdaChoiceRendererTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/LambdaChoiceRendererTest.java new file mode 100644 index 00000000000..67724106f0a --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/LambdaChoiceRendererTest.java @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.markup.html.form; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; + +/** + * Tests {@link LambdaChoiceRenderer} + */ +class LambdaChoiceRendererTest { + + private final Choice choice = new Choice(); + + @Test + void testLambdaChoiceRendererWithoutExpression() { + final LambdaChoiceRenderer renderer = new LambdaChoiceRenderer<>(); + assertEquals(String.valueOf(0), renderer.getIdValue(choice, 0)); + assertSame(choice, renderer.getDisplayValue(choice)); + } + + @Test + void testLambdaChoiceRendererWithNullObjectAndWithoutExpression() { + final LambdaChoiceRenderer renderer = new LambdaChoiceRenderer<>(); + assertEquals(String.valueOf(0), renderer.getIdValue(null, 0)); + assertEquals("", renderer.getDisplayValue(null)); + } + + @Test + void testLambdaChoiceRendererWithDisplayExpression() { + final LambdaChoiceRenderer renderer = new LambdaChoiceRenderer<>(Choice::getName); + assertEquals(String.valueOf(0), renderer.getIdValue(choice, 0)); + assertEquals(choice.getName(), renderer.getDisplayValue(choice)); + } + + @Test + void testLambdaChoiceRendererWithDisplayAndIdExpression() { + final LambdaChoiceRenderer renderer = new LambdaChoiceRenderer<>(Choice::getName, Choice::getId); + assertEquals(String.valueOf(choice.getId()), renderer.getIdValue(choice, 0)); + assertEquals(choice.getName(), renderer.getDisplayValue(choice)); + } + + @Test + void testLambdaChoiceRendererWithNullObjectAndDisplayAndIdExpression() { + final LambdaChoiceRenderer renderer = new LambdaChoiceRenderer<>(Choice::getName, Choice::getId); + assertEquals("", renderer.getIdValue(null, 0)); + assertEquals("", renderer.getDisplayValue(null)); + } + + @Test + void testLambdaChoiceRendererWithNullReturnValueAndDisplayAndIdExpression() { + final LambdaChoiceRenderer renderer = new LambdaChoiceRenderer<>(Choice::getNull, Choice::getNull); + assertEquals("", renderer.getIdValue(choice, 0)); + assertEquals("", renderer.getDisplayValue(choice)); + } + + /** + * Class for testing + */ + private static class Choice { + public Long getId() { + return -1L; + } + + public String getName() { + return "name"; + } + + public Object getNull() { + return null; + } + } + +} From 884e5b8fabdc4f600632435b7302ac45befc8730 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 27 May 2021 15:07:37 +0300 Subject: [PATCH 16/88] Remove useless @author --- .../org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java index 79070fa7a72..27cc03d9a1a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/LambdaChoiceRenderer.java @@ -44,7 +44,6 @@ *

* * @param The model object type - * @author */ public class LambdaChoiceRenderer implements IChoiceRenderer { private static final long serialVersionUID = 1L; From 35ba51ed61663816846a03158269734239b19cca Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 27 May 2021 15:13:09 +0300 Subject: [PATCH 17/88] Update Jetty to 9.4.41 and maven-javadoc-plugin to 3.3.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3b650a4809a..81070900722 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ 1.1.2 3.1.0 1.9.0 - 9.4.40.v20210413 + 9.4.41.v20210516 5.7.2 3.0.2 1.2.3 @@ -183,7 +183,7 @@ 1.6 2.5.2 3.2.0 - 3.2.0 + 3.3.0 3.1.1 2.5.3 1.7.0 From d8e6061ca77e4d023bfb80d8bd15fc9e2c177f15 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 1 Jun 2021 11:25:15 +0300 Subject: [PATCH 18/88] Send GitHub notifications to commits@wicket.a.o Discussed at: https://markmail.org/message/5qkttpa6qcvc6ui6 (cherry picked from commit 8d44c5b5094cccc9d5e05408e42ccc1bd0dd4da6) --- .asf.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.asf.yaml b/.asf.yaml index cef13e1c67d..23c4a758ef7 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -6,3 +6,8 @@ github: - java - web - html + +notifications: + commits: commits@wicket.apache.org + pullrequests: commits@wicket.apache.org + jira_options: link label comment From ef31a27b0c222b315193de27b35e88ce1af1c359 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 4 Jun 2021 16:02:38 +0300 Subject: [PATCH 19/88] Update Mockito to 3.11.0 (cherry picked from commit 7f8a61a87436a29fe12dfc23f991fdb3bd33d032) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 81070900722..b4e35d35d06 100644 --- a/pom.xml +++ b/pom.xml @@ -163,7 +163,7 @@ 6.2.0.Final 1.7.3 4.1.19 - 3.10.0 + 3.11.0 3.2 1.0.12 1.7.25 From 4abcb5a56bdd65730188e6c820a6a7392c20d1f9 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 9 Jun 2021 16:37:06 +0300 Subject: [PATCH 20/88] Update Jetty to 9.4.42 and Spring to 5.3.8 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b4e35d35d06..7de71b660c7 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ 1.1.2 3.1.0 1.9.0 - 9.4.41.v20210516 + 9.4.42.v20210604 5.7.2 3.0.2 1.2.3 @@ -167,7 +167,7 @@ 3.2 1.0.12 1.7.25 - 5.3.7 + 5.3.8 3.4.3 3.1.7.Final 2.3 From 8d83afba1bfe0c86f0401c217260e06f577f8678 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 14 Jun 2021 14:00:09 +0300 Subject: [PATCH 21/88] Update Mockito to 3.11.1 Trigger a build for INFRA-21830 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7de71b660c7..bc6b48eeb04 100644 --- a/pom.xml +++ b/pom.xml @@ -163,7 +163,7 @@ 6.2.0.Final 1.7.3 4.1.19 - 3.11.0 + 3.11.1 3.2 1.0.12 1.7.25 From a81a499cd0b223842c77b4f0423f04efc49c837b Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 14 Jun 2021 15:02:25 +0300 Subject: [PATCH 22/88] Add a profile for JDK 18 --- pom.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pom.xml b/pom.xml index bc6b48eeb04..083c39b6aac 100644 --- a/pom.xml +++ b/pom.xml @@ -1558,6 +1558,32 @@ + + java18 + + + + org.apache.maven.plugins + maven-toolchains-plugin + ${maven-toolchains-plugin.version} + + + + toolchain + + + + + + + 18 + + + + + + + From d8a252553c6a70f236afc73c286285a50b2cae77 Mon Sep 17 00:00:00 2001 From: Martin Grigorov Date: Thu, 17 Jun 2021 09:46:06 +0300 Subject: [PATCH 23/88] WICKET-6895 Links to examples in documentation not points to old version of 8x Fix the url to use examples9x --- wicket-user-guide/src/main/asciidoc/single.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-user-guide/src/main/asciidoc/single.adoc b/wicket-user-guide/src/main/asciidoc/single.adoc index a134fca7805..e7f96e844d9 100644 --- a/wicket-user-guide/src/main/asciidoc/single.adoc +++ b/wicket-user-guide/src/main/asciidoc/single.adoc @@ -9,7 +9,7 @@ The Apache Software Foundation :sectnums: //custom variables used inside the guide -:wicket_examples_url: http://examples8x.wicket.apache.org +:wicket_examples_url: http://examples9x.wicket.apache.org :wicket_tutorial_examples_url: https://wicket-guide.herokuapp.com/ == Introduction From 11f04a2612ee56814bc287e1d05bfa679abbacc9 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 18 Jun 2021 10:34:51 +0300 Subject: [PATCH 24/88] INFRA-21830 Test build on JDK 16 & 17 From 45f0333f99da5f5eb21e7b9f659959c527780084 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 24 Jun 2021 16:36:07 +0300 Subject: [PATCH 25/88] WICKET-6896 AutoCompleteTextField re-opens dropdown item list after item has been selected --- .../html/autocomplete/wicket-autocomplete.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js index 7d23fbe402d..0aa39b45160 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js @@ -77,6 +77,12 @@ // timeout handler that cancels the hiding of the menu if the focus is still on menu items var hideAutoCompleteTimer; + // A flag indicating whether the 'change' event has been triggered manually after selection + // from the menu. + // In this case we don't want to render the menu. + // It is usually rendered on successful Ajax response + var isTriggeredChange = false; + function initialize(){ var isShowing = false; // Remove the autocompletion menu if still present from @@ -450,9 +456,10 @@ } if (triggerChangeOnHide) { + triggerChangeOnHide = false; var input = Wicket.$(ajaxAttributes.c); + isTriggeredChange = true; jQuery(input).trigger('change'); - triggerChangeOnHide = false; } } @@ -677,7 +684,12 @@ } setSelected(selectedIndex); } - showAutoComplete(); + + if (isTriggeredChange) { + isTriggeredChange = false; + } else { + showAutoComplete(); + } } else { hideAutoComplete(); } From 0559ec5ea858e1db4e87ea2859a0eb648703959e Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 00:08:28 +0300 Subject: [PATCH 26/88] WICKET-6897 Javadoc build fails on fresh checkout of master or rel/wicket-9.3.0 Use different configuration for maven-javadoc-plugin for JDK 11/12 and 13+. 13+ has no -no-module-directories option Fix javadoc errors/warnings. Remove useless javadoc With this the javadoc build for JDK 11 & 16 seems to be fixed - there are no errors. JDK 17+ still has some problem --- pom.xml | 103 +++++++++---- .../org/apache/wicket/MarkupContainer.java | 2 +- .../ajax/AjaxNewWindowNotifyingBehavior.java | 2 +- .../ajax/attributes/AjaxCallListener.java | 2 +- ...axFormChoiceComponentUpdatingBehavior.java | 2 +- .../paging/AjaxPagingNavigator.java | 4 +- .../core/util/crypt/AbstractJceCrypt.java | 4 +- .../wicket/markup/html/border/Border.java | 4 +- .../markup/html/border/BorderBehavior.java | 4 +- .../html/form/AbstractCheckSelector.java | 2 +- .../markup/html/form/AbstractSubmitLink.java | 5 +- .../markup/html/form/AutoLabelResolver.java | 2 +- .../html/form/AutoLabelTextResolver.java | 2 +- .../markup/html/form/CheckBoxSelector.java | 2 +- .../wicket/markup/html/form/CheckGroup.java | 14 +- .../form/CheckboxMultipleChoiceSelector.java | 2 +- .../markup/resolver/AutoLinkResolver.java | 4 +- .../protocol/http/AbstractRequestLogger.java | 2 +- .../protocol/http/AjaxEnclosureListener.java | 2 +- .../request/resource/AbstractResource.java | 8 +- .../html/form/AutoLabelWithContentTest.java | 2 +- .../html/form/CheckBoxMultipleChoiceTest.java | 2 +- wicket-examples/pom.xml | 4 - .../request/flow/RedirectToUrlException.java | 7 +- wicket-user-guide/pom.xml | 4 - .../wicket/util/string/StringValue.java | 4 +- .../util/value/CopyOnWriteValueMap.java | 137 ------------------ .../apache/wicket/util/value/ValueMap.java | 111 -------------- 28 files changed, 112 insertions(+), 331 deletions(-) diff --git a/pom.xml b/pom.xml index 083c39b6aac..340fdf98445 100644 --- a/pom.xml +++ b/pom.xml @@ -1002,30 +1002,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - 128m - 256m - true - - https://docs.oracle.com/en/java/javase/11/docs/api/ - - false - none - --no-module-directories - - - - attach-javadocs - - jar - - - - org.apache.maven.plugins maven-release-plugin @@ -1262,14 +1238,6 @@ maven-gpg-plugin true - - org.apache.maven.plugins - maven-javadoc-plugin - true - - --no-module-directories - - org.apache.maven.plugins maven-toolchains-plugin @@ -1584,6 +1552,77 @@ + + on-java-12- + + [11,12] + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + 128m + 256m + true + + https://docs.oracle.com/en/java/javase/11/docs/api/ + + false + none + --no-module-directories + + + + attach-javadocs + + jar + + + + + + + + + + on-java-13+ + + [13,) + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + 128m + 256m + true + + https://docs.oracle.com/en/java/javase/16/docs/api/ + + false + none + + + + attach-javadocs + + jar + + + + + + + + diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java index d2531a5bfc8..d0309ffd322 100644 --- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java @@ -2139,7 +2139,7 @@ public Component findComponentToDequeue(ComponentTag tag) /** * Adds a dequeued component to this container. This method should rarely be overridden because * the common case of simply forwarding the component to - * {@link MarkupContainer#add(Component...))} method should cover most cases. Components that + * {@link MarkupContainer#add(Component...)} method should cover most cases. Components that * implement a custom hierarchy, such as borders, may wish to override it to support edge-case * non-standard behavior. * diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java index 4f8cb06ab2e..06497ecc99e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxNewWindowNotifyingBehavior.java @@ -52,7 +52,7 @@ public class AjaxNewWindowNotifyingBehavior extends AbstractDefaultAjaxBehavior /** * Returns the window's name. * - * @return name of {@value null} if not yet bound to a window + * @return name of {@code null} if not yet bound to a window */ public String getWindowName() { diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxCallListener.java b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxCallListener.java index ac7d73992c8..6c44322bfbe 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxCallListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxCallListener.java @@ -63,7 +63,7 @@ public AjaxCallListener onInit(final CharSequence init) * Sets the JavaScript code that will be returned by {@link #getDoneHandler(Component)}. * If this code was already set, the new one will be appended to the existing one. * - * @param init + * @param done * the JavaScript code for the corresponding handler * @return This */ diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.java index f646b7b7875..522c703e4be 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.java @@ -35,7 +35,7 @@ *

* Use the normal {@link AjaxFormComponentUpdatingBehavior} for the normal single component fields. *

- * Notification is triggered by a {@value change} JavaScript event - if needed {@link #getEvent()} can be overridden + * Notification is triggered by a {@code change} JavaScript event - if needed {@link #getEvent()} can be overridden * to deviate from this default. * * @author jcompagner diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java index a8b3a55aad4..c1ed5443789 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigator.java @@ -135,7 +135,7 @@ protected PagingNavigation newNavigation(final String id, final IPageable pageab * @param target * the request target to add the components that need to be updated in the ajax * event. - * @see Component#getOutputMarkupId(boolean) + * @see Component#getOutputMarkupId() */ protected void onAjaxEvent(AjaxRequestTarget target) { @@ -158,4 +158,4 @@ protected void onAjaxEvent(AjaxRequestTarget target) target.add(this); } } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java index 1f8ca906763..fd1f630a0b8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java @@ -85,7 +85,7 @@ public final String encryptUrlSafe(final String plainText) /** * Encrypts the given text into a byte array. * - * @param plainText + * @param plainBytes * text to encrypt * @return the string encrypted * @throws GeneralSecurityException @@ -94,7 +94,7 @@ public final String encryptUrlSafe(final String plainText) @Override - final public void setKey(String key) + public final void setKey(String key) { throw new UnsupportedOperationException("This method has been deprecated in ICrypt and will be removed."); } diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java index 7edf2d838e0..cc4cb9349b8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java @@ -117,7 +117,7 @@ * <html> * <body> * <span wicket:id = "myBorder"> - * <input wicket:id="name"/;> + * <input wicket:id="name"/> * </span> * </body> * </html> @@ -128,7 +128,7 @@ * or its Body as well. *

* - * Other methods like {@link #remove()}, {@link #get(int)}, {@link #iterator()}, etc. are not + * Other methods like {@link #remove()}, {@link #get(String)}, {@link #iterator()}, etc. are not * aliased to work on the border's body and attention must be paid when they need to be used. * * @see BorderPanel An alternative implementation based on Panel diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderBehavior.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderBehavior.java index 9459918fa8b..c899611233a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderBehavior.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderBehavior.java @@ -38,8 +38,8 @@ /** * This is a behavior implementation that can be used if you have markup that should be around a - * component. It works just like {@link Border} so you have to have a HTML - * beforeHTML after in the html of your subclass. But different than + * component. It works just like {@link Border} so you have to have a <wicket:border>HTML + * before <wicket:body/> HTML after </wicket:border> in the html of your subclass. But different than * Border you can not add components to the Border markup, only to the BorderBody. * * @author jcompagner diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractCheckSelector.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractCheckSelector.java index 049d49e523c..d440d5ce49a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractCheckSelector.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractCheckSelector.java @@ -38,7 +38,7 @@ * @see CheckGroupSelector * @see CheckBoxSelector * - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel */ public abstract class AbstractCheckSelector extends LabeledWebMarkupContainer implements diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java index bc100d61c36..d100bbf028f 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java @@ -27,9 +27,6 @@ */ public abstract class AbstractSubmitLink extends AbstractLink implements IFormSubmittingComponent { - /** - * - */ private static final long serialVersionUID = 1L; /** @@ -95,7 +92,7 @@ public AbstractSubmitLink(String id, Form form) * onSubmit method of the parent form is not called. A common use for this is to create a cancel * button. * - * TODO: This is a copy & paste from Button + * TODO: This is a copy and paste from Button * * @param defaultFormProcessing * defaultFormProcessing diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java index 4ca498a25f5..c39addd443a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java @@ -63,7 +63,7 @@ *

* * @author igor - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel */ public class AutoLabelResolver implements IComponentResolver { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelTextResolver.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelTextResolver.java index bf48aaae34a..22384bcef97 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelTextResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AutoLabelTextResolver.java @@ -94,7 +94,7 @@ * * * - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel * @author igor */ public class AutoLabelTextResolver implements IComponentResolver diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxSelector.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxSelector.java index 83ae73df71f..41c7a86d8c1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxSelector.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBoxSelector.java @@ -31,7 +31,7 @@ * automatically updates the state of the "select all" checkbox. Override * {@link AbstractCheckSelector#wantAutomaticUpdate()} to change this. * - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel */ public class CheckBoxSelector extends AbstractCheckSelector { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java index e05b0d51b4d..05dce6b079c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckGroup.java @@ -38,16 +38,18 @@ * be in the component hierarchy somewhere below the group component. The model of the CheckGroup * component has to be an instance of java.util.Collection. The model collection of the group is * filled with model objects of all selected Check components. - * - * ie - * + * + *

+ * i.e. + * <span wicket:id="checkboxgroup"> * ... - * choice 1 + * <input type="checkbox" wicket:id="checkbox1">choice 1</input> * ... - * choice 2 + * <input type="checkbox" wicket:id="checkbox2">choice 2</input> * ... - * + * </span> * + *

* * @see org.apache.wicket.markup.html.form.Check * @see org.apache.wicket.markup.html.form.CheckGroupSelector

diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckboxMultipleChoiceSelector.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckboxMultipleChoiceSelector.java index deb4820e0f2..98c2b739eeb 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckboxMultipleChoiceSelector.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckboxMultipleChoiceSelector.java @@ -22,7 +22,7 @@ * "select all" checkbox. Override {@link AbstractCheckSelector#wantAutomaticUpdate()} to change * this. * - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel */ public class CheckboxMultipleChoiceSelector extends AbstractCheckSelector { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java b/wicket-core/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java index 8b462dd53ad..c23cf7593cc 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java @@ -48,7 +48,7 @@ * "autolink" by the MarkupParser for all tags with href attribute, such as anchor and link tags * with no explicit wicket id. E.g. <a href="Home.html"> *

- * If href points to a *.html file, a BookmarkablePageLink will automatically be created, except + * If href points to a *.html file, a BookmarkablePageLink will automatically be created, except * for absolute paths, where an ExternalLink is created. *

* If href points to a *.html file, it resolves the given URL by searching for a page class, either @@ -144,7 +144,7 @@ public final static class AutolinkBookmarkablePageLink extends BookmarkablePa private final String anchor; /** - * When using to let Wicket lookup for pages and create the related links, + * When using <wicket:link> to let Wicket lookup for pages and create the related links, * it's not possible to change the "setAutoEnable" property, which defaults to true. This * affects the prototype because, sometimes designers _want_ links to be enabled. */ diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/AbstractRequestLogger.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/AbstractRequestLogger.java index e39ca47672a..02e42fdbaa3 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/AbstractRequestLogger.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/AbstractRequestLogger.java @@ -45,7 +45,7 @@ *

* The information in the log files can take any format, depending on the request logger * implementation: currently Wicket supports two formats: a {@link RequestLogger legacy, log4j - * compatible format}, and a {@link JsonRequestLogger JSON format}. + * compatible format}, and a JsonRequestLogger JSON format. */ public abstract class AbstractRequestLogger implements IRequestLogger { diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/AjaxEnclosureListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/AjaxEnclosureListener.java index 351d5495c39..acd96f670f6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/AjaxEnclosureListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/AjaxEnclosureListener.java @@ -41,7 +41,7 @@ * * Syntax for inline enclosure: * - * + * <tr wicket:enclosure="controllingChildId"> * * In this example the tag used is tr, but any other tag could be used as well. The attribute * "wicket:enclosure" is mandatory, and is used to recognise an inline enclosure. The value of the diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java index f45d79a9dd3..698d446897e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java @@ -426,7 +426,7 @@ public Instant getLastModified() /** * Check to determine if the resource data needs to be written. This method checks the * If-Modified-Since request header and compares it to lastModified property. - * In order for this method to work {@link #setLastModified(Time)} has to be called first. + * In order for this method to work {@link #setLastModified(Instant)} has to be called first. * * @param attributes * request attributes @@ -497,7 +497,7 @@ public ResourceResponse setCacheDuration(Duration duration) * * @return duration for caching * - * @see org.apache.wicket.settings.ResourceSettings#setDefaultCacheDuration(org.apache.wicket.util.time.Duration) + * @see org.apache.wicket.settings.ResourceSettings#setDefaultCacheDuration(Duration) * @see org.apache.wicket.settings.ResourceSettings#getDefaultCacheDuration() */ public Duration getCacheDuration() @@ -519,7 +519,7 @@ public Duration getCacheDuration() * @return cache scope * * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#getCacheDuration() - * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration(org.apache.wicket.util.time.Duration) + * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration(Duration) * @see org.apache.wicket.request.http.WebResponse.CacheScope */ public WebResponse.CacheScope getCacheScope() @@ -536,7 +536,7 @@ public WebResponse.CacheScope getCacheScope() * scope for caching * * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#getCacheDuration() - * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration(org.apache.wicket.util.time.Duration) + * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration(Duration) * @see org.apache.wicket.request.http.WebResponse.CacheScope * * @return {@code this}, for chaining. diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java index ee1ebb5f25e..e32117c836b 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/AutoLabelWithContentTest.java @@ -26,7 +26,7 @@ * components to support things like * {@literal }. * - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel */ @SuppressWarnings({ "rawtypes", "unchecked" }) class AutoLabelWithContentTest extends WicketTestCase diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoiceTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoiceTest.java index 465eb1770fc..c93276d8f97 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoiceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/CheckBoxMultipleChoiceTest.java @@ -32,7 +32,7 @@ * Test the dynamic prefix/suffix feature introduced with * https://issues.apache.org/jira/browse/WICKET-3478 * - * @author Carl-Eric Menzel + * @author Carl-Eric Menzel */ class CheckBoxMultipleChoiceTest extends WicketTestCase { diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index 2624f7e1a29..71bb03d0f39 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -235,10 +235,6 @@ org.apache.maven.plugins maven-war-plugin - - org.apache.maven.plugins - maven-javadoc-plugin - org.eclipse.jetty jetty-maven-plugin diff --git a/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java b/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java index 537fbdc22a7..98a45cb3268 100644 --- a/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java +++ b/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java @@ -25,10 +25,9 @@ * Causes Wicket to interrupt current request processing and send a redirect to the given url. * * Use this if you want to redirect to an external or none Wicket url. If you want to redirect to a - * page use the {@link RestartResponseException} - * - * @see RestartResponseException - * @see RestartResponseAtInterceptPageException + * page use the org.apache.wicket.RestartResponseException + * + * Also see org.apache.wicket.RestartResponseAtInterceptPageException */ public class RedirectToUrlException extends ReplaceHandlerException { diff --git a/wicket-user-guide/pom.xml b/wicket-user-guide/pom.xml index e338fb42e30..f2f1a778416 100644 --- a/wicket-user-guide/pom.xml +++ b/wicket-user-guide/pom.xml @@ -44,10 +44,6 @@ org.apache.maven.plugins maven-deploy-plugin - - org.apache.maven.plugins - maven-javadoc-plugin - org.apache.maven.plugins maven-source-plugin diff --git a/wicket-util/src/main/java/org/apache/wicket/util/string/StringValue.java b/wicket-util/src/main/java/org/apache/wicket/util/string/StringValue.java index 9e696dbdb3d..7e991c2179d 100755 --- a/wicket-util/src/main/java/org/apache/wicket/util/string/StringValue.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/string/StringValue.java @@ -548,7 +548,7 @@ public final Double toDoubleObject() throws StringValueConversionException * * @return Converted text * @throws StringValueConversionException - * @see Duration#valueOf(String, java.util.Locale) + * @see Duration#parse(CharSequence) */ public final Duration toDuration() throws StringValueConversionException { @@ -569,7 +569,7 @@ public final Duration toDuration() throws StringValueConversionException * the default value * @return the converted text as a duration or the default value if text is empty or * inconvertible - * @see Duration#valueOf(String, java.util.Locale) + * @see Duration#parse(CharSequence) */ public final Duration toDuration(final Duration defaultValue) { diff --git a/wicket-util/src/main/java/org/apache/wicket/util/value/CopyOnWriteValueMap.java b/wicket-util/src/main/java/org/apache/wicket/util/value/CopyOnWriteValueMap.java index fa2834cc1bf..603f4bda1d3 100755 --- a/wicket-util/src/main/java/org/apache/wicket/util/value/CopyOnWriteValueMap.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/value/CopyOnWriteValueMap.java @@ -55,9 +55,6 @@ public CopyOnWriteValueMap(final IValueMap wrapped) this.wrapped = wrapped; } - /** - * @see java.util.Map#clear() - */ @Override public void clear() { @@ -78,27 +75,18 @@ private void checkAndCopy() } } - /** - * @see java.util.Map#containsKey(Object) - */ @Override public boolean containsKey(final Object key) { return wrapped.containsKey(key); } - /** - * @see java.util.Map#containsValue(Object) - */ @Override public boolean containsValue(final Object value) { return wrapped.containsValue(value); } - /** - * @see java.util.Map#entrySet() - */ @Override public Set> entrySet() { @@ -106,9 +94,6 @@ public Set> entrySet() return wrapped.entrySet(); } - /** - * @see java.util.Map#equals(Object) - */ @Override public boolean equals(final Object o) { @@ -121,171 +106,114 @@ public int hashCode() return wrapped.hashCode(); } - /** - * @see java.util.Map#get(Object) - */ @Override public Object get(final Object key) { return wrapped.get(key); } - /** - * @see IValueMap#getBoolean(String) - */ @Override public boolean getBoolean(final String key) throws StringValueConversionException { return wrapped.getBoolean(key); } - /** - * @see IValueMap#getCharSequence(String) - */ @Override public CharSequence getCharSequence(final String key) { return wrapped.getCharSequence(key); } - /** - * @see IValueMap#getDouble(String) - */ @Override public double getDouble(final String key) throws StringValueConversionException { return wrapped.getDouble(key); } - /** - * @see IValueMap#getDouble(String, double) - */ @Override public double getDouble(final String key, final double defaultValue) { return wrapped.getDouble(key, defaultValue); } - /** - * @see IValueMap#getDuration(String) - */ @Override public Duration getDuration(final String key) throws StringValueConversionException { return wrapped.getDuration(key); } - /** - * @see IValueMap#getInt(String, int) - */ @Override public int getInt(final String key, final int defaultValue) { return wrapped.getInt(key, defaultValue); } - /** - * @see IValueMap#getInt(String) - */ @Override public int getInt(final String key) throws StringValueConversionException { return wrapped.getInt(key); } - /** - * @see IValueMap#getKey(String) - */ @Override public String getKey(final String key) { return wrapped.getKey(key); } - /** - * @see IValueMap#getLong(String, long) - */ @Override public long getLong(final String key, final long defaultValue) { return wrapped.getLong(key, defaultValue); } - /** - * @see IValueMap#getLong(String) - */ @Override public long getLong(final String key) throws StringValueConversionException { return wrapped.getLong(key); } - /** - * @see IValueMap#getString(String, String) - */ @Override public String getString(final String key, final String defaultValue) { return wrapped.getString(key, defaultValue); } - /** - * @see IValueMap#getString(String) - */ @Override public String getString(final String key) { return wrapped.getString(key); } - /** - * @see IValueMap#getStringArray(String) - */ @Override public String[] getStringArray(final String key) { return wrapped.getStringArray(key); } - /** - * @see IValueMap#getStringValue(String) - */ @Override public StringValue getStringValue(final String key) { return wrapped.getStringValue(key); } - /** - * @see IValueMap#getInstant(String) - */ @Override public Instant getInstant(final String key) throws StringValueConversionException { return wrapped.getInstant(key); } - /** - * @see java.util.Map#isEmpty() - */ @Override public boolean isEmpty() { return wrapped.isEmpty(); } - /** - * @see IValueMap#isImmutable() - */ @Override public boolean isImmutable() { return false; } - /** - * @see java.util.Map#keySet() - */ @Override public Set keySet() { @@ -293,18 +221,12 @@ public Set keySet() return wrapped.keySet(); } - /** - * @see IValueMap#makeImmutable() - */ @Override public IValueMap makeImmutable() { return wrapped.makeImmutable(); } - /** - * @see java.util.Map#put(Object, Object) - */ @Override public Object put(final String key, final Object value) { @@ -312,9 +234,6 @@ public Object put(final String key, final Object value) return wrapped.put(key, value); } - /** - * @see java.util.Map#putAll(Map) - */ @Override public void putAll(final Map map) { @@ -322,9 +241,6 @@ public void putAll(final Map map) wrapped.putAll(map); } - /** - * @see java.util.Map#remove(Object) - */ @Override public Object remove(final Object key) { @@ -332,18 +248,12 @@ public Object remove(final Object key) return wrapped.remove(key); } - /** - * @see java.util.Map#size() - */ @Override public int size() { return wrapped.size(); } - /** - * @see java.util.Map#values() - */ @Override public Collection values() { @@ -354,137 +264,90 @@ public Collection values() // // getAs convenience methods // // - /** - * @see IValueMap#getAsBoolean(String) - * - */ @Override public Boolean getAsBoolean(final String key) { return wrapped.getAsBoolean(key); } - /** - * @see IValueMap#getAsBoolean(String, boolean) - * - */ @Override public boolean getAsBoolean(final String key, final boolean defaultValue) { return wrapped.getAsBoolean(key, defaultValue); } - /** - * @see IValueMap#getAsInteger(String) - */ @Override public Integer getAsInteger(final String key) { return wrapped.getAsInteger(key); } - /** - * @see IValueMap#getAsInteger(String, int) - */ @Override public int getAsInteger(final String key, final int defaultValue) { return wrapped.getAsInteger(key, defaultValue); } - /** - * @see IValueMap#getAsLong(String) - */ @Override public Long getAsLong(final String key) { return wrapped.getAsLong(key); } - /** - * @see IValueMap#getAsLong(String, long) - */ @Override public long getAsLong(final String key, final long defaultValue) { return wrapped.getAsLong(key, defaultValue); } - /** - * @see IValueMap#getAsDouble(String) - */ @Override public Double getAsDouble(final String key) { return wrapped.getAsDouble(key); } - /** - * @see IValueMap#getAsDouble(String, double) - */ @Override public double getAsDouble(final String key, final double defaultValue) { return wrapped.getAsDouble(key, defaultValue); } - /** - * @see IValueMap#getAsDuration(String) - */ @Override public Duration getAsDuration(final String key) { return wrapped.getAsDuration(key); } - /** - * @see IValueMap#getAsDuration(String, Duration) - */ @Override public Duration getAsDuration(final String key, final Duration defaultValue) { return wrapped.getAsDuration(key, defaultValue); } - /** - * @see IValueMap#getAsInstant(String) - */ @Override public Instant getAsInstant(final String key) { return wrapped.getAsInstant(key); } - /** - * @see IValueMap#getAsTime(String, Time) - */ @Override public Instant getAsTime(final String key, final Instant defaultValue) { return wrapped.getAsTime(key, defaultValue); } - /** - * @see IValueMap#getAsEnum(String, Class) - */ @Override public > T getAsEnum(final String key, final Class eClass) { return wrapped.getAsEnum(key, eClass); } - /** - * @see IValueMap#getAsEnum - */ @Override public > T getAsEnum(final String key, final T defaultValue) { return wrapped.getAsEnum(key, defaultValue); } - /** - * @see IValueMap#getAsEnum(String, Class, Enum) - */ @Override public > T getAsEnum(final String key, final Class eClass, final T defaultValue) diff --git a/wicket-util/src/main/java/org/apache/wicket/util/value/ValueMap.java b/wicket-util/src/main/java/org/apache/wicket/util/value/ValueMap.java index ae554ae85b2..02247a366a7 100755 --- a/wicket-util/src/main/java/org/apache/wicket/util/value/ValueMap.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/value/ValueMap.java @@ -217,9 +217,6 @@ public ValueMap(final String keyValuePairs, final String delimiter, } } - /** - * @see java.util.Map#clear() - */ @Override public final void clear() { @@ -227,81 +224,54 @@ public final void clear() super.clear(); } - /** - * @see IValueMap#getBoolean(String) - */ @Override public final boolean getBoolean(final String key) throws StringValueConversionException { return getStringValue(key).toBoolean(); } - /** - * @see IValueMap#getDouble(String) - */ @Override public final double getDouble(final String key) throws StringValueConversionException { return getStringValue(key).toDouble(); } - /** - * @see IValueMap#getDouble(String, double) - */ @Override public final double getDouble(final String key, final double defaultValue) { return getStringValue(key).toDouble(defaultValue); } - /** - * @see IValueMap#getDuration(String) - */ @Override public final Duration getDuration(final String key) throws StringValueConversionException { return getStringValue(key).toDuration(); } - /** - * @see IValueMap#getInt(String) - */ @Override public final int getInt(final String key) throws StringValueConversionException { return getStringValue(key).toInt(); } - /** - * @see IValueMap#getInt(String, int) - */ @Override public final int getInt(final String key, final int defaultValue) { return getStringValue(key).toInt(defaultValue); } - /** - * @see IValueMap#getLong(String) - */ @Override public final long getLong(final String key) throws StringValueConversionException { return getStringValue(key).toLong(); } - /** - * @see IValueMap#getLong(String, long) - */ @Override public final long getLong(final String key, final long defaultValue) { return getStringValue(key).toLong(defaultValue); } - /** - * @see IValueMap#getString(String, String) - */ @Override public final String getString(final String key, final String defaultValue) { @@ -309,9 +279,6 @@ public final String getString(final String key, final String defaultValue) return value != null ? value : defaultValue; } - /** - * @see IValueMap#getString(String) - */ @Override public final String getString(final String key) { @@ -340,9 +307,6 @@ else if (o.getClass().isArray() && (Array.getLength(o) > 0)) } } - /** - * @see IValueMap#getCharSequence(String) - */ @Override public final CharSequence getCharSequence(final String key) { @@ -379,9 +343,6 @@ else if (o.getClass().isArray() && (Array.getLength(o) > 0)) } } - /** - * @see IValueMap#getStringArray(String) - */ @Override public String[] getStringArray(final String key) { @@ -411,36 +372,24 @@ else if (o.getClass().isArray()) return new String[] { o.toString() }; } - /** - * @see IValueMap#getStringValue(String) - */ @Override public StringValue getStringValue(final String key) { return StringValue.valueOf(getString(key)); } - /** - * @see IValueMap#getInstant(String) - */ @Override public final Instant getInstant(final String key) throws StringValueConversionException { return getStringValue(key).toInstant(); } - /** - * @see IValueMap#isImmutable() - */ @Override public final boolean isImmutable() { return immutable; } - /** - * @see IValueMap#makeImmutable() - */ @Override public final IValueMap makeImmutable() { @@ -448,9 +397,6 @@ public final IValueMap makeImmutable() return this; } - /** - * @see java.util.Map#put(Object, Object) - */ @Override public Object put(final String key, final Object value) { @@ -500,9 +446,6 @@ else if (o.getClass().isArray()) } } - /** - * @see java.util.Map#putAll(java.util.Map) - */ @Override public void putAll(final Map map) { @@ -510,9 +453,6 @@ public void putAll(final Map map) super.putAll(map); } - /** - * @see java.util.Map#remove(java.lang.Object) - */ @Override public Object remove(final Object key) { @@ -520,9 +460,6 @@ public Object remove(final Object key) return super.remove(key); } - /** - * @see IValueMap#getKey(String) - */ @Override public String getKey(final String key) { @@ -591,10 +528,6 @@ private void checkMutability() // // getAs convenience methods // // - /** - * @see IValueMap#getAsBoolean(String) - * - */ @Override public Boolean getAsBoolean(final String key) { @@ -613,10 +546,6 @@ public Boolean getAsBoolean(final String key) } } - /** - * @see IValueMap#getAsBoolean(String, boolean) - * - */ @Override public boolean getAsBoolean(final String key, final boolean defaultValue) { @@ -635,9 +564,6 @@ public boolean getAsBoolean(final String key, final boolean defaultValue) } } - /** - * @see IValueMap#getAsInteger(String) - */ @Override public Integer getAsInteger(final String key) { @@ -656,18 +582,12 @@ public Integer getAsInteger(final String key) } } - /** - * @see IValueMap#getAsInteger(String, int) - */ @Override public int getAsInteger(final String key, final int defaultValue) { return getInt(key, defaultValue); } - /** - * @see IValueMap#getAsLong(String) - */ @Override public Long getAsLong(final String key) { @@ -686,18 +606,12 @@ public Long getAsLong(final String key) } } - /** - * @see IValueMap#getAsLong(String, long) - */ @Override public long getAsLong(final String key, final long defaultValue) { return getLong(key, defaultValue); } - /** - * @see IValueMap#getAsDouble(String) - */ @Override public Double getAsDouble(final String key) { @@ -716,27 +630,18 @@ public Double getAsDouble(final String key) } } - /** - * @see IValueMap#getAsDouble(String, double) - */ @Override public double getAsDouble(final String key, final double defaultValue) { return getDouble(key, defaultValue); } - /** - * @see IValueMap#getAsDuration(String) - */ @Override public Duration getAsDuration(final String key) { return getAsDuration(key, null); } - /** - * @see IValueMap#getAsDuration(String, Duration) - */ @Override public Duration getAsDuration(final String key, final Duration defaultValue) { @@ -755,18 +660,12 @@ public Duration getAsDuration(final String key, final Duration defaultValue) } } - /** - * @see IValueMap#getAsInstant(String) - */ @Override public Instant getAsInstant(final String key) { return getAsTime(key, null); } - /** - * @see IValueMap#getAsTime(String, Time) - */ @Override public Instant getAsTime(final String key, final Instant defaultValue) { @@ -785,9 +684,6 @@ public Instant getAsTime(final String key, final Instant defaultValue) } } - /** - * @see org.apache.wicket.util.value.IValueMap#getAsEnum(java.lang.String, java.lang.Class) - */ @Override public > T getAsEnum(final String key, final Class eClass) { @@ -795,9 +691,6 @@ public > T getAsEnum(final String key, final Class eClass) return this.getEnumImpl(key, eClass, (T)null); } - /** - * @see org.apache.wicket.util.value.IValueMap#getAsEnum(java.lang.String, java.lang.Enum) - */ @Override public > T getAsEnum(final String key, final T defaultValue) { @@ -809,10 +702,6 @@ public > T getAsEnum(final String key, final T defaultValue) return getEnumImpl(key, defaultValue.getClass(), defaultValue); } - /** - * @see org.apache.wicket.util.value.IValueMap#getAsEnum(java.lang.String, java.lang.Class, - * java.lang.Enum) - */ @Override public > T getAsEnum(final String key, final Class eClass, final T defaultValue) From c01e5690bdeb3ca579295cd78b3ab53f65a189db Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 01:38:01 +0300 Subject: [PATCH 27/88] WICKET-6897 Javadoc build fails on fresh checkout of master or rel/wicket-9.3.0 Fix all javadoc errors and warnings --- pom.xml | 4 +- .../org/apache/wicket/cdi/NonContextual.java | 4 +- .../apache/wicket/IPageRendererProvider.java | 2 +- .../java/org/apache/wicket/Localizer.java | 2 +- .../wicket/NonResettingRestartException.java | 4 +- .../apache/wicket/ajax/AjaxRequestTarget.java | 4 +- .../org/apache/wicket/behavior/Behavior.java | 4 +- .../core/request/handler/IPageProvider.java | 2 +- .../handler/PageAndComponentProvider.java | 2 +- .../core/request/handler/PageProvider.java | 2 +- .../core/request/mapper/ResourceMapper.java | 2 +- .../wicket/core/util/lang/WicketObjects.java | 1 - .../feedback/FeedbackMessagesModel.java | 2 +- .../apache/wicket/markup/IMarkupFragment.java | 2 +- .../apache/wicket/markup/MergedMarkup.java | 6 +-- .../org/apache/wicket/markup/WicketTag.java | 6 +-- .../wicket/markup/head/CssHeaderItem.java | 4 +- .../markup/html/HeaderPartContainer.java | 4 +- .../wicket/markup/html/border/Border.java | 2 +- .../markup/html/form/AbstractSubmitLink.java | 9 ----- .../markup/html/form/FormComponentPanel.java | 2 +- .../form/FormComponentUpdatingBehavior.java | 6 +-- .../html/form/ILabelProviderLocator.java | 2 +- .../wicket/markup/html/form/ImageButton.java | 3 -- .../markup/html/form/NumberTextField.java | 4 +- .../wicket/markup/html/form/SubmitLink.java | 9 +---- .../markup/html/image/ExternalSource.java | 10 +---- .../wicket/markup/html/image/Image.java | 3 -- .../markup/html/image/NonCachingImage.java | 7 ++-- .../wicket/markup/parser/IXmlPullParser.java | 16 ++++---- .../wicket/markup/parser/XmlPullParser.java | 2 +- .../parser/filter/EnclosureHandler.java | 2 +- .../parser/filter/WicketLinkTagHandler.java | 4 +- .../ChildFirstHeaderRenderStrategy.java | 2 +- .../renderStrategy/IHeaderRenderStrategy.java | 2 +- .../resolver/WicketContainerResolver.java | 24 ++++++------ .../main/java/org/apache/wicket/package.html | 25 +++++------- .../page/CouldNotLockPageException.java | 2 +- .../protocol/http/IWebApplicationFactory.java | 2 +- .../wicket/protocol/http/RequestUtils.java | 2 +- .../wicket/protocol/http/WebApplication.java | 6 +-- .../http/servlet/ServletWebRequest.java | 2 +- .../wicket/protocol/https/RequireHttps.java | 3 -- .../resource/DynamicImageResource.java | 2 +- .../resource/ResourceReferenceRegistry.java | 2 +- .../caching/IStaticCacheableResource.java | 4 +- .../resource/FileSystemResourceReference.java | 2 +- .../filter/EmptySrcAttributeCheckFilter.java | 5 +-- .../util/template/TextTemplateDecorator.java | 38 +------------------ .../wicket/util/tester/BaseWicketTester.java | 2 +- .../wicket/util/tester/WicketTester.java | 2 +- .../validator/CreditCardValidator.java | 4 +- .../validator/EmailAddressValidator.java | 9 +++-- .../markup/html/internal/SimplePanel.java | 2 +- .../apache/wicket/devutils/DevUtilsPage.java | 2 +- .../apache/wicket/devutils/DevUtilsPanel.java | 2 +- .../wicket/devutils/debugbar/DebugBar.java | 2 +- .../debugbar/InspectorDebugPanel.java | 2 +- .../debugbar/SessionSizeDebugPanel.java | 2 +- .../devutils/debugbar/StandardDebugPanel.java | 2 +- .../extensions/ajax/AjaxDownloadBehavior.java | 8 ++-- .../extensions/ajax/AjaxFileDropBehavior.java | 4 +- .../ajax/markup/html/AjaxLazyLoadPanel.java | 2 +- .../markup/html/AjaxLazyLoadPanelTester.java | 2 +- .../autocomplete/AutoCompleteSettings.java | 4 +- .../autocomplete/IAutoCompleteRenderer.java | 8 ++-- .../html/form/upload/UploadProgressBar.java | 2 +- .../ajax/markup/html/modal/ModalWindow.java | 3 +- .../markup/html/repeater/AjaxListPanel.java | 6 +-- .../html/basic/ILinkRenderStrategy.java | 2 +- .../form/datetime/AbstractDateTimeField.java | 6 +-- .../form/datetime/LocalDateTimeTextField.java | 4 +- .../form/datetime/LocalTimeTextField.java | 4 +- .../markup/html/form/datetime/TimeField.java | 6 +-- .../form/datetime/ZonedDateTimeField.java | 2 +- .../data/table/export/CSVDataExporter.java | 4 +- .../data/table/export/ExportToolbar.java | 2 +- .../markup/html/repeater/tree/NestedTree.java | 6 +-- .../markup/html/repeater/tree/TableTree.java | 2 +- .../html/repeater/tree/content/Folder.java | 2 +- .../tree/content/StyledLinkLabel.java | 4 +- .../extensions/wizard/IWizardModel.java | 2 +- .../extensions/wizard/WizardButton.java | 4 +- .../extensions/wizard/WizardButtonBar.java | 3 -- .../wizard/dynamic/IDynamicWizardStep.java | 2 +- .../apache/wicket/jmx/DebugSettingsMBean.java | 22 +++++------ .../wicket/jmx/RequestCycleSettingsMBean.java | 10 +++-- .../apache/wicket/jmx/StoreSettingsMBean.java | 2 +- .../wicket/jmx/wrapper/DebugSettings.java | 37 ------------------ .../spring/SpringWebApplicationFactory.java | 10 ++--- .../velocity/markup/html/VelocityPanel.java | 4 +- 91 files changed, 175 insertions(+), 296 deletions(-) diff --git a/pom.xml b/pom.xml index 340fdf98445..0b6b8776536 100644 --- a/pom.xml +++ b/pom.xml @@ -1571,7 +1571,7 @@ https://docs.oracle.com/en/java/javase/11/docs/api/ - false + true none --no-module-directories @@ -1607,7 +1607,7 @@ https://docs.oracle.com/en/java/javase/16/docs/api/ - false + true none diff --git a/wicket-cdi/src/main/java/org/apache/wicket/cdi/NonContextual.java b/wicket-cdi/src/main/java/org/apache/wicket/cdi/NonContextual.java index b596f53d081..4db8fb48986 100644 --- a/wicket-cdi/src/main/java/org/apache/wicket/cdi/NonContextual.java +++ b/wicket-cdi/src/main/java/org/apache/wicket/cdi/NonContextual.java @@ -62,10 +62,10 @@ public static void undeploy() } /** - * Convenience factory method for an instance, see {@link #of(Class). + * Convenience factory method for an instance, see {@link #of(Class)}. * * @param - * @param clazz + * @param t * @return The NonContextual for the instance's class */ @SuppressWarnings("unchecked") diff --git a/wicket-core/src/main/java/org/apache/wicket/IPageRendererProvider.java b/wicket-core/src/main/java/org/apache/wicket/IPageRendererProvider.java index 1171d9c7d54..182e4a8c1b7 100755 --- a/wicket-core/src/main/java/org/apache/wicket/IPageRendererProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/IPageRendererProvider.java @@ -22,7 +22,7 @@ import org.apache.wicket.request.handler.render.PageRenderer; /** - * Interface for {@link Function}<RenderPageRequestHandler, PageRenderer> + * Interface for Function<RenderPageRequestHandler, PageRenderer> */ public interface IPageRendererProvider extends Function { diff --git a/wicket-core/src/main/java/org/apache/wicket/Localizer.java b/wicket-core/src/main/java/org/apache/wicket/Localizer.java index 2c7c038cb40..9ec5059d8da 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Localizer.java +++ b/wicket-core/src/main/java/org/apache/wicket/Localizer.java @@ -550,7 +550,7 @@ protected String getCacheKey(final String key, final Component component, final * Helper method to handle property variable substitution in strings. * * @param component - * The component requesting a model value or {@code null] + * The component requesting a model value or {@code null} * @param string * The string to substitute into * @param model diff --git a/wicket-core/src/main/java/org/apache/wicket/NonResettingRestartException.java b/wicket-core/src/main/java/org/apache/wicket/NonResettingRestartException.java index 07f2dd58f00..5663eff746a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/NonResettingRestartException.java +++ b/wicket-core/src/main/java/org/apache/wicket/NonResettingRestartException.java @@ -95,8 +95,8 @@ public NonResettingRestartException(final String redirectUrl) * * @param handler * the IRequestHandler to use - * @param removeScheduled - * a flag indicating whether to remove already a scheduled IRequestHandler + * @param removeAll + * a flag indicating whether to remove already a scheduled IRequestHandlers */ public NonResettingRestartException(final IRequestHandler handler, boolean removeAll) { diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java index 8bf5707c745..6c874dc1453 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java @@ -41,7 +41,7 @@ interface IListener * Triggered before ajax request target begins its response cycle * * @param map - * modifiable map (markupId -> component) of components already added to the target + * modifiable map (markupId -> component) of components already added to the target * @param target * the target itself. Could be used to add components or to append/prepend * javascript @@ -59,7 +59,7 @@ default void onBeforeRespond(Map map, AjaxRequestTarget targe * (adding components, javascript) will have no effect * * @param map - * read-only map:markupId->component of components already added to the target + * read-only map:markupId->component of components already added to the target * @param response * response object that can be used to output javascript */ diff --git a/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java b/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java index 8c02f933e76..c4eae58caea 100644 --- a/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java +++ b/wicket-core/src/main/java/org/apache/wicket/behavior/Behavior.java @@ -270,7 +270,7 @@ public void onRemove(Component component) * *

* Usage:
- * component.add(onTag(tag -> tag.put(key, value))); + * component.add(onTag(tag -> tag.put(key, value))); *

* * @param onTagConsumer @@ -298,7 +298,7 @@ public void onComponentTag(Component component, ComponentTag tag) *

* Usage:
* component.add(onAttribute("class", - * currentValue -> condition(currentValue) ? "positive" : "negative")); + * currentValue -> condition(currentValue) ? "positive" : "negative")); *

* * @param name diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java index 47d72391aca..a232c6d94d6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java @@ -54,7 +54,7 @@ public interface IPageProvider /** * Returns whether the provided page was expired prior to this access. * - * @return true> if the page was created after its original instance expired. + * @return true if the page was created after its original instance expired. */ boolean wasExpired(); diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java index 0638c9b0f5c..22931d5b447 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java @@ -107,7 +107,7 @@ public PageAndComponentProvider(int pageId, Class pa } /** - * @see PageProvider#PageProvider(int, Class, PageParameters, Integer) + * @see PageProvider#PageProvider(Integer, Class, Integer) * * @param pageId * @param pageClass diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageProvider.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageProvider.java index 33c616ef5b0..7193eb89bdd 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageProvider.java @@ -39,7 +39,7 @@ * that can use the {@link PageProvider} to access the page. *

* Apart from simplifying {@link IRequestMapper}s and {@link IRequestHandler}s {@link PageProvider} - * also helps performance because creating or obtaining page from {@link IPageManager} is delayed + * also helps performance because creating or obtaining page from {@link org.apache.wicket.page.IPageManager} is delayed * until the {@link IRequestHandler} actually requires the page. * * @author Matej Knopp diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java b/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java index 69f82f7af82..4f96213d4fc 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java @@ -50,7 +50,7 @@ * sample structure of url * *

- *    /myresources/${category}/images/[indexed-param-0]/[indexed-param-1]?[named-param-1=value]&[named-param-2=value2]
+ *    /myresources/${category}/images/[indexed-param-0]/[indexed-param-1]?[named-param-1=value]&[named-param-2=value2]
  * 
* *

sample usage

diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java index 46491500fb4..6f776f8f3b5 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java @@ -146,7 +146,6 @@ public long sizeOf(Serializable object) * @param object * The object to clone * @return A deep copy of the object - * @see #cloneModel(Object) */ @SuppressWarnings("unchecked") public static T cloneObject(final T object) diff --git a/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java b/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java index b574b364178..c056deed4a7 100644 --- a/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java +++ b/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java @@ -193,7 +193,7 @@ public void detach() * * See {@link FeedbackCollector#setIncludeSession} and {@link Session#getFeedbackMessages} * - * @param value + * @param includeSession * @return * @return {@code this} for chaining */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/IMarkupFragment.java b/wicket-core/src/main/java/org/apache/wicket/markup/IMarkupFragment.java index ef51ce9da11..046163150d1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/IMarkupFragment.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/IMarkupFragment.java @@ -57,7 +57,7 @@ public interface IMarkupFragment extends Iterable /** * Finds a markup fragment that spans a tag * - * @param id + * @param wicketId * the wicket:id attribute in the tag * @return the markup fragment that spans the complete found tag */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/MergedMarkup.java b/wicket-core/src/main/java/org/apache/wicket/markup/MergedMarkup.java index 363ea10afcf..a1cc42d7e6a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/MergedMarkup.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/MergedMarkup.java @@ -41,8 +41,8 @@ * be inserted. From the derived markup all tags in between <wicket:extend> and * </wicket:extend> will be inserted. *

- * In addition, all <wicket:head> regions are copied as well. This allows to develop completely - * self-contained plug & play components including javascript etc. + * In addition, all <wicket:head> regions are copied as well. This allows to develop completely + * self-contained plug & play components including javascript etc. * * @author Juergen Donnerstag */ @@ -58,7 +58,7 @@ public class MergedMarkup extends Markup * @param baseMarkup * The base markup * @param extendIndex - * Index where has been found + * Index where <wicket:extend> has been found */ public MergedMarkup(final Markup markup, final Markup baseMarkup, int extendIndex) { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/WicketTag.java b/wicket-core/src/main/java/org/apache/wicket/markup/WicketTag.java index ddcf8757373..37798faf621 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/WicketTag.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/WicketTag.java @@ -31,10 +31,10 @@ * WicketTag extends ComponentTag and will be created by a MarkupParser whenever it parses a tag in * the wicket namespace. By default, this namespace is "wicket", so wicket tags are then of the form * <wicket:*> - *

+ * <p> * Note 1: you need to add an XHTML doctype to your markup and use <html xmlns:wicket> to * create a XHTML conform namespace for such tags. - *

+ * <p> * Note 2: The namespace name is configurable. E.g. <html xmlns:wcn="http://wicket"> * * @author Juergen Donnerstag @@ -169,7 +169,7 @@ public final boolean isEnclosureTag() } /** - * @return True if , , = 8) { + * if (properties.isBrowserInternetExplorer() && properties.getBrowserVersionMajor() >= 8) { * response.renderCSSReference(new PackageResourceReference(MyPage.class, "my-conditional.css" )); * } * } @@ -177,7 +177,7 @@ public static CssUrlReferenceHeaderItem forUrl(String url, String media) * public void renderHead(IHeaderResponse response) { * WebClientInfo clientInfo = (WebClientInfo) getSession().getClientInfo(); * ClientProperties properties = clientInfo.getProperties(); - * if (properties.isBrowserInternetExplorer() && properties.getBrowserVersionMajor() >= 8) { + * if (properties.isBrowserInternetExplorer() && properties.getBrowserVersionMajor() >= 8) { * response.renderCSSReference(new PackageResourceReference(MyPage.class, "my-conditional.css" )); * } * } diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/HeaderPartContainer.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/HeaderPartContainer.java index 5f1ea734da2..ec72ffa8853 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/HeaderPartContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/HeaderPartContainer.java @@ -37,7 +37,7 @@ public final class HeaderPartContainer extends WebMarkupContainer implements ICo /** The panel or bordered page the header part is associated with */ private final MarkupContainer container; - /** . A kind of namespace */ + /** <wicket:head scope="...">. A kind of namespace */ private final String scope; /** @@ -96,4 +96,4 @@ public final Component resolve(final MarkupContainer container, // The tag must be resolved against the panel and not against the page return this.container.get(tag.getId()); } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java index cc4cb9349b8..1feea65b2d1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java @@ -147,7 +147,7 @@ public abstract class Border extends WebMarkupContainer implements IComponentRes /** */ public static final String BORDER = "border"; - /** The body component associated with */ + /** The body component associated with <wicket:body> */ private final BorderBodyContainer body; /** diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java index d100bbf028f..0b1de70b482 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractSubmitLink.java @@ -110,18 +110,12 @@ public final AbstractSubmitLink setDefaultFormProcessing(boolean defaultFormProc return this; } - /** - * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#getDefaultFormProcessing() - */ @Override public boolean getDefaultFormProcessing() { return defaultFormProcessing; } - /** - * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#getForm() - */ @Override public Form getForm() { @@ -135,9 +129,6 @@ public Form getForm() } } - /** - * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#getInputName() - */ @Override public String getInputName() { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java index c85772a59c9..5fe284fa781 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java @@ -24,7 +24,7 @@ import org.apache.wicket.util.visit.IVisitor; /** - * Panel (has it's own markup, defined between tags), that can act as a form + * Panel (has it's own markup, defined between <wicket:panel> tags), that can act as a form * component. It typically wouldn't receive any input yourself, and often you can get by with * nesting form components in panels proper. However, using this panel can help you with building * components act to the outside world as one component, but internally uses separate components. diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentUpdatingBehavior.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentUpdatingBehavior.java index 1b7c231cd30..577214fbf91 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentUpdatingBehavior.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponentUpdatingBehavior.java @@ -33,7 +33,7 @@ * Contrary to {@link AjaxFormComponentUpdatingBehavior} all notification are sent via * standard HTTP requests and the full page is rendered as a response. *

- * Notification is triggered by a {@value change} JavaScript event - if needed {@link #getEvent()} can be overridden + * Notification is triggered by a {@code change} JavaScript event - if needed {@link #getEvent()} can be overridden * to deviate from this default. *

* Note: This behavior has limited support for {@link FormComponent}s outside of a form, i.e. multiple @@ -126,7 +126,7 @@ public void renderHead(Component component, IHeaderResponse response) /** * Which JavaScript event triggers notification. * - * @return {@value change} by default + * @return {@code change} by default */ protected String getEvent() { @@ -198,7 +198,7 @@ protected boolean getUpdateModel() /** * Hook method invoked when the component is updated. *

- * Note: {@link #onError(AjaxRequestTarget, RuntimeException)} is called instead when processing + * Note: {@link #onError(RuntimeException)} is called instead when processing * of the {@link FormComponent} failed with conversion or validation errors! */ protected void onUpdate() diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ILabelProviderLocator.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ILabelProviderLocator.java index 852bfad3bad..4dfc1de5457 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ILabelProviderLocator.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ILabelProviderLocator.java @@ -20,7 +20,7 @@ /** * This interface can be used to mark some complex component, e.g. a Panel, as capable of providing a reference to a {@link ILabelProvider}, - * e.g a form component. The typical use case could be a user has a components factory of type "label" --> "panel with some fields". Let's say the structure of + * e.g a form component. The typical use case could be a user has a components factory of type "label" --> "panel with some fields". Let's say the structure of * this panel varies but we still would like to use wicket:for="panel". In this case this panel could implement ILabelProviderLocator to point * to TextFiled that label should refer to. * diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java index 389cd76ac4d..5b6bc01c502 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/ImageButton.java @@ -132,9 +132,6 @@ public boolean rendersPage() return false; } - /** - * @see org.apache.wicket.IResourceListener#onResourceRequested() - */ @Override public void onRequest() { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/NumberTextField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/NumberTextField.java index f0c995c229c..b9077f789e0 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/NumberTextField.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/NumberTextField.java @@ -34,8 +34,8 @@ * the HTML specification. Use a simple * {@code TextField} to use a locale specific conversion of numbers. *

- * Automatically validates the input against the configured {@link #setMinimum(N) min} and - * {@link #setMaximum(N) max} attributes. If any of them is null then respective + * Automatically validates the input against the configured {@link #setMinimum(Number) min} and + * {@link #setMaximum(Number) max} attributes. If any of them is null then respective * MIN_VALUE or MAX_VALUE for the number type is used. If the number type has no minimum and/or * maximum value then {@link Double#MIN_VALUE} and {@link Double#MAX_VALUE} are used respectfully. * diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java index c67b8e9bb4c..65527063b06 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/SubmitLink.java @@ -16,6 +16,7 @@ */ package org.apache.wicket.markup.html.form; +import org.apache.wicket.IRequestListener; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.OnEventHeaderItem; @@ -146,7 +147,7 @@ public SubmitLink(String id, IModel model, Form form) * This method is here as a means to fall back on normal link behavior when this link is not * nested in a form. Not intended to be called by clients directly. * - * @see org.apache.wicket.markup.html.link.ILinkListener#onLinkClicked() + * @see IRequestListener#onRequest() */ public final void onLinkClicked() { @@ -154,9 +155,6 @@ public final void onLinkClicked() onAfterSubmit(); } - /** - * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) - */ @Override protected void onComponentTag(ComponentTag tag) { @@ -228,9 +226,6 @@ protected CharSequence getTriggerJavaScript() } } - /** - * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#onError() - */ @Override public void onError() { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalSource.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalSource.java index afd74097a23..d97c90f8ff6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalSource.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalSource.java @@ -48,10 +48,6 @@ public class ExternalSource extends ExternalImage * * @param id * the component id - * @param src - * the source URL - * @param srcSet - * a list of URLs placed in the srcset attribute */ public ExternalSource(String id) { @@ -63,8 +59,6 @@ public ExternalSource(String id) * * @param id * the component id - * @param src - * the source URL * @param srcSet * a list of URLs placed in the srcset attribute */ @@ -78,8 +72,6 @@ public ExternalSource(String id, List srcSet) * * @param id * the component id - * @param src - * the model source URL * @param srcSetModel * a model list of URLs placed in the srcset attribute */ @@ -138,4 +130,4 @@ public final CrossOrigin getCrossOrigin() { return null; } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java index 48c9382302e..e2ee91968b7 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java @@ -179,9 +179,6 @@ public boolean rendersPage() return false; } - /** - * @see org.apache.wicket.IResourceListener#onResourceRequested() - */ @Override public void onRequest() { diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java index e29ac648e9f..99991326fb1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java @@ -52,7 +52,7 @@ public NonCachingImage(String id, IModel model) /** * Construct. * - * @see Image#Image(String, org.apache.wicket.request.resource.IResource) + * @see Image#Image(String, IResource, IResource...) * * @param id * @param imageResource @@ -65,8 +65,7 @@ public NonCachingImage(String id, IResource imageResource) /** * Construct. * - * @see Image#Image(String, org.apache.wicket.request.resource.ResourceReference, - * org.apache.wicket.request.mapper.parameter.PageParameters) + * @see Image#Image(String, ResourceReference, PageParameters, ResourceReference...) * * @param id * @param resourceReference @@ -81,7 +80,7 @@ public NonCachingImage(String id, ResourceReference resourceReference, /** * Construct. * - * @see Image#Image(String, ResourceReference) + * @see Image#Image(String, ResourceReference, ResourceReference...) * * @param id * @param resourceReference diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/IXmlPullParser.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/IXmlPullParser.java index 29cbe065064..44cba9e851f 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/IXmlPullParser.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/IXmlPullParser.java @@ -35,31 +35,31 @@ enum HttpTagType { /** next() must be called at least once for the Type to be valid */ NOT_INITIALIZED, - /** */ + /** <name ...> */ TAG, /** Tag body in between two tags */ BODY, - /** */ + /** <!-- ... --> */ COMMENT, - /** */ + /** <!--[if ] ... --> */ CONDITIONAL_COMMENT, - /** */ + /** <![endif]--> */ CONDITIONAL_COMMENT_ENDIF, - /** */ + /** <![CDATA[ .. ]]> */ CDATA, - /** */ + /** <?...> */ PROCESSING_INSTRUCTION, - /** */ + /** <!DOCTYPE ...> */ DOCTYPE, - /** all other tags which look like */ + /** all other tags which look like <!.. > */ SPECIAL_TAG, } diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java index a0aee997f9c..46dc2b0a743 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java @@ -323,7 +323,7 @@ else if (lowerCase.startsWith(STYLE)) } /** - * Handle special tags like or or + * Handle special tags like <!-- --> or <![CDATA[..]]> or <?xml> * * @param tagText * @param openBracketIndex diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java index 507494420f0..19ec847c66c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java @@ -69,7 +69,7 @@ public Component newComponent(MarkupContainer container, ComponentTag tag) /** The child attribute */ public static final String CHILD_ATTRIBUTE = "child"; - /** Stack of tags */ + /** Stack of <wicket:enclosure> tags */ private Deque stack; /** The id of the first wicket tag inside the enclosure */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java index a0f75fe5ccc..e01b199c60c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java @@ -39,13 +39,13 @@ /** * This is a markup inline filter. It identifies xml tags which include a href attribute and which * are not Wicket specific components and flags these tags (ComponentTag) as autolink enabled. A - * component resolver will later resolve the href and assign a BookmarkablePageLink to it + * component resolver will later resolve the href and assign a BookmarkablePageLink to it * (automatically). *

* An application setting is used as default value, which might be modified for specific regions. * These regions are identified by <wicket:link> tags with an optional 'autolink' attribute. * The default value for the attribute is true, thus enabling autolinking. An open-close - * <wicket:link/> tag will change the autolink status until the end of the markup document or + * <wicket:link/> tag will change the autolink status until the end of the markup document or * the next <wicket:link> tag respectively. <wicket:link> regions may be nested. * * @author Juergen Donnerstag diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/ChildFirstHeaderRenderStrategy.java b/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/ChildFirstHeaderRenderStrategy.java index f1b03a48959..d22f61ea3f4 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/ChildFirstHeaderRenderStrategy.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/ChildFirstHeaderRenderStrategy.java @@ -24,7 +24,7 @@ import org.apache.wicket.util.visit.IVisit; /** - * This a header render strategy implements a child->parent->root sequence, which is inverse to how + * This a header render strategy implements a child->parent->root sequence, which is inverse to how * it was until Wicket 1.5. It now allows parent containers to replace child contributions, since * their contribution is added to the markup after the child ones (see WICKET-2693). diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/IHeaderRenderStrategy.java b/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/IHeaderRenderStrategy.java index b15f1491884..7a82bd7888e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/IHeaderRenderStrategy.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/renderStrategy/IHeaderRenderStrategy.java @@ -23,7 +23,7 @@ /** * Allows for different header render strategies. The difference per strategy will be order in which * components are asked to add to the markup header section. Before 1.5 it was - * page->container->child. Since 1.5 it has been changed to child->container->parent (see WICKET-2693) * * @author Juergen Donnerstag diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java b/wicket-core/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java index 28adcf12ba1..fce0e54b2e8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/resolver/WicketContainerResolver.java @@ -33,12 +33,12 @@ * like this: * * - * - * - * - * - * - *
...
...
+ * <table> + * <span wicket:id="repeater"> + * <tr><td>...</td></tr> + * <tr><td>...</td></tr> + * </span> + * </table> *
* * Notice that we had to attach the repeater to a component tag - in this case a span, @@ -46,12 +46,12 @@ * following: * * - * - * - * - * - * - *
...
...
+ * <table> + * <wicket:container wicket:id="repeater"> + * <tr><td>...</td></tr> + * <tr><td>...</td></tr> + * </wicket:container> + * </table> *
* * The above is valid markup because wicket namespaced tags are allowed anywhere diff --git a/wicket-core/src/main/java/org/apache/wicket/package.html b/wicket-core/src/main/java/org/apache/wicket/package.html index a1e7bf0fc5e..2678cb69d6d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/package.html +++ b/wicket-core/src/main/java/org/apache/wicket/package.html @@ -24,36 +24,31 @@ The core Wicket package. The key core classes you will need to learn to do basic Wicket programming are:

    -
  • {@link wicket.Application} / {@link wicket.protocol.http.WebApplication} - Subclass WebApplication to create your application. +
  • {@link org.apache.wicket.Application} / {@link org.apache.wicket.protocol.http.WebApplication} - Subclass WebApplication to create your application. Set your home page with Application.getPages().setHomePage(MyHomePage.class). Configure Wicket for deployment with Application.getSettings().configure("deployment"). Substitute "development" to get default settings for a development environment. -
  • {@link wicket.Component} - You will need to carefully study this class as Component is very +
  • {@link org.apache.wicket.Component} - You will need to carefully study this class as Component is very central to Wicket. There are a large number of convenience methods in Component and, naturally, every component in Wicket is a subclass of Component, so all these methods are available to all Components. -
  • {@link wicket.IRequestCycleFactory} - If you are working with a persistence framework - such as Hibernate or JDO, you may need to implement a request cycle factory in order +
  • {@link org.apache.wicket.request.cycle.IRequestCycleListener} - If you are working with a persistence framework + such as Hibernate or JDO, you may need to implement a request cycle listener in order to open a persistence session at the beginning of a request and close the session at the end of the request. - -
  • {@link wicket.ISessionFactory} - For all but the most trivial applications, you will - need to create your own session factory. Your implementation of this interface - will generally be quite simple, generally just returning a new instance of your - own application-specific subclass of WebSession. - -
  • {@link wicket.MarkupContainer} - You will need to study MarkupContainer carefully as + +
  • {@link org.apache.wicket.MarkupContainer} - You will need to study MarkupContainer carefully as this class contains all the logic for creating and maintaining component hierarchies. -
  • {@link wicket.Page} / {@link wicket.markup.html.WebPage} - Every page in your wicket application will extend WebPage +
  • {@link org.apache.wicket.Page} / {@link org.apache.wicket.markup.html.WebPage} - Every page in your wicket application will extend WebPage (or some other subclass of Page if you are writing something other than a web application). There are a number of important methods in Page and you should be familiar with all of them. -
  • {@link wicket.PageParameters} - A simple wrapper for query string parameters. +
  • {@link org.apache.wicket.request.mapper.parameter.PageParameters} - A simple wrapper for query string parameters. -
  • {@link wicket.Session} / {@link wicket.protocol.http.WebSession} - It is particularly important to understand Session +
  • {@link org.apache.wicket.Session} / {@link org.apache.wicket.protocol.http.WebSession} - It is particularly important to understand Session if you are doing clustering, but even for a very basic application you will want to create your own subclass of WebSession using a session factory so that you can store any session properties in a typesafe way. Note that since Pages are first @@ -62,4 +57,4 @@

- \ No newline at end of file + diff --git a/wicket-core/src/main/java/org/apache/wicket/page/CouldNotLockPageException.java b/wicket-core/src/main/java/org/apache/wicket/page/CouldNotLockPageException.java index 4e2ee156013..aa774be0052 100644 --- a/wicket-core/src/main/java/org/apache/wicket/page/CouldNotLockPageException.java +++ b/wicket-core/src/main/java/org/apache/wicket/page/CouldNotLockPageException.java @@ -23,7 +23,7 @@ * the lock on a page instance that is currently locked by another thread and it cannot * do that for some specified {@link org.apache.wicket.settings.RequestCycleSettings#getTimeout() duration} * - * @see org.apache.wicket.settings.RequestCycleSettings#setTimeout(org.apache.wicket.util.time.Duration) + * @see org.apache.wicket.settings.RequestCycleSettings#setTimeout(Duration) * @see org.apache.wicket.settings.ExceptionSettings#setThreadDumpStrategy(org.apache.wicket.settings.ExceptionSettings.ThreadDumpStrategy) */ public class CouldNotLockPageException extends RuntimeException diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/IWebApplicationFactory.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/IWebApplicationFactory.java index acb0b51f2b0..a055ab1332d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/IWebApplicationFactory.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/IWebApplicationFactory.java @@ -23,7 +23,7 @@ *
  * <filter>
  *   <filter-name>MyApplication</filter-name>
- *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
  *   <init-param>
  *     <param-name>applicationFactoryClassName</param-name>
  *     <param-value>org.mycompany.MyWebApplicationFactory</param-value>
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestUtils.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestUtils.java
index ccb349b1440..d7a58bffc72 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestUtils.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/RequestUtils.java
@@ -42,7 +42,7 @@ public final class RequestUtils
 	 * value map.
 	 * 
 	 * @param queryString
-	 *            string to decode, uses '&' to separate parameters and '=' to separate key from
+	 *            string to decode, uses '&' to separate parameters and '=' to separate key from
 	 *            value
 	 * @param params
 	 *            parameters map to write the found key/ value pairs to
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
index a3c4ffc7cda..c4987c80cf0 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
@@ -724,9 +724,9 @@ public void internalDestroy()
 	 * 
 	 * Internal initialization. First determine the deployment mode. First check the system property
 	 * -Dwicket.configuration. If it does not exist check the servlet init parameter (
-	 * <init-param><param-name>configuration</param-name>). If not
+	 * <init-param><param-name>configuration</param-name>). If not
 	 * found check the servlet context init parameter
-	 * <context-param><param-name6gt;configuration</param-name>). If the
+	 * <context-param><param-name6gt;configuration</param-name>). If the
 	 * parameter is "development" (which is default), settings appropriate for development are set.
 	 * If it's "deployment" , deployment settings are used. If development is specified and a
 	 * "sourceFolder" init parameter is also set, then resources in that folder will be polled for
@@ -1150,4 +1150,4 @@ public void setCspSettings(ContentSecurityPolicySettings cspSettings)
 	{
 		this.cspSettings = cspSettings;
 	}
-}
\ No newline at end of file
+}
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
index a69660b856b..94d81c6f4fc 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java
@@ -117,7 +117,7 @@ public ServletWebRequest(HttpServletRequest httpServletRequest, String filterPre
 	 * Example: if current url is
 	 * 
 	 * 
-	 * http://localhost:8080/context/filter/mapping/wicket/bookmarkable/com.foo.Page?1&id=2
+	 * http://localhost:8080/context/filter/mapping/wicket/bookmarkable/com.foo.Page?1&id=2
 	 * 
* * the base url is wicket/bookmarkable/com.foo.Page diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/https/RequireHttps.java b/wicket-core/src/main/java/org/apache/wicket/protocol/https/RequireHttps.java index be7ed5ba836..49a36c4f640 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/https/RequireHttps.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/https/RequireHttps.java @@ -27,9 +27,6 @@ * * NOTES: Adding {@link Inherited} annotation to this annotation will not work because we also want * it to work for interfaces - * - * @see SwitchProtocolRequestHandler - * */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java index 468a498cdbd..a6a3ec30332 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java @@ -113,7 +113,7 @@ protected byte[] toImageData(final BufferedImage image) /** * Get image data for our dynamic image resource. If the subclass regenerates the data, it - * should set the {@link DynamicImageResource#setLastModifiedTime(Time)} when it does so. This + * should set the {@link DynamicImageResource#setLastModifiedTime(Instant)} when it does so. This * ensures that image caching works correctly. * * @param attributes diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/ResourceReferenceRegistry.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/ResourceReferenceRegistry.java index 3d2282daf2c..b021342f8d1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/ResourceReferenceRegistry.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/ResourceReferenceRegistry.java @@ -407,7 +407,7 @@ protected ResourceReference createDefaultResourceReference(final Key key) * Set the cache size in number of entries * * @param autoAddedCapacity - * A value < 0 will disable aging of auto-create resource references. They will be + * A value < 0 will disable aging of auto-create resource references. They will be * created, added to the registry and live their until manually removed or the * application shuts down. */ diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java index e5808516448..09c888e0bd5 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java @@ -41,8 +41,8 @@ public interface IStaticCacheableResource extends IResource * get unique caching key for the resource stream produced by * {@link #getResourceStream()} * - * @return serializable key with properly supports {@link #equals(Object)} and - * {@link #hashCode()} + * @return serializable key which properly supports {@link Object#equals(Object)} and + * {@link Object#hashCode()} */ Serializable getCacheKey(); diff --git a/wicket-core/src/main/java/org/apache/wicket/resource/FileSystemResourceReference.java b/wicket-core/src/main/java/org/apache/wicket/resource/FileSystemResourceReference.java index 87d52d567b7..f76738d63f6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/resource/FileSystemResourceReference.java +++ b/wicket-core/src/main/java/org/apache/wicket/resource/FileSystemResourceReference.java @@ -135,7 +135,7 @@ public FileSystemResourceReference(Class scope, String name) } /** - * Creates a new {@link org.apache.wicket.markup.html.media.FileSystemResource} and applies the + * Creates a new {@link FileSystemResource} and applies the * path to it. */ @Override diff --git a/wicket-core/src/main/java/org/apache/wicket/response/filter/EmptySrcAttributeCheckFilter.java b/wicket-core/src/main/java/org/apache/wicket/response/filter/EmptySrcAttributeCheckFilter.java index 64e50d9bfe4..a4b750a2c09 100644 --- a/wicket-core/src/main/java/org/apache/wicket/response/filter/EmptySrcAttributeCheckFilter.java +++ b/wicket-core/src/main/java/org/apache/wicket/response/filter/EmptySrcAttributeCheckFilter.java @@ -41,9 +41,6 @@ public class EmptySrcAttributeCheckFilter implements IResponseFilter */ public static final EmptySrcAttributeCheckFilter INSTANCE = new EmptySrcAttributeCheckFilter(); - /** - * @see org.apache.wicket.IResponseFilter#filter(AppendingStringBuffer) - */ @Override public AppendingStringBuffer filter(final AppendingStringBuffer responseBuffer) { @@ -69,4 +66,4 @@ public AppendingStringBuffer filter(final AppendingStringBuffer responseBuffer) } return responseBuffer; } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplateDecorator.java b/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplateDecorator.java index 3737bbe5938..053d38785f7 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplateDecorator.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplateDecorator.java @@ -108,111 +108,75 @@ public String asString(Map variables) */ public abstract String getAfterTemplateContents(); - /** - * @see org.apache.wicket.util.resource.AbstractStringResourceStream#close() - */ @Override public void close() throws IOException { decorated.close(); } - /** - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { return decorated.equals(obj); } - /** - * @see org.apache.wicket.util.resource.AbstractStringResourceStream#getContentType() - */ @Override public String getContentType() { return decorated.getContentType(); } - /** - * @see org.apache.wicket.util.resource.AbstractStringResourceStream#getInputStream() - */ @Override public InputStream getInputStream() throws ResourceStreamNotFoundException { return decorated.getInputStream(); } - /** - * @see org.apache.wicket.util.resource.AbstractResourceStream#getLocale() - */ @Override public Locale getLocale() { return decorated.getLocale(); } - /** - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { return decorated.hashCode(); } - /** - * @see org.apache.wicket.util.resource.AbstractStringResourceStream#lastModifiedTime() - */ @Override public Instant lastModifiedTime() { return decorated.lastModifiedTime(); } - /** - * @see org.apache.wicket.util.resource.AbstractResourceStream#setCharset(java.nio.charset.Charset) - */ @Override public void setCharset(Charset charset) { decorated.setCharset(charset); } - /** - * @see org.apache.wicket.util.resource.AbstractStringResourceStream#setLastModified(org.apache.wicket.util.time.Time) - */ @Override public void setLastModified(Instant lastModified) { decorated.setLastModified(lastModified); } - /** - * @see org.apache.wicket.util.resource.AbstractResourceStream#setLocale(java.util.Locale) - */ @Override public void setLocale(Locale locale) { decorated.setLocale(locale); } - /** - * @see org.apache.wicket.util.template.TextTemplate#getString() - */ @Override public String getString() { return decorated.getString(); } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { return decorated.toString(); } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java index 254ae389852..dd19670ba85 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java @@ -955,7 +955,7 @@ public ResourceReference startResourceReference(final ResourceReference referenc } /** - * @return last response or null> if no response has been produced yet. + * @return last response or null if no response has been produced yet. */ public MockHttpServletResponse getLastResponse() { diff --git a/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java b/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java index b573a3a7439..2146cb0b8da 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java @@ -826,7 +826,7 @@ public void clickLink(Component link) } /** - * Asserts that that the BookmarkablePageLink identified by "id" points to the page as + * Asserts that that the BookmarkablePageLink identified by "id" points to the page as * expected - including parameters. * * @param id diff --git a/wicket-core/src/main/java/org/apache/wicket/validation/validator/CreditCardValidator.java b/wicket-core/src/main/java/org/apache/wicket/validation/validator/CreditCardValidator.java index 8f72127221c..ed5fbfc40b9 100644 --- a/wicket-core/src/main/java/org/apache/wicket/validation/validator/CreditCardValidator.java +++ b/wicket-core/src/main/java/org/apache/wicket/validation/validator/CreditCardValidator.java @@ -24,13 +24,13 @@ /** * Checks if a credit card number is valid. The number will be checked for "American Express", * "China UnionPay", "Diners Club Carte Blanche", "Diners Club International", - * "Diners Club US & Canada", "Discover Card", "JCB", "Laser", "Maestro", "MasterCard", "Solo", + * "Diners Club US & Canada", "Discover Card", "JCB", "Laser", "Maestro", "MasterCard", "Solo", * "Switch", "Visa" and "Visa Electron". If none of those apply to the credit card number, the * credit card number is considered invalid. * *

* Card prefixes and lengths have been taken from Wikipedia. + * href="http://en.wikipedia.org/w/index.php?title=Bank_card_number&oldid=322132931">Wikipedia. * * @author Johan Compagner * @author Joachim F. Rohde diff --git a/wicket-core/src/main/java/org/apache/wicket/validation/validator/EmailAddressValidator.java b/wicket-core/src/main/java/org/apache/wicket/validation/validator/EmailAddressValidator.java index cbeec09f39b..a9d5b03b3f3 100644 --- a/wicket-core/src/main/java/org/apache/wicket/validation/validator/EmailAddressValidator.java +++ b/wicket-core/src/main/java/org/apache/wicket/validation/validator/EmailAddressValidator.java @@ -24,14 +24,15 @@ * NOTICE: This validator only checks the most commonly used email address patterns. For a validator * that can check the entire range of rfc compliant email addresses see * org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator - * + * + *

Also see org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator

+ * * @author Chris Turner * @author Jonathan Locke * @author Martijn Dashorst * @author Al Maw - * - * @see org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator - * + * + * * @since 1.3 */ public class EmailAddressValidator extends PatternValidator diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/SimplePanel.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/SimplePanel.java index 67699278e95..37c3805133a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/SimplePanel.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/SimplePanel.java @@ -38,7 +38,7 @@ public class SimplePanel extends Panel public SimplePanel(String id) { super(id); - add(new Label("label", new Model("hello world"))); + add(new Label("label", new Model<>("hello world"))); } } diff --git a/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPage.java b/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPage.java index d5cddde7908..f3b6c64ed48 100644 --- a/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPage.java +++ b/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPage.java @@ -29,7 +29,7 @@ * All pages in the wicket-devutils package should extend this page so that they automatically get * checked to make sure that the utilities are enabled in the application debug settings. * - * @author Jeremy Thomerson + * @author Jeremy Thomerson */ public class DevUtilsPage extends WebPage { diff --git a/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPanel.java b/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPanel.java index 87764f3804d..cf1060ec69e 100644 --- a/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPanel.java +++ b/wicket-devutils/src/main/java/org/apache/wicket/devutils/DevUtilsPanel.java @@ -23,7 +23,7 @@ * All panels in the wicket-devutils package should extend this panel so that they automatically get * checked to make sure that the utilities are enabled in the application debug settings. * - * @author Jeremy Thomerson + * @author Jeremy Thomerson */ public class DevUtilsPanel extends Panel { diff --git a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/DebugBar.java b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/DebugBar.java index 8c9e1c6f91e..8a7bfaaadb4 100644 --- a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/DebugBar.java +++ b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/DebugBar.java @@ -62,7 +62,7 @@ * Important: if there is an element with a z-index in this part of your page, the DebugBar will need a higher * "z-index" style value to show up. Or you can use different position for it. See wicket-debugbar.css.

* - * @author Jeremy Thomerson + * @author Jeremy Thomerson * @see IDebugBarContributor */ public class DebugBar extends DevUtilsPanel diff --git a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/InspectorDebugPanel.java b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/InspectorDebugPanel.java index 33a07055427..ca5db3996ad 100644 --- a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/InspectorDebugPanel.java +++ b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/InspectorDebugPanel.java @@ -28,7 +28,7 @@ /** * A panel that adds a link to the inspector to the debug bar. * - * @author Jeremy Thomerson + * @author Jeremy Thomerson */ public class InspectorDebugPanel extends StandardDebugPanel { diff --git a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/SessionSizeDebugPanel.java b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/SessionSizeDebugPanel.java index 0fe3c62b603..2a86f96cfc0 100644 --- a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/SessionSizeDebugPanel.java +++ b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/SessionSizeDebugPanel.java @@ -29,7 +29,7 @@ * A panel for the debug bar that shows the session size and links to the page that shows more * information about sessions. * - * @author Jeremy Thomerson + * @author Jeremy Thomerson */ public class SessionSizeDebugPanel extends StandardDebugPanel { diff --git a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/StandardDebugPanel.java b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/StandardDebugPanel.java index 921b0099728..ed2ec0b12e6 100644 --- a/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/StandardDebugPanel.java +++ b/wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/StandardDebugPanel.java @@ -30,7 +30,7 @@ * A standard looking debug panel with an img (optional) and a string of data, and the whole thing * is a link. * - * @author Jeremy Thomerson + * @author Jeremy Thomerson */ public abstract class StandardDebugPanel extends DevUtilsPanel { diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownloadBehavior.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownloadBehavior.java index 729cd60b1f4..d3882ff05ff 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownloadBehavior.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxDownloadBehavior.java @@ -54,7 +54,7 @@ * add(new AjaxButton("download") * { * @Override - * protected void onSubmit(IPartialPageRequestHandler handler, Form<?> form) + * protected void onSubmit(IPartialPageRequestHandler handler, Form<?> form) * { * download.initiate(handler); * } @@ -96,7 +96,7 @@ public enum Location { * the resource has to be a {@link ContentDisposition#ATTACHMENT}. *

* Note: This will trigger JavaScript unload event on the page! - * Does not support {@link AjaxDownloadBehavior#onDownloadFailed(IPartialPageRequestHandler)} callback, + * Does not support {@link AjaxDownloadBehavior#onDownloadFailed(AjaxRequestTarget)} callback, * i.e. it is not possible to detect when the download has failed! */ SameWindow, @@ -144,7 +144,7 @@ public AjaxDownloadBehavior(IResource resource) *

* The {@link IResource} returned by {@link ResourceReference#getResource()} must call * {@link #markCompleted(Attributes)} when responding, otherwise the callback - * {@link #onDownloadSuccess(IPartialPageRequestHandler)} will not work. + * {@link #onDownloadSuccess(AjaxRequestTarget)} will not work. * * @param reference * reference to resource to download @@ -159,7 +159,7 @@ public AjaxDownloadBehavior(ResourceReference reference) *

* The {@link IResource} returned by {@link ResourceReference#getResource()} must call * {@link #markCompleted(Attributes)} when responding, otherwise the callback - * {@link #onDownloadSuccess(IPartialPageRequestHandler)} will not work. + * {@link #onDownloadSuccess(AjaxRequestTarget)} will not work. * * @param reference * reference to resource to download diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxFileDropBehavior.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxFileDropBehavior.java index 0501610c741..b2f29c9216a 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxFileDropBehavior.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/AjaxFileDropBehavior.java @@ -201,11 +201,11 @@ protected void onFileUpload(AjaxRequestTarget target, List files) * * @param target * the current request handler - * @param e + * @param fux * the error that occurred */ protected void onError(AjaxRequestTarget target, FileUploadException fux) { throw new WicketRuntimeException(fux); } -} \ No newline at end of file +} diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanel.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanel.java index c0eeadbe769..dd4b34a636c 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanel.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanel.java @@ -184,7 +184,7 @@ protected void onConfigure() * Since all LazyLoadingPanels on a page share the same Ajax timer, its update interval * is derived from the minimum of all panel's update intervals. * - * @return update interval, must not be {@value null} + * @return update interval, must not be {@code null} */ protected Duration getUpdateInterval() { return Duration.ofSeconds(1); diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanelTester.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanelTester.java index b4775f22551..599dab808d4 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanelTester.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanelTester.java @@ -79,7 +79,7 @@ else if (behaviors.size() > 1) * the tester * @param panel * the panel - * @return update duration or {@value null} of already loadedO + * @return update duration or {@code null} of already loadedO */ public static Duration loadAjaxLazyLoadPanel(final BaseWicketTester wt, final AjaxLazyLoadPanel panel) { diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java index 89b78ab6ce5..339c14e4a72 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java @@ -326,9 +326,7 @@ public AutoCompleteSettings setShowListOnFocusGain(final boolean showListOnFocus /** * Sets whether the popup positioning will take into account browser window visible area or not. * (so always show popup bottom-right or not)
- * THIS WILL PRODUCE UNWANTED BEHAVIOR WITH IE versions < 8 (probably because of unreliable - * clientWidth/clientHeight browser element properties). - * + * * @param useSmartPositioning * the flag * @return this {@link AutoCompleteSettings}. diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/IAutoCompleteRenderer.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/IAutoCompleteRenderer.java index 55a0d6b1c3c..3958a0a3fdd 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/IAutoCompleteRenderer.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/IAutoCompleteRenderer.java @@ -34,20 +34,20 @@ *

  * new IAutoCompleteRenderer() {
  *     void renderHead(Response r) { r.write("
- * 
    + * <ul> * "); } * * void render(Object o, Response r) { * // notice the textvalue attribute we define for li element * r.write(" - *
  • + * <li textvalue=\""+o.toString()+"\"> * <i>"+o.toString()+"</i> - *
  • + * </li> * "; * } * * void renderFooter(Response r) { r.write(" - *
+ * </ul> * "); } * } *
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java index f6d3f4b8dd1..04307b8aeb0 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadProgressBar.java @@ -55,7 +55,7 @@ * protected void init() { * super.init(); * - * getApplicationSettings().setUploadProgressUpdatesEnabled(true); // <-- + * <b>getApplicationSettings().setUploadProgressUpdatesEnabled(true);</b> // <-- * } * } * diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java index eea20e9b973..7247e458b4a 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java @@ -1005,7 +1005,7 @@ private String getContentMarkupId() /** * Returns the javascript used to open the window. Subclass - * {@link #postProcessSettings(AppendingStringBuffer)} to modify the JavaScript if needed. + * {@link #postProcessSettings(JSONObject)} to modify the JavaScript if needed. * * See WICKET-12 * @@ -1126,7 +1126,6 @@ else if (getMaskType() == MaskType.SEMI_TRANSPARENT) * Method that allows tweaking the settings * * @param settings - * @return settings json */ protected void postProcessSettings(JSONObject settings) { diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/AjaxListPanel.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/AjaxListPanel.java index b5ad0ce2c5e..e631b265e04 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/AjaxListPanel.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/AjaxListPanel.java @@ -80,7 +80,7 @@ public String newChildId() { * optional target * @return the component * - * @param T component type + * @param component type */ public T append(T component, AjaxRequestTarget target) { @@ -114,7 +114,7 @@ public T append(T component, AjaxRequestTarget target) * @return the component * @throws EmptyStackException if empty * - * @param T component type + * @param component type */ public T delete(T component, AjaxRequestTarget target) { @@ -126,4 +126,4 @@ public T delete(T component, AjaxRequestTarget target) { return (T)component; } -} \ No newline at end of file +} diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/ILinkRenderStrategy.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/ILinkRenderStrategy.java index 477566a4a3f..64640ab5adf 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/ILinkRenderStrategy.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/ILinkRenderStrategy.java @@ -18,7 +18,7 @@ /** * An implementation of ILinkRenderStrategy transforms a link target (e.g. email - * address) into a proper html link (e.g. <a href="mailto:...">...</a>) + * address) into a proper html link (e.g. <a href="mailto:...">...</a>) * * @author Gerolf Seitz */ diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/AbstractDateTimeField.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/AbstractDateTimeField.java index a9e9cf2b5cf..cd81b566f24 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/AbstractDateTimeField.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/AbstractDateTimeField.java @@ -32,11 +32,11 @@ import org.apache.wicket.util.convert.ConversionException; /** - * Works on a {@link java.time.Temporal} object, aggregating a {@link LocalDateTextField} and a {@link TimeField}. + * Works on a {@link java.time.temporal.Temporal} object, aggregating a {@link LocalDateTextField} and a {@link TimeField}. *

* Ajaxifying an AbstractDateTimeField: * If you want to update this component with an {@link AjaxFormComponentUpdatingBehavior}, you have to attach it - * to the contained components by overriding {@link #newDateTextField(String, IModel)}: + * to the contained components by overriding {@link #newDateField(String, IModel)}: * *

{@code
  *  DateTimeField dateTimeField = new DateTimeField(...) {
@@ -188,7 +188,7 @@ public void convertInput()
 	/**
 	 * Get a default time if none was entered.
 	 * 
-	 * @return {@value null} by default
+	 * @return {@code null} by default
 	 */
 	protected LocalTime getDefaultTime()
 	{
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalDateTimeTextField.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalDateTimeTextField.java
index 5095334eb36..f8724f6927a 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalDateTimeTextField.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalDateTimeTextField.java
@@ -53,7 +53,7 @@ public class LocalDateTimeTextField extends TextField implements
 	 *            the component id
 	 * @param model
 	 *            the model
-	 * @param pattern
+	 * @param dateTimePattern
 	 *            the pattern to use
 	 */
 	public LocalDateTimeTextField(String id, IModel model, String dateTimePattern)
@@ -82,7 +82,7 @@ public String getTextFormat(Locale locale)
 	 * 
 	 * @param id
 	 *            the component id
-	 * @param pattern
+	 * @param dateTimePattern
 	 *            the pattern to use
 	 */
 	public LocalDateTimeTextField(String id, String dateTimePattern)
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalTimeTextField.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalTimeTextField.java
index 36df2e10280..9ca41f104ab 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalTimeTextField.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/LocalTimeTextField.java
@@ -53,7 +53,7 @@ public class LocalTimeTextField extends TextField implements ITextFor
 	 *            the component id
 	 * @param model
 	 *            the model
-	 * @param pattern
+	 * @param timePattern
 	 *            the pattern to use
 	 */
 	public LocalTimeTextField(String id, IModel model, String timePattern)
@@ -82,7 +82,7 @@ public String getTextFormat(Locale locale)
 	 * 
 	 * @param id
 	 *            the component id
-	 * @param pattern
+	 * @param datePattern
 	 *            the pattern to use
 	 */
 	public LocalTimeTextField(String id, String datePattern)
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/TimeField.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/TimeField.java
index 7fd78adfb3b..382c19276aa 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/TimeField.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/TimeField.java
@@ -294,8 +294,8 @@ protected void onConfigure()
 	 * Checks whether the current {@link Locale} uses the 12h or 24h time format. This method can be
 	 * overridden to e.g. always use 24h format.
 	 * 
-	 * @return {@value true}, if the current {@link Locale} uses the 12h format.
- * {@value false}, otherwise + * @return {@code true}, if the current {@link Locale} uses the 12h format.
+ * {@code false}, otherwise */ protected boolean use12HourFormat() { @@ -363,4 +363,4 @@ public void setObject(AM_PM amPm) // ignored } } -} \ No newline at end of file +} diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedDateTimeField.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedDateTimeField.java index 31076944f94..7deba38bd30 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedDateTimeField.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedDateTimeField.java @@ -24,7 +24,7 @@ import org.apache.wicket.model.IModel; /** - * Works on a {@link java.time.ZonedDateTimeTime} object. See {@link AbstractDateTimeField} for + * Works on a {@link java.time.ZonedDateTime} object. See {@link AbstractDateTimeField} for * further details. * * @author eelcohillenius diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/CSVDataExporter.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/CSVDataExporter.java index d41a418c562..c189178a545 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/CSVDataExporter.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/CSVDataExporter.java @@ -255,7 +255,7 @@ protected IConverterLocator getConverterLocator() { /** * Wrap the given model- * - * @param displayModel + * @param model * @return */ protected IModel wrapModel(IModel model) @@ -299,4 +299,4 @@ public void close() throws IOException writer.close(); } } -} \ No newline at end of file +} diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java index 8b2bca4883b..765cd6bdaf4 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java @@ -226,7 +226,7 @@ protected IResourceStream getResourceStream(Attributes attributes) /** * How long should the export be cached. * - * @return default is {@link Duration#NONE} + * @return default is {@link Duration#ZERO} */ protected Duration getCacheDuration() { return Duration.ZERO; diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.java index 80e91178482..1cb9c3ef723 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/NestedTree.java @@ -86,7 +86,7 @@ public Component newSubtree(String id, IModel model) /** * Overridden to let the node output its markup id. * - * @see #updateNode(T, IPartialPageRequestHandler) + * @see #updateNode(Object, IPartialPageRequestHandler) * @see Component#setOutputMarkupId(boolean) */ @Override @@ -129,11 +129,7 @@ public void component(BranchItem branch, IVisit visit) /** * Overridden to update the corresponding {@link Node} only. -<<<<<<< HEAD * -======= - * ->>>>>>> master * @param node * node to update * @param target diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.java index dce03c7333b..305bc9417bf 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/TableTree.java @@ -109,7 +109,7 @@ public TableTree(final String id, final List> columns, * Factory method for the wrapped {@link DataTable}. * * Note: If overwritten, the DataTable's row items have to output their markupId, or - * {@link #updateNode(Object, Optional)} will fail. + * {@link #updateNode(Object, IPartialPageRequestHandler)} will fail. * * @param id * @param columns diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/Folder.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/Folder.java index 8130d72e155..d43e1064f48 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/Folder.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/Folder.java @@ -30,7 +30,7 @@ * * The link is used to expand/collapse the tree depending on the {@link State} of the current node. * Nodes without children are not clickable. Subclasses may change this behavior by overriding - * {@link #isClickable()} and {@link #onClick(Optional)}. + * {@link #isClickable()} and {@link #onClick(Optional)} * * @author svenmeier */ diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/StyledLinkLabel.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/StyledLinkLabel.java index 3d2bd25852c..e93fa0568ce 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/StyledLinkLabel.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/tree/content/StyledLinkLabel.java @@ -68,10 +68,10 @@ public T getModelObject() * Hook method to create a new link component. * * This default implementation returns an {@link AjaxFallbackLink} which invokes - * {@link #onClick(Optional)} only if {@link #isClickable()} returns true. + * {@link #onClick(Optional)} only if {@link #isClickable()} returns true. * * @see #isClickable() - * @see #onClick(Optional) + * @see #onClick(Optional) */ protected MarkupContainer newLinkComponent(String id, IModel model) { diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/IWizardModel.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/IWizardModel.java index b9b77b88b2a..e5c5da61557 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/IWizardModel.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/IWizardModel.java @@ -88,7 +88,7 @@ public interface IWizardModel extends IClusterable * * @param step * the step to check - * @return True if its the final step in the wizard, false< otherwise. + * @return True if its the final step in the wizard, false otherwise. */ boolean isLastStep(IWizardStep step); diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButton.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButton.java index 2b6c50dd6bf..3e7efbaf6e6 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButton.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButton.java @@ -45,8 +45,8 @@ public abstract class WizardButton extends Button * The component id * @param wizard * The wizard - * @param labelResourceKey - * The resource key of the button's label + * @param label + * The button's label */ public WizardButton(final String id, final IWizard wizard, final IModel label) { diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButtonBar.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButtonBar.java index 4bd54ef20d4..0959967232e 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButtonBar.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/WizardButtonBar.java @@ -78,9 +78,6 @@ protected void onBeforeRender() } } - /** - * @see org.apache.wicket.extensions.wizard.IDefaultButtonProvider#getDefaultButton(org.apache.wicket.extensions.wizard.IWizardModel) - */ public WizardButton getDefaultButton(final IWizardModel model) { if (model.isNextAvailable()) diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/dynamic/IDynamicWizardStep.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/dynamic/IDynamicWizardStep.java index a68b5ebd662..9c9d88c8efd 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/dynamic/IDynamicWizardStep.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/wizard/dynamic/IDynamicWizardStep.java @@ -36,7 +36,7 @@ public interface IDynamicWizardStep extends IWizardStep /** * Gets whether this is the last step in the wizard. * - * @return True if its the final step in the wizard, false< otherwise. + * @return True if its the final step in the wizard, false otherwise. * * @see IWizardModel#isLastStep(IWizardStep) */ diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java index b65cafddd6c..283f5ed6e4e 100644 --- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java +++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/DebugSettingsMBean.java @@ -56,16 +56,16 @@ public interface DebugSettingsMBean * If the parameter value is non-empty then Wicket will use it as the name of an attribute of the * component tag to print the {@link org.apache.wicket.Component}'s path. * - * @param enabled + * @param name */ - public void setComponentPathAttributeName(String name); + void setComponentPathAttributeName(String name); /** * @see #setComponentPathAttributeName(String) * @return The name of the attribute for the {@link org.apache.wicket.markup.ComponentTag}. * If {@code null} or empty then the attribute won't be rendered */ - public String getComponentPathAttributeName(); + String getComponentPathAttributeName(); /** * Enables wrapping output of markup container in html comments that contain markup container's @@ -73,7 +73,7 @@ public interface DebugSettingsMBean * * @param enable */ - public void setOutputMarkupContainerClassName(boolean enable); + void setOutputMarkupContainerClassName(boolean enable); /** * Returns whether the output of markup container's should be wrapped by comments containing the @@ -81,7 +81,7 @@ public interface DebugSettingsMBean * * @return true if the markup container's class name should be written to response */ - public boolean isOutputMarkupContainerClassName(); + boolean isOutputMarkupContainerClassName(); /** * Returns status of line precise error reporting for added components that are not present in @@ -91,7 +91,7 @@ public interface DebugSettingsMBean * * @return true if the line precise error reporting is enabled */ - public boolean isLinePreciseReportingOnAddComponentEnabled(); + boolean isLinePreciseReportingOnAddComponentEnabled(); /** * Enables line precise error reporting for added components that are not present in the markup: @@ -101,7 +101,7 @@ public interface DebugSettingsMBean * * @param enable */ - public void setLinePreciseReportingOnAddComponentEnabled(boolean enable); + void setLinePreciseReportingOnAddComponentEnabled(boolean enable); /** * Returns status of line precise error reporting for new components that are not present in the @@ -110,7 +110,7 @@ public interface DebugSettingsMBean * * @return true if the line precise error reporting is enabled */ - public boolean isLinePreciseReportingOnNewComponentEnabled(); + boolean isLinePreciseReportingOnNewComponentEnabled(); /** * Enables line precise error reporting for new components that are not present in the markup: @@ -119,19 +119,19 @@ public interface DebugSettingsMBean * * @param enable */ - public void setLinePreciseReportingOnNewComponentEnabled(boolean enable); + void setLinePreciseReportingOnNewComponentEnabled(boolean enable); /** * Enables all of the panels and pages, etc, from wicket-devutils package. * * @param enable */ - public void setDevelopmentUtilitiesEnabled(boolean enable); + void setDevelopmentUtilitiesEnabled(boolean enable); /** * Are all of the panels and pages, etc, from wicket-devutils package enabled? * * @return true if all of the panels and pages, etc, from wicket-devutils package are enabled */ - public boolean isDevelopmentUtilitiesEnabled(); + boolean isDevelopmentUtilitiesEnabled(); } diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/RequestCycleSettingsMBean.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/RequestCycleSettingsMBean.java index 9a6e9b6f6ce..f0bd55e80a2 100644 --- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/RequestCycleSettingsMBean.java +++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/RequestCycleSettingsMBean.java @@ -17,6 +17,8 @@ package org.apache.wicket.jmx; import java.io.UnsupportedEncodingException; + +import org.apache.wicket.Session; import org.apache.wicket.markup.html.pages.BrowserInfoPage; /** @@ -34,8 +36,8 @@ public interface RequestCycleSettingsMBean /** * Gets whether Wicket should try to get extensive client info by redirecting to * {@link BrowserInfoPage a page that polls for client capabilities}. This method is used by the - * default implementation of {@link WebRequestCycle#newClientInfo()}, so if that method is - * overriden, there is no guarantee this method will be taken into account. + * default implementation of {@link Session#getClientInfo()}, so if that method is + * overridden, there is no guarantee this method will be taken into account. * * @return Whether to gather extensive client info */ @@ -67,8 +69,8 @@ public interface RequestCycleSettingsMBean /** * Sets whether Wicket should try to get extensive client info by redirecting to * {@link BrowserInfoPage a page that polls for client capabilities}. This method is used by the - * default implementation of {@link WebRequestCycle#newClientInfo()}, so if that method is - * overriden, there is no guarantee this method will be taken into account. + * default implementation of {@link Session#getClientInfo()}, so if that method is + * overridden, there is no guarantee this method will be taken into account. * * @param gatherExtendedBrowserInfo * Whether to gather extensive client info diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/StoreSettingsMBean.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/StoreSettingsMBean.java index 079019e26f8..3a1a34b780e 100644 --- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/StoreSettingsMBean.java +++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/StoreSettingsMBean.java @@ -43,7 +43,7 @@ public interface StoreSettingsMBean /** * @return {@code true} when the HTTP worker thread doesn't wait for the storing of the page's - * bytes in {@link IPageStore} + * bytes in {@link org.apache.wicket.pageStore.IPageStore} */ boolean isAsynchronous(); } diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java index 8f80816519d..f4cdea5139f 100644 --- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java +++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/wrapper/DebugSettings.java @@ -56,109 +56,72 @@ public boolean isAjaxDebugModeEnabled() return application.getDebugSettings().isAjaxDebugModeEnabled(); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setAjaxDebugModeEnabled(boolean) - */ @Override public void setAjaxDebugModeEnabled(final boolean enable) { application.getDebugSettings().setAjaxDebugModeEnabled(enable); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setComponentUseCheck(boolean) - */ @Override public void setComponentUseCheck(final boolean check) { application.getDebugSettings().setComponentUseCheck(check); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setComponentPathAttributeName(boolean) - */ @Override public void setComponentPathAttributeName(final String name) { application.getDebugSettings().setComponentPathAttributeName(name); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#isOutputComponentPath() - */ @Override public String getComponentPathAttributeName() { return application.getDebugSettings().getComponentPathAttributeName(); } - - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setOutputMarkupContainerClassName(boolean) - */ @Override public void setOutputMarkupContainerClassName(final boolean enable) { application.getDebugSettings().setOutputMarkupContainerClassName(enable); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#isOutputMarkupContainerClassName() - */ @Override public boolean isOutputMarkupContainerClassName() { return application.getDebugSettings().isOutputMarkupContainerClassName(); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#isLinePreciseReportingOnAddComponentEnabled() - */ @Override public boolean isLinePreciseReportingOnAddComponentEnabled() { return application.getDebugSettings().isLinePreciseReportingOnAddComponentEnabled(); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setLinePreciseReportingOnAddComponentEnabled(boolean) - */ @Override public void setLinePreciseReportingOnAddComponentEnabled(final boolean enable) { application.getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(enable); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#isLinePreciseReportingOnNewComponentEnabled() - */ @Override public boolean isLinePreciseReportingOnNewComponentEnabled() { return application.getDebugSettings().isLinePreciseReportingOnNewComponentEnabled(); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setLinePreciseReportingOnNewComponentEnabled(boolean) - */ @Override public void setLinePreciseReportingOnNewComponentEnabled(final boolean enable) { application.getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(enable); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#setDevelopmentUtilitiesEnabled(boolean) - */ @Override public void setDevelopmentUtilitiesEnabled(final boolean enable) { application.getDebugSettings().setDevelopmentUtilitiesEnabled(enable); } - /** - * @see org.apache.wicket.jmx.DebugSettingsMBean#isDevelopmentUtilitiesEnabled() - */ @Override public boolean isDevelopmentUtilitiesEnabled() { diff --git a/wicket-spring/src/main/java/org/apache/wicket/spring/SpringWebApplicationFactory.java b/wicket-spring/src/main/java/org/apache/wicket/spring/SpringWebApplicationFactory.java index 9c0ad8d9f40..7045bbc7716 100644 --- a/wicket-spring/src/main/java/org/apache/wicket/spring/SpringWebApplicationFactory.java +++ b/wicket-spring/src/main/java/org/apache/wicket/spring/SpringWebApplicationFactory.java @@ -41,7 +41,7 @@ *
  * <filter>
  *   <filter-name>MyApplication</filter-name>
- *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
  *   <init-param>
  *     <param-name>applicationFactoryClassName</param-name>
  *     <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
@@ -57,7 +57,7 @@
  * 
  * <filter>
  *   <filter-name>MyApplication</filter-name>
- *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
  *   <init-param>
  *     <param-name>applicationFactoryClassName</param-name>
  *     <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
@@ -78,7 +78,7 @@
  * 
  * <filter>
  *   <filter-name>MyApplication</filter-name>
- *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ *   <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
  *   <init-param>
  *     <param-name>applicationFactoryClassName</param-name>
  *     <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
@@ -181,7 +181,7 @@ private WebApplication createApplication(final ApplicationContext applicationCon
 
 	/**
 	 * Creates and initializes a new {@link WebApplicationContext}, with the given context as the
-	 * parent. Based on the logic in {@link FrameworkServlet#createWebApplicationContext}
+	 * parent. Based on the logic in Spring's FrameworkServlet#createWebApplicationContext()
 	 * 
 	 * @param parent
 	 *            parent application context
@@ -206,7 +206,7 @@ protected final ConfigurableWebApplicationContext createWebApplicationContext(
 
 	/**
 	 * This is a hook for potential subclasses to perform additional processing on the context.
-	 * Based on the logic in {@link FrameworkServlet#postProcessWebApplicationContext}
+	 * Based on the logic in Spring's FrameworkServlet#postProcessWebApplicationContext()
 	 * 
 	 * @param wac
 	 *            additional application context
diff --git a/wicket-velocity/src/main/java/org/apache/wicket/velocity/markup/html/VelocityPanel.java b/wicket-velocity/src/main/java/org/apache/wicket/velocity/markup/html/VelocityPanel.java
index 1133f8e4386..4ab790f3f24 100644
--- a/wicket-velocity/src/main/java/org/apache/wicket/velocity/markup/html/VelocityPanel.java
+++ b/wicket-velocity/src/main/java/org/apache/wicket/velocity/markup/html/VelocityPanel.java
@@ -39,9 +39,9 @@
 
 /**
  * Panel that displays the result of rendering a Velocity template. The template itself can be any
+ * href="http://velocity.apache.org">Velocity template. The template itself can be any
  * {@link StringResourceStream} implementation, of which there are a number of convenient
- * implementations in the {@link org.apache.wicket.util} package. The model can be any normal
+ * implementations in the org.apache.wicket.util package. The model can be any normal
  * {@link Map}, which will be used to create the {@link VelocityContext}.
  * 

* Note: Be sure to properly initialize the Velocity engine before using From 6f4ed26ea8121928526515cf4dd7f26d24f0e810 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 11:16:35 +0300 Subject: [PATCH 28/88] Remove dependencies which already come as transitive ones from wicket-native-websocket-core --- .../wicket-native-websocket-core/pom.xml | 2 -- .../wicket-native-websocket-javax/pom.xml | 8 -------- 2 files changed, 10 deletions(-) diff --git a/wicket-native-websocket/wicket-native-websocket-core/pom.xml b/wicket-native-websocket/wicket-native-websocket-core/pom.xml index 9f4add1d443..567231cbd25 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-core/pom.xml @@ -39,11 +39,9 @@ org.apache.wicket wicket-core - org.junit.jupiter junit-jupiter-engine - diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml index 554eab8021f..cfc13760b37 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml @@ -37,14 +37,6 @@ jakarta.websocket jakarta.websocket-api - - javax.servlet - javax.servlet-api - - - org.apache.wicket - wicket-core - org.apache.wicket wicket-native-websocket-core From 580ab68797cf983bdf681e225217f5230f082a7e Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 11:17:20 +0300 Subject: [PATCH 29/88] WICKET-6897 Javadoc build fails on fresh checkout of master or rel/wicket-9.3.0 Simplify the setup of maven-javadoc-plugin by using Maven properties --- pom.xml | 102 ++++++++++++++++++++------------------------------------ 1 file changed, 36 insertions(+), 66 deletions(-) diff --git a/pom.xml b/pom.xml index 0b6b8776536..bf5da5bde80 100644 --- a/pom.xml +++ b/pom.xml @@ -124,6 +124,9 @@ UTF-8 UTF-8 + + https://docs.oracle.com/en/java/javase/${java.specification.version}/docs/api/ + true true true @@ -1002,6 +1005,30 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + 128m + 256m + true + + ${javadoc.jdk.apidocs.link} + + true + none + ${javadoc.additionalJOption} + + + + attach-javadocs + + jar + + + + org.apache.maven.plugins maven-release-plugin @@ -1238,6 +1265,11 @@ maven-gpg-plugin true + + org.apache.maven.plugins + maven-javadoc-plugin + true + org.apache.maven.plugins maven-toolchains-plugin @@ -1553,75 +1585,13 @@ - on-java-12- + on-java-11-or-12 [11,12] - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - 128m - 256m - true - - https://docs.oracle.com/en/java/javase/11/docs/api/ - - true - none - --no-module-directories - - - - attach-javadocs - - jar - - - - - - - - - - on-java-13+ - - [13,) - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - 128m - 256m - true - - https://docs.oracle.com/en/java/javase/16/docs/api/ - - true - none - - - - attach-javadocs - - jar - - - - - - - + + --no-module-directories + From cc4cb65ac9854f9466a68e719113a795d8a7afdf Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 11:29:23 +0300 Subject: [PATCH 30/88] Do not fail the build when maven-javadoc-plugin fails There is a mysterious error in websocker-core module - javadoc cannot see javax.servlet.Filter class for some reason --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bf5da5bde80..82c55c7f588 100644 --- a/pom.xml +++ b/pom.xml @@ -1016,7 +1016,7 @@ ${javadoc.jdk.apidocs.link} - true + false none ${javadoc.additionalJOption} From c94e971e5604d742f42b062b70e0ed0c48a22ce6 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 12:05:01 +0300 Subject: [PATCH 31/88] Add a profile for JDK EA (17+) that fixes the url to the javadocs Fixes yet another javadoc error while building with JDK EA --- pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 82c55c7f588..e2ee502efca 100644 --- a/pom.xml +++ b/pom.xml @@ -1585,7 +1585,7 @@ - on-java-11-or-12 + on-jdk-11-or-12 [11,12] @@ -1593,6 +1593,15 @@ --no-module-directories + + on-jdk-early-access + + [17,) + + + https://download.java.net/java/early_access/jdk${java.specification.version}/docs/api/ + + From 54866f2b3e7670a69be74937f09457edcf280838 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 14:35:02 +0300 Subject: [PATCH 32/88] WICKET-6897 Javadoc build fails on fresh checkout of master or rel/wicket-9.3.0 Further javadoc + JPMS fixes: - explicitly specify sourceDirectory as a source path, so that javadoc does not try to load it from modu - link the source too. Seems useful - specify that the version of the sources is 8-like, i.e. we do not yet use module-info.java (JPMS) --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e2ee502efca..625dff30678 100644 --- a/pom.xml +++ b/pom.xml @@ -1016,9 +1016,13 @@ ${javadoc.jdk.apidocs.link} - false + + true none ${javadoc.additionalJOption} + ${project.build.sourceDirectory} + + 8 From 49db07e8b64bdcd6551518bd0dc4cf8a2f7f44ee Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 15:57:44 +0300 Subject: [PATCH 33/88] WICKET-6897 Fix the linking of the sources in javadoc For some reason git didn't included this change in the previous commit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 625dff30678..6a01a4dd143 100644 --- a/pom.xml +++ b/pom.xml @@ -1016,7 +1016,7 @@ ${javadoc.jdk.apidocs.link} - + true true none ${javadoc.additionalJOption} From c2b6d625e1e85b02a8fb9689680c9666889b11bb Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 28 Jun 2021 09:46:04 +0300 Subject: [PATCH 34/88] Update Mockito to 3.11.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a01a4dd143..6f7889cd1ff 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ 6.2.0.Final 1.7.3 4.1.19 - 3.11.1 + 3.11.2 3.2 1.0.12 1.7.25 From d44ca1a40d44f85d2e2064ecb1fe562b14d64183 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 30 Jun 2021 09:19:54 +0300 Subject: [PATCH 35/88] WICKET-6899 Add setExceptionMapperProvider() to Application --- .../src/main/java/org/apache/wicket/Application.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index fa4ce294618..a450fad5a02 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -651,8 +651,8 @@ protected void internalInit() pageFactory = newPageFactory(); - requestCycleProvider = (context) -> new RequestCycle(context); - exceptionMapperProvider = () -> new DefaultExceptionMapper(); + requestCycleProvider = RequestCycle::new; + exceptionMapperProvider = DefaultExceptionMapper::new; // add a request cycle listener that logs each request for the requestlogger. getRequestCycleListeners().add(new RequestLoggerRequestCycleListener()); @@ -671,6 +671,10 @@ public Supplier getExceptionMapperProvider() return exceptionMapperProvider; } + public void setExceptionMapperProvider(Supplier exceptionMapperProvider) { + this.exceptionMapperProvider = Args.notNull(exceptionMapperProvider, "exceptionMapperProvider"); + } + /** * * @return Session state provider From a73bf2e18a4409edcd115b5176a0dd336e1cee96 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 7 Jul 2021 10:12:36 +0300 Subject: [PATCH 36/88] Minor non-functional cleanup: - fix javadoc - simplify construction of a collection from another collection - do not specify the generic type when there is no need, it is infered - do not call .toString(), it is implicit --- .../main/java/org/apache/wicket/Component.java | 2 +- .../data/table/filter/FilterToolbar.java | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index e1f522e3bb1..83618f3d9b1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -3066,7 +3066,7 @@ public final Component setOutputMarkupId(final boolean output) /** * Render a placeholder tag when the component is not visible. The tag is of form: - * <componenttag hidden=""" id="markupid"/>. This method will also call + * <componenttag hidden="" id="markupid"/>. This method will also call * setOutputMarkupId(true). * * This is useful, for example, in ajax situations where the component starts out invisible and diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterToolbar.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterToolbar.java index d5e32c0c80e..74d30ef495a 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterToolbar.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterToolbar.java @@ -65,28 +65,20 @@ public FilterToolbar(final DataTable table, final FilterForm Args.notNull(table, "table"); - IModel>> model = new IModel>>() { + IModel>> model = new IModel<>() { private static final long serialVersionUID = 1L; @Override public List> getObject() { - List> columnsModels = new LinkedList<>(); - - for (IColumn column : table.getColumns()) - { - columnsModels.add(column); - } - return columnsModels; + return new LinkedList<>(table.getColumns()); } }; - // populate the toolbar with components provided by filtered columns - ListView> filters = new ListView>("filters", model) + ListView> filters = new ListView<>("filters", model) { private static final long serialVersionUID = 1L; - @Override protected void populateItem(ListItem> item) { @@ -114,7 +106,7 @@ protected void populateItem(ListItem> item) filter.getId() + "] required component id [" + getId() + - "] generating column [" + col.toString() + "] "); + "] generating column [" + col + "] "); } } From 9cc762888b639a2de35a19580795133c30179880 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Sat, 3 Jul 2021 19:17:53 +0200 Subject: [PATCH 37/88] Added CHANGELOG for release 9.4.0 --- CHANGELOG-9.x | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG-9.x b/CHANGELOG-9.x index 001da7e94f4..e23ceb74842 100644 --- a/CHANGELOG-9.x +++ b/CHANGELOG-9.x @@ -2,6 +2,31 @@ This file contains all changes done in releases for Apache Wicket 9.x. ======================================================================= +Release Notes - Wicket - Version 9.4.0 + +** Bug + + * [WICKET-6875] - Example for FileSystemResource.java does not work + * [WICKET-6877] - Removing component's MetaData during detach phase from within a Behavior causes issue + * [WICKET-6878] - Rendering of relative Urls does not take into account filterpath for absolute Urls + * [WICKET-6881] - Link on website to JavaDoc of version 1.3.x is broken + * [WICKET-6895] - Links to examples in documentation points to old version of 8x + * [WICKET-6896] - AutoCompleteTextField re-opens dropdown item list after item has been selected + * [WICKET-6897] - Javadoc build fails on fresh checkout of master or rel/wicket-9.3.0 + +** New Feature + + * [WICKET-6886] - LambdaChoiceRenderer + +** Improvement + + * [WICKET-6876] - add an AJAX behavior that allows to collect file information when a file, to be uploaded, is selected. + * [WICKET-6880] - Documentation of DataTable/DataGridView has reference to unknown class UserProvider + * [WICKET-6885] - Add scope col and colgroup to HeadersToolbar + * [WICKET-6899] - Add setExceptionMapperProvider to Application + +======================================================================= + Release Notes - Wicket - Version 9.3.0 ** Bug From c9f927608616e5b64059952096560ae6702ce3b2 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Wed, 7 Jul 2021 22:31:39 +0200 Subject: [PATCH 38/88] Start next development version --- archetypes/quickstart/pom.xml | 2 +- pom.xml | 48 +++++++++---------- testing/wicket-common-tests/pom.xml | 2 +- testing/wicket-js-tests/pom.xml | 2 +- wicket-auth-roles/pom.xml | 2 +- wicket-bean-validation/pom.xml | 2 +- wicket-cdi/pom.xml | 2 +- wicket-core/pom.xml | 2 +- wicket-devutils/pom.xml | 2 +- wicket-examples/pom.xml | 2 +- wicket-experimental/pom.xml | 2 +- wicket-experimental/wicket-http2/pom.xml | 4 +- .../wicket-http2/wicket-http2-core/pom.xml | 2 +- .../wicket-http2/wicket-http2-jetty/pom.xml | 2 +- .../wicket-http2-servlet4/pom.xml | 2 +- .../wicket-http2/wicket-http2-tomcat/pom.xml | 2 +- .../wicket-http2-undertow/pom.xml | 2 +- wicket-experimental/wicket-metrics/pom.xml | 4 +- wicket-extensions/pom.xml | 2 +- wicket-guice/pom.xml | 2 +- wicket-ioc/pom.xml | 2 +- wicket-jmx/pom.xml | 2 +- wicket-native-websocket/pom.xml | 2 +- .../wicket-native-websocket-core/pom.xml | 2 +- .../wicket-native-websocket-javax/pom.xml | 2 +- wicket-objectsizeof-agent/pom.xml | 2 +- wicket-request/pom.xml | 2 +- wicket-spring/pom.xml | 2 +- wicket-user-guide/pom.xml | 2 +- wicket-util/pom.xml | 2 +- wicket-velocity/pom.xml | 2 +- wicket/pom.xml | 2 +- 32 files changed, 57 insertions(+), 57 deletions(-) diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml index af5d6a6e56d..c8d3bca67e7 100644 --- a/archetypes/quickstart/pom.xml +++ b/archetypes/quickstart/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../../pom.xml wicket-archetype-quickstart diff --git a/pom.xml b/pom.xml index 6f7889cd1ff..60d18f90b92 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT pom Wicket Parent Wicket is a Java-based open source component web application framework. @@ -124,7 +124,7 @@ UTF-8 UTF-8 - + https://docs.oracle.com/en/java/javase/${java.specification.version}/docs/api/ true @@ -339,7 +339,7 @@ org.apache.wicket wicket - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT @@ -348,31 +348,31 @@ org.apache.wicket wicket-auth-roles - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-bean-validation - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-cdi - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-core - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-devutils - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar @@ -383,97 +383,97 @@ org.apache.wicket wicket-extensions - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-guice - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-ioc - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-jmx - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-native-websocket-core - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-native-websocket-javax - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-request - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-spring - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-util - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket wicket-velocity - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-core - 0.15-SNAPSHOT + 0.16-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-jetty - 0.15-SNAPSHOT + 0.16-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-servlet4 - 0.15-SNAPSHOT + 0.16-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-tomcat - 0.15-SNAPSHOT + 0.16-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-undertow - 0.15-SNAPSHOT + 0.16-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-metrics - 0.16-SNAPSHOT + 0.17-SNAPSHOT jar diff --git a/testing/wicket-common-tests/pom.xml b/testing/wicket-common-tests/pom.xml index 08c67bf7584..685ba1d2f8d 100644 --- a/testing/wicket-common-tests/pom.xml +++ b/testing/wicket-common-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../../pom.xml wicket-common-tests diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml index 0d3f3b0e1a2..50d16902797 100644 --- a/testing/wicket-js-tests/pom.xml +++ b/testing/wicket-js-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../../pom.xml wicket-js-tests diff --git a/wicket-auth-roles/pom.xml b/wicket-auth-roles/pom.xml index daba532f57a..f3b6f3de30f 100644 --- a/wicket-auth-roles/pom.xml +++ b/wicket-auth-roles/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-auth-roles diff --git a/wicket-bean-validation/pom.xml b/wicket-bean-validation/pom.xml index 7dd268ce4df..d043d1cb616 100644 --- a/wicket-bean-validation/pom.xml +++ b/wicket-bean-validation/pom.xml @@ -4,7 +4,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-bean-validation diff --git a/wicket-cdi/pom.xml b/wicket-cdi/pom.xml index f4f7620a08a..d4e4bf5a99b 100644 --- a/wicket-cdi/pom.xml +++ b/wicket-cdi/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-cdi diff --git a/wicket-core/pom.xml b/wicket-core/pom.xml index 5311dff6884..e6375cd5073 100644 --- a/wicket-core/pom.xml +++ b/wicket-core/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-core diff --git a/wicket-devutils/pom.xml b/wicket-devutils/pom.xml index 8c6ef6e6433..94ffc1fe9fa 100644 --- a/wicket-devutils/pom.xml +++ b/wicket-devutils/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-devutils diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index 71bb03d0f39..5dc9e60097f 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-examples diff --git a/wicket-experimental/pom.xml b/wicket-experimental/pom.xml index 99990534124..3708ee35a9f 100644 --- a/wicket-experimental/pom.xml +++ b/wicket-experimental/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml org.apache.wicket.experimental.wicket9 diff --git a/wicket-experimental/wicket-http2/pom.xml b/wicket-experimental/wicket-http2/pom.xml index fd7ff24479d..33e0db796a2 100644 --- a/wicket-experimental/wicket-http2/pom.xml +++ b/wicket-experimental/wicket-http2/pom.xml @@ -20,11 +20,11 @@ org.apache.wicket.experimental.wicket9 wicket-experimental - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-http2 - 0.15-SNAPSHOT + 0.16-SNAPSHOT pom Wicket Http/2 diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml index e57a8ae4db3..f9ce802a15e 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.15-SNAPSHOT + 0.16-SNAPSHOT ../pom.xml wicket-http2-core diff --git a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml index 02fbad9535c..9dfcab65c90 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.15-SNAPSHOT + 0.16-SNAPSHOT ../pom.xml wicket-http2-jetty diff --git a/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml index 883e233cb00..24ddf9d9d54 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.15-SNAPSHOT + 0.16-SNAPSHOT ../pom.xml wicket-http2-servlet4 diff --git a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml index de2b958c944..5fc03feec69 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.15-SNAPSHOT + 0.16-SNAPSHOT ../pom.xml wicket-http2-tomcat diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml index 3bfd6804ba8..20c81940de3 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.15-SNAPSHOT + 0.16-SNAPSHOT ../pom.xml wicket-http2-undertow diff --git a/wicket-experimental/wicket-metrics/pom.xml b/wicket-experimental/wicket-metrics/pom.xml index 599d7e84229..35e51bbd74d 100644 --- a/wicket-experimental/wicket-metrics/pom.xml +++ b/wicket-experimental/wicket-metrics/pom.xml @@ -20,11 +20,11 @@ org.apache.wicket.experimental.wicket9 wicket-experimental - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-metrics - 0.16-SNAPSHOT + 0.17-SNAPSHOT bundle Wicket Metrics diff --git a/wicket-extensions/pom.xml b/wicket-extensions/pom.xml index 572a7fa57ce..00373b2f621 100644 --- a/wicket-extensions/pom.xml +++ b/wicket-extensions/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-extensions diff --git a/wicket-guice/pom.xml b/wicket-guice/pom.xml index 72e18e4c9c2..c9c95f6b74f 100644 --- a/wicket-guice/pom.xml +++ b/wicket-guice/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-guice diff --git a/wicket-ioc/pom.xml b/wicket-ioc/pom.xml index 9d0a2838dfc..106b9116bff 100644 --- a/wicket-ioc/pom.xml +++ b/wicket-ioc/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-ioc diff --git a/wicket-jmx/pom.xml b/wicket-jmx/pom.xml index 662d6f5c713..b549be87d17 100644 --- a/wicket-jmx/pom.xml +++ b/wicket-jmx/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-jmx diff --git a/wicket-native-websocket/pom.xml b/wicket-native-websocket/pom.xml index e8811be6bdc..042e5e9b882 100644 --- a/wicket-native-websocket/pom.xml +++ b/wicket-native-websocket/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-native-websocket diff --git a/wicket-native-websocket/wicket-native-websocket-core/pom.xml b/wicket-native-websocket/wicket-native-websocket-core/pom.xml index 567231cbd25..460b745c82b 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-core/pom.xml @@ -21,7 +21,7 @@ org.apache.wicket wicket-native-websocket - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml index cfc13760b37..9855dd5adb0 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-native-websocket - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-native-websocket-javax diff --git a/wicket-objectsizeof-agent/pom.xml b/wicket-objectsizeof-agent/pom.xml index ef3f4218bad..e0cd694e089 100644 --- a/wicket-objectsizeof-agent/pom.xml +++ b/wicket-objectsizeof-agent/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-objectsizeof-agent diff --git a/wicket-request/pom.xml b/wicket-request/pom.xml index 8c4c9403b4a..1f871c3dd6c 100755 --- a/wicket-request/pom.xml +++ b/wicket-request/pom.xml @@ -20,7 +20,7 @@ wicket-parent org.apache.wicket - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT wicket-request bundle diff --git a/wicket-spring/pom.xml b/wicket-spring/pom.xml index 95cf7f67c93..31898ba5939 100644 --- a/wicket-spring/pom.xml +++ b/wicket-spring/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-spring diff --git a/wicket-user-guide/pom.xml b/wicket-user-guide/pom.xml index f2f1a778416..b1f4e1087c7 100644 --- a/wicket-user-guide/pom.xml +++ b/wicket-user-guide/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-user-guide diff --git a/wicket-util/pom.xml b/wicket-util/pom.xml index a0c869b91a1..5a681e2a1ce 100755 --- a/wicket-util/pom.xml +++ b/wicket-util/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-util diff --git a/wicket-velocity/pom.xml b/wicket-velocity/pom.xml index 54da1891fed..33829a0b889 100644 --- a/wicket-velocity/pom.xml +++ b/wicket-velocity/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket-velocity diff --git a/wicket/pom.xml b/wicket/pom.xml index ed5af532ab0..5d337be31d0 100644 --- a/wicket/pom.xml +++ b/wicket/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.4.0-SNAPSHOT + 9.5.0-SNAPSHOT ../pom.xml wicket From b0d6e1b927e429c23f1d65cba72dd064378bad46 Mon Sep 17 00:00:00 2001 From: Maxim Solodovnik Date: Fri, 9 Jul 2021 19:52:14 +0700 Subject: [PATCH 39/88] no jira: javadoc:aggregate seems to work locally --- pom.xml | 1 - testing/wicket-threadtest/src/site/site.xml | 5 ----- wicket-auth-roles/src/site/site.xml | 5 ----- wicket-core/src/site/site.xml | 7 +------ wicket-examples/src/site/site.xml | 7 +------ wicket-extensions/src/site/site.xml | 7 +------ wicket-guice/src/site/site.xml | 7 +------ wicket-ioc/src/site/site.xml | 5 ----- wicket-jmx/src/site/site.xml | 5 ----- wicket-objectsizeof-agent/src/site/site.xml | 5 ----- wicket-spring/src/site/site.xml | 7 +------ wicket-velocity/src/site/site.xml | 5 ----- 12 files changed, 5 insertions(+), 61 deletions(-) diff --git a/pom.xml b/pom.xml index 60d18f90b92..eb5088a1514 100644 --- a/pom.xml +++ b/pom.xml @@ -1020,7 +1020,6 @@ true none ${javadoc.additionalJOption} - ${project.build.sourceDirectory} 8 diff --git a/testing/wicket-threadtest/src/site/site.xml b/testing/wicket-threadtest/src/site/site.xml index d7d3f0af77e..69832b7c858 100644 --- a/testing/wicket-threadtest/src/site/site.xml +++ b/testing/wicket-threadtest/src/site/site.xml @@ -16,9 +16,4 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - diff --git a/wicket-auth-roles/src/site/site.xml b/wicket-auth-roles/src/site/site.xml index 473731303fc..51f911ad6a6 100644 --- a/wicket-auth-roles/src/site/site.xml +++ b/wicket-auth-roles/src/site/site.xml @@ -16,9 +16,4 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - diff --git a/wicket-core/src/site/site.xml b/wicket-core/src/site/site.xml index 075939797eb..eb467740253 100644 --- a/wicket-core/src/site/site.xml +++ b/wicket-core/src/site/site.xml @@ -16,11 +16,6 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT -

@@ -29,7 +24,7 @@ - + diff --git a/wicket-examples/src/site/site.xml b/wicket-examples/src/site/site.xml index bc7a7b24bd4..8f12de66dd4 100644 --- a/wicket-examples/src/site/site.xml +++ b/wicket-examples/src/site/site.xml @@ -16,11 +16,6 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - @@ -29,7 +24,7 @@ - + diff --git a/wicket-extensions/src/site/site.xml b/wicket-extensions/src/site/site.xml index c1b05e6264f..83976085bcc 100644 --- a/wicket-extensions/src/site/site.xml +++ b/wicket-extensions/src/site/site.xml @@ -16,11 +16,6 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - @@ -43,7 +38,7 @@ - + diff --git a/wicket-guice/src/site/site.xml b/wicket-guice/src/site/site.xml index f96a184e380..d0d490d584e 100644 --- a/wicket-guice/src/site/site.xml +++ b/wicket-guice/src/site/site.xml @@ -16,11 +16,6 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - @@ -29,7 +24,7 @@ - + diff --git a/wicket-ioc/src/site/site.xml b/wicket-ioc/src/site/site.xml index 3ecc377a767..e7e9fb34e57 100644 --- a/wicket-ioc/src/site/site.xml +++ b/wicket-ioc/src/site/site.xml @@ -16,9 +16,4 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - diff --git a/wicket-jmx/src/site/site.xml b/wicket-jmx/src/site/site.xml index 4e20e7a1e7f..28ae8724a98 100644 --- a/wicket-jmx/src/site/site.xml +++ b/wicket-jmx/src/site/site.xml @@ -16,9 +16,4 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - diff --git a/wicket-objectsizeof-agent/src/site/site.xml b/wicket-objectsizeof-agent/src/site/site.xml index 07fbc12ad08..842168c83e0 100644 --- a/wicket-objectsizeof-agent/src/site/site.xml +++ b/wicket-objectsizeof-agent/src/site/site.xml @@ -16,9 +16,4 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - diff --git a/wicket-spring/src/site/site.xml b/wicket-spring/src/site/site.xml index defaee2bcbc..0974ce55cc9 100644 --- a/wicket-spring/src/site/site.xml +++ b/wicket-spring/src/site/site.xml @@ -16,11 +16,6 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - @@ -29,7 +24,7 @@ - + diff --git a/wicket-velocity/src/site/site.xml b/wicket-velocity/src/site/site.xml index e4495ac97b5..04a17d588fd 100644 --- a/wicket-velocity/src/site/site.xml +++ b/wicket-velocity/src/site/site.xml @@ -16,9 +16,4 @@ limitations under the License. --> - - org.apache.wicket - wicket-site-skin - 1.0-SNAPSHOT - From a8e5176a9c83ed928d82a2e05f5e0489b6939865 Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Thu, 15 Jul 2021 13:20:31 +0200 Subject: [PATCH 40/88] WICKET-6901 document size modifier --- .../validation/BeanValidationConfiguration.java | 13 ++++++++++++- .../apache/wicket/bean/validation/ITagModifier.java | 5 ++++- .../wicket/bean/validation/PropertyValidator.java | 7 ++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java index 7971c84dd81..5182d695eb9 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java @@ -69,7 +69,13 @@ public BeanValidationConfiguration() } /** - * Registeres a tag modifier for a specific constraint annotation + * Registers a tag modifier for a specific constraint annotation. + *

+ * By default {@link Size} constraints are automatically mapped to maxlength of text inputs, + * this can be disabled by registering a {@link ITagModifier#NoOp} instead: + * + * configuration.register(Size.class, ITagModifier.NoOp}); + * * * @param annotationType * constraint annotation such as {@link Size} @@ -88,6 +94,11 @@ public BeanValidationConfiguration register(Class anno return this; } + /** + * Get the registered modifier for the given annotation. + * + * @see #register(Class, ITagModifier) + */ @Override @SuppressWarnings("unchecked") public ITagModifier getTagModifier(Class annotationType) diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java index 962d9b1e7d3..9e424106bc0 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java @@ -29,4 +29,7 @@ public interface ITagModifier * constraint annotation */ void modify(FormComponent component, ComponentTag tag, T annotation); -} + + public static final ITagModifier NoOp = (component, tag, annotation) -> { + }; +} \ No newline at end of file diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java index 437c04a45fe..91be1efc5ca 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java @@ -32,14 +32,15 @@ * *

* The validator will set the required flag on the form component it is attached to based on the - * presence of the @NotNull annotation. Notice, the required flag will only be set to {@code true}, + * presence of the @NotNull annotation, see {@link BeanValidationContext#isRequiredConstraint(ConstraintDescriptor)} + * for details. Notice, the required flag will only be set to {@code true}, * components with the required flag already set to {@code true} will not have the flag set to * {@code false} by this validator. *

* *

- * The validator will allow {@link ITagModifier}s configured in {@link BeanValidationConfiguration} - * to mutate the markup tag of the component it is attached to. + * The validator will allow {@link ITagModifier}s registered on {@link BeanValidationContext} + * to mutate the markup tag of the component it is attached to, e.g. add a maxlength attribute. *

* *

From 9a38f90323a29592ff305b57b4368c12ee823d14 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 25 Jun 2021 16:36:31 +0300 Subject: [PATCH 41/88] WICKET-6904 Make Apache Wicket fully supporting Java9+ module system Add module-info.java for most Maven modules but http2 http2 modules will be JPMS-ed in a separate commit to reduce the merge conflicts with 10.x These are the known issues: - maven-clirr-plugin does not work. Need to use -Dclirr.skip=true - many dependencies still do not provide JMPS modules (e.g. servlet-api, commons-fileupload, velocity, ...). We will use them as automodules until they provide proper modules --- pom.xml | 62 +- testing/wicket-common-tests/pom.xml | 1 - .../wicket/osgi/OsgiClashingPackagesTest.java | 13 +- testing/wicket-js-tests/pom.xml | 1 - wicket-auth-roles/pom.xml | 4 - .../src/main/java/module-info.java | 30 + .../util/license/ApacheLicenceHeaderTest.java | 4 +- .../util/markup/xhtml/WellFormedXmlTest.java | 69 +- wicket-bean-validation/pom.xml | 22 +- .../src/main/java/module-info.java | 24 + .../BeanValidationConfiguration.java | 16 + .../validation/BeanValidationContext.java | 18 +- .../bean/validation/ConstraintIterator.java | 16 + .../validation/DefaultPropertyResolver.java | 16 + .../validation/DefaultValidatorProvider.java | 16 + .../DefaultViolationTranslator.java | 18 +- .../wicket/bean/validation/GroupsModel.java | 16 + .../bean/validation/IPropertyResolver.java | 16 + .../wicket/bean/validation/ITagModifier.java | 16 + .../bean/validation/IViolationTranslator.java | 16 + .../wicket/bean/validation/Property.java | 16 + .../bean/validation/PropertyValidator.java | 16 + .../validation/PropertyValidator.properties | 14 + .../validation/SessionLocaleInterpolator.java | 18 +- .../bean/validation/SizeTagModifier.java | 16 + .../validation/ValidationModelResolver.java | 16 + .../PropertyValidatorRequiredTest.java | 16 + .../bean/validation/TestValidatableBean.java | 16 + .../ValidationModelResolverTest.java | 18 +- .../util/license/ApacheLicenceHeaderTest.java | 37 + .../util/markup/xhtml/WellFormedXmlTest.java | 35 + wicket-cdi/pom.xml | 4 - wicket-cdi/src/main/java/module-info.java | 29 + wicket-core/pom.xml | 4 - wicket-core/src/main/java/module-info.java | 141 ++++ .../request/resource/AbstractResource.java | 3 +- .../{ => core}/request/resource/sample.js | 0 .../ajax/form/AjaxFormSubmitBehaviorTest.java | 4 +- ...uestCycleListenerCallOrderApplication.java | 4 +- ...ultiRequestCycleListenerCallOrderPage.html | 0 ...ultiRequestCycleListenerCallOrderPage.java | 2 +- ...ultiRequestCycleListenerCallOrderTest.java | 2 +- .../cycle/PageRequestHandlerTrackerTest.java | 5 +- .../RequestCycleListenerDetachOrderTest.java | 200 ++--- .../cycle/RequestCycleListenerTest.java | 5 +- .../request/cycle/RequestCycleUrlForTest.java | 4 +- .../cycle/RequestHandlerExecutorTest.java | 2 +- .../request/cycle/RerenderAjaxPage.html | 0 .../request/cycle/RerenderAjaxPage.java | 2 +- .../request/cycle/RerenderPage.html | 0 .../request/cycle/RerenderPage.java | 2 +- .../request/cycle/RerenderPageTest.java | 5 +- .../request/cycle/UrlRendererTest.java | 2 +- .../request/handler/PageIdPolicyTest.java | 340 ++++---- .../request/handler/PageProviderTest.java | 2 +- .../handler/render/AbstractVariations.java | 2 +- .../render/ShouldRedirectToTargetUrl.java | 2 +- ...dRenderPageAndWriteResponseVariations.java | 2 +- .../SkipRenderWithSetResponsePageTest.java | 2 +- ...essPageManipulatingPageParametersTest.java | 2 +- .../handler/render/TestPageRenderer.java | 13 +- .../handler/render/TestVariations.java | 2 +- .../request/handler/render/Variation.java | 2 +- .../handler/render/VariationIterator.java | 2 +- .../handler/render/WebPageRendererTest.java | 34 +- .../resource/ResourceAuthorizationTest.java | 2 +- .../AbstractBookmarkableMapperTest.java | 2 +- .../request/mapper/CustomHomePageTest.java | 2 +- .../mapper/info/ComponentInfoTest.java | 3 +- .../mapper/info/PageComponentInfoTest.java | 3 +- .../request/resource/BundlesPage.html | 0 .../request/resource/BundlesPage.java | 3 +- .../resource/BundlesPage_ext_result.html | 0 .../request/resource/BundlesPage_result.html | 2 +- .../resource/BundlesPage_result_defer.html | 2 +- .../resource/ByteArrayResourceTest.java | 3 +- .../resource/CharSequenceResourceTest.java | 22 +- .../ContextRelativeResourceReferenceTest.java | 4 +- .../resource/CssPackageResourceTest.java | 3 +- .../resource/DynamicImageResourceTest.java | 3 +- .../JavaScriptPackageResourceTest.java | 3 +- .../resource/LessResourceReference.less | 0 .../resource/LessResourceReferenceTest.java | 15 +- .../MetaInfStaticResourceReferenceTest.java | 240 +++--- .../MinifiedAwareResourceReferenceTest.java | 4 +- .../PackageResourceReferenceTest.java | 780 +++++++++--------- .../request/resource/ResouceBundleTest.java | 8 +- .../resource/ResourceReferenceLambdaTest.java | 6 +- .../ResourceReferenceLocatingTest.csv | 0 .../ResourceReferenceLocatingTest.java | 4 +- .../ResourceReferenceRegistryTest.java | 26 +- .../resource/UrlResourceReferenceTest.java | 3 +- .../request/resource/WriteCallbackTest.java | 134 +-- .../wicket/{ => core}/request/resource/a.css | 0 .../wicket/{ => core}/request/resource/a.js | 0 .../wicket/{ => core}/request/resource/b.css | 0 .../wicket/{ => core}/request/resource/b.js | 0 .../{ => core}/request/resource/b.min.css | 0 .../{ => core}/request/resource/b.min.js | 0 .../{ => core}/request/resource/b_de.js | 0 .../{ => core}/request/resource/b_nl.js | 0 .../{ => core}/request/resource/b_nl.min.js | 0 .../{ => core}/request/resource/b_nl_BE.js | 0 .../request/resource/b_nl_BE.min.js | 0 .../{ => core}/request/resource/b_style.js | 0 .../request/resource/b_style.min.js | 0 .../{ => core}/request/resource/b_style_nl.js | 0 .../request/resource/b_style_nl.min.js | 0 .../request/resource/b_style_nl_BE.js | 0 .../request/resource/b_style_nl_BE.min.js | 0 .../request/resource/b_var_style.js | 0 .../request/resource/b_var_style.min.js | 0 .../request/resource/b_var_style_nl.js | 0 .../request/resource/b_var_style_nl.min.js | 0 .../request/resource/b_var_style_nl_BE.js | 0 .../request/resource/b_var_style_nl_BE.min.js | 0 .../ContextRelativeResourceCachingTest.java | 4 +- ...ithVersionResourceCachingStrategyTest.java | 5 +- ...ithVersionResourceCachingStrategyTest.java | 5 +- .../resource/caching/TestResource.java | 4 +- .../{ => core}/request/resource/resource.txt | 0 .../request/resource/resource_en.txt | 0 .../request/resource/resource_en_US.txt | 0 .../request/resource/resource_gt_4096.txt | 0 .../request/resource/resource_style.txt | 0 .../request/resource/resource_style2.txt | 0 .../request/resource/resource_style2_pt.txt | 0 .../resource/resource_style2_pt_BR.txt | 0 .../request/resource/resource_style_en.txt | 0 .../request/resource/resource_style_en_US.txt | 0 .../request/resource/resource_var.txt | 0 .../request/resource/resource_var_en.txt | 0 .../request/resource/resource_var_en_US.txt | 0 .../request/resource/resource_var_style.txt | 0 .../request/resource/resource_var_style2.txt | 0 .../resource/resource_var_style2_pt.txt | 0 .../resource/resource_var_style2_pt_BR.txt | 0 .../resource/resource_var_style_en.txt | 0 .../resource/resource_var_style_en_US.txt | 0 .../{ => core}/util/ExceptionTestBase.java | 2 +- .../{ => core}/util/Log4jEventHistory.java | 148 ++-- .../util/cookies/CookieUtilsTest.java | 359 ++++---- .../cookies/CookieValuePersisterTestPage.html | 52 +- .../cookies/CookieValuePersisterTestPage.java | 140 ++-- ...eserveRequestCookieAfterLinkClickTest.java | 2 +- ...SetCookieAndRedirectStatefullTestPage.html | 52 +- ...SetCookieAndRedirectStatefullTestPage.java | 123 +-- ...SetCookieAndRedirectStatelessTestPage.html | 52 +- ...SetCookieAndRedirectStatelessTestPage.java | 125 +-- .../cookies/SetCookieAndRedirectTest.java | 142 ++-- .../util/file/WebApplicationPathTest.java | 3 +- .../wicket/{ => core}/util/io/PageA.java | 2 +- .../wicket/{ => core}/util/io/PageB.java | 2 +- .../util/io/SerializableCheckerTest.java | 331 ++++---- .../wicket/{ => core}/util/lang/Address.java | 2 +- .../{ => core}/util/lang/BooleanBean.java | 2 +- .../wicket/{ => core}/util/lang/Country.java | 2 +- .../wicket/{ => core}/util/lang/Country2.java | 94 +-- .../wicket/{ => core}/util/lang/Document.java | 4 +- .../wicket/{ => core}/util/lang/Person.java | 2 +- .../wicket/{ => core}/util/lang/Person2.java | 2 +- .../util/lang/PropertyResolverTest.java | 4 +- .../util/lang/WicketObjectsTest.java | 2 +- .../util/markup/xhtml/WellFormedXmlTest.java | 69 +- .../resource/ClassPathResourceFinderTest.java | 2 +- .../{ => core}/util/resource/PathTest.java | 4 +- .../resource/ResourceStreamLocatorTest.java | 4 +- .../resource/ResourceStreamLocatorTest.txt | 0 .../resource/ResourceStreamLocatorTest_de.txt | 0 .../ResourceStreamLocatorTest_de_DE.txt | 0 .../ResourceStreamLocatorTest_de_DE_POSIX.txt | 0 .../ResourceStreamLocatorTest_de__POSIX.txt | 0 .../resource/ResourceStreamLocatorTest_fr.txt | 0 .../ResourceStreamLocatorTest_style.txt | 0 .../ResourceStreamLocatorTest_style_de.txt | 0 .../ResourceStreamLocatorTest_style_de_DE.txt | 0 ...rceStreamLocatorTest_style_de_DE_POSIX.txt | 0 ...ourceStreamLocatorTest_style_de__POSIX.txt | 0 .../util/resource/UrlResourceStreamTest.java | 294 +++---- .../CachingResourceStreamLocatorTest.java | 4 +- .../locator/ResourceNameIteratorTest.java | 362 ++++---- .../sourcePath/ResourceStreamLocatorTest.txt | 0 .../ResourceStreamLocatorTest_de.txt | 0 .../ResourceStreamLocatorTest_de_DE.txt | 0 .../ResourceStreamLocatorTest_de_DE_POSIX.txt | 0 .../ResourceStreamLocatorTest_de__POSIX.txt | 0 .../ResourceStreamLocatorTest_style.txt | 0 .../ResourceStreamLocatorTest_style_de.txt | 0 .../ResourceStreamLocatorTest_style_de_DE.txt | 0 ...rceStreamLocatorTest_style_de_DE_POSIX.txt | 0 ...ourceStreamLocatorTest_style_de__POSIX.txt | 0 .../util/string/JavaScriptStripperTest.java | 2 +- .../PropertyVariableInterpolatorTest.java | 146 ++-- .../util/template/CssTemplateTest.java | 4 +- .../util/tester/BlockedResourceLinkPage.html | 0 .../util/tester/BlockedResourceLinkPage.java | 2 +- .../{ => core}/util/tester/CookiePage.java | 3 +- .../FormTesterSubmitLinkTest$TestPage.html | 0 .../util/tester/FormTesterSubmitLinkTest.java | 5 +- .../util/tester/FormTesterTest.java | 18 +- .../util/tester/MockAjaxFormPage.html | 0 .../util/tester/MockAjaxFormPage.java | 2 +- .../util/tester/MockFormFileUploadPage.html | 0 .../util/tester/MockFormFileUploadPage.java | 2 +- .../{ => core}/util/tester/MockFormPage.html | 0 .../{ => core}/util/tester/MockFormPage.java | 2 +- .../util/tester/MockFormSubmitsPage.html | 0 .../util/tester/MockFormSubmitsPage.java | 2 +- ...ockPageAjaxSubmitLinkSubmitsWholeForm.html | 0 ...ockPageAjaxSubmitLinkSubmitsWholeForm.java | 2 +- ...kPageParameterPage$MockInnerClassPage.html | 0 .../util/tester/MockPageParameterPage.html | 0 .../util/tester/MockPageParameterPage.java | 2 +- ...PageWithFormAndAjaxFormSubmitBehavior.html | 0 ...PageWithFormAndAjaxFormSubmitBehavior.java | 2 +- .../tester/MockPageWithFormAndCheckGroup.html | 0 .../tester/MockPageWithFormAndCheckGroup.java | 2 +- .../tester/MockPageWithLabelInEnclosure.html | 0 .../tester/MockPageWithLabelInEnclosure.java | 2 +- .../util/tester/MockPageWithLinkAndLabel.html | 0 .../util/tester/MockPageWithLinkAndLabel.java | 88 +- .../util/tester/MockResourceLinkPage.html | 0 .../util/tester/MockResourceLinkPage.java | 2 +- .../util/tester/NestedFormPage.html | 0 .../util/tester/NestedFormPage.java | 2 +- ...rtComponentInPageRedirectToRenderTest.java | 3 +- .../{ => core}/util/tester/TagTesterTest.java | 5 +- .../WicketTesterClickExternalLinkTest.java | 3 +- .../util/tester/WicketTesterCookieTest.java | 12 +- .../WicketTesterLazyIsPageStatelessBase.java | 3 +- ...tTesterLazyIsPageStatelessOnePassTest.java | 2 +- ...zyIsPageStatelessRedirectToBufferTest.java | 3 +- ...zyIsPageStatelessRedirectToRenderTest.java | 2 +- .../WicketTesterSessionCreationTest.java | 4 +- .../WicketTesterSessionInvalidateTest.java | 3 +- .../util/tester/WicketTesterTest.java | 29 +- .../{ => core}/util/tester/apps_1/Book.java | 2 +- .../util/tester/apps_1/CreateBook.html | 0 .../util/tester/apps_1/CreateBook.java | 2 +- .../util/tester/apps_1/CreateBook.properties | 0 .../util/tester/apps_1/MyMockApplication.java | 2 +- .../apps_1/MyMockApplication.properties | 0 .../apps_1/MyMockApplication_de.properties | 0 .../apps_1/MyMockApplication_nl.properties | 0 .../util/tester/apps_1/SuccessPage.html | 0 .../util/tester/apps_1/SuccessPage.java | 2 +- .../util/tester/apps_1/ViewBook.html | 0 .../util/tester/apps_1/ViewBook.java | 2 +- .../util/tester/apps_2/LoginPage.html | 0 .../util/tester/apps_2/LoginPage.java | 2 +- .../util/tester/apps_2/RedirectPage.html | 0 .../util/tester/apps_2/RedirectPage.java | 2 +- .../{ => core}/util/tester/apps_2/Test.java | 2 +- .../util/tester/apps_3/ChoicePage.html | 0 .../util/tester/apps_3/ChoicePage.java | 4 +- .../util/tester/apps_3/FormTesterTest.java | 4 +- .../util/tester/apps_4/EmailPage.html | 0 .../util/tester/apps_4/EmailPage.java | 2 +- .../util/tester/apps_4/EmailPage.properties | 0 .../util/tester/apps_4/FormTesterTest.java | 2 +- .../util/tester/apps_5/AjaxLinkClickTest.java | 2 +- .../apps_5/AjaxSubmitLinkClickTest.java | 7 +- .../MockPageWithFormAndContainedLink.html | 26 +- .../MockPageWithFormAndContainedLink.java | 100 +-- .../apps_5/MockPageWithFormAndLink.html | 0 .../apps_5/MockPageWithFormAndLink.java | 2 +- .../util/tester/apps_5/MockPageWithLink.html | 0 .../util/tester/apps_5/MockPageWithLink.java | 2 +- .../util/tester/apps_6/LinkPage.html | 0 .../util/tester/apps_6/LinkPage.java | 266 +++--- .../util/tester/apps_6/ResultPage.html | 0 .../util/tester/apps_6/ResultPage.java | 98 +-- .../util/tester/apps_7/HomePage.html | 12 +- .../util/tester/apps_7/HomePage.java | 2 +- .../util/tester/apps_7/TestHomePage.java | 84 +- .../util/tester/apps_7/WicketApplication.java | 2 +- .../ComponentFeedbackResourceTestingPage.html | 0 .../ComponentFeedbackResourceTestingPage.java | 4 +- .../apps_8/TestResourceProvidingLabel.java | 4 +- .../TestResourceProvidingLabel.properties | 0 .../wicket/{ => core}/util/tester/bg.jpg | Bin .../cookies/CollectAllRequestCookiesPage.java | 2 +- .../util/tester/cookies/EndPage.java | 2 +- .../util/tester/cookies/SetCookiePage.java | 2 +- .../wicket/{ => core}/util/tester/test.html | 0 ...lidResourceSpecificationExceptionTest.java | 2 +- wicket-devutils/pom.xml | 4 - .../src/main/java/module-info.java | 33 + .../util/license/ApacheLicenceHeaderTest.java | 4 +- .../util/markup/xhtml/WellFormedXmlTest.java | 69 +- .../wicket-http2/wicket-http2-core/pom.xml | 4 - wicket-experimental/wicket-metrics/pom.xml | 4 - .../src/main/java/module-info.java | 36 + wicket-extensions/pom.xml | 4 - .../src/main/java/module-info.java | 74 ++ .../util/license/ApacheLicenceHeaderTest.java | 36 + .../util/markup/xhtml/WellFormedXmlTest.java | 69 +- wicket-guice/pom.xml | 4 - wicket-guice/src/main/java/module-info.java | 27 + .../util/license/ApacheLicenceHeaderTest.java | 71 +- wicket-ioc/pom.xml | 4 - wicket-ioc/src/main/java/module-info.java | 27 + .../util/license/ApacheLicenceHeaderTest.java | 36 + wicket-jmx/pom.xml | 4 - wicket-jmx/src/main/java/module-info.java | 28 + .../util/license/ApacheLicenceHeaderTest.java | 3 +- .../util/license/ApacheLicenceHeaderTest.java | 34 - .../wicket-native-websocket-core/pom.xml | 4 - .../src/main/java/module-info.java | 32 + .../wicket-native-websocket-javax/pom.xml | 4 - .../src/main/java/module-info.java | 28 + wicket-objectsizeof-agent/pom.xml | 4 - .../src/main/java/module-info.java | 24 + wicket-request/src/main/java/module-info.java | 35 + wicket-spring/src/main/java/module-info.java | 32 + .../util/license/ApacheLicenceHeaderTest.java | 4 +- .../util/license/ApacheLicenceHeaderTest.java | 34 - wicket-util/pom.xml | 1 + wicket-util/src/main/java/module-info.java | 56 ++ .../src/main/java/module-info.java | 26 + .../util/license/ApacheLicenceHeaderTest.java | 4 +- 321 files changed, 4052 insertions(+), 2937 deletions(-) create mode 100644 wicket-auth-roles/src/main/java/module-info.java rename wicket-auth-roles/src/test/java/org/apache/wicket/{ => authroles}/util/license/ApacheLicenceHeaderTest.java (91%) rename wicket-auth-roles/src/test/java/org/apache/wicket/{ => authroles}/util/markup/xhtml/WellFormedXmlTest.java (89%) create mode 100644 wicket-bean-validation/src/main/java/module-info.java create mode 100644 wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/license/ApacheLicenceHeaderTest.java create mode 100644 wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/markup/xhtml/WellFormedXmlTest.java create mode 100644 wicket-cdi/src/main/java/module-info.java create mode 100644 wicket-core/src/main/java/module-info.java rename wicket-core/src/test/java/META-INF/resources/org/apache/wicket/{ => core}/request/resource/sample.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/MultiRequestCycleListenerCallOrderApplication.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/MultiRequestCycleListenerCallOrderPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/MultiRequestCycleListenerCallOrderPage.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/MultiRequestCycleListenerCallOrderTest.java (99%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/PageRequestHandlerTrackerTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RequestCycleListenerDetachOrderTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RequestCycleListenerTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RequestCycleUrlForTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RequestHandlerExecutorTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RerenderAjaxPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RerenderAjaxPage.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RerenderPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RerenderPage.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/RerenderPageTest.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/cycle/UrlRendererTest.java (99%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/PageIdPolicyTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/PageProviderTest.java (99%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/AbstractVariations.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/ShouldRedirectToTargetUrl.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/SkipRenderWithSetResponsePageTest.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/StatelessPageManipulatingPageParametersTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/TestPageRenderer.java (84%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/TestVariations.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/Variation.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/VariationIterator.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/render/WebPageRendererTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/handler/resource/ResourceAuthorizationTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/mapper/CustomHomePageTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/mapper/info/ComponentInfoTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/mapper/info/PageComponentInfoTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/BundlesPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/BundlesPage.java (91%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/BundlesPage_ext_result.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/BundlesPage_result.html (60%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/BundlesPage_result_defer.html (56%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ByteArrayResourceTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/CharSequenceResourceTest.java (77%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ContextRelativeResourceReferenceTest.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/CssPackageResourceTest.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/DynamicImageResourceTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/JavaScriptPackageResourceTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/LessResourceReference.less (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/LessResourceReferenceTest.java (88%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/MetaInfStaticResourceReferenceTest.java (90%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/MinifiedAwareResourceReferenceTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/PackageResourceReferenceTest.java (90%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ResouceBundleTest.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ResourceReferenceLambdaTest.java (89%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ResourceReferenceLocatingTest.csv (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ResourceReferenceLocatingTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/ResourceReferenceRegistryTest.java (79%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/UrlResourceReferenceTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/WriteCallbackTest.java (81%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/a.css (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/a.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b.css (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b.min.css (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_de.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_nl.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_nl.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_nl_BE.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_nl_BE.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_style.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_style.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_style_nl.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_style_nl.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_style_nl_BE.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_style_nl_BE.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_var_style.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_var_style.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_var_style_nl.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_var_style_nl.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_var_style_nl_BE.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/b_var_style_nl_BE.min.js (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/caching/ContextRelativeResourceCachingTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/caching/TestResource.java (87%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_en.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_en_US.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_gt_4096.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_style.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_style2.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_style2_pt.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_style2_pt_BR.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_style_en.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_style_en_US.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_en.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_en_US.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_style.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_style2.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_style2_pt.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_style2_pt_BR.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_style_en.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/request/resource/resource_var_style_en_US.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/ExceptionTestBase.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/Log4jEventHistory.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/CookieUtilsTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/CookieValuePersisterTestPage.html (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/CookieValuePersisterTestPage.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/PreserveRequestCookieAfterLinkClickTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/SetCookieAndRedirectStatefullTestPage.html (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/SetCookieAndRedirectStatefullTestPage.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/SetCookieAndRedirectStatelessTestPage.html (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/SetCookieAndRedirectStatelessTestPage.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/cookies/SetCookieAndRedirectTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/file/WebApplicationPathTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/io/PageA.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/io/PageB.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/io/SerializableCheckerTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/Address.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/BooleanBean.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/Country.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/Country2.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/Document.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/Person.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/Person2.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/PropertyResolverTest.java (99%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/lang/WicketObjectsTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/markup/xhtml/WellFormedXmlTest.java (90%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/PathTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_de.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_de_DE.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_de_DE_POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_de__POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_fr.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_style.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_style_de.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_style_de_DE.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_style_de_DE_POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/ResourceStreamLocatorTest_style_de__POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/UrlResourceStreamTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/locator/CachingResourceStreamLocatorTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/locator/ResourceNameIteratorTest.java (90%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_de.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE_POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_de__POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_style.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_style_de.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE_POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/resource/sourcePath/ResourceStreamLocatorTest_style_de__POSIX.txt (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/string/JavaScriptStripperTest.java (99%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/string/interpolator/PropertyVariableInterpolatorTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/template/CssTemplateTest.java (90%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/BlockedResourceLinkPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/BlockedResourceLinkPage.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/CookiePage.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/FormTesterSubmitLinkTest$TestPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/FormTesterSubmitLinkTest.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/FormTesterTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockAjaxFormPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockAjaxFormPage.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockFormFileUploadPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockFormFileUploadPage.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockFormPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockFormPage.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockFormSubmitsPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockFormSubmitsPage.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageParameterPage$MockInnerClassPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageParameterPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageParameterPage.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithFormAndCheckGroup.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithFormAndCheckGroup.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithLabelInEnclosure.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithLabelInEnclosure.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithLinkAndLabel.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockPageWithLinkAndLabel.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockResourceLinkPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/MockResourceLinkPage.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/NestedFormPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/NestedFormPage.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/StartComponentInPageRedirectToRenderTest.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/TagTesterTest.java (99%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterClickExternalLinkTest.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterCookieTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterLazyIsPageStatelessBase.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterSessionCreationTest.java (91%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterSessionInvalidateTest.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/WicketTesterTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/Book.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/CreateBook.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/CreateBook.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/CreateBook.properties (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/MyMockApplication.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/MyMockApplication.properties (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/MyMockApplication_de.properties (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/MyMockApplication_nl.properties (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/SuccessPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/SuccessPage.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/ViewBook.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_1/ViewBook.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_2/LoginPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_2/LoginPage.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_2/RedirectPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_2/RedirectPage.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_2/Test.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_3/ChoicePage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_3/ChoicePage.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_3/FormTesterTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_4/EmailPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_4/EmailPage.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_4/EmailPage.properties (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_4/FormTesterTest.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/AjaxLinkClickTest.java (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/AjaxSubmitLinkClickTest.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/MockPageWithFormAndContainedLink.html (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/MockPageWithFormAndContainedLink.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/MockPageWithFormAndLink.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/MockPageWithFormAndLink.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/MockPageWithLink.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_5/MockPageWithLink.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_6/LinkPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_6/LinkPage.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_6/ResultPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_6/ResultPage.java (93%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_7/HomePage.html (98%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_7/HomePage.java (97%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_7/TestHomePage.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_7/WicketApplication.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_8/ComponentFeedbackResourceTestingPage.html (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java (95%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_8/TestResourceProvidingLabel.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/apps_8/TestResourceProvidingLabel.properties (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/bg.jpg (100%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/cookies/CollectAllRequestCookiesPage.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/cookies/EndPage.java (94%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/cookies/SetCookiePage.java (96%) rename wicket-core/src/test/java/org/apache/wicket/{ => core}/util/tester/test.html (100%) create mode 100644 wicket-devutils/src/main/java/module-info.java rename wicket-devutils/src/test/java/org/apache/wicket/{ => devutils}/util/license/ApacheLicenceHeaderTest.java (91%) rename wicket-devutils/src/test/java/org/apache/wicket/{ => devutils}/util/markup/xhtml/WellFormedXmlTest.java (89%) create mode 100644 wicket-experimental/wicket-metrics/src/main/java/module-info.java create mode 100644 wicket-extensions/src/main/java/module-info.java create mode 100644 wicket-extensions/src/test/java/org/apache/wicket/extensions/util/license/ApacheLicenceHeaderTest.java rename wicket-extensions/src/test/java/org/apache/wicket/{ => extensions}/util/markup/xhtml/WellFormedXmlTest.java (89%) create mode 100644 wicket-guice/src/main/java/module-info.java rename {wicket-ioc/src/test/java/org/apache/wicket => wicket-guice/src/test/java/org/apache/wicket/guice}/util/license/ApacheLicenceHeaderTest.java (91%) create mode 100644 wicket-ioc/src/main/java/module-info.java create mode 100644 wicket-ioc/src/test/java/org/apache/wicket/injection/util/license/ApacheLicenceHeaderTest.java create mode 100644 wicket-jmx/src/main/java/module-info.java rename {wicket-guice/src/test/java/org/apache/wicket => wicket-jmx/src/test/java/org/apache/wicket/jmx}/util/license/ApacheLicenceHeaderTest.java (91%) delete mode 100644 wicket-jmx/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java create mode 100644 wicket-native-websocket/wicket-native-websocket-core/src/main/java/module-info.java create mode 100644 wicket-native-websocket/wicket-native-websocket-javax/src/main/java/module-info.java create mode 100644 wicket-objectsizeof-agent/src/main/java/module-info.java create mode 100644 wicket-request/src/main/java/module-info.java create mode 100644 wicket-spring/src/main/java/module-info.java rename {wicket-extensions/src/test/java/org/apache/wicket => wicket-spring/src/test/java/org/apache/wicket/spring}/util/license/ApacheLicenceHeaderTest.java (91%) delete mode 100644 wicket-spring/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java create mode 100644 wicket-util/src/main/java/module-info.java create mode 100644 wicket-velocity/src/main/java/module-info.java rename wicket-velocity/src/test/java/org/apache/wicket/{ => contrib}/util/license/ApacheLicenceHeaderTest.java (91%) diff --git a/pom.xml b/pom.xml index eb5088a1514..c6d5c31adc4 100644 --- a/pom.xml +++ b/pom.xml @@ -159,7 +159,7 @@ 3.1.0 1.9.0 9.4.42.v20210604 - 5.7.2 + 5.8.0-M1 3.0.2 1.2.3 2.2 @@ -169,7 +169,7 @@ 3.11.2 3.2 1.0.12 - 1.7.25 + 2.0.0-alpha2 5.3.8 3.4.3 3.1.7.Final @@ -198,7 +198,6 @@ 3.3.1 1.5.1 - MUST-BE-OVERRIDDEN-BY-MODULES @@ -340,9 +339,6 @@ org.apache.wicket wicket 9.5.0-SNAPSHOT - pom @@ -999,9 +995,6 @@ true true - - ${automatic-module-name} - @@ -1017,11 +1010,10 @@ ${javadoc.jdk.apidocs.link} true - true + false none ${javadoc.additionalJOption} - - 8 + ${java.specification.version} @@ -1099,6 +1091,7 @@ --add-opens java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-modules=ALL-SYSTEM + false @@ -1302,12 +1295,6 @@ - - all - - true - - fast @@ -1366,45 +1353,6 @@ - - Java 11 - - 11 - - - - -Xdoclint:none - - - - buildbot - - - - org.apache.maven.plugins - maven-toolchains-plugin - ${maven-toolchains-plugin.version} - - - - toolchain - - - - - - - ${maven.compiler.source} - - - - - - - java12 diff --git a/testing/wicket-common-tests/pom.xml b/testing/wicket-common-tests/pom.xml index 685ba1d2f8d..2253110dc2b 100644 --- a/testing/wicket-common-tests/pom.xml +++ b/testing/wicket-common-tests/pom.xml @@ -29,7 +29,6 @@ Tests for all Wicket modules - org.apache.wicket.common.tests true diff --git a/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java b/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java index b7670d0c5a3..3af34dd27dd 100644 --- a/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java +++ b/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java @@ -23,11 +23,11 @@ * * Based on https://gist.github.com/1977817, contributed by Andreas Pieber */ -public class OsgiClashingPackagesTest +class OsgiClashingPackagesTest { @Test - public void collectProjectPackages() throws IOException + void collectProjectPackages() throws IOException { char pathSeparator = System.getProperty("path.separator").charAt(0); String classpath = System.getProperty("java.class.path"); @@ -118,11 +118,14 @@ public void addTo(Map> projectBuckets) { for (String packageWithContent : packagesWithContent) { - if (!projectBuckets.containsKey(packageWithContent)) + if (!"".equals(packageWithContent)) { - projectBuckets.put(packageWithContent, new ArrayList<>()); + if (!projectBuckets.containsKey(packageWithContent)) + { + projectBuckets.put(packageWithContent, new ArrayList<>()); + } + projectBuckets.get(packageWithContent).add(this); } - projectBuckets.get(packageWithContent).add(this); } } diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml index 50d16902797..be0ef7f0a42 100644 --- a/testing/wicket-js-tests/pom.xml +++ b/testing/wicket-js-tests/pom.xml @@ -29,7 +29,6 @@ JavaScript tests for all Wicket modules - org.apache.wicket.js.tests true diff --git a/wicket-auth-roles/pom.xml b/wicket-auth-roles/pom.xml index f3b6f3de30f..013b5badbd0 100644 --- a/wicket-auth-roles/pom.xml +++ b/wicket-auth-roles/pom.xml @@ -31,10 +31,6 @@ annotations. - - org.apache.wicket.auth.roles - - org.apache.wicket diff --git a/wicket-auth-roles/src/main/java/module-info.java b/wicket-auth-roles/src/main/java/module-info.java new file mode 100644 index 00000000000..78fe9882142 --- /dev/null +++ b/wicket-auth-roles/src/main/java/module-info.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.auth.roles { + requires java.base; + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + + exports org.apache.wicket.authroles.authentication; + exports org.apache.wicket.authroles.authentication.pages; + exports org.apache.wicket.authroles.authentication.panel; + exports org.apache.wicket.authroles.authorization.strategies.role; + exports org.apache.wicket.authroles.authorization.strategies.role.annotations; + exports org.apache.wicket.authroles.authorization.strategies.role.metadata; +} diff --git a/wicket-auth-roles/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/license/ApacheLicenceHeaderTest.java similarity index 91% rename from wicket-auth-roles/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/license/ApacheLicenceHeaderTest.java index 6c207039910..b01debde46d 100644 --- a/wicket-auth-roles/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.authroles.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-auth-roles/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/markup/xhtml/WellFormedXmlTest.java similarity index 89% rename from wicket-auth-roles/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java rename to wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/markup/xhtml/WellFormedXmlTest.java index 88d902528f6..0902d1ebb0d 100644 --- a/wicket-auth-roles/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java +++ b/wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/markup/xhtml/WellFormedXmlTest.java @@ -1,34 +1,35 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.markup.xhtml; - -import org.junit.jupiter.api.Test; - -/** - * Checks that the html markup files are well formed xml-s. - * - * @author akiraly - */ -public class WellFormedXmlTest extends WellFormedXmlTestCase -{ - @Test - @Override - public void markupFiles() - { - super.markupFiles(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.authroles.util.markup.xhtml; + +import org.apache.wicket.util.markup.xhtml.WellFormedXmlTestCase; +import org.junit.jupiter.api.Test; + +/** + * Checks that the html markup files are well formed xml-s. + * + * @author akiraly + */ +public class WellFormedXmlTest extends WellFormedXmlTestCase +{ + @Test + @Override + public void markupFiles() + { + super.markupFiles(); + } +} diff --git a/wicket-bean-validation/pom.xml b/wicket-bean-validation/pom.xml index d043d1cb616..1ae5a1be1c7 100644 --- a/wicket-bean-validation/pom.xml +++ b/wicket-bean-validation/pom.xml @@ -1,4 +1,20 @@ - + + 4.0.0 @@ -11,10 +27,6 @@ bundle Wicket Bean Validation - - org.apache.wicket.bean.validation - - jakarta.el diff --git a/wicket-bean-validation/src/main/java/module-info.java b/wicket-bean-validation/src/main/java/module-info.java new file mode 100644 index 00000000000..ce46fc16998 --- /dev/null +++ b/wicket-bean-validation/src/main/java/module-info.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.bean.validation { + requires org.apache.wicket.util; + requires org.apache.wicket.core; + requires java.validation; + + exports org.apache.wicket.bean.validation; +} diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java index 5182d695eb9..625939c2424 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.lang.annotation.Annotation; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationContext.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationContext.java index 8f1f8b9f4bb..bc0b89efeca 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationContext.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationContext.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.lang.annotation.Annotation; @@ -52,4 +68,4 @@ public interface BeanValidationContext extends IPropertyResolver * @return true if required */ boolean isRequiredConstraint(ConstraintDescriptor constraint); -} \ No newline at end of file +} diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ConstraintIterator.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ConstraintIterator.java index 3110bb8239d..a81ac4bc112 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ConstraintIterator.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ConstraintIterator.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.util.ArrayList; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java index 44092084b48..3f1d61263cd 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultPropertyResolver.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import org.apache.wicket.WicketRuntimeException; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultValidatorProvider.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultValidatorProvider.java index 645d6250c15..d31eed422e7 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultValidatorProvider.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultValidatorProvider.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.util.function.Supplier; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultViolationTranslator.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultViolationTranslator.java index 7b006aa3359..8f9adc8dbc5 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultViolationTranslator.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/DefaultViolationTranslator.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.util.ArrayList; @@ -92,4 +108,4 @@ private String getMessageKey(String message) return null; } -} \ No newline at end of file +} diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/GroupsModel.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/GroupsModel.java index ff9798020c5..24337f94be2 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/GroupsModel.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/GroupsModel.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.util.ArrayList; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IPropertyResolver.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IPropertyResolver.java index dabe39f2191..51f83c76df9 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IPropertyResolver.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IPropertyResolver.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import org.apache.wicket.markup.html.form.FormComponent; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java index 9e424106bc0..6c37caccd83 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.lang.annotation.Annotation; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IViolationTranslator.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IViolationTranslator.java index f9e594a3995..a8a920123fb 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IViolationTranslator.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/IViolationTranslator.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import javax.validation.ConstraintViolation; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/Property.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/Property.java index cabe799621a..b411f17915d 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/Property.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/Property.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.io.Serializable; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java index 91be1efc5ca..cb13fbee60c 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.util.Arrays; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.properties b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.properties index 29f5511b42f..981b6389e65 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.properties +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.properties @@ -1,3 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. javax.validation.constraints.AssertFalse.message = '${label}' must be false javax.validation.constraints.AssertTrue.message = '${label}' must be true javax.validation.constraints.DecimalMax.message = '${label}' must be less than or equal to ${value} diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SessionLocaleInterpolator.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SessionLocaleInterpolator.java index 02828a35e40..a0dd59f6422 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SessionLocaleInterpolator.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SessionLocaleInterpolator.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import java.util.Locale; @@ -54,4 +70,4 @@ private Locale getLocale() { return Session.exists() ? Session.get().getLocale() : null; } -} \ No newline at end of file +} diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SizeTagModifier.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SizeTagModifier.java index 9f2aa672e59..8c42548c2e3 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SizeTagModifier.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/SizeTagModifier.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import javax.validation.constraints.Size; diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ValidationModelResolver.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ValidationModelResolver.java index cb8cfcdd910..58f7409bf8f 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ValidationModelResolver.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ValidationModelResolver.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import org.apache.wicket.markup.html.form.FormComponent; diff --git a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/PropertyValidatorRequiredTest.java b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/PropertyValidatorRequiredTest.java index 4e56c9b4581..cdb18a757f0 100644 --- a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/PropertyValidatorRequiredTest.java +++ b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/PropertyValidatorRequiredTest.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import org.apache.wicket.MarkupContainer; diff --git a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/TestValidatableBean.java b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/TestValidatableBean.java index e33c7b9922e..0105484221e 100644 --- a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/TestValidatableBean.java +++ b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/TestValidatableBean.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import javax.validation.constraints.NotNull; diff --git a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/ValidationModelResolverTest.java b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/ValidationModelResolverTest.java index a174ed443ec..2c390f4e628 100644 --- a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/ValidationModelResolverTest.java +++ b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/ValidationModelResolverTest.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.bean.validation; import org.apache.wicket.markup.html.form.TextField; @@ -44,4 +60,4 @@ public void propertyModelBoundToComponent() assertEquals("text", model.getPropertyField().getName()); } -} \ No newline at end of file +} diff --git a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/license/ApacheLicenceHeaderTest.java b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/license/ApacheLicenceHeaderTest.java new file mode 100644 index 00000000000..1ba480773ec --- /dev/null +++ b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/license/ApacheLicenceHeaderTest.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.bean.validation.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; + +/** + * Test that the license headers are in place in this project. The tests are run from + * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. + * + * @author Frank Bille Jensen (frankbille) + */ +public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase +{ + /** + * Construct. + */ + public ApacheLicenceHeaderTest() + { + // addHeaders = true; + htmlIgnore.add("src/main/java/org/apache/wicket/authroles/authentication/pages"); + } +} diff --git a/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/markup/xhtml/WellFormedXmlTest.java b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/markup/xhtml/WellFormedXmlTest.java new file mode 100644 index 00000000000..07158b04c5f --- /dev/null +++ b/wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/markup/xhtml/WellFormedXmlTest.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.bean.validation.util.markup.xhtml; + +import org.apache.wicket.util.markup.xhtml.WellFormedXmlTestCase; +import org.junit.jupiter.api.Test; + +/** + * Checks that the html markup files are well formed xml-s. + * + * @author akiraly + */ +public class WellFormedXmlTest extends WellFormedXmlTestCase +{ + @Test + @Override + public void markupFiles() + { + super.markupFiles(); + } +} diff --git a/wicket-cdi/pom.xml b/wicket-cdi/pom.xml index d4e4bf5a99b..8c3b4594a02 100644 --- a/wicket-cdi/pom.xml +++ b/wicket-cdi/pom.xml @@ -33,10 +33,6 @@ and resources. - - org.apache.wicket.cdi - - jakarta.annotation diff --git a/wicket-cdi/src/main/java/module-info.java b/wicket-cdi/src/main/java/module-info.java new file mode 100644 index 00000000000..3db04a12519 --- /dev/null +++ b/wicket-cdi/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.cdi { + requires java.annotation; + requires java.naming; + requires jakarta.enterprise.cdi.api; + requires jakarta.inject.api; + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.slf4j; + + exports org.apache.wicket.cdi; +} diff --git a/wicket-core/pom.xml b/wicket-core/pom.xml index e6375cd5073..23c5900198b 100644 --- a/wicket-core/pom.xml +++ b/wicket-core/pom.xml @@ -36,10 +36,6 @@ persisted using your favorite technology. - - org.apache.wicket.core - - org.hamcrest diff --git a/wicket-core/src/main/java/module-info.java b/wicket-core/src/main/java/module-info.java new file mode 100644 index 00000000000..bf3a6e42e55 --- /dev/null +++ b/wicket-core/src/main/java/module-info.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.core { + requires java.instrument; + requires java.desktop; + requires java.sql; + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.commons.io; + requires org.apache.commons.collections4; + requires commons.fileupload; + requires org.slf4j; + requires javax.servlet.api; + requires org.danekja.jdk.serializable.functional; + requires com.github.openjson; + requires org.junit.jupiter.api; + + provides org.apache.wicket.IInitializer with org.apache.wicket.Initializer; + provides org.apache.wicket.resource.FileSystemPathService with org.apache.wicket.resource.FileSystemJarPathService; + + exports org.apache.wicket; + exports org.apache.wicket.ajax; + exports org.apache.wicket.ajax.attributes; + exports org.apache.wicket.ajax.form; + exports org.apache.wicket.ajax.json; + exports org.apache.wicket.ajax.markup.html; + exports org.apache.wicket.ajax.markup.html.form; + exports org.apache.wicket.ajax.markup.html.navigation.paging; + exports org.apache.wicket.application; + exports org.apache.wicket.authentication; + exports org.apache.wicket.authentication.strategy; + exports org.apache.wicket.authorization; + exports org.apache.wicket.authorization.strategies; + exports org.apache.wicket.authorization.strategies.action; + exports org.apache.wicket.authorization.strategies.page; + exports org.apache.wicket.behavior; + exports org.apache.wicket.coep; + exports org.apache.wicket.coop; + exports org.apache.wicket.core.random; + exports org.apache.wicket.core.request; + exports org.apache.wicket.core.request.handler; + exports org.apache.wicket.core.request.handler.logger; + exports org.apache.wicket.core.request.mapper; + exports org.apache.wicket.core.util.crypt; + exports org.apache.wicket.core.util.file; + exports org.apache.wicket.core.util.lang; + exports org.apache.wicket.core.util.objects.checker; + exports org.apache.wicket.core.util.resource; + exports org.apache.wicket.core.util.resource.locator; + exports org.apache.wicket.core.util.resource.locator.caching; + exports org.apache.wicket.core.util.string; + exports org.apache.wicket.core.util.string.interpolator; + exports org.apache.wicket.core.util.watch; + exports org.apache.wicket.csp; + exports org.apache.wicket.css; + exports org.apache.wicket.event; + exports org.apache.wicket.feedback; + exports org.apache.wicket.javascript; + exports org.apache.wicket.markup; + exports org.apache.wicket.markup.head; + exports org.apache.wicket.markup.head.filter; + exports org.apache.wicket.markup.head.internal; + exports org.apache.wicket.markup.html; + exports org.apache.wicket.markup.html.basic; + exports org.apache.wicket.markup.html.border; + exports org.apache.wicket.markup.html.debug; + exports org.apache.wicket.markup.html.form; + exports org.apache.wicket.markup.html.form.upload; + exports org.apache.wicket.markup.html.form.validation; + exports org.apache.wicket.markup.html.image; + exports org.apache.wicket.markup.html.image.resource; + exports org.apache.wicket.markup.html.include; + exports org.apache.wicket.markup.html.internal; + exports org.apache.wicket.markup.html.link; + exports org.apache.wicket.markup.html.list; + exports org.apache.wicket.markup.html.media; + exports org.apache.wicket.markup.html.media.audio; + exports org.apache.wicket.markup.html.media.video; + exports org.apache.wicket.markup.html.navigation.paging; + exports org.apache.wicket.markup.html.pages; + exports org.apache.wicket.markup.html.panel; + exports org.apache.wicket.markup.loader; + exports org.apache.wicket.markup.parser; + exports org.apache.wicket.markup.parser.filter; + exports org.apache.wicket.markup.renderStrategy; + exports org.apache.wicket.markup.repeater; + exports org.apache.wicket.markup.repeater.data; + exports org.apache.wicket.markup.repeater.util; + exports org.apache.wicket.markup.resolver; + exports org.apache.wicket.markup.transformer; + exports org.apache.wicket.mock; + exports org.apache.wicket.model; + exports org.apache.wicket.model.util; + exports org.apache.wicket.page; + exports org.apache.wicket.pageStore; + exports org.apache.wicket.pageStore.crypt; + exports org.apache.wicket.pageStore.disk; + exports org.apache.wicket.protocol.http; + exports org.apache.wicket.protocol.http.mock; + exports org.apache.wicket.protocol.http.request; + exports org.apache.wicket.protocol.http.servlet; + exports org.apache.wicket.protocol.https; + exports org.apache.wicket.request.component; + exports org.apache.wicket.request.cycle; + exports org.apache.wicket.request.handler.render; + exports org.apache.wicket.request.handler.resource; + exports org.apache.wicket.request.resource; + exports org.apache.wicket.request.resource.caching; + exports org.apache.wicket.request.resource.caching.version; + exports org.apache.wicket.resource; + exports org.apache.wicket.resource.bundles; + exports org.apache.wicket.resource.loader; + exports org.apache.wicket.response; + exports org.apache.wicket.response.filter; + exports org.apache.wicket.serialize; + exports org.apache.wicket.serialize.java; + exports org.apache.wicket.session; + exports org.apache.wicket.settings; + exports org.apache.wicket.util.cookies; + exports org.apache.wicket.util.image; + exports org.apache.wicket.util.reference; + exports org.apache.wicket.util.template; + exports org.apache.wicket.util.tester; + exports org.apache.wicket.validation; + exports org.apache.wicket.validation.validator; +} diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java index 698d446897e..04a5c5687fd 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java @@ -18,7 +18,6 @@ import java.io.IOException; import java.io.InputStream; -import java.sql.Time; import java.time.Duration; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -950,7 +949,7 @@ public abstract static class WriteCallback * @param stream * input stream */ - protected final void writeStream(Attributes attributes, InputStream stream) throws IOException + protected void writeStream(Attributes attributes, InputStream stream) throws IOException { final Response response = attributes.getResponse(); Streams.copy(stream, response.getOutputStream()); diff --git a/wicket-core/src/test/java/META-INF/resources/org/apache/wicket/request/resource/sample.js b/wicket-core/src/test/java/META-INF/resources/org/apache/wicket/core/request/resource/sample.js similarity index 100% rename from wicket-core/src/test/java/META-INF/resources/org/apache/wicket/request/resource/sample.js rename to wicket-core/src/test/java/META-INF/resources/org/apache/wicket/core/request/resource/sample.js diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehaviorTest.java b/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehaviorTest.java index 062890864e3..70854f34116 100644 --- a/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehaviorTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehaviorTest.java @@ -22,7 +22,7 @@ import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.util.tester.FormTester; -import org.apache.wicket.util.tester.NestedFormPage; +import org.apache.wicket.core.util.tester.NestedFormPage; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; @@ -107,4 +107,4 @@ protected void onSubmit() { get("outer:inner").replaceWith(inner); } } -} \ No newline at end of file +} diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderApplication.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderApplication.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderApplication.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderApplication.java index aa057e75af3..a7a699dd7b3 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderApplication.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderApplication.java @@ -14,13 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import java.util.ArrayList; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.request.IRequestHandler; import org.apache.wicket.request.Url; +import org.apache.wicket.request.cycle.IRequestCycleListener; +import org.apache.wicket.request.cycle.RequestCycle; class MultiRequestCycleListenerCallOrderApplication extends WebApplication { diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderPage.html b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderPage.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderPage.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderPage.java index 065caab311a..75fc8676f79 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderTest.java similarity index 99% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderTest.java index f0b57235379..9d530f2b9b4 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/MultiRequestCycleListenerCallOrderTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/MultiRequestCycleListenerCallOrderTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/PageRequestHandlerTrackerTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/PageRequestHandlerTrackerTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/PageRequestHandlerTrackerTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/PageRequestHandlerTrackerTest.java index ce684c53a69..e023932f9f0 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/PageRequestHandlerTrackerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/PageRequestHandlerTrackerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -29,6 +29,9 @@ import org.apache.wicket.request.IRequestMapper; import org.apache.wicket.request.Request; import org.apache.wicket.request.Url; +import org.apache.wicket.request.cycle.IRequestCycleListener; +import org.apache.wicket.request.cycle.PageRequestHandlerTracker; +import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.mapper.IRequestMapperDelegate; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleListenerDetachOrderTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleListenerDetachOrderTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleListenerDetachOrderTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleListenerDetachOrderTest.java index 70e82f7bd13..17d3647c8d8 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleListenerDetachOrderTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleListenerDetachOrderTest.java @@ -1,99 +1,101 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.request.cycle; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.wicket.MarkupContainer; -import org.apache.wicket.markup.IMarkupResourceStreamProvider; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.util.resource.IResourceStream; -import org.apache.wicket.util.resource.StringResourceStream; -import org.apache.wicket.util.tester.WicketTester; -import org.junit.jupiter.api.Test; - - -/** - * Tests that pages are detached before {@link IRequestCycleListener#onDetach(RequestCycle)} are - * invoked - * - * WICKET-4181 - * - * @author igor - */ -public class RequestCycleListenerDetachOrderTest -{ - @Test - void pageDetachedBeforeListener() - { - List events = new ArrayList(); - - WicketTester tester = new WicketTester(); - tester.getApplication().getRequestCycleListeners().add(new TestListener(events)); - tester.startPage(new TestPage(events)); - - assertEquals(Event.PAGE_DETACHED, events.get(0)); - assertEquals(Event.LISTENER_DETACHED, events.get(1)); - } - - private static class TestListener implements IRequestCycleListener - { - private final List events; - - TestListener(List events) - { - this.events = events; - } - - @Override - public void onDetach(RequestCycle cycle) - { - events.add(Event.LISTENER_DETACHED); - } - } - - private class TestPage extends WebPage implements IMarkupResourceStreamProvider - { - private final List events; - - TestPage(List events) - { - this.events = events; - } - - @Override - protected void onDetach() - { - super.onDetach(); - events.add(Event.PAGE_DETACHED); - } - - @Override - public IResourceStream getMarkupResourceStream(MarkupContainer container, - Class containerClass) - { - return new StringResourceStream(""); - } - } - - private static enum Event { - PAGE_DETACHED, LISTENER_DETACHED - }; -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.request.cycle; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.markup.IMarkupResourceStreamProvider; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.request.cycle.IRequestCycleListener; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.util.resource.IResourceStream; +import org.apache.wicket.util.resource.StringResourceStream; +import org.apache.wicket.util.tester.WicketTester; +import org.junit.jupiter.api.Test; + + +/** + * Tests that pages are detached before {@link IRequestCycleListener#onDetach(RequestCycle)} are + * invoked + * + * WICKET-4181 + * + * @author igor + */ +public class RequestCycleListenerDetachOrderTest +{ + @Test + void pageDetachedBeforeListener() + { + List events = new ArrayList(); + + WicketTester tester = new WicketTester(); + tester.getApplication().getRequestCycleListeners().add(new TestListener(events)); + tester.startPage(new TestPage(events)); + + assertEquals(Event.PAGE_DETACHED, events.get(0)); + assertEquals(Event.LISTENER_DETACHED, events.get(1)); + } + + private static class TestListener implements IRequestCycleListener + { + private final List events; + + TestListener(List events) + { + this.events = events; + } + + @Override + public void onDetach(RequestCycle cycle) + { + events.add(Event.LISTENER_DETACHED); + } + } + + private class TestPage extends WebPage implements IMarkupResourceStreamProvider + { + private final List events; + + TestPage(List events) + { + this.events = events; + } + + @Override + protected void onDetach() + { + super.onDetach(); + events.add(Event.PAGE_DETACHED); + } + + @Override + public IResourceStream getMarkupResourceStream(MarkupContainer container, + Class containerClass) + { + return new StringResourceStream(""); + } + } + + private static enum Event { + PAGE_DETACHED, LISTENER_DETACHED + }; +} diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleListenerTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleListenerTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleListenerTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleListenerTest.java index caa89f9468e..27003952da9 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleListenerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleListenerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -37,6 +37,9 @@ import org.apache.wicket.request.RequestHandlerExecutor.ReplaceHandlerException; import org.apache.wicket.request.Response; import org.apache.wicket.request.Url; +import org.apache.wicket.request.cycle.IRequestCycleListener; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.cycle.RequestCycleContext; import org.apache.wicket.request.handler.EmptyRequestHandler; import org.apache.wicket.resource.DummyApplication; import org.junit.jupiter.api.AfterEach; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleUrlForTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleUrlForTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleUrlForTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleUrlForTest.java index 26026437802..413164ec7c9 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestCycleUrlForTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestCycleUrlForTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.argThat; @@ -28,6 +28,8 @@ import org.apache.wicket.request.Request; import org.apache.wicket.request.Response; import org.apache.wicket.request.Url; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.cycle.RequestCycleContext; import org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler; import org.apache.wicket.request.handler.resource.ResourceRequestHandler; import org.apache.wicket.request.mapper.parameter.PageParameters; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestHandlerExecutorTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestHandlerExecutorTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestHandlerExecutorTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestHandlerExecutorTest.java index eb42129bd59..1cdd45ed387 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RequestHandlerExecutorTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RequestHandlerExecutorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import org.apache.wicket.request.IRequestCycle; import org.apache.wicket.request.IRequestHandler; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderAjaxPage.html b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderAjaxPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderAjaxPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderAjaxPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderAjaxPage.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderAjaxPage.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderAjaxPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderAjaxPage.java index 928fc34b5cf..01501da406a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderAjaxPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderAjaxPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPage.html b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPage.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPage.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPage.java index 6adba974f19..e9de1cefc09 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import java.io.Serializable; import java.time.Duration; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPageTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPageTest.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPageTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPageTest.java index 98d7a4cd904..f2a31705c6f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/RerenderPageTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/RerenderPageTest.java @@ -14,14 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import org.apache.wicket.core.request.mapper.MountedMapper; import org.apache.wicket.protocol.http.mock.MockHttpServletResponse; -import org.apache.wicket.request.cycle.RerenderPage.Supplier; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; @@ -54,7 +53,7 @@ void wicket5960() tester.assertContains(""); // add a supplier to modify the URL during render - page.setNewValueHandler(new Supplier() + page.setNewValueHandler(new RerenderPage.Supplier() { private static final long serialVersionUID = 1L; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/cycle/UrlRendererTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/UrlRendererTest.java similarity index 99% rename from wicket-core/src/test/java/org/apache/wicket/request/cycle/UrlRendererTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/cycle/UrlRendererTest.java index b7df84900e9..ce244a9287e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/cycle/UrlRendererTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/cycle/UrlRendererTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.cycle; +package org.apache.wicket.core.request.cycle; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/PageIdPolicyTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageIdPolicyTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/PageIdPolicyTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageIdPolicyTest.java index b0895ed2fa4..3e2e5581202 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/PageIdPolicyTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageIdPolicyTest.java @@ -1,170 +1,170 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.request.handler; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.nio.charset.Charset; - -import org.apache.wicket.IPageManagerProvider; -import org.apache.wicket.MarkupContainer; -import org.apache.wicket.ajax.AjaxEventBehavior; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.markup.IMarkupResourceStreamProvider; -import org.apache.wicket.markup.html.WebComponent; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.mock.MockApplication; -import org.apache.wicket.page.IManageablePage; -import org.apache.wicket.page.IPageManager; -import org.apache.wicket.page.PageManager; -import org.apache.wicket.pageStore.IPageContext; -import org.apache.wicket.pageStore.InMemoryPageStore; -import org.apache.wicket.pageStore.RequestPageStore; -import org.apache.wicket.request.Url; -import org.apache.wicket.util.resource.IResourceStream; -import org.apache.wicket.util.resource.StringResourceStream; -import org.apache.wicket.util.tester.WicketTester; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * @author Pedro Santos - */ -public class PageIdPolicyTest -{ - private WicketTester tester; - private InMemoryPageStore pageStore; - private MockApplication application; - private int storeCount; - - /** - * Asserting that page get touched in an AJAX request that is only repaint its children.
- * In this case no new page id is being generated and the old page is touched and stored again.
- * - * @see WICKET-3667 - */ - @Test - void testPageGetsTouchedInAjaxRequest() - { - TestPage testPage = new TestPage(); - tester.startPage(TestPage.class); - int referenceStoreCount = storeCount; - tester.executeAjaxUrl(testPage.getAjaxUrl(tester.getRequest().getCharacterEncoding())); - // the page should be stored even for ajax requests - assertEquals(referenceStoreCount + 1, storeCount); - } - - /** - * - */ - @Test - void testPageIdDontGetIncreasedInAjaxRequest() - { - TestPage testPage = new TestPage(); - tester.startPage(testPage); - String testPageId = testPage.getId(); - tester.executeAjaxUrl(testPage.getAjaxUrl(tester.getRequest().getCharacterEncoding())); - assertEquals(testPageId, testPage.getId()); - assertTrue(testPage.ajaxCallbackExecuted); - } - - @BeforeEach - void setUp() throws Exception - { - application = new MockApplication(); - pageStore = new InMemoryPageStore("test", Integer.MAX_VALUE) - { - @Override - public void addPage(IPageContext context, IManageablePage page) - { - super.addPage(context, page); - storeCount++; - } - }; - tester = new WicketTester(application) - { - @Override - protected IPageManagerProvider newTestPageManagerProvider() - { - return new IPageManagerProvider() - { - @Override - public IPageManager get() - { - return new PageManager(new RequestPageStore(pageStore)); - } - }; - } - }; - } - - @AfterEach - void tearDown() throws Exception - { - tester.destroy(); - } - - /** */ - public static class TestPage extends WebPage implements IMarkupResourceStreamProvider - { - /** */ - private static final long serialVersionUID = 1L; - AjaxEventBehavior eventBehavior; - boolean ajaxCallbackExecuted; - - /** - * Construct. - */ - public TestPage() - { - WebComponent component; - component = new WebComponent("component"); - component.add(eventBehavior = new AjaxEventBehavior("click") - { - /** */ - private static final long serialVersionUID = 1L; - - @Override - protected void onEvent(AjaxRequestTarget target) - { - ajaxCallbackExecuted = true; - } - }); - add(component); - } - - /** - * @param encoding - * @return ajaxUrl - */ - public Url getAjaxUrl(String encoding) - { - return Url.parse(eventBehavior.getCallbackUrl().toString(), Charset.forName(encoding)); - } - - @Override - public IResourceStream getMarkupResourceStream(MarkupContainer container, - Class containerClass) - { - return new StringResourceStream( - ""); - } - - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.request.handler; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.charset.Charset; + +import org.apache.wicket.IPageManagerProvider; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.ajax.AjaxEventBehavior; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.markup.IMarkupResourceStreamProvider; +import org.apache.wicket.markup.html.WebComponent; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.mock.MockApplication; +import org.apache.wicket.page.IManageablePage; +import org.apache.wicket.page.IPageManager; +import org.apache.wicket.page.PageManager; +import org.apache.wicket.pageStore.IPageContext; +import org.apache.wicket.pageStore.InMemoryPageStore; +import org.apache.wicket.pageStore.RequestPageStore; +import org.apache.wicket.request.Url; +import org.apache.wicket.util.resource.IResourceStream; +import org.apache.wicket.util.resource.StringResourceStream; +import org.apache.wicket.util.tester.WicketTester; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * @author Pedro Santos + */ +public class PageIdPolicyTest +{ + private WicketTester tester; + private InMemoryPageStore pageStore; + private MockApplication application; + private int storeCount; + + /** + * Asserting that page get touched in an AJAX request that is only repaint its children.
+ * In this case no new page id is being generated and the old page is touched and stored again.
+ * + * @see WICKET-3667 + */ + @Test + void testPageGetsTouchedInAjaxRequest() + { + TestPage testPage = new TestPage(); + tester.startPage(TestPage.class); + int referenceStoreCount = storeCount; + tester.executeAjaxUrl(testPage.getAjaxUrl(tester.getRequest().getCharacterEncoding())); + // the page should be stored even for ajax requests + assertEquals(referenceStoreCount + 1, storeCount); + } + + /** + * + */ + @Test + void testPageIdDontGetIncreasedInAjaxRequest() + { + TestPage testPage = new TestPage(); + tester.startPage(testPage); + String testPageId = testPage.getId(); + tester.executeAjaxUrl(testPage.getAjaxUrl(tester.getRequest().getCharacterEncoding())); + assertEquals(testPageId, testPage.getId()); + assertTrue(testPage.ajaxCallbackExecuted); + } + + @BeforeEach + void setUp() throws Exception + { + application = new MockApplication(); + pageStore = new InMemoryPageStore("test", Integer.MAX_VALUE) + { + @Override + public void addPage(IPageContext context, IManageablePage page) + { + super.addPage(context, page); + storeCount++; + } + }; + tester = new WicketTester(application) + { + @Override + protected IPageManagerProvider newTestPageManagerProvider() + { + return new IPageManagerProvider() + { + @Override + public IPageManager get() + { + return new PageManager(new RequestPageStore(pageStore)); + } + }; + } + }; + } + + @AfterEach + void tearDown() throws Exception + { + tester.destroy(); + } + + /** */ + public static class TestPage extends WebPage implements IMarkupResourceStreamProvider + { + /** */ + private static final long serialVersionUID = 1L; + AjaxEventBehavior eventBehavior; + boolean ajaxCallbackExecuted; + + /** + * Construct. + */ + public TestPage() + { + WebComponent component; + component = new WebComponent("component"); + component.add(eventBehavior = new AjaxEventBehavior("click") + { + /** */ + private static final long serialVersionUID = 1L; + + @Override + protected void onEvent(AjaxRequestTarget target) + { + ajaxCallbackExecuted = true; + } + }); + add(component); + } + + /** + * @param encoding + * @return ajaxUrl + */ + public Url getAjaxUrl(String encoding) + { + return Url.parse(eventBehavior.getCallbackUrl().toString(), Charset.forName(encoding)); + } + + @Override + public IResourceStream getMarkupResourceStream(MarkupContainer container, + Class containerClass) + { + return new StringResourceStream( + ""); + } + + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/PageProviderTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageProviderTest.java similarity index 99% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/PageProviderTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageProviderTest.java index 252760e4e84..235dbafeac6 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/PageProviderTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageProviderTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler; +package org.apache.wicket.core.request.handler; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/AbstractVariations.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/AbstractVariations.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/AbstractVariations.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/AbstractVariations.java index af4fe153da7..66ef83c112e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/AbstractVariations.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/AbstractVariations.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; abstract class AbstractVariations { diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/ShouldRedirectToTargetUrl.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/ShouldRedirectToTargetUrl.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/ShouldRedirectToTargetUrl.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/ShouldRedirectToTargetUrl.java index 55486d6eb43..546f93887d3 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/ShouldRedirectToTargetUrl.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/ShouldRedirectToTargetUrl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import org.apache.wicket.core.request.handler.RenderPageRequestHandler; import org.apache.wicket.request.Url; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java index 4a7ed37a881..deda4d762e8 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/ShouldRenderPageAndWriteResponseVariations.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import org.apache.wicket.core.request.handler.RenderPageRequestHandler; import org.apache.wicket.request.Url; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/SkipRenderWithSetResponsePageTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/SkipRenderWithSetResponsePageTest.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/SkipRenderWithSetResponsePageTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/SkipRenderWithSetResponsePageTest.java index 885c8ca449c..d1cecd7e84b 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/SkipRenderWithSetResponsePageTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/SkipRenderWithSetResponsePageTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import static org.junit.jupiter.api.Assertions.fail; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/StatelessPageManipulatingPageParametersTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/StatelessPageManipulatingPageParametersTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/StatelessPageManipulatingPageParametersTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/StatelessPageManipulatingPageParametersTest.java index efb11f23805..54bc4b9031a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/StatelessPageManipulatingPageParametersTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/StatelessPageManipulatingPageParametersTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import org.apache.wicket.MarkupContainer; import org.apache.wicket.markup.IMarkupResourceStreamProvider; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/TestPageRenderer.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/TestPageRenderer.java similarity index 84% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/TestPageRenderer.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/TestPageRenderer.java index bed615e13ff..b285e177e68 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/TestPageRenderer.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/TestPageRenderer.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import org.apache.wicket.core.request.handler.RenderPageRequestHandler; import org.apache.wicket.core.request.handler.RenderPageRequestHandler.RedirectPolicy; import org.apache.wicket.protocol.http.BufferedWebResponse; import org.apache.wicket.request.Url; import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.handler.render.WebPageRenderer; /** * Configures common methods which are used by all tests @@ -42,6 +43,16 @@ public TestPageRenderer(RenderPageRequestHandler handler) super(handler); } + @Override + public boolean shouldRedirectToTargetUrl(RequestCycle cycle, Url currentUrl, Url targetUrl) { + return super.shouldRedirectToTargetUrl(cycle, currentUrl, targetUrl); + } + + @Override + public boolean shouldRenderPageAndWriteResponse(RequestCycle cycle, Url currentUrl, Url targetUrl) { + return super.shouldRenderPageAndWriteResponse(cycle, currentUrl, targetUrl); + } + @Override protected BufferedWebResponse renderPage(Url targetUrl, RequestCycle requestCycle) { diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/TestVariations.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/TestVariations.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/TestVariations.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/TestVariations.java index 4473c73c54d..6b8717340b6 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/TestVariations.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/TestVariations.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/Variation.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/Variation.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/Variation.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/Variation.java index 8bc014e8d74..0d3955db85e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/Variation.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/Variation.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import java.util.Arrays; import java.util.List; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/VariationIterator.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/VariationIterator.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/VariationIterator.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/VariationIterator.java index 14480ba6e85..8014ff31c06 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/VariationIterator.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/VariationIterator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import java.util.Iterator; import java.util.NoSuchElementException; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/WebPageRendererTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/WebPageRendererTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/render/WebPageRendererTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/WebPageRendererTest.java index caea6676be2..b8244cd5a88 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/render/WebPageRendererTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/render/WebPageRendererTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.render; +package org.apache.wicket.core.request.handler.render; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -38,8 +38,10 @@ import org.apache.wicket.request.UrlRenderer; import org.apache.wicket.request.component.IRequestablePage; import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.handler.render.PageRenderer; import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.http.WebResponse; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -612,7 +614,7 @@ void testShouldRenderPageAndWriteResponseCondition() { renderer.newPageInstance = true; renderer.pageStateless = true; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test"), Url.parse("test"))); renderer.ajax = false; @@ -622,7 +624,7 @@ void testShouldRenderPageAndWriteResponseCondition() { renderer.newPageInstance = false; renderer.pageStateless = false; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test1"), Url.parse("test2"))); // or @@ -634,7 +636,7 @@ void testShouldRenderPageAndWriteResponseCondition() { renderer.ajax = false; renderer.onePassRender = true; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test1"), Url.parse("test2"))); renderer.redirectPolicy = RedirectPolicy.ALWAYS_REDIRECT; @@ -643,21 +645,21 @@ void testShouldRenderPageAndWriteResponseCondition() { renderer.newPageInstance = false; renderer.pageStateless = false; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test"), Url.parse("test"))); // or // the targetUrl matches current url and it's redirect-to-render renderer.redirectToRender = true; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test"), Url.parse("test"))); renderer.pageStateless = true; renderer.newPageInstance = true; renderer.redirectToRender = true; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test"), Url.parse("test"))); // or @@ -672,7 +674,7 @@ void testShouldRenderPageAndWriteResponseCondition() { renderer.newPageInstance = true; renderer.pageStateless = true; - assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertTrue(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test1"), Url.parse("test2"))); } @@ -704,14 +706,14 @@ void testShouldNOTRenderPageAndWriteResponseCondition() { renderer.newPageInstance = true; renderer.pageStateless = true; - assertFalse(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertFalse(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test1"), Url.parse("test2"))); renderer.redirectToRender = false; renderer.newPageInstance = false; renderer.pageStateless = false; - assertFalse(renderer.shouldRenderPageAndWriteResponse(requestCycle, + Assertions.assertFalse(renderer.shouldRenderPageAndWriteResponse(requestCycle, Url.parse("test"), Url.parse("test"))); } @@ -794,7 +796,7 @@ void shouldRedirectToTargetUrlCondition() { renderer.pageStateless = false; renderer.sessionTemporary = false; - assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), + Assertions.assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), Url.parse("test2"))); // or @@ -802,7 +804,7 @@ void shouldRedirectToTargetUrlCondition() { renderer.redirectPolicy = RedirectPolicy.AUTO_REDIRECT; renderer.redirectToRender = true; - assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), + Assertions.assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), Url.parse("test2"))); // or @@ -810,7 +812,7 @@ void shouldRedirectToTargetUrlCondition() { renderer.redirectToRender = false; renderer.ajax = true; - assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test"), + Assertions.assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test"), Url.parse("test"))); // or @@ -821,14 +823,14 @@ void shouldRedirectToTargetUrlCondition() { renderer.ajax = false; renderer.newPageInstance = true; - assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), + Assertions.assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), Url.parse("test2"))); renderer.newPageInstance = false; renderer.sessionTemporary = true; renderer.pageStateless = true; - assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), + Assertions.assertTrue(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), Url.parse("test2"))); // just redirect } @@ -857,7 +859,7 @@ void shouldNOTRedirectToTargetUrlCondition() { renderer.pageStateless=false; renderer.sessionTemporary=false; - assertFalse(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), + Assertions.assertFalse(renderer.shouldRedirectToTargetUrl(requestCycle, Url.parse("test1"), Url.parse("test2"))); } diff --git a/wicket-core/src/test/java/org/apache/wicket/request/handler/resource/ResourceAuthorizationTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/resource/ResourceAuthorizationTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/handler/resource/ResourceAuthorizationTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/handler/resource/ResourceAuthorizationTest.java index 36db7c5b13e..a6782291383 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/handler/resource/ResourceAuthorizationTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/resource/ResourceAuthorizationTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.handler.resource; +package org.apache.wicket.core.request.handler.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractBookmarkableMapperTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractBookmarkableMapperTest.java index 3af1c62aec1..7eae474bfdc 100644 --- a/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractBookmarkableMapperTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractBookmarkableMapperTest.java @@ -29,7 +29,7 @@ import org.apache.wicket.request.Url; import org.apache.wicket.request.mapper.info.PageInfo; import org.apache.wicket.util.tester.WicketTestCase; -import org.apache.wicket.util.tester.WicketTesterLazyIsPageStatelessRedirectToBufferTest.EmptyPage; +import org.apache.wicket.core.util.tester.WicketTesterLazyIsPageStatelessRedirectToBufferTest.EmptyPage; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/request/mapper/CustomHomePageTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/CustomHomePageTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/request/mapper/CustomHomePageTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/mapper/CustomHomePageTest.java index ecdefe4642b..94137a9f133 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/mapper/CustomHomePageTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/CustomHomePageTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.mapper; +package org.apache.wicket.core.request.mapper; import org.apache.wicket.Application; import org.apache.wicket.protocol.http.WebApplication; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/mapper/info/ComponentInfoTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/info/ComponentInfoTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/mapper/info/ComponentInfoTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/mapper/info/ComponentInfoTest.java index 21df52eb81f..60f2fe9296c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/mapper/info/ComponentInfoTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/info/ComponentInfoTest.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.mapper.info; +package org.apache.wicket.core.request.mapper.info; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import org.apache.wicket.request.mapper.info.ComponentInfo; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/request/mapper/info/PageComponentInfoTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/info/PageComponentInfoTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/mapper/info/PageComponentInfoTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/mapper/info/PageComponentInfoTest.java index a657b8814bf..3802f7d8443 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/mapper/info/PageComponentInfoTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/info/PageComponentInfoTest.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.mapper.info; +package org.apache.wicket.core.request.mapper.info; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import org.apache.wicket.request.mapper.info.PageComponentInfo; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage.html b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage.java similarity index 91% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage.java index 74d40841894..88d07bbf158 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.request.resource.JavaScriptResourceReference; /** * @author papegaaij diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_ext_result.html b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_ext_result.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_ext_result.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_ext_result.html diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_result.html b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_result.html similarity index 60% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_result.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_result.html index 02caf0aa1b2..345aaf151a9 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_result.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_result.html @@ -1,5 +1,5 @@ - + diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_result_defer.html b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_result_defer.html similarity index 56% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_result_defer.html rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_result_defer.html index ebaf99ef5ea..995a44c58b6 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/BundlesPage_result_defer.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/BundlesPage_result_defer.html @@ -1,5 +1,5 @@ - + diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ByteArrayResourceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ByteArrayResourceTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ByteArrayResourceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ByteArrayResourceTest.java index 6c163fe5d51..9af925dc3a4 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/ByteArrayResourceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ByteArrayResourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; @@ -26,6 +26,7 @@ import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.http.WebResponse; +import org.apache.wicket.request.resource.ByteArrayResource; import org.apache.wicket.request.resource.IResource.Attributes; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/CharSequenceResourceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/CharSequenceResourceTest.java similarity index 77% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/CharSequenceResourceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/CharSequenceResourceTest.java index 340597dd126..23404aa456a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/CharSequenceResourceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/CharSequenceResourceTest.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import org.apache.wicket.request.resource.CharSequenceResource; import org.junit.jupiter.api.Test; /** @@ -28,17 +29,30 @@ */ class CharSequenceResourceTest { + class CSR extends CharSequenceResource + { + public CSR(String contentType) { + super(contentType); + } + + // make it public for the test + @Override + public Long getLength(CharSequence data) { + return super.getLength(data); + } + } + @Test void getLength_whenNoUnicodeSymbols_thenReturnTheStringLength() throws Exception { - CharSequenceResource resource = new CharSequenceResource("plain/text"); + CSR resource = new CSR("plain/text"); assertEquals(Long.valueOf(4L), resource.getLength("abcd")); } @Test void getLength_UTF8_whenUnicodeSymbols_thenReturnTheBytesLength() throws Exception { - CharSequenceResource resource = new CharSequenceResource("plain/text"); + CSR resource = new CSR("plain/text"); resource.setCharset(StandardCharsets.UTF_8); assertEquals(Long.valueOf(5L), resource.getLength("a\u1234d")); } @@ -46,7 +60,7 @@ void getLength_UTF8_whenUnicodeSymbols_thenReturnTheBytesLength() throws Excepti @Test void getLength_UTF16_whenUnicodeSymbols_thenReturnTheBytesLength() throws Exception { - CharSequenceResource resource = new CharSequenceResource("plain/text"); + CSR resource = new CSR("plain/text"); resource.setCharset(StandardCharsets.UTF_16); assertEquals(Long.valueOf(8L), resource.getLength("a\u1234d")); } diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ContextRelativeResourceReferenceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ContextRelativeResourceReferenceTest.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ContextRelativeResourceReferenceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ContextRelativeResourceReferenceTest.java index 215331054bc..b4bb670ad1d 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/ContextRelativeResourceReferenceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ContextRelativeResourceReferenceTest.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.resource.ContextRelativeResource; +import org.apache.wicket.request.resource.ContextRelativeResourceReference; import org.apache.wicket.util.tester.WicketTestCase; import org.apache.wicket.util.tester.WicketTester; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/CssPackageResourceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/CssPackageResourceTest.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/CssPackageResourceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/CssPackageResourceTest.java index 7820e4c7be5..5038afd275a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/CssPackageResourceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/CssPackageResourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -24,6 +24,7 @@ import org.apache.wicket.markup.html.PackageResourceTest; import org.apache.wicket.mock.MockApplication; import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.resource.CssPackageResource; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/DynamicImageResourceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/DynamicImageResourceTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/DynamicImageResourceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/DynamicImageResourceTest.java index ccee98fc2b2..b9b87d5f51e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/DynamicImageResourceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/DynamicImageResourceTest.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import javax.servlet.http.HttpServletResponse; +import org.apache.wicket.request.resource.DynamicImageResource; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/JavaScriptPackageResourceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/JavaScriptPackageResourceTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/JavaScriptPackageResourceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/JavaScriptPackageResourceTest.java index 14a63cb2b7f..a0b4e13c08c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/JavaScriptPackageResourceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/JavaScriptPackageResourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -25,6 +25,7 @@ import org.apache.wicket.markup.html.PackageResourceTest; import org.apache.wicket.mock.MockApplication; import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.resource.JavaScriptPackageResource; import org.apache.wicket.util.resource.ResourceStreamNotFoundException; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/LessResourceReference.less b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/LessResourceReference.less similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/LessResourceReference.less rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/LessResourceReference.less diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/LessResourceReferenceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/LessResourceReferenceTest.java similarity index 88% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/LessResourceReferenceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/LessResourceReferenceTest.java index 7e4b6d5d21f..56146d4a486 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/LessResourceReferenceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/LessResourceReferenceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -29,6 +29,11 @@ import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.mock.MockApplication; import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.resource.CssPackageResource; +import org.apache.wicket.request.resource.CssResourceReference; +import org.apache.wicket.request.resource.PackageResource; +import org.apache.wicket.request.resource.ResourceReference; +import org.apache.wicket.request.resource.ResourceReferenceRegistry; import org.apache.wicket.util.file.Files; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; @@ -41,7 +46,7 @@ * * @since 1.5.9 */ -public class LessResourceReferenceTest extends WicketTestCase +class LessResourceReferenceTest extends WicketTestCase { private static final AtomicBoolean PROCESS_RESPONSE_CALLED = new AtomicBoolean(false); @@ -128,8 +133,8 @@ void processLessResources() void processLessResourcesWithoutStartingAPage() { // make a request to the resource that is not registered in the ResourceReferenceRegistry - CharSequence urlToReference = "./wicket/resource/org.apache.wicket.request.resource.LessResourceReferenceTest/LessResourceReference.less"; - tester.executeUrl(urlToReference.toString()); + String urlToReference = "./wicket/resource/org.apache.wicket.core.request.resource.LessResourceReferenceTest/LessResourceReference.less"; + tester.executeUrl(urlToReference); assertTrue(PROCESS_RESPONSE_CALLED.get()); } @@ -146,7 +151,7 @@ public void renderHead(IHeaderResponse response) public IResourceStream getMarkupResourceStream(MarkupContainer container, Class containerClass) { - return new StringResourceStream(""); + return new StringResourceStream(""); } } diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/MetaInfStaticResourceReferenceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/MetaInfStaticResourceReferenceTest.java similarity index 90% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/MetaInfStaticResourceReferenceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/MetaInfStaticResourceReferenceTest.java index 135e42f55ea..e300cb4ac69 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/MetaInfStaticResourceReferenceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/MetaInfStaticResourceReferenceTest.java @@ -1,119 +1,121 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.request.resource; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import java.lang.reflect.Field; -import java.net.MalformedURLException; -import java.net.URL; - -import org.apache.wicket.mock.MockApplication; -import org.apache.wicket.mock.MockWebRequest; -import org.apache.wicket.protocol.http.mock.MockServletContext; -import org.apache.wicket.request.IRequestHandler; -import org.apache.wicket.request.Url; -import org.apache.wicket.util.tester.BaseWicketTester; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * Tests for {@link MetaInfStaticResourceReference}. - * - * @author akiraly - */ -class MetaInfStaticResourceReferenceTest -{ - private static final String STATIC_RESOURCE_NAME = "sample.js"; - - /** - * Test with Servlet 3.0 container - * - * @throws MalformedURLException - * should not happen - */ - @Test - void testWithServlet30() throws MalformedURLException - { - MockApplication application = new MockApplication(); - MockServletContext servletContext = new MockServletContext(application, null); - BaseWicketTester tester = new BaseWicketTester(application, servletContext); - - MetaInfStaticResourceReference metaRes = new MetaInfStaticResourceReference(getClass(), - STATIC_RESOURCE_NAME); - PackageResourceReference packRes = new PackageResourceReference(getClass(), - STATIC_RESOURCE_NAME); - - Url packUrl = tester.getRequestCycle().mapUrlFor(packRes, null); - Url metaUrl = tester.getRequestCycle().mapUrlFor(metaRes, null); - - assertNotNull(metaUrl); - assertNotNull(packUrl); - assertFalse(metaUrl.equals(packUrl), "Meta and pack resource should not map to the same url under servlet 3.0."); - - String metaUrlStr = metaUrl.toString(); - if (metaUrlStr.charAt(1) != '/') - { - metaUrlStr = "/" + metaUrlStr; - } - - // meta resource is served by the servlet container under 3.0 - URL metaNetUrl = servletContext.getResource(metaUrlStr); - - assertNotNull(metaNetUrl, "Meta resource is not found by the 3.0 servlet container."); - - MockWebRequest request = new MockWebRequest(packUrl); - - IRequestHandler requestHandler = tester.getApplication() - .getRootRequestMapper() - .mapRequest(request); - - // the pack resource is still served by wicket - assertNotNull(requestHandler); - } - - /** - * Needs to clear META_INF_RESOURCES_SUPPORTED field in {@link MetaInfStaticResourceReference} - * class between tests because classes do not get reloaded between junit tests. This is not a - * problem in production where the servlet container is not changing versions. - * - * @throws Exception - * if the reflection magic failed - */ - @BeforeEach - void before() throws Exception - { - Field field = MetaInfStaticResourceReference.class.getDeclaredField("META_INF_RESOURCES_SUPPORTED"); - field.setAccessible(true); - field.set(null, null); - } - - /** - * {@link #before()} - * - * @throws Exception - * if before fails - */ - @AfterEach - void after() throws Exception - { - before(); - } - -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.request.resource; + +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.lang.reflect.Field; +import java.net.MalformedURLException; +import java.net.URL; + +import org.apache.wicket.mock.MockApplication; +import org.apache.wicket.mock.MockWebRequest; +import org.apache.wicket.protocol.http.mock.MockServletContext; +import org.apache.wicket.request.IRequestHandler; +import org.apache.wicket.request.Url; +import org.apache.wicket.request.resource.MetaInfStaticResourceReference; +import org.apache.wicket.request.resource.PackageResourceReference; +import org.apache.wicket.util.tester.BaseWicketTester; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Tests for {@link MetaInfStaticResourceReference}. + * + * @author akiraly + */ +class MetaInfStaticResourceReferenceTest +{ + private static final String STATIC_RESOURCE_NAME = "sample.js"; + + /** + * Test with Servlet 3.0 container + * + * @throws MalformedURLException + * should not happen + */ + @Test + void testWithServlet30() throws MalformedURLException + { + MockApplication application = new MockApplication(); + MockServletContext servletContext = new MockServletContext(application, null); + BaseWicketTester tester = new BaseWicketTester(application, servletContext); + + MetaInfStaticResourceReference metaRes = new MetaInfStaticResourceReference(getClass(), + STATIC_RESOURCE_NAME); + PackageResourceReference packRes = new PackageResourceReference(getClass(), + STATIC_RESOURCE_NAME); + + Url packUrl = tester.getRequestCycle().mapUrlFor(packRes, null); + Url metaUrl = tester.getRequestCycle().mapUrlFor(metaRes, null); + + assertNotNull(metaUrl); + assertNotNull(packUrl); + assertNotEquals(metaUrl, packUrl, "Meta and pack resource should not map to the same url under servlet 3.0."); + + String metaUrlStr = metaUrl.toString(); + if (metaUrlStr.charAt(1) != '/') + { + metaUrlStr = "/" + metaUrlStr; + } + + // meta resource is served by the servlet container under 3.0 + URL metaNetUrl = servletContext.getResource(metaUrlStr); + + assertNotNull(metaNetUrl, "Meta resource is not found by the 3.0 servlet container."); + + MockWebRequest request = new MockWebRequest(packUrl); + + IRequestHandler requestHandler = tester.getApplication() + .getRootRequestMapper() + .mapRequest(request); + + // the pack resource is still served by wicket + assertNotNull(requestHandler); + } + + /** + * Needs to clear META_INF_RESOURCES_SUPPORTED field in {@link MetaInfStaticResourceReference} + * class between tests because classes do not get reloaded between junit tests. This is not a + * problem in production where the servlet container is not changing versions. + * + * @throws Exception + * if the reflection magic failed + */ + @BeforeEach + void before() throws Exception + { + Field field = MetaInfStaticResourceReference.class.getDeclaredField("META_INF_RESOURCES_SUPPORTED"); + field.setAccessible(true); + field.set(null, null); + } + + /** + * {@link #before()} + * + * @throws Exception + * if before fails + */ + @AfterEach + void after() throws Exception + { + before(); + } + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/MinifiedAwareResourceReferenceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/MinifiedAwareResourceReferenceTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/MinifiedAwareResourceReferenceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/MinifiedAwareResourceReferenceTest.java index 7bec622f958..1b5afb191a5 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/MinifiedAwareResourceReferenceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/MinifiedAwareResourceReferenceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -23,6 +23,8 @@ import org.apache.wicket.Application; import org.apache.wicket.core.util.resource.locator.ResourceStreamLocator; import org.apache.wicket.request.resource.IResource.Attributes; +import org.apache.wicket.request.resource.JavaScriptResourceReference; +import org.apache.wicket.request.resource.ResourceReference; import org.apache.wicket.response.ByteArrayResponse; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.tester.WicketTestCase; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/PackageResourceReferenceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/PackageResourceReferenceTest.java similarity index 90% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/PackageResourceReferenceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/PackageResourceReferenceTest.java index 426ee241407..bf8cd883983 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/PackageResourceReferenceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/PackageResourceReferenceTest.java @@ -1,381 +1,399 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.request.resource; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Locale; - -import org.apache.wicket.Application; -import org.apache.wicket.ThreadContext; -import org.apache.wicket.protocol.http.mock.MockHttpServletRequest; -import org.apache.wicket.protocol.http.mock.MockHttpServletResponse; -import org.apache.wicket.request.Request; -import org.apache.wicket.request.Response; -import org.apache.wicket.request.resource.AbstractResource.ContentRangeType; -import org.apache.wicket.request.resource.IResource.Attributes; -import org.apache.wicket.request.resource.ResourceReference.UrlAttributes; -import org.apache.wicket.response.ByteArrayResponse; -import org.apache.wicket.util.io.IOUtils; -import org.apache.wicket.util.tester.WicketTestCase; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * @author Pedro Santos - */ -class PackageResourceReferenceTest extends WicketTestCase -{ - private static Class scope = PackageResourceReferenceTest.class; - private static Locale[] locales = { null, new Locale("en"), new Locale("en", "US") }; - private static String[] styles = { null, "style" }; - private static String[] variations = { null, "var" }; - - /** - * @throws Exception - */ - @BeforeEach - void before() throws Exception - { - // some locale outside those in locales array - tester.getSession().setLocale(Locale.CHINA); - } - - /** - * - */ - @Test - void resourceResolution() - { - for (Locale locale : locales) - { - for (String style : styles) - { - for (String variation : variations) - { - ResourceReference reference = new PackageResourceReference(scope, - "resource.txt", locale, style, variation); - UrlAttributes urlAttributes = reference.getUrlAttributes(); - assertEquals(locale, urlAttributes.getLocale()); - assertEquals(style, urlAttributes.getStyle()); - assertEquals(variation, urlAttributes.getVariation()); - - ByteArrayResponse byteResponse = new ByteArrayResponse(); - Attributes mockAttributes = new Attributes(tester.getRequestCycle() - .getRequest(), byteResponse); - reference.getResource().respond(mockAttributes); - String fileContent = new String(byteResponse.getBytes()); - if (locale != null) - { - assertTrue(fileContent.contains(locale.getLanguage())); - if (locale.getCountry() != null) - { - assertTrue(fileContent.contains(locale.getCountry())); - } - } - if (style != null) - { - assertTrue(fileContent.contains(style)); - } - if (variation != null) - { - assertTrue(fileContent.contains(variation)); - } - } - } - } - } - - /** - * - */ - @Test - void resourceResponse() - { - for (Locale locale : locales) - { - for (String style : styles) - { - for (String variation : variations) - { - ResourceReference reference = new PackageResourceReference(scope, - "resource.txt", locale, style, variation); - - ByteArrayResponse byteResponse = new ByteArrayResponse(); - Attributes mockAttributes = new Attributes(tester.getRequestCycle() - .getRequest(), byteResponse); - reference.getResource().respond(mockAttributes); - String fileContent = new String(byteResponse.getBytes()); - if (locale != null) - { - assertTrue(fileContent.contains(locale.getLanguage())); - if (locale.getCountry() != null) - { - assertTrue(fileContent.contains(locale.getCountry())); - } - } - if (style != null) - { - assertTrue(fileContent.contains(style)); - } - if (variation != null) - { - assertTrue(fileContent.contains(variation)); - } - } - } - } - } - - /** - * Asserting if user did not set any locale or style, those from session get used if any - */ - @Test - void sessionAttributesRelevance() - { - for (Locale locale : new Locale[] { new Locale("en"), new Locale("en", "US") }) - { - tester.getSession().setLocale(locale); - for (String style : styles) - { - tester.getSession().setStyle(style); - for (String variation : variations) - { - ResourceReference reference = new PackageResourceReference(scope, - "resource.txt", null, null, variation); - UrlAttributes urlAttributes = reference.getUrlAttributes(); - assertEquals(tester.getSession().getLocale(), urlAttributes.getLocale()); - assertEquals(tester.getSession().getStyle(), urlAttributes.getStyle()); - assertEquals(variation, urlAttributes.getVariation()); - } - } - } - } - - /** - * Assert preference for specified locale and style over session ones - */ - @Test - void userAttributesPreference() - { - tester.getSession().setLocale(new Locale("en")); - tester.getSession().setStyle("style"); - - Locale[] userLocales = { null, new Locale("pt"), new Locale("pt", "BR") }; - String userStyle = "style2"; - - for (Locale userLocale : userLocales) - { - for (String variation : variations) - { - ResourceReference reference = new PackageResourceReference(scope, "resource.txt", - userLocale, userStyle, variation); - UrlAttributes urlAttributes = reference.getUrlAttributes(); - - assertEquals(userLocale, urlAttributes.getLocale()); - assertEquals(userStyle, urlAttributes.getStyle()); - assertEquals(variation, urlAttributes.getVariation()); - } - } - } - - /** - * see WICKET-5251 : Proper detection of already minified resources - */ - @Test - void testMinifiedNameDetectMinInName() - { - final PackageResourceReference html5minjs = new PackageResourceReference("html5.min.js"); - assertEquals("html5.min.js", html5minjs.getMinifiedName()); - - final PackageResourceReference html5notminjs = new PackageResourceReference("html5.notmin.js"); - assertEquals("html5.notmin.min.js", html5notminjs.getMinifiedName()); - - final PackageResourceReference html5notmin = new PackageResourceReference("html5notmin"); - assertEquals("html5notmin.min", html5notmin.getMinifiedName()); - - final PackageResourceReference html5min = new PackageResourceReference("html5.min"); - assertEquals("html5.min", html5min.getMinifiedName()); - - } - - /** - * see WICKET-5250 - for JavaScriptResourceReference - */ - @Test - void testJavaScriptResourceReferenceRespectsMinifiedResourcesDetection() - { - Application.get().getResourceSettings().setUseMinifiedResources(true); - final JavaScriptResourceReference notMinified = new JavaScriptResourceReference(PackageResourceReferenceTest.class, "a.js"); - final JavaScriptPackageResource notMinifiedResource = notMinified.getResource(); - assertTrue(notMinifiedResource.getCompress(), "Not minified resource should got its compress flag set to true"); - - final JavaScriptResourceReference alreadyMinified = new JavaScriptResourceReference(PackageResourceReferenceTest.class, "b.min.js"); - final JavaScriptPackageResource alreadyMinifiedResource = alreadyMinified.getResource(); - assertFalse(alreadyMinifiedResource.getCompress(), "Already minified resource should got its compress flag set to false"); - } - - /** - * see WICKET-5250 - for CSSResourceReference - */ - @Test - void testCSSResourceReferenceRespectsMinifiedResourcesDetection() - { - Application.get().getResourceSettings().setUseMinifiedResources(true); - final CssResourceReference notMinified = new CssResourceReference(PackageResourceReferenceTest.class, "a.css"); - final CssPackageResource notMinifiedResource = notMinified.getResource(); - assertTrue(notMinifiedResource.getCompress(), "Not minified resource should got its compress flag set to true"); - - final CssResourceReference alreadyMinified = new CssResourceReference(PackageResourceReferenceTest.class, "b.min.css"); - final CssPackageResource alreadyMinifiedResource = alreadyMinified.getResource(); - assertFalse(alreadyMinifiedResource.getCompress(), "Already minified resource should got its compress flag set to false"); - } - - /** - * See WICKET-5819 - Media tags - */ - @Test - void testContentRange() - { - // Test range - assertEquals("resource", makeRangeRequest("bytes=0-7")); - assertEquals("ource", makeRangeRequest("bytes=3-7")); - assertEquals("resource_var_style_en.txt", makeRangeRequest("bytes=0-")); - assertEquals("var_style_en.txt", makeRangeRequest("bytes=9-")); - assertEquals("resource_var_style_en.txt", makeRangeRequest("bytes=-")); - assertEquals("resource_var_style_en.txt", makeRangeRequest("bytes=-25")); - } - - private String makeRangeRequest(String range) - { - ResourceReference reference = new PackageResourceReference(scope, "resource.txt", - locales[1], styles[1], variations[1]); - - ByteArrayResponse byteResponse = new ByteArrayResponse(); - - Request request = tester.getRequestCycle().getRequest(); - MockHttpServletRequest mockHttpServletRequest = (MockHttpServletRequest)request.getContainerRequest(); - mockHttpServletRequest.setHeader("range", range); - Attributes mockAttributes = new Attributes(request, byteResponse); - reference.getResource().respond(mockAttributes); - return new String(byteResponse.getBytes()); - } - - /** - * See WICKET-5819 - Media tags - * - * @throws IOException - */ - @Test - void testContentRangeLarge() throws IOException - { - InputStream resourceAsStream = null; - try - { - resourceAsStream = PackageResourceReference.class.getResourceAsStream("resource_gt_4096.txt"); - String content = new String(IOUtils.toByteArray(resourceAsStream)); - - // Check buffer comprehensive range request - String bytes4094_4105 = makeRangeRequestToBigResource("bytes=4094-4105"); - assertEquals(12, bytes4094_4105.length()); - assertEquals("River Roller", bytes4094_4105); - - // Check buffer exceeding range request - String bytes1000_4999 = makeRangeRequestToBigResource("bytes=1000-4999"); - assertEquals(4000, bytes1000_4999.length()); - assertEquals(content.substring(1000, 5000), bytes1000_4999); - - // Check buffer exceeding range request until end of content - String bytes1000_end = makeRangeRequestToBigResource("bytes=1000-"); - assertEquals(4529, bytes1000_end.length()); - assertEquals(content.substring(1000, content.length()), bytes1000_end); - - // Check complete range request - assertEquals(content.length(), makeRangeRequestToBigResource("bytes=-").length()); - } - finally - { - IOUtils.closeQuietly(resourceAsStream); - } - } - - private String makeRangeRequestToBigResource(String range) - { - ResourceReference reference = new PackageResourceReference(scope, "resource_gt_4096.txt", - null, null, null); - - ByteArrayResponse byteResponse = new ByteArrayResponse(); - - Request request = tester.getRequestCycle().getRequest(); - MockHttpServletRequest mockHttpServletRequest = (MockHttpServletRequest)request.getContainerRequest(); - mockHttpServletRequest.setHeader("range", range); - Attributes mockAttributes = new Attributes(request, byteResponse); - reference.getResource().respond(mockAttributes); - return new String(byteResponse.getBytes()); - } - - /** - * See WICKET-5819 - Media tags - */ - @Test - void testContentRangeHeaders() - { - // Test header fields - ResourceReference reference = new PackageResourceReference(scope, "resource.txt", - locales[1], styles[1], variations[1]); - Request request = tester.getRequestCycle().getRequest(); - Response response = tester.getRequestCycle().getResponse(); - MockHttpServletResponse mockHttpServletResponse = (MockHttpServletResponse)response.getContainerResponse(); - Attributes mockAttributes = new Attributes(request, response); - reference.getResource().respond(mockAttributes); - assertEquals(ContentRangeType.BYTES.getTypeName(), - mockHttpServletResponse.getHeader("Accept-Range")); - // For normal: If a resource supports content range no content is delivered - // if no "Range" header is given, but we have to deliver it, because - // other resources then media should get the content. (e.g. CSS, JS, etc.) Browsers - // detecting media requests and automatically add the "Range" header for - // partial content and they don't make an initial request to detect if a media - // resource supports Content-Range (by the Accept-Range header) - assertEquals("resource_var_style_en.txt", - new String(mockHttpServletResponse.getBinaryContent())); - } - - /** - * https://issues.apache.org/jira/browse/WICKET-6031 - */ - @Test - void noRequestCycle() - { - ThreadContext.setRequestCycle(null); - - PackageResourceReference reference = new PackageResourceReference(scope, "resource.txt", - locales[1], styles[1], variations[1]); - - PackageResource resource = reference.getResource(); - assertNotNull(resource); - - assertEquals(locales[1], resource.getResourceStream().getLocale()); - assertEquals(styles[1], resource.getResourceStream().getStyle()); - assertEquals(variations[1], resource.getResourceStream().getVariation()); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.request.resource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Locale; + +import org.apache.wicket.Application; +import org.apache.wicket.ThreadContext; +import org.apache.wicket.protocol.http.mock.MockHttpServletRequest; +import org.apache.wicket.protocol.http.mock.MockHttpServletResponse; +import org.apache.wicket.request.Request; +import org.apache.wicket.request.Response; +import org.apache.wicket.request.resource.AbstractResource.ContentRangeType; +import org.apache.wicket.request.resource.CssPackageResource; +import org.apache.wicket.request.resource.CssResourceReference; +import org.apache.wicket.request.resource.IResource.Attributes; +import org.apache.wicket.request.resource.JavaScriptPackageResource; +import org.apache.wicket.request.resource.JavaScriptResourceReference; +import org.apache.wicket.request.resource.PackageResource; +import org.apache.wicket.request.resource.PackageResourceReference; +import org.apache.wicket.request.resource.ResourceReference; +import org.apache.wicket.request.resource.ResourceReference.UrlAttributes; +import org.apache.wicket.response.ByteArrayResponse; +import org.apache.wicket.util.io.IOUtils; +import org.apache.wicket.util.tester.WicketTestCase; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * @author Pedro Santos + */ +class PackageResourceReferenceTest extends WicketTestCase +{ + private static Class scope = PackageResourceReferenceTest.class; + private static final Locale[] locales = { null, new Locale("en"), new Locale("en", "US") }; + private static final String[] styles = { null, "style" }; + private static final String[] variations = { null, "var" }; + + /** + * @throws Exception + */ + @BeforeEach + void before() + { + // some locale outside those in locales array + tester.getSession().setLocale(Locale.CHINA); + } + + /** + * + */ + @Test + void resourceResolution() + { + for (Locale locale : locales) + { + for (String style : styles) + { + for (String variation : variations) + { + ResourceReference reference = new PackageResourceReference(scope, + "resource.txt", locale, style, variation); + UrlAttributes urlAttributes = reference.getUrlAttributes(); + assertEquals(locale, urlAttributes.getLocale()); + assertEquals(style, urlAttributes.getStyle()); + assertEquals(variation, urlAttributes.getVariation()); + + ByteArrayResponse byteResponse = new ByteArrayResponse(); + Attributes mockAttributes = new Attributes(tester.getRequestCycle() + .getRequest(), byteResponse); + reference.getResource().respond(mockAttributes); + String fileContent = new String(byteResponse.getBytes()); + if (locale != null) + { + assertTrue(fileContent.contains(locale.getLanguage())); + if (locale.getCountry() != null) + { + assertTrue(fileContent.contains(locale.getCountry())); + } + } + if (style != null) + { + assertTrue(fileContent.contains(style)); + } + if (variation != null) + { + assertTrue(fileContent.contains(variation)); + } + } + } + } + } + + @Test + void resourceResponse() + { + for (Locale locale : locales) + { + for (String style : styles) + { + for (String variation : variations) + { + ResourceReference reference = new PackageResourceReference(scope, + "resource.txt", locale, style, variation); + + ByteArrayResponse byteResponse = new ByteArrayResponse(); + Attributes mockAttributes = new Attributes(tester.getRequestCycle() + .getRequest(), byteResponse); + reference.getResource().respond(mockAttributes); + String fileContent = new String(byteResponse.getBytes()); + if (locale != null) + { + assertTrue(fileContent.contains(locale.getLanguage())); + if (locale.getCountry() != null) + { + assertTrue(fileContent.contains(locale.getCountry())); + } + } + if (style != null) + { + assertTrue(fileContent.contains(style)); + } + if (variation != null) + { + assertTrue(fileContent.contains(variation)); + } + } + } + } + } + + /** + * Asserting if user did not set any locale or style, those from session get used if any + */ + @Test + void sessionAttributesRelevance() + { + for (Locale locale : new Locale[] { new Locale("en"), new Locale("en", "US") }) + { + tester.getSession().setLocale(locale); + for (String style : styles) + { + tester.getSession().setStyle(style); + for (String variation : variations) + { + ResourceReference reference = new PackageResourceReference(scope, + "resource.txt", null, null, variation); + UrlAttributes urlAttributes = reference.getUrlAttributes(); + assertEquals(tester.getSession().getLocale(), urlAttributes.getLocale()); + assertEquals(tester.getSession().getStyle(), urlAttributes.getStyle()); + assertEquals(variation, urlAttributes.getVariation()); + } + } + } + } + + /** + * Assert preference for specified locale and style over session ones + */ + @Test + void userAttributesPreference() + { + tester.getSession().setLocale(new Locale("en")); + tester.getSession().setStyle("style"); + + Locale[] userLocales = { null, new Locale("pt"), new Locale("pt", "BR") }; + String userStyle = "style2"; + + for (Locale userLocale : userLocales) + { + for (String variation : variations) + { + ResourceReference reference = new PackageResourceReference(scope, "resource.txt", + userLocale, userStyle, variation); + UrlAttributes urlAttributes = reference.getUrlAttributes(); + + assertEquals(userLocale, urlAttributes.getLocale()); + assertEquals(userStyle, urlAttributes.getStyle()); + assertEquals(variation, urlAttributes.getVariation()); + } + } + } + + /** + * see WICKET-5251 : Proper detection of already minified resources + */ + @Test + void testMinifiedNameDetectMinInName() + { + class PRR extends PackageResourceReference + { + + public PRR(String key) { + super(key); + } + + // make it public for the test + @Override + public String getMinifiedName() { + return super.getMinifiedName(); + } + } + + final PRR html5minjs = new PRR("html5.min.js"); + assertEquals("html5.min.js", html5minjs.getMinifiedName()); + + final PRR html5notminjs = new PRR("html5.notmin.js"); + assertEquals("html5.notmin.min.js", html5notminjs.getMinifiedName()); + + final PRR html5notmin = new PRR("html5notmin"); + assertEquals("html5notmin.min", html5notmin.getMinifiedName()); + + final PRR html5min = new PRR("html5.min"); + assertEquals("html5.min", html5min.getMinifiedName()); + + } + + /** + * see WICKET-5250 - for JavaScriptResourceReference + */ + @Test + void testJavaScriptResourceReferenceRespectsMinifiedResourcesDetection() + { + Application.get().getResourceSettings().setUseMinifiedResources(true); + final JavaScriptResourceReference notMinified = new JavaScriptResourceReference(PackageResourceReferenceTest.class, "a.js"); + final JavaScriptPackageResource notMinifiedResource = notMinified.getResource(); + assertTrue(notMinifiedResource.getCompress(), "Not minified resource should got its compress flag set to true"); + + final JavaScriptResourceReference alreadyMinified = new JavaScriptResourceReference(PackageResourceReferenceTest.class, "b.min.js"); + final JavaScriptPackageResource alreadyMinifiedResource = alreadyMinified.getResource(); + assertFalse(alreadyMinifiedResource.getCompress(), "Already minified resource should got its compress flag set to false"); + } + + /** + * see WICKET-5250 - for CSSResourceReference + */ + @Test + void testCSSResourceReferenceRespectsMinifiedResourcesDetection() + { + Application.get().getResourceSettings().setUseMinifiedResources(true); + final CssResourceReference notMinified = new CssResourceReference(PackageResourceReferenceTest.class, "a.css"); + final CssPackageResource notMinifiedResource = notMinified.getResource(); + assertTrue(notMinifiedResource.getCompress(), "Not minified resource should got its compress flag set to true"); + + final CssResourceReference alreadyMinified = new CssResourceReference(PackageResourceReferenceTest.class, "b.min.css"); + final CssPackageResource alreadyMinifiedResource = alreadyMinified.getResource(); + assertFalse(alreadyMinifiedResource.getCompress(), "Already minified resource should got its compress flag set to false"); + } + + /** + * See WICKET-5819 - Media tags + */ + @Test + void testContentRange() + { + // Test range + assertEquals("resource", makeRangeRequest("bytes=0-7")); + assertEquals("ource", makeRangeRequest("bytes=3-7")); + assertEquals("resource_var_style_en.txt", makeRangeRequest("bytes=0-")); + assertEquals("var_style_en.txt", makeRangeRequest("bytes=9-")); + assertEquals("resource_var_style_en.txt", makeRangeRequest("bytes=-")); + assertEquals("resource_var_style_en.txt", makeRangeRequest("bytes=-25")); + } + + private String makeRangeRequest(String range) + { + ResourceReference reference = new PackageResourceReference(scope, "resource.txt", + locales[1], styles[1], variations[1]); + + ByteArrayResponse byteResponse = new ByteArrayResponse(); + + Request request = tester.getRequestCycle().getRequest(); + MockHttpServletRequest mockHttpServletRequest = (MockHttpServletRequest)request.getContainerRequest(); + mockHttpServletRequest.setHeader("range", range); + Attributes mockAttributes = new Attributes(request, byteResponse); + reference.getResource().respond(mockAttributes); + return new String(byteResponse.getBytes()); + } + + /** + * See WICKET-5819 - Media tags + * + * @throws IOException + */ + @Test + void testContentRangeLarge() throws IOException + { + InputStream resourceAsStream = null; + try + { + resourceAsStream = PackageResourceReferenceTest.class.getResourceAsStream("resource_gt_4096.txt"); + String content = new String(IOUtils.toByteArray(resourceAsStream)); + + // Check buffer comprehensive range request + String bytes4094_4105 = makeRangeRequestToBigResource("bytes=4094-4105"); + assertEquals(12, bytes4094_4105.length()); + assertEquals("River Roller", bytes4094_4105); + + // Check buffer exceeding range request + String bytes1000_4999 = makeRangeRequestToBigResource("bytes=1000-4999"); + assertEquals(4000, bytes1000_4999.length()); + assertEquals(content.substring(1000, 5000), bytes1000_4999); + + // Check buffer exceeding range request until end of content + String bytes1000_end = makeRangeRequestToBigResource("bytes=1000-"); + assertEquals(4529, bytes1000_end.length()); + assertEquals(content.substring(1000), bytes1000_end); + + // Check complete range request + assertEquals(content.length(), makeRangeRequestToBigResource("bytes=-").length()); + } + finally + { + IOUtils.closeQuietly(resourceAsStream); + } + } + + private String makeRangeRequestToBigResource(String range) + { + ResourceReference reference = new PackageResourceReference(scope, "resource_gt_4096.txt", + null, null, null); + + ByteArrayResponse byteResponse = new ByteArrayResponse(); + + Request request = tester.getRequestCycle().getRequest(); + MockHttpServletRequest mockHttpServletRequest = (MockHttpServletRequest)request.getContainerRequest(); + mockHttpServletRequest.setHeader("range", range); + Attributes mockAttributes = new Attributes(request, byteResponse); + reference.getResource().respond(mockAttributes); + return new String(byteResponse.getBytes()); + } + + /** + * See WICKET-5819 - Media tags + */ + @Test + void testContentRangeHeaders() + { + // Test header fields + ResourceReference reference = new PackageResourceReference(scope, "resource.txt", + locales[1], styles[1], variations[1]); + Request request = tester.getRequestCycle().getRequest(); + Response response = tester.getRequestCycle().getResponse(); + MockHttpServletResponse mockHttpServletResponse = (MockHttpServletResponse)response.getContainerResponse(); + Attributes mockAttributes = new Attributes(request, response); + reference.getResource().respond(mockAttributes); + assertEquals(ContentRangeType.BYTES.getTypeName(), + mockHttpServletResponse.getHeader("Accept-Range")); + // For normal: If a resource supports content range no content is delivered + // if no "Range" header is given, but we have to deliver it, because + // other resources then media should get the content. (e.g. CSS, JS, etc.) Browsers + // detecting media requests and automatically add the "Range" header for + // partial content and they don't make an initial request to detect if a media + // resource supports Content-Range (by the Accept-Range header) + assertEquals("resource_var_style_en.txt", + new String(mockHttpServletResponse.getBinaryContent())); + } + + /** + * https://issues.apache.org/jira/browse/WICKET-6031 + */ + @Test + void noRequestCycle() + { + ThreadContext.setRequestCycle(null); + + PackageResourceReference reference = new PackageResourceReference(scope, "resource.txt", + locales[1], styles[1], variations[1]); + + PackageResource resource = reference.getResource(); + assertNotNull(resource); + + assertEquals(locales[1], resource.getResourceStream().getLocale()); + assertEquals(styles[1], resource.getResourceStream().getStyle()); + assertEquals(variations[1], resource.getResourceStream().getVariation()); + } + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResouceBundleTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResouceBundleTest.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ResouceBundleTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResouceBundleTest.java index 9b5b85c4995..86bb258830f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResouceBundleTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResouceBundleTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; @@ -28,6 +28,10 @@ import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.request.Url; +import org.apache.wicket.request.resource.IResource; +import org.apache.wicket.request.resource.JavaScriptResourceReference; +import org.apache.wicket.request.resource.ResourceReference; +import org.apache.wicket.request.resource.UrlResourceReference; import org.apache.wicket.request.resource.caching.IStaticCacheableResource; import org.apache.wicket.resource.bundles.ConcatBundleResource; import org.apache.wicket.resource.bundles.ResourceBundleReference; @@ -43,7 +47,7 @@ * * @author papegaaij */ -public class ResouceBundleTest extends WicketTestCase +class ResouceBundleTest extends WicketTestCase { @BeforeEach void before() diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLambdaTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLambdaTest.java similarity index 89% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLambdaTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLambdaTest.java index a31d65ffbe3..bd49e7598c9 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLambdaTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLambdaTest.java @@ -14,11 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.resource.IResource; +import org.apache.wicket.request.resource.ResourceReference; import org.apache.wicket.util.tester.WicketTestCase; import org.apache.wicket.util.tester.WicketTester; import org.junit.jupiter.api.Test; @@ -33,7 +35,7 @@ protected WicketTester newWicketTester(WebApplication app) { WicketTester wicketTester = super.newWicketTester(app); - IResource res = (attributes) -> + IResource res = (attributes) -> attributes.getResponse().write(output); ResourceReference resRef = ResourceReference.of("lambdares", () -> res); diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLocatingTest.csv b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLocatingTest.csv similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLocatingTest.csv rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLocatingTest.csv diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLocatingTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLocatingTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLocatingTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLocatingTest.java index e36243b3dd2..7143170b652 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceLocatingTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceLocatingTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -27,6 +27,8 @@ import java.util.Locale; import java.util.stream.Stream; +import org.apache.wicket.request.resource.JavaScriptResourceReference; +import org.apache.wicket.request.resource.PackageResourceReference; import org.apache.wicket.util.io.Streams; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.BeforeEach; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceRegistryTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceRegistryTest.java similarity index 79% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceRegistryTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceRegistryTest.java index ca4c0b5890f..562dc406ca4 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/ResourceReferenceRegistryTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/ResourceReferenceRegistryTest.java @@ -14,12 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.instanceOf; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.apache.wicket.request.resource.CssPackageResource; +import org.apache.wicket.request.resource.IResource; +import org.apache.wicket.request.resource.PackageResource; +import org.apache.wicket.request.resource.PackageResourceReference; +import org.apache.wicket.request.resource.ResourceReference; +import org.apache.wicket.request.resource.ResourceReferenceRegistry; +import org.apache.wicket.request.resource.SharedResourceReference; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; @@ -35,7 +42,7 @@ class ResourceReferenceRegistryTest extends WicketTestCase @Test void addRemove() { - ResourceReferenceRegistry registry = new ResourceReferenceRegistry(); + RRR registry = new RRR(); assertEquals(0, registry.getSize()); ResourceReference reference = new PackageResourceReference( @@ -55,7 +62,7 @@ void addRemove() @Test void addSharedResourceReference() { - ResourceReferenceRegistry registry = new ResourceReferenceRegistry(); + RRR registry = new RRR(); assertEquals(0, registry.getSize()); ResourceReference reference = new SharedResourceReference( @@ -67,7 +74,7 @@ void addSharedResourceReference() @Test void setNullResourceReferenceFactoryStillUsesTheDefault() { - ResourceReferenceRegistry registry = new ResourceReferenceRegistry(); + RRR registry = new RRR(); registry.setResourceReferenceFactory(null); ResourceReference.Key key = new ResourceReference.Key(ResourceReferenceRegistryTest.class.getName(), "a.css", null, null, null); @@ -79,7 +86,7 @@ void setNullResourceReferenceFactoryStillUsesTheDefault() @Test void createLessResourceReference() { - ResourceReferenceRegistry registry = new ResourceReferenceRegistry(); + RRR registry = new RRR(); registry.setResourceReferenceFactory(new LessResourceReferenceTest.LessResourceReferenceFactory()); ResourceReference.Key key = new ResourceReference.Key(ResourceReferenceRegistryTest.class.getName(), "LessResourceReference.less", null, null, null); @@ -87,4 +94,13 @@ void createLessResourceReference() assertThat(reference, instanceOf(LessResourceReferenceTest.LessResourceReference.class)); assertThat(reference.getResource(), instanceOf(LessResourceReferenceTest.LessPackageResource.class)); } + + class RRR extends ResourceReferenceRegistry + { + // make it public for the test + @Override + public ResourceReference createDefaultResourceReference(ResourceReference.Key key) { + return super.createDefaultResourceReference(key); + } + } } diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/UrlResourceReferenceTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/UrlResourceReferenceTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/UrlResourceReferenceTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/UrlResourceReferenceTest.java index 81b655455f7..49fb4e57e75 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/UrlResourceReferenceTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/UrlResourceReferenceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource; +package org.apache.wicket.core.request.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -26,6 +26,7 @@ import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.request.Url; +import org.apache.wicket.request.resource.UrlResourceReference; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; import org.apache.wicket.util.tester.WicketTestCase; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/WriteCallbackTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/WriteCallbackTest.java similarity index 81% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/WriteCallbackTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/WriteCallbackTest.java index 1dba5f6bd2f..f6e1966caa7 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/WriteCallbackTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/WriteCallbackTest.java @@ -1,65 +1,69 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.request.resource; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; - -import org.apache.wicket.mock.MockWebRequest; -import org.apache.wicket.request.Url; -import org.apache.wicket.request.resource.AbstractResource.WriteCallback; -import org.apache.wicket.request.resource.IResource.Attributes; -import org.apache.wicket.response.ByteArrayResponse; -import org.junit.jupiter.api.Test; - -/** - * @author Kent Tong - */ -class WriteCallbackTest -{ - - /** - */ - @Test - void writeStream() throws IOException - { - WriteCallback callback = new WriteCallback() - { - - @Override - public void writeData(Attributes attributes) - { - - } - }; - ByteArrayResponse response = new ByteArrayResponse(); - Attributes attributes = new Attributes(new MockWebRequest(new Url()), response); - byte[] srcData = new byte[5000]; - for (int i = 0; i < srcData.length; i++) - { - srcData[i] = (byte)i; - } - InputStream in = new ByteArrayInputStream(srcData); - callback.writeStream(attributes, in); - assertTrue(Arrays.equals(response.getBytes(), srcData), "Content not equal"); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.request.resource; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import org.apache.wicket.mock.MockWebRequest; +import org.apache.wicket.request.Url; +import org.apache.wicket.request.resource.AbstractResource.WriteCallback; +import org.apache.wicket.request.resource.IResource.Attributes; +import org.apache.wicket.response.ByteArrayResponse; +import org.junit.jupiter.api.Test; + +/** + * @author Kent Tong + */ +class WriteCallbackTest +{ + + /** + */ + @Test + void writeStream() throws IOException + { + class WC extends WriteCallback + { + @Override + public void writeData(Attributes attributes) + { + + } + + @Override + public void writeStream(Attributes attributes, InputStream is) throws IOException { + super.writeStream(attributes, is); + } + } + WC callback = new WC(); + ByteArrayResponse response = new ByteArrayResponse(); + Attributes attributes = new Attributes(new MockWebRequest(new Url()), response); + byte[] srcData = new byte[5000]; + for (int i = 0; i < srcData.length; i++) + { + srcData[i] = (byte)i; + } + InputStream in = new ByteArrayInputStream(srcData); + callback.writeStream(attributes, in); + assertArrayEquals(response.getBytes(), srcData, "Content not equal"); + } + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/a.css b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/a.css similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/a.css rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/a.css diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/a.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/a.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/a.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/a.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b.css b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.css similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b.css rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.css diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b.min.css b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.min.css similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b.min.css rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.min.css diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_de.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_de.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_de.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_de.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl_BE.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl_BE.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl_BE.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl_BE.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl_BE.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl_BE.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_nl_BE.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_nl_BE.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_style.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_style.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_style.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_style.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl_BE.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl_BE.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl_BE.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl_BE.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl_BE.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl_BE.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_style_nl_BE.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_style_nl_BE.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl_BE.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl_BE.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl_BE.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl_BE.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl_BE.min.js b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl_BE.min.js similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/b_var_style_nl_BE.min.js rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/b_var_style_nl_BE.min.js diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/ContextRelativeResourceCachingTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/ContextRelativeResourceCachingTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/caching/ContextRelativeResourceCachingTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/ContextRelativeResourceCachingTest.java index 8e9544ecab6..ee3aab32f60 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/ContextRelativeResourceCachingTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/ContextRelativeResourceCachingTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource.caching; +package org.apache.wicket.core.request.resource.caching; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -31,6 +31,8 @@ import org.apache.wicket.request.resource.ContextRelativeResource; import org.apache.wicket.request.resource.ResourceReference; import org.apache.wicket.request.resource.SharedResourceReference; +import org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy; +import org.apache.wicket.request.resource.caching.IResourceCachingStrategy; import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.request.resource.caching.version.StaticResourceVersion; import org.apache.wicket.util.tester.WicketTestCase; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java index 21f807f2ef5..d2c8d80572a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/FilenameWithVersionResourceCachingStrategyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource.caching; +package org.apache.wicket.core.request.resource.caching; import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Duration; @@ -24,6 +24,9 @@ import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.request.resource.AbstractResource; +import org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy; +import org.apache.wicket.request.resource.caching.IResourceCachingStrategy; +import org.apache.wicket.request.resource.caching.ResourceUrl; import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion; import org.apache.wicket.util.tester.BaseWicketTester; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java index c0268d0d31f..d5d0ada0791 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/QueryStringWithVersionResourceCachingStrategyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource.caching; +package org.apache.wicket.core.request.resource.caching; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -26,6 +26,9 @@ import org.apache.wicket.request.mapper.parameter.INamedParameters; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.request.resource.AbstractResource; +import org.apache.wicket.request.resource.caching.IResourceCachingStrategy; +import org.apache.wicket.request.resource.caching.QueryStringWithVersionResourceCachingStrategy; +import org.apache.wicket.request.resource.caching.ResourceUrl; import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion; import org.apache.wicket.util.tester.BaseWicketTester; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/TestResource.java b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/TestResource.java similarity index 87% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/caching/TestResource.java rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/TestResource.java index e21b6aa14a2..de98a1b37ac 100644 --- a/wicket-core/src/test/java/org/apache/wicket/request/resource/caching/TestResource.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/caching/TestResource.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.request.resource.caching; +package org.apache.wicket.core.request.resource.caching; import java.io.Serializable; +import org.apache.wicket.request.resource.caching.IResourceCachingStrategy; +import org.apache.wicket.request.resource.caching.IStaticCacheableResource; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_en.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_en.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_en.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_en.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_en_US.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_en_US.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_en_US.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_en_US.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_gt_4096.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_gt_4096.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_gt_4096.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_gt_4096.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style2.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style2.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style2.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style2.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style2_pt.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style2_pt.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style2_pt.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style2_pt.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style2_pt_BR.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style2_pt_BR.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style2_pt_BR.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style2_pt_BR.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style_en.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style_en.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style_en.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style_en.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style_en_US.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style_en_US.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_style_en_US.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_style_en_US.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_en.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_en.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_en.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_en.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_en_US.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_en_US.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_en_US.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_en_US.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style2.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style2.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style2.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style2.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style2_pt.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style2_pt.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style2_pt.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style2_pt.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style2_pt_BR.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style2_pt_BR.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style2_pt_BR.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style2_pt_BR.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style_en.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style_en.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style_en.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style_en.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style_en_US.txt b/wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style_en_US.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/request/resource/resource_var_style_en_US.txt rename to wicket-core/src/test/java/org/apache/wicket/core/request/resource/resource_var_style_en_US.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/ExceptionTestBase.java b/wicket-core/src/test/java/org/apache/wicket/core/util/ExceptionTestBase.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/ExceptionTestBase.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/ExceptionTestBase.java index 05d22035821..d07375e9fff 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/ExceptionTestBase.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/ExceptionTestBase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util; +package org.apache.wicket.core.util; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/Log4jEventHistory.java b/wicket-core/src/test/java/org/apache/wicket/core/util/Log4jEventHistory.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/Log4jEventHistory.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/Log4jEventHistory.java index 8d87ea9119a..e7939ac0bed 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/Log4jEventHistory.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/Log4jEventHistory.java @@ -1,74 +1,74 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.log4j.AppenderSkeleton; -import org.apache.log4j.Level; -import org.apache.log4j.spi.LoggingEvent; - -/** - * Log the log4j messages for further assertions - * */ -class Log4jEventHistory extends AppenderSkeleton -{ - private List history = new ArrayList(); - - /** - * @return log history - */ - public List getHistory() - { - return history; - } - - @Override - public void close() - { - } - - @Override - public boolean requiresLayout() - { - return false; - } - - @Override - protected void append(LoggingEvent event) - { - history.add(event); - } - - /** - * @param level - * @param msg - * @return if this message was logged - */ - public boolean contains(Level level, String msg) - { - for (LoggingEvent event : history) - { - if (msg.equals(event.getMessage()) && level.equals(event.getLevel())) - { - return true; - } - } - return false; - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.log4j.AppenderSkeleton; +import org.apache.log4j.Level; +import org.apache.log4j.spi.LoggingEvent; + +/** + * Log the log4j messages for further assertions + * */ +class Log4jEventHistory extends AppenderSkeleton +{ + private List history = new ArrayList(); + + /** + * @return log history + */ + public List getHistory() + { + return history; + } + + @Override + public void close() + { + } + + @Override + public boolean requiresLayout() + { + return false; + } + + @Override + protected void append(LoggingEvent event) + { + history.add(event); + } + + /** + * @param level + * @param msg + * @return if this message was logged + */ + public boolean contains(Level level, String msg) + { + for (LoggingEvent event : history) + { + if (msg.equals(event.getMessage()) && level.equals(event.getLevel())) + { + return true; + } + } + return false; + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieUtilsTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieUtilsTest.java index 9dc3347327c..b350b2087b0 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieUtilsTest.java @@ -1,179 +1,180 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.cookies; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import javax.servlet.http.Cookie; - -import org.apache.wicket.Page; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.util.cookies.CookieValuePersisterTestPage.TestForm; -import org.apache.wicket.util.tester.WicketTestCase; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** - * - * @author Juergen Donnerstag - */ -class CookieUtilsTest extends WicketTestCase -{ - @BeforeEach - void before() - { - tester.startPage(CookieValuePersisterTestPage.class); - } - - /** - * - * @throws Exception - */ - @SuppressWarnings({ "unchecked" }) - @Test - void test1() throws Exception - { - // How does the test work: Make sure you have a page, form and form component properly set - // up (getRelativePath() etc.). See #before(). - final Page page = tester.getLastRenderedPage(); - - // Get the form and form component created - final TestForm form = (TestForm)page.get("form"); - final TextField textField = (TextField)form.get("input"); - - // Right after init, the requests and responses cookie lists must be empty - assertEquals(0, getRequestCookies().size()); - assertEquals(0, getResponseCookies().size()); - - // Create a persister for the test - final CookieUtils persister = new CookieUtils(); - - // See comment in CookieUtils on how removing a Cookies works. As no cookies in the request, - // no "delete" cookie will be added to the response. - persister.remove(textField); - assertEquals(0, getRequestCookies().size()); - assertEquals(0, getResponseCookies().size()); - - // Save the input field's value (add it to the response's cookie list) - persister.save(textField); - assertTrue(getRequestCookies().isEmpty()); - assertEquals(1, getResponseCookies().size()); - assertEquals("test", (getResponseCookies().get(0)).getValue()); - assertEquals("form.input", (getResponseCookies().get(0)).getName()); - assertEquals(tester.getRequest().getContextPath() + tester.getRequest().getServletPath(), - (getResponseCookies().get(0)).getPath()); - - // To remove a cookie means to add a cookie with maxAge=0. Provided a cookie with the same - // name has been provided in the request. Thus, no changes in our test case - persister.remove(textField); - assertEquals(0, getRequestCookies().size()); - assertEquals(1, getResponseCookies().size()); - assertEquals("test", (getResponseCookies().get(0)).getValue()); - assertEquals("form.input", (getResponseCookies().get(0)).getName()); - assertEquals(tester.getRequest().getContextPath() + tester.getRequest().getServletPath(), - (getResponseCookies().get(0)).getPath()); - - // Try to load it. Because there is no Cookie matching the textfield's name the model's - // value remains unchanged - persister.load(textField); - assertEquals("test", textField.getDefaultModelObjectAsString()); - - // Simulate loading a textfield. Initialize textfield with a new (default) value, copy the - // cookie from response to request (simulating a browser), than load the textfield from - // cookie and voala the textfield's value should change. - // save means: add it to the response - // load means: take it from request - assertEquals("test", textField.getDefaultModelObjectAsString()); - textField.setDefaultModelObject("new text"); - assertEquals("new text", textField.getDefaultModelObjectAsString()); - copyCookieFromResponseToRequest(); - assertEquals(1, getRequestCookies().size()); - assertEquals(1, getResponseCookies().size()); - - persister.load(textField); - assertEquals("test", textField.getDefaultModelObjectAsString()); - assertEquals(1, getRequestCookies().size()); - assertEquals(1, getResponseCookies().size()); - - // remove all cookies from mock response. Because I'll find the cookie to be removed in the - // request, the persister will create a "delete" cookie to remove the cookie on the client - // and add it to the response. The already existing Cookie from the previous test gets - // removed from response since it is the same. - persister.remove(textField); - assertEquals(1, getRequestCookies().size()); - assertEquals(1, getResponseCookies().size()); - assertEquals("form.input", (getResponseCookies().get(0)).getName()); - assertEquals(0, (getResponseCookies().get(0)).getMaxAge()); - } - - @Test - void saveLoadValue() - { - CookieUtils utils = new CookieUtils(); - String value1 = "value one"; - String key = "key"; - utils.save(key, value1); - before(); // execute a request cycle, so the response cookie is send with the next request - String result = utils.load(key); - assertEquals(value1, result); - } - - @Test - void defaults() - { - CookieDefaults defaults = new CookieDefaults(); - defaults.setComment("A comment"); - defaults.setDomain("A domain"); - defaults.setMaxAge(123); - defaults.setSecure(true); - defaults.setVersion(456); - CookieUtils utils = new CookieUtils(defaults); - String value1 = "value one"; - String key = "key"; - utils.save(key, value1); - before(); // execute a request cycle, so the response cookie is send with the next request - Cookie result = utils.getCookie(key); - assertEquals(defaults.getComment(), result.getComment()); - } - - private void copyCookieFromResponseToRequest() - { - tester.getRequest().addCookie(getResponseCookies().iterator().next()); - } - - private Collection getRequestCookies() - { - if (tester.getRequest().getCookies() == null) - { - return Collections.emptyList(); - } - else - { - return Arrays.asList(tester.getRequest().getCookies()); - } - } - - private List getResponseCookies() - { - return tester.getResponse().getCookies(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.cookies; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.servlet.http.Cookie; + +import org.apache.wicket.Page; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.util.cookies.CookieDefaults; +import org.apache.wicket.util.cookies.CookieUtils; +import org.apache.wicket.util.tester.WicketTestCase; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * + * @author Juergen Donnerstag + */ +class CookieUtilsTest extends WicketTestCase +{ + @BeforeEach + void before() + { + tester.startPage(CookieValuePersisterTestPage.class); + } + + /** + * + * @throws Exception + */ + @SuppressWarnings({ "unchecked" }) + @Test + void test1() throws Exception + { + // How does the test work: Make sure you have a page, form and form component properly set + // up (getRelativePath() etc.). See #before(). + final Page page = tester.getLastRenderedPage(); + + // Get the form and form component created + final CookieValuePersisterTestPage.TestForm form = (CookieValuePersisterTestPage.TestForm)page.get("form"); + final TextField textField = (TextField)form.get("input"); + + // Right after init, the requests and responses cookie lists must be empty + assertEquals(0, getRequestCookies().size()); + assertEquals(0, getResponseCookies().size()); + + // Create a persister for the test + final CookieUtils persister = new CookieUtils(); + + // See comment in CookieUtils on how removing a Cookies works. As no cookies in the request, + // no "delete" cookie will be added to the response. + persister.remove(textField); + assertEquals(0, getRequestCookies().size()); + assertEquals(0, getResponseCookies().size()); + + // Save the input field's value (add it to the response's cookie list) + persister.save(textField); + assertTrue(getRequestCookies().isEmpty()); + assertEquals(1, getResponseCookies().size()); + assertEquals("test", (getResponseCookies().get(0)).getValue()); + assertEquals("form.input", (getResponseCookies().get(0)).getName()); + assertEquals(tester.getRequest().getContextPath() + tester.getRequest().getServletPath(), + (getResponseCookies().get(0)).getPath()); + + // To remove a cookie means to add a cookie with maxAge=0. Provided a cookie with the same + // name has been provided in the request. Thus, no changes in our test case + persister.remove(textField); + assertEquals(0, getRequestCookies().size()); + assertEquals(1, getResponseCookies().size()); + assertEquals("test", (getResponseCookies().get(0)).getValue()); + assertEquals("form.input", (getResponseCookies().get(0)).getName()); + assertEquals(tester.getRequest().getContextPath() + tester.getRequest().getServletPath(), + (getResponseCookies().get(0)).getPath()); + + // Try to load it. Because there is no Cookie matching the textfield's name the model's + // value remains unchanged + persister.load(textField); + assertEquals("test", textField.getDefaultModelObjectAsString()); + + // Simulate loading a textfield. Initialize textfield with a new (default) value, copy the + // cookie from response to request (simulating a browser), than load the textfield from + // cookie and voala the textfield's value should change. + // save means: add it to the response + // load means: take it from request + assertEquals("test", textField.getDefaultModelObjectAsString()); + textField.setDefaultModelObject("new text"); + assertEquals("new text", textField.getDefaultModelObjectAsString()); + copyCookieFromResponseToRequest(); + assertEquals(1, getRequestCookies().size()); + assertEquals(1, getResponseCookies().size()); + + persister.load(textField); + assertEquals("test", textField.getDefaultModelObjectAsString()); + assertEquals(1, getRequestCookies().size()); + assertEquals(1, getResponseCookies().size()); + + // remove all cookies from mock response. Because I'll find the cookie to be removed in the + // request, the persister will create a "delete" cookie to remove the cookie on the client + // and add it to the response. The already existing Cookie from the previous test gets + // removed from response since it is the same. + persister.remove(textField); + assertEquals(1, getRequestCookies().size()); + assertEquals(1, getResponseCookies().size()); + assertEquals("form.input", (getResponseCookies().get(0)).getName()); + assertEquals(0, (getResponseCookies().get(0)).getMaxAge()); + } + + @Test + void saveLoadValue() + { + CookieUtils utils = new CookieUtils(); + String value1 = "value one"; + String key = "key"; + utils.save(key, value1); + before(); // execute a request cycle, so the response cookie is send with the next request + String result = utils.load(key); + assertEquals(value1, result); + } + + @Test + void defaults() + { + CookieDefaults defaults = new CookieDefaults(); + defaults.setComment("A comment"); + defaults.setDomain("A domain"); + defaults.setMaxAge(123); + defaults.setSecure(true); + defaults.setVersion(456); + CookieUtils utils = new CookieUtils(defaults); + String value1 = "value one"; + String key = "key"; + utils.save(key, value1); + before(); // execute a request cycle, so the response cookie is send with the next request + Cookie result = utils.getCookie(key); + assertEquals(defaults.getComment(), result.getComment()); + } + + private void copyCookieFromResponseToRequest() + { + tester.getRequest().addCookie(getResponseCookies().iterator().next()); + } + + private Collection getRequestCookies() + { + if (tester.getRequest().getCookies() == null) + { + return Collections.emptyList(); + } + else + { + return Arrays.asList(tester.getRequest().getCookies()); + } + } + + private List getResponseCookies() + { + return tester.getResponse().getCookies(); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieValuePersisterTestPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieValuePersisterTestPage.html similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieValuePersisterTestPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieValuePersisterTestPage.html index 35b562d4588..5b2d3cfe6dc 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieValuePersisterTestPage.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieValuePersisterTestPage.html @@ -1,26 +1,26 @@ - - - -

- -
- - - + + + +
+ +
+ + + diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieValuePersisterTestPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieValuePersisterTestPage.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieValuePersisterTestPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieValuePersisterTestPage.java index 91441620ad6..f62f939603c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieValuePersisterTestPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/CookieValuePersisterTestPage.java @@ -1,70 +1,70 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.cookies; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.markup.html.panel.FeedbackPanel; -import org.apache.wicket.model.Model; - - -/** - * Mock page for testing. - * - * @author Chris Turner - */ -public class CookieValuePersisterTestPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - /** - * Construct. - */ - public CookieValuePersisterTestPage() - { - // Create and add feedback panel to page - final FeedbackPanel feedback = new FeedbackPanel("feedback"); - add(feedback); - add(new TestForm("form")); - } - - /** - * - */ - public final class TestForm extends Form - { - private static final long serialVersionUID = 1L; - - /** - * Constructor - * - * @param id - * Name of form - */ - TestForm(final String id) - { - super(id); - add(new TextField("input", new Model("test"))); - } - - @Override - public final void onSubmit() - { - } - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.cookies; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.panel.FeedbackPanel; +import org.apache.wicket.model.Model; + + +/** + * Mock page for testing. + * + * @author Chris Turner + */ +public class CookieValuePersisterTestPage extends WebPage +{ + private static final long serialVersionUID = 1L; + + /** + * Construct. + */ + public CookieValuePersisterTestPage() + { + // Create and add feedback panel to page + final FeedbackPanel feedback = new FeedbackPanel("feedback"); + add(feedback); + add(new TestForm("form")); + } + + /** + * + */ + public final class TestForm extends Form + { + private static final long serialVersionUID = 1L; + + /** + * Constructor + * + * @param id + * Name of form + */ + TestForm(final String id) + { + super(id); + add(new TextField("input", new Model("test"))); + } + + @Override + public final void onSubmit() + { + } + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/PreserveRequestCookieAfterLinkClickTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/PreserveRequestCookieAfterLinkClickTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/PreserveRequestCookieAfterLinkClickTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/PreserveRequestCookieAfterLinkClickTest.java index fde9098cdbd..0621f495860 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/PreserveRequestCookieAfterLinkClickTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/PreserveRequestCookieAfterLinkClickTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.cookies; +package org.apache.wicket.core.util.cookies; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatefullTestPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatefullTestPage.html similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatefullTestPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatefullTestPage.html index 2406cfbf2b4..742e5869428 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatefullTestPage.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatefullTestPage.html @@ -1,26 +1,26 @@ - - - -
- - -
- - + + + +
+ + +
+ + diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatefullTestPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatefullTestPage.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatefullTestPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatefullTestPage.java index 0af469bb32d..1eb316f0650 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatefullTestPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatefullTestPage.java @@ -1,61 +1,62 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.cookies; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; - - -/** - * Stateful form page which sets a cookie and calls setResponsePage() - * - * @author Bertrand Guay-Paquet - */ -public class SetCookieAndRedirectStatefullTestPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - /** */ - private static final String cookieName = "CookieValuePersisterStatelessTestPage"; - - private IModel inputModel; - - /** - * Construct. - */ - public SetCookieAndRedirectStatefullTestPage() - { - inputModel = new Model(); - Form form = new Form("form") - { - private static final long serialVersionUID = 1L; - - @Override - protected void onSubmit() - { - CookieUtils utils = new CookieUtils(); - utils.save(cookieName, inputModel.getObject()); - setResponsePage(getApplication().getHomePage()); - } - }; - add(form); - form.add(new TextField("input", inputModel)); - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.cookies; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.util.cookies.CookieUtils; + + +/** + * Stateful form page which sets a cookie and calls setResponsePage() + * + * @author Bertrand Guay-Paquet + */ +public class SetCookieAndRedirectStatefullTestPage extends WebPage +{ + private static final long serialVersionUID = 1L; + + /** */ + private static final String cookieName = "CookieValuePersisterStatelessTestPage"; + + private IModel inputModel; + + /** + * Construct. + */ + public SetCookieAndRedirectStatefullTestPage() + { + inputModel = new Model(); + Form form = new Form("form") + { + private static final long serialVersionUID = 1L; + + @Override + protected void onSubmit() + { + CookieUtils utils = new CookieUtils(); + utils.save(cookieName, inputModel.getObject()); + setResponsePage(getApplication().getHomePage()); + } + }; + add(form); + form.add(new TextField("input", inputModel)); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatelessTestPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatelessTestPage.html similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatelessTestPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatelessTestPage.html index 2406cfbf2b4..742e5869428 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatelessTestPage.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatelessTestPage.html @@ -1,26 +1,26 @@ - - - -
- - -
- - + + + +
+ + +
+ + diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatelessTestPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatelessTestPage.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatelessTestPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatelessTestPage.java index 665bd9d67f8..57ed2adae6d 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectStatelessTestPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectStatelessTestPage.java @@ -1,62 +1,63 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.cookies; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.form.StatelessForm; -import org.apache.wicket.markup.html.form.TextField; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; - - -/** - * Stateless form page which sets a cookie and calls setResponsePage() - * - * @author Bertrand Guay-Paquet - */ -public class SetCookieAndRedirectStatelessTestPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - /** */ - private static final String cookieName = "CookieValuePersisterStatelessTestPage"; - - private IModel inputModel; - - /** - * Construct. - */ - public SetCookieAndRedirectStatelessTestPage() - { - inputModel = new Model(); - Form form = new StatelessForm("form") - { - private static final long serialVersionUID = 1L; - - @Override - protected void onSubmit() - { - CookieUtils utils = new CookieUtils(); - utils.save(cookieName, inputModel.getObject()); - setResponsePage(getApplication().getHomePage()); - } - }; - add(form); - form.add(new TextField("input", inputModel)); - } -} \ No newline at end of file +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.cookies; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.StatelessForm; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.util.cookies.CookieUtils; + + +/** + * Stateless form page which sets a cookie and calls setResponsePage() + * + * @author Bertrand Guay-Paquet + */ +public class SetCookieAndRedirectStatelessTestPage extends WebPage +{ + private static final long serialVersionUID = 1L; + + /** */ + private static final String cookieName = "CookieValuePersisterStatelessTestPage"; + + private IModel inputModel; + + /** + * Construct. + */ + public SetCookieAndRedirectStatelessTestPage() + { + inputModel = new Model(); + Form form = new StatelessForm("form") + { + private static final long serialVersionUID = 1L; + + @Override + protected void onSubmit() + { + CookieUtils utils = new CookieUtils(); + utils.save(cookieName, inputModel.getObject()); + setResponsePage(getApplication().getHomePage()); + } + }; + add(form); + form.add(new TextField("input", inputModel)); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectTest.java index 4429c0cbb74..e0ac5c15d25 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/SetCookieAndRedirectTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/cookies/SetCookieAndRedirectTest.java @@ -1,71 +1,71 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.cookies; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.List; -import javax.servlet.http.Cookie; - -import org.apache.wicket.Page; -import org.apache.wicket.util.tester.FormTester; -import org.apache.wicket.util.tester.WicketTestCase; -import org.junit.jupiter.api.Test; - -/** - * Tests setting a cookie and calling setResponsePage() in the same request. - * - * @author Bertrand Guay-Paquet - */ -class SetCookieAndRedirectTest extends WicketTestCase -{ - private static final String cookieValue = "cookieValue"; - - /** - * Validate proper cookie value set with stateful page - */ - @Test - void statefulPage() - { - tester.startPage(SetCookieAndRedirectStatefullTestPage.class); - FormTester formTester = tester.newFormTester("form"); - formTester.setValue("input", cookieValue); - formTester.submit(); - Page page = tester.getLastRenderedPage(); - - List cookies = tester.getLastResponse().getCookies(); - assertEquals(1, cookies.size()); - assertEquals(cookieValue, cookies.get(0).getValue()); - } - - /** - * Validate proper cookie value set with stateless page - */ - @Test - void statelessPage() - { - tester.startPage(SetCookieAndRedirectStatelessTestPage.class); - FormTester formTester = tester.newFormTester("form"); - formTester.setValue("input", cookieValue); - formTester.submit(); - Page page = tester.getLastRenderedPage(); - - List cookies = tester.getLastResponse().getCookies(); - assertEquals(1, cookies.size()); - assertEquals(cookieValue, cookies.get(0).getValue()); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.cookies; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.List; +import javax.servlet.http.Cookie; + +import org.apache.wicket.Page; +import org.apache.wicket.util.tester.FormTester; +import org.apache.wicket.util.tester.WicketTestCase; +import org.junit.jupiter.api.Test; + +/** + * Tests setting a cookie and calling setResponsePage() in the same request. + * + * @author Bertrand Guay-Paquet + */ +class SetCookieAndRedirectTest extends WicketTestCase +{ + private static final String cookieValue = "cookieValue"; + + /** + * Validate proper cookie value set with stateful page + */ + @Test + void statefulPage() + { + tester.startPage(SetCookieAndRedirectStatefullTestPage.class); + FormTester formTester = tester.newFormTester("form"); + formTester.setValue("input", cookieValue); + formTester.submit(); + Page page = tester.getLastRenderedPage(); + + List cookies = tester.getLastResponse().getCookies(); + assertEquals(1, cookies.size()); + assertEquals(cookieValue, cookies.get(0).getValue()); + } + + /** + * Validate proper cookie value set with stateless page + */ + @Test + void statelessPage() + { + tester.startPage(SetCookieAndRedirectStatelessTestPage.class); + FormTester formTester = tester.newFormTester("form"); + formTester.setValue("input", cookieValue); + formTester.submit(); + Page page = tester.getLastRenderedPage(); + + List cookies = tester.getLastResponse().getCookies(); + assertEquals(1, cookies.size()); + assertEquals(cookieValue, cookies.get(0).getValue()); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/file/WebApplicationPathTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/file/WebApplicationPathTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/file/WebApplicationPathTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/file/WebApplicationPathTest.java index 81c288e4d7a..a35e0bc4960 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/file/WebApplicationPathTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/file/WebApplicationPathTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.file; +package org.apache.wicket.core.util.file; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -22,7 +22,6 @@ import java.net.URL; import javax.servlet.ServletContext; -import org.apache.wicket.core.util.file.WebApplicationPath; import org.apache.wicket.util.resource.IResourceStream; import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatchers; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/io/PageA.java b/wicket-core/src/test/java/org/apache/wicket/core/util/io/PageA.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/io/PageA.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/io/PageA.java index a62d3852dda..a7a7806a955 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/io/PageA.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/io/PageA.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.io; +package org.apache.wicket.core.util.io; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.request.http.WebResponse; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/io/PageB.java b/wicket-core/src/test/java/org/apache/wicket/core/util/io/PageB.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/io/PageB.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/io/PageB.java index d4170be1eb6..a19797d2f76 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/io/PageB.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/io/PageB.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.io; +package org.apache.wicket.core.util.io; import org.apache.wicket.markup.html.WebPage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/io/SerializableCheckerTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/io/SerializableCheckerTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/io/SerializableCheckerTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/io/SerializableCheckerTest.java index 8e7d3e1a24a..cee0e250ea2 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/io/SerializableCheckerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/io/SerializableCheckerTest.java @@ -1,165 +1,166 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.io; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.Serializable; - -import org.apache.wicket.core.util.objects.checker.AbstractObjectChecker; -import org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream; -import org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker; -import org.apache.wicket.util.value.ValueMap; -import org.junit.jupiter.api.Test; - -/** - * @author Pedro Santos - */ -class SerializableCheckerTest -{ - - /** - * Test {@link ValueMap} serializability. - * - * @throws IOException - */ - @Test - void valueMap() throws IOException - { - CheckingObjectOutputStream checker = new CheckingObjectOutputStream( - new ByteArrayOutputStream(), - new ObjectSerializationChecker(new NotSerializableException())); - checker.writeObject(new ValueMap()); - } - - /** - * Asserts that {@link org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream} - * will check an instance just once, despite it occurs more than once in the object tree - * - * https://issues.apache.org/jira/browse/WICKET-5642 - * - * @throws IOException - */ - @Test - void checkObjectsByIdentity() throws IOException - { - CountingChecker countingChecker = new CountingChecker(); - CheckingObjectOutputStream outputStream = new CheckingObjectOutputStream( - new ByteArrayOutputStream(), countingChecker); - final IdentityTestType type = new IdentityTestType(); - type.member = new SerializableTypeWithMember(type); - outputStream.writeObject(type); - - assertEquals(2, countingChecker.getCount()); - } - - /** - * @throws IOException - */ - @Test - void nonSerializableTypeDetection() throws IOException - { - CheckingObjectOutputStream checker = new CheckingObjectOutputStream( - new ByteArrayOutputStream(), - new ObjectSerializationChecker(new NotSerializableException())); - String exceptionMessage = null; - try - { - checker.writeObject(new TestType2()); - } - catch (CheckingObjectOutputStream.ObjectCheckException e) - { - exceptionMessage = e.getMessage(); - } - assertTrue(exceptionMessage.contains(NonSerializableType.class.getName())); - } - - private static class CountingChecker extends AbstractObjectChecker - { - private int count = 0; - - @Override - public Result check(Object object) - { - count++; - return super.check(object); - } - - private int getCount() - { - return count; - } - } - - private static class SerializableTypeWithMember extends SerializableType - { - private final IdentityTestType member; - - private SerializableTypeWithMember(IdentityTestType member) - { - this.member = member; - } - } - - private static class IdentityTestType implements Serializable - { - private static final long serialVersionUID = 1L; - - private SerializableType member; - - @Override - public boolean equals(Object obj) - { - return false; - } - } - - private static class TestType2 implements Serializable - { - private static final long serialVersionUID = 1L; - ProblematicType problematicType = new ProblematicType(); - SerializableType serializableType = new SerializableType(); - NonSerializableType nonSerializable = new NonSerializableType(); - } - - private static class NonSerializableType - { - } - - private static class SerializableType implements Serializable - { - private static final long serialVersionUID = 1L; - } - private static class TestException extends RuntimeException - { - private static final long serialVersionUID = 1L; - - } - private static class ProblematicType implements Serializable - { - private static final long serialVersionUID = 1L; - - @Override - public boolean equals(Object obj) - { - throw new TestException(); - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.io; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.io.NotSerializableException; +import java.io.Serializable; + +import org.apache.wicket.core.util.objects.checker.AbstractObjectChecker; +import org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream; +import org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker; +import org.apache.wicket.util.io.ByteArrayOutputStream; +import org.apache.wicket.util.value.ValueMap; +import org.junit.jupiter.api.Test; + +/** + * @author Pedro Santos + */ +class SerializableCheckerTest +{ + + /** + * Test {@link ValueMap} serializability. + * + * @throws IOException + */ + @Test + void valueMap() throws IOException + { + CheckingObjectOutputStream checker = new CheckingObjectOutputStream( + new ByteArrayOutputStream(), + new ObjectSerializationChecker(new NotSerializableException())); + checker.writeObject(new ValueMap()); + } + + /** + * Asserts that {@link org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream} + * will check an instance just once, despite it occurs more than once in the object tree + * + * https://issues.apache.org/jira/browse/WICKET-5642 + * + * @throws IOException + */ + @Test + void checkObjectsByIdentity() throws IOException + { + CountingChecker countingChecker = new CountingChecker(); + CheckingObjectOutputStream outputStream = new CheckingObjectOutputStream( + new ByteArrayOutputStream(), countingChecker); + final IdentityTestType type = new IdentityTestType(); + type.member = new SerializableTypeWithMember(type); + outputStream.writeObject(type); + + assertEquals(2, countingChecker.getCount()); + } + + /** + * @throws IOException + */ + @Test + void nonSerializableTypeDetection() throws IOException + { + CheckingObjectOutputStream checker = new CheckingObjectOutputStream( + new ByteArrayOutputStream(), + new ObjectSerializationChecker(new NotSerializableException())); + String exceptionMessage = null; + try + { + checker.writeObject(new TestType2()); + } + catch (CheckingObjectOutputStream.ObjectCheckException e) + { + exceptionMessage = e.getMessage(); + } + assertTrue(exceptionMessage.contains(NonSerializableType.class.getName())); + } + + private static class CountingChecker extends AbstractObjectChecker + { + private int count = 0; + + @Override + public Result check(Object object) + { + count++; + return super.check(object); + } + + private int getCount() + { + return count; + } + } + + private static class SerializableTypeWithMember extends SerializableType + { + private final IdentityTestType member; + + private SerializableTypeWithMember(IdentityTestType member) + { + this.member = member; + } + } + + private static class IdentityTestType implements Serializable + { + private static final long serialVersionUID = 1L; + + private SerializableType member; + + @Override + public boolean equals(Object obj) + { + return false; + } + } + + private static class TestType2 implements Serializable + { + private static final long serialVersionUID = 1L; + ProblematicType problematicType = new ProblematicType(); + SerializableType serializableType = new SerializableType(); + NonSerializableType nonSerializable = new NonSerializableType(); + } + + private static class NonSerializableType + { + } + + private static class SerializableType implements Serializable + { + private static final long serialVersionUID = 1L; + } + private static class TestException extends RuntimeException + { + private static final long serialVersionUID = 1L; + + } + private static class ProblematicType implements Serializable + { + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object obj) + { + throw new TestException(); + } + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/Address.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Address.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/Address.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/Address.java index c6da5a1f787..a9027d17506 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/Address.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Address.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; /** * @author jcompagner diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/BooleanBean.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/BooleanBean.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/BooleanBean.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/BooleanBean.java index 63e8a93871f..53550ba1c49 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/BooleanBean.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/BooleanBean.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; /** * Bean for {@link PropertyResolverTest#booleanVsBoolean()} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/Country.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Country.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/Country.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/Country.java index 561af073026..17133fe5f73 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/Country.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Country.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; /** * @author jcompagner diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/Country2.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Country2.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/Country2.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/Country2.java index 04ffbad6dfb..5dbc1d16eec 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/Country2.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Country2.java @@ -1,47 +1,47 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.lang; - -/** - * @author jcompagner - */ -class Country2 extends Country -{ - - private final Country country; - - /** - * Construct. - * - * @param name - * @param country - */ - public Country2(String name, Country country) - { - super(name); - this.country = country; - } - - /** - * @return Country - */ - public Country getSubCountry() - { - return country; - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.lang; + +/** + * @author jcompagner + */ +class Country2 extends Country +{ + + private final Country country; + + /** + * Construct. + * + * @param name + * @param country + */ + public Country2(String name, Country country) + { + super(name); + this.country = country; + } + + /** + * @return Country + */ + public Country getSubCountry() + { + return country; + } + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/Document.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Document.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/Document.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/Document.java index 1b59337c998..6cefe56efd1 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/Document.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Document.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; import java.util.HashMap; import java.util.Map; @@ -41,4 +41,4 @@ public T getProperty(String name) { public void setProperty(String name, T t) { values.put(name, t); } -} \ No newline at end of file +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/Person.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Person.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/Person.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/Person.java index 3c546ce5bd3..6afa959e3d1 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/Person.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Person.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; import java.util.ArrayList; import java.util.List; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/Person2.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Person2.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/Person2.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/Person2.java index fcfc1c5173c..00966f53739 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/Person2.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/Person2.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; /** * @author jcompagner diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/PropertyResolverTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyResolverTest.java similarity index 99% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/PropertyResolverTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyResolverTest.java index 6291557b6d8..c61dff13dbc 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/PropertyResolverTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/PropertyResolverTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -39,13 +39,11 @@ import org.apache.wicket.ConverterLocator; import org.apache.wicket.IConverterLocator; import org.apache.wicket.WicketRuntimeException; -import org.apache.wicket.core.util.lang.PropertyResolver; import org.apache.wicket.core.util.lang.PropertyResolver.AbstractGetAndSet; import org.apache.wicket.core.util.lang.PropertyResolver.CachingPropertyLocator; import org.apache.wicket.core.util.lang.PropertyResolver.DefaultPropertyLocator; import org.apache.wicket.core.util.lang.PropertyResolver.IGetAndSet; import org.apache.wicket.core.util.lang.PropertyResolver.IPropertyLocator; -import org.apache.wicket.core.util.lang.PropertyResolverConverter; import org.apache.wicket.util.convert.ConversionException; import org.apache.wicket.util.convert.IConverter; import org.apache.wicket.util.convert.converter.AbstractConverter; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/lang/WicketObjectsTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/WicketObjectsTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/lang/WicketObjectsTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/lang/WicketObjectsTest.java index 00f491963d3..fcd5d695af4 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/lang/WicketObjectsTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/lang/WicketObjectsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.lang; +package org.apache.wicket.core.util.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/markup/xhtml/WellFormedXmlTest.java similarity index 90% rename from wicket-core/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/markup/xhtml/WellFormedXmlTest.java index 26cfc9d1768..fe2b182598e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/markup/xhtml/WellFormedXmlTest.java @@ -1,34 +1,35 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.markup.xhtml; - -import org.junit.jupiter.api.Test; - -/** - * Checks that the html markup files are well formed xml-s. - * - * @author akiraly - */ -class WellFormedXmlTest extends WellFormedXmlTestCase -{ - @Test - @Override - public void markupFiles() - { - super.markupFiles(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.markup.xhtml; + +import org.apache.wicket.util.markup.xhtml.WellFormedXmlTestCase; +import org.junit.jupiter.api.Test; + +/** + * Checks that the html markup files are well formed xml-s. + * + * @author akiraly + */ +class WellFormedXmlTest extends WellFormedXmlTestCase +{ + @Test + @Override + public void markupFiles() + { + super.markupFiles(); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ClassPathResourceFinderTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ClassPathResourceFinderTest.java index 74044f8bd7d..4f1a710fd77 100644 --- a/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ClassPathResourceFinderTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ClassPathResourceFinderTest.java @@ -16,7 +16,7 @@ */ package org.apache.wicket.core.util.resource; -import static org.apache.wicket.util.resource.ResourceStreamLocatorTest.getFilename; +import static org.apache.wicket.core.util.resource.ResourceStreamLocatorTest.getFilename; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/PathTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/PathTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/PathTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/PathTest.java index 44d8f90a564..7535a529338 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/resource/PathTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/PathTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.resource; +package org.apache.wicket.core.util.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -28,6 +28,8 @@ import java.util.Arrays; import org.apache.wicket.util.file.Path; +import org.apache.wicket.util.resource.IResourceStream; +import org.apache.wicket.util.resource.ResourceStreamNotFoundException; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest.java index 80ae8332331..cb9a7242f6c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.resource; +package org.apache.wicket.core.util.resource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -31,6 +31,8 @@ import org.apache.wicket.core.util.resource.locator.IResourceStreamLocator; import org.apache.wicket.core.util.resource.locator.ResourceStreamLocator; import org.apache.wicket.util.file.IResourceFinder; +import org.apache.wicket.util.resource.FileResourceStream; +import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.string.Strings; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de_DE.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de_DE.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de_DE.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de_DE.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de_DE_POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de_DE_POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de_DE_POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de_DE_POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de__POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de__POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_de__POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_de__POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_fr.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_fr.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_fr.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_fr.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de_DE.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de_DE.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de_DE.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de_DE.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de_DE_POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de_DE_POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de_DE_POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de_DE_POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de__POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de__POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/ResourceStreamLocatorTest_style_de__POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/ResourceStreamLocatorTest_style_de__POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/UrlResourceStreamTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/UrlResourceStreamTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/UrlResourceStreamTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/UrlResourceStreamTest.java index b724dd49650..60829c9b05d 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/resource/UrlResourceStreamTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/UrlResourceStreamTest.java @@ -1,147 +1,147 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.resource; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLStreamHandler; -import java.util.concurrent.atomic.AtomicInteger; - -import org.apache.wicket.core.util.resource.UrlResourceStream; -import org.apache.wicket.util.lang.Bytes; -import org.junit.jupiter.api.Test; - -/** - * @author Kent Tong - */ -class UrlResourceStreamTest { - /** - * lastModified() shouldn't change the content length if the file isn't really changed. - * - * @throws IOException - */ - @Test - void lastModifiedForResourceInJar() throws IOException { - String anyClassInJarFile = "/java/lang/String.class"; - URL url = getClass().getResource(anyClassInJarFile); - UrlResourceStream stream = new UrlResourceStream(url); - Bytes length = stream.length(); - stream.lastModifiedTime(); - assertEquals(stream.length(), length); - stream.close(); - } - - /** - * Verifies that a connection is opened just once but each #getInputStream() opens a new one - * and all input streams are closed with UrlResourceStream#close() - * - * https://issues.apache.org/jira/browse/WICKET-3176 - * https://issues.apache.org/jira/browse/WICKET-4293 - * - * @throws IOException - * @throws ResourceStreamNotFoundException - */ - @Test - void loadJustOnce() throws IOException, ResourceStreamNotFoundException { - String anyClassInJarFile = "/java/lang/String.class"; - URL realURL = getClass().getResource(anyClassInJarFile); - - final AtomicInteger connectCounter = new AtomicInteger(0); - final AtomicInteger streamCounter = new AtomicInteger(0); - URL url = new URL(null, "test://anything", new CountingURLStreamHandler(realURL, - connectCounter, streamCounter)); - - UrlResourceStream countingStream = new UrlResourceStream(url); - - // assert the call is not made yet - assertEquals(0, connectCounter.get()); - assertEquals(0, streamCounter.get()); - - // assert the connection is loaded lazily - countingStream.length(); - assertEquals(1, connectCounter.get()); - assertEquals(0, streamCounter.get()); - - // assert the following calls do not make new connections - countingStream.getInputStream(); - assertEquals(1, connectCounter.get()); - assertEquals(1, streamCounter.get()); - countingStream.getContentType(); - assertEquals(1, connectCounter.get()); - assertEquals(1, streamCounter.get()); - countingStream.getInputStream(); - assertEquals(1, connectCounter.get()); - assertEquals(2, streamCounter.get()); - countingStream.close(); - - assertEquals(1, connectCounter.get()); - assertEquals(2, streamCounter.get()); - - // assert the connection is re-opened (again lazily) second time, - // but stream is not re-opened yet - countingStream.length(); - - assertEquals(2, connectCounter.get()); - assertEquals(2, streamCounter.get()); - - // assert stream is re-opened on next getInputStream call - countingStream.getInputStream(); - assertEquals(2, connectCounter.get()); - assertEquals(3, streamCounter.get()); - } - - - /** - * {@link URLStreamHandler} that counts the calls to {@link URL#openConnection()} - */ - private static final class CountingURLStreamHandler extends URLStreamHandler { - private final AtomicInteger connectCounter, streamCounter; - - private final URL realURL; - - CountingURLStreamHandler(URL realURL, AtomicInteger connectCounter, - AtomicInteger streamCounter) { - this.connectCounter = connectCounter; - this.streamCounter = streamCounter; - this.realURL = realURL; - } - - @Override - protected URLConnection openConnection(URL u) throws IOException { - connectCounter.getAndIncrement(); - - final URLConnection realConn = realURL.openConnection(); - return new URLConnection(u) { - - @Override - public void connect() throws IOException { - realConn.connect(); - } - - @Override - public InputStream getInputStream() throws IOException { - streamCounter.incrementAndGet(); - return realConn.getInputStream(); - } - }; - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.resource; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.wicket.util.lang.Bytes; +import org.apache.wicket.util.resource.ResourceStreamNotFoundException; +import org.junit.jupiter.api.Test; + +/** + * @author Kent Tong + */ +class UrlResourceStreamTest { + /** + * lastModified() shouldn't change the content length if the file isn't really changed. + * + * @throws IOException + */ + @Test + void lastModifiedForResourceInJar() throws IOException { + String anyClassInJarFile = "/java/lang/String.class"; + URL url = getClass().getResource(anyClassInJarFile); + UrlResourceStream stream = new UrlResourceStream(url); + Bytes length = stream.length(); + stream.lastModifiedTime(); + assertEquals(stream.length(), length); + stream.close(); + } + + /** + * Verifies that a connection is opened just once but each #getInputStream() opens a new one + * and all input streams are closed with UrlResourceStream#close() + * + * https://issues.apache.org/jira/browse/WICKET-3176 + * https://issues.apache.org/jira/browse/WICKET-4293 + * + * @throws IOException + * @throws ResourceStreamNotFoundException + */ + @Test + void loadJustOnce() throws IOException, ResourceStreamNotFoundException { + String anyClassInJarFile = "/java/lang/String.class"; + URL realURL = getClass().getResource(anyClassInJarFile); + + final AtomicInteger connectCounter = new AtomicInteger(0); + final AtomicInteger streamCounter = new AtomicInteger(0); + URL url = new URL(null, "test://anything", new CountingURLStreamHandler(realURL, + connectCounter, streamCounter)); + + UrlResourceStream countingStream = new UrlResourceStream(url); + + // assert the call is not made yet + assertEquals(0, connectCounter.get()); + assertEquals(0, streamCounter.get()); + + // assert the connection is loaded lazily + countingStream.length(); + assertEquals(1, connectCounter.get()); + assertEquals(0, streamCounter.get()); + + // assert the following calls do not make new connections + countingStream.getInputStream(); + assertEquals(1, connectCounter.get()); + assertEquals(1, streamCounter.get()); + countingStream.getContentType(); + assertEquals(1, connectCounter.get()); + assertEquals(1, streamCounter.get()); + countingStream.getInputStream(); + assertEquals(1, connectCounter.get()); + assertEquals(2, streamCounter.get()); + countingStream.close(); + + assertEquals(1, connectCounter.get()); + assertEquals(2, streamCounter.get()); + + // assert the connection is re-opened (again lazily) second time, + // but stream is not re-opened yet + countingStream.length(); + + assertEquals(2, connectCounter.get()); + assertEquals(2, streamCounter.get()); + + // assert stream is re-opened on next getInputStream call + countingStream.getInputStream(); + assertEquals(2, connectCounter.get()); + assertEquals(3, streamCounter.get()); + } + + + /** + * {@link URLStreamHandler} that counts the calls to {@link URL#openConnection()} + */ + private static final class CountingURLStreamHandler extends URLStreamHandler { + private final AtomicInteger connectCounter, streamCounter; + + private final URL realURL; + + CountingURLStreamHandler(URL realURL, AtomicInteger connectCounter, + AtomicInteger streamCounter) { + this.connectCounter = connectCounter; + this.streamCounter = streamCounter; + this.realURL = realURL; + } + + @Override + protected URLConnection openConnection(URL u) throws IOException { + connectCounter.getAndIncrement(); + + final URLConnection realConn = realURL.openConnection(); + return new URLConnection(u) { + + @Override + public void connect() throws IOException { + realConn.connect(); + } + + @Override + public InputStream getInputStream() throws IOException { + streamCounter.incrementAndGet(); + return realConn.getInputStream(); + } + }; + } + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/locator/CachingResourceStreamLocatorTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/locator/CachingResourceStreamLocatorTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/locator/CachingResourceStreamLocatorTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/locator/CachingResourceStreamLocatorTest.java index 825d92ab4f0..fd15e29cb3c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/resource/locator/CachingResourceStreamLocatorTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/locator/CachingResourceStreamLocatorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.resource.locator; +package org.apache.wicket.core.util.resource.locator; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -30,8 +30,6 @@ import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; import org.apache.wicket.core.util.resource.ClassPathResourceFinder; import org.apache.wicket.core.util.resource.UrlResourceStream; -import org.apache.wicket.core.util.resource.locator.IResourceStreamLocator; -import org.apache.wicket.core.util.resource.locator.ResourceStreamLocator; import org.apache.wicket.core.util.resource.locator.caching.CachingResourceStreamLocator; import org.apache.wicket.util.resource.FileResourceStream; import org.apache.wicket.util.resource.IResourceStream; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/locator/ResourceNameIteratorTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/locator/ResourceNameIteratorTest.java similarity index 90% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/locator/ResourceNameIteratorTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/locator/ResourceNameIteratorTest.java index 0212315d68b..487c19a8e15 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/resource/locator/ResourceNameIteratorTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/locator/ResourceNameIteratorTest.java @@ -1,183 +1,179 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.resource.locator; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Locale; - -import org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator; -import org.apache.wicket.core.util.resource.locator.LocaleResourceNameIterator; -import org.apache.wicket.core.util.resource.locator.ResourceNameIterator; -import org.apache.wicket.core.util.resource.locator.StyleAndVariationResourceNameIterator; -import org.apache.wicket.util.tester.WicketTestCase; -import org.junit.jupiter.api.Test; - -/** - * @author Pedro Santos - */ -class ResourceNameIteratorTest extends WicketTestCase -{ - /** - * Asserting no duplicated locale sufix get iterated - */ - @Test - void localeResourceNameIterator() - { - Locale locale = new Locale("a", "b", "c"); - LocaleResourceNameIterator iterator = new LocaleResourceNameIterator(locale, false); - HashSet variations = new HashSet(); - while (iterator.hasNext()) - { - assertTrue(variations.add(iterator.next())); - } - assertEquals(4, variations.size()); - assertTrue(variations.contains("_a_B_c")); - assertTrue(variations.contains("_a_B")); - assertTrue(variations.contains("_a")); - assertTrue(variations.contains("")); - - locale = new Locale("a", "b"); - iterator = new LocaleResourceNameIterator(locale, false); - variations = new HashSet(); - while (iterator.hasNext()) - { - assertTrue(variations.add(iterator.next())); - } - assertEquals(3, variations.size()); - assertTrue(variations.contains("_a_B")); - assertTrue(variations.contains("_a")); - assertTrue(variations.contains("")); - - locale = new Locale("a"); - iterator = new LocaleResourceNameIterator(locale, false); - variations = new HashSet(); - while (iterator.hasNext()) - { - assertTrue(variations.add(iterator.next())); - } - assertEquals(2, variations.size()); - assertTrue(variations.contains("_a")); - assertTrue(variations.contains("")); - } - - /** - * - */ - @Test - void styleAndVariationResourceNameIterator() - { - StyleAndVariationResourceNameIterator iterator = new StyleAndVariationResourceNameIterator( - null, null); - assertTrue(iterator.hasNext()); - iterator.next(); - assertFalse(iterator.hasNext()); - - iterator = new StyleAndVariationResourceNameIterator("style", null); - assertTrue(iterator.hasNext()); - iterator.next(); - assertEquals("style", iterator.getStyle()); - assertEquals(null, iterator.getVariation()); - iterator.next(); - assertEquals(null, iterator.getStyle()); - assertEquals(null, iterator.getVariation()); - assertFalse(iterator.hasNext()); - - iterator = new StyleAndVariationResourceNameIterator("style", "variation"); - assertTrue(iterator.hasNext()); - iterator.next(); - assertEquals("style", iterator.getStyle()); - assertEquals("variation", iterator.getVariation()); - iterator.next(); - assertEquals("style", iterator.getStyle()); - assertEquals(null, iterator.getVariation()); - iterator.next(); - assertEquals(null, iterator.getStyle()); - assertEquals("variation", iterator.getVariation()); - iterator.next(); - assertEquals(null, iterator.getStyle()); - assertEquals(null, iterator.getVariation()); - assertFalse(iterator.hasNext()); - } - - /** - * - */ - @Test - void extensionResourceNameIterator() - { - ExtensionResourceNameIterator iterator = new ExtensionResourceNameIterator(null); - assertTrue(iterator.hasNext()); - assertEquals(null, iterator.next()); - assertFalse(iterator.hasNext()); - - iterator = new ExtensionResourceNameIterator(Arrays.asList("txt")); - assertTrue(iterator.hasNext()); - assertEquals("txt", iterator.next()); - assertFalse(iterator.hasNext()); - - iterator = new ExtensionResourceNameIterator(Arrays.asList("properties", "utf8.properties", "properties.xml")); - assertTrue(iterator.hasNext()); - assertEquals("properties", iterator.next()); - assertTrue(iterator.hasNext()); - assertEquals("utf8.properties", iterator.next()); - assertTrue(iterator.hasNext()); - assertEquals("properties.xml", iterator.next()); - assertFalse(iterator.hasNext()); - } - - /** - * - */ - @Test - void noDuplicateVariations() - { - String path = "patch.extension"; - String style = null; - String var = "var"; - Locale locale = Locale.CANADA_FRENCH; - Iterable extensions = null; - boolean strict = false; - Iterator iterator = new ResourceNameIterator(path, style, var, locale, extensions, strict); - HashSet variations = new HashSet(); - while (iterator.hasNext()) - { - assertTrue(variations.add(iterator.next())); - } - assertEquals(6, variations.size()); - } - - /** - * - */ - @Test - void noTrailingDotWhenNoExtension() - { - Iterator iterator = new ResourceNameIterator("foo", null, null, null, null, false); - - assertTrue(iterator.hasNext()); - - assertEquals("foo", iterator.next()); - - assertFalse(iterator.hasNext()); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.resource.locator; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.wicket.util.tester.WicketTestCase; +import org.junit.jupiter.api.Test; + +/** + * @author Pedro Santos + */ +class ResourceNameIteratorTest extends WicketTestCase +{ + /** + * Asserting no duplicated locale sufix get iterated + */ + @Test + void localeResourceNameIterator() + { + Locale locale = new Locale("a", "b", "c"); + LocaleResourceNameIterator iterator = new LocaleResourceNameIterator(locale, false); + HashSet variations = new HashSet(); + while (iterator.hasNext()) + { + assertTrue(variations.add(iterator.next())); + } + assertEquals(4, variations.size()); + assertTrue(variations.contains("_a_B_c")); + assertTrue(variations.contains("_a_B")); + assertTrue(variations.contains("_a")); + assertTrue(variations.contains("")); + + locale = new Locale("a", "b"); + iterator = new LocaleResourceNameIterator(locale, false); + variations = new HashSet(); + while (iterator.hasNext()) + { + assertTrue(variations.add(iterator.next())); + } + assertEquals(3, variations.size()); + assertTrue(variations.contains("_a_B")); + assertTrue(variations.contains("_a")); + assertTrue(variations.contains("")); + + locale = new Locale("a"); + iterator = new LocaleResourceNameIterator(locale, false); + variations = new HashSet(); + while (iterator.hasNext()) + { + assertTrue(variations.add(iterator.next())); + } + assertEquals(2, variations.size()); + assertTrue(variations.contains("_a")); + assertTrue(variations.contains("")); + } + + /** + * + */ + @Test + void styleAndVariationResourceNameIterator() + { + StyleAndVariationResourceNameIterator iterator = new StyleAndVariationResourceNameIterator( + null, null); + assertTrue(iterator.hasNext()); + iterator.next(); + assertFalse(iterator.hasNext()); + + iterator = new StyleAndVariationResourceNameIterator("style", null); + assertTrue(iterator.hasNext()); + iterator.next(); + assertEquals("style", iterator.getStyle()); + assertEquals(null, iterator.getVariation()); + iterator.next(); + assertEquals(null, iterator.getStyle()); + assertEquals(null, iterator.getVariation()); + assertFalse(iterator.hasNext()); + + iterator = new StyleAndVariationResourceNameIterator("style", "variation"); + assertTrue(iterator.hasNext()); + iterator.next(); + assertEquals("style", iterator.getStyle()); + assertEquals("variation", iterator.getVariation()); + iterator.next(); + assertEquals("style", iterator.getStyle()); + assertEquals(null, iterator.getVariation()); + iterator.next(); + assertEquals(null, iterator.getStyle()); + assertEquals("variation", iterator.getVariation()); + iterator.next(); + assertEquals(null, iterator.getStyle()); + assertEquals(null, iterator.getVariation()); + assertFalse(iterator.hasNext()); + } + + /** + * + */ + @Test + void extensionResourceNameIterator() + { + ExtensionResourceNameIterator iterator = new ExtensionResourceNameIterator(null); + assertTrue(iterator.hasNext()); + assertEquals(null, iterator.next()); + assertFalse(iterator.hasNext()); + + iterator = new ExtensionResourceNameIterator(Arrays.asList("txt")); + assertTrue(iterator.hasNext()); + assertEquals("txt", iterator.next()); + assertFalse(iterator.hasNext()); + + iterator = new ExtensionResourceNameIterator(Arrays.asList("properties", "utf8.properties", "properties.xml")); + assertTrue(iterator.hasNext()); + assertEquals("properties", iterator.next()); + assertTrue(iterator.hasNext()); + assertEquals("utf8.properties", iterator.next()); + assertTrue(iterator.hasNext()); + assertEquals("properties.xml", iterator.next()); + assertFalse(iterator.hasNext()); + } + + /** + * + */ + @Test + void noDuplicateVariations() + { + String path = "patch.extension"; + String style = null; + String var = "var"; + Locale locale = Locale.CANADA_FRENCH; + Iterable extensions = null; + boolean strict = false; + Iterator iterator = new ResourceNameIterator(path, style, var, locale, extensions, strict); + HashSet variations = new HashSet(); + while (iterator.hasNext()) + { + assertTrue(variations.add(iterator.next())); + } + assertEquals(6, variations.size()); + } + + /** + * + */ + @Test + void noTrailingDotWhenNoExtension() + { + Iterator iterator = new ResourceNameIterator("foo", null, null, null, null, false); + + assertTrue(iterator.hasNext()); + + assertEquals("foo", iterator.next()); + + assertFalse(iterator.hasNext()); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE_POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE_POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE_POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de_DE_POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de__POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de__POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_de__POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_de__POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE_POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE_POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE_POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de_DE_POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de__POSIX.txt b/wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de__POSIX.txt similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/resource/sourcePath/ResourceStreamLocatorTest_style_de__POSIX.txt rename to wicket-core/src/test/java/org/apache/wicket/core/util/resource/sourcePath/ResourceStreamLocatorTest_style_de__POSIX.txt diff --git a/wicket-core/src/test/java/org/apache/wicket/util/string/JavaScriptStripperTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/string/JavaScriptStripperTest.java similarity index 99% rename from wicket-core/src/test/java/org/apache/wicket/util/string/JavaScriptStripperTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/string/JavaScriptStripperTest.java index d928cc66ff8..e7df54695d8 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/string/JavaScriptStripperTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/string/JavaScriptStripperTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.string; +package org.apache.wicket.core.util.string; import org.apache.wicket.core.util.string.JavaScriptStripper; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/string/interpolator/PropertyVariableInterpolatorTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/string/interpolator/PropertyVariableInterpolatorTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/string/interpolator/PropertyVariableInterpolatorTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/string/interpolator/PropertyVariableInterpolatorTest.java index e437501496a..fb890795a8b 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/string/interpolator/PropertyVariableInterpolatorTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/string/interpolator/PropertyVariableInterpolatorTest.java @@ -1,73 +1,73 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.string.interpolator; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.apache.wicket.core.util.string.interpolator.PropertyVariableInterpolator; -import org.junit.jupiter.api.Test; - -/** - * Tests {@link PropertyVariableInterpolator} - * - * @author Gerolf Seitz - */ -class PropertyVariableInterpolatorTest -{ - /** - * - */ - @Test - void withValue() - { - TestClass object = new TestClass("value"); - String result = new PropertyVariableInterpolator("${key}", object).toString(); - assertEquals("value", result.toString()); - } - - /** - * A test that shows a usage of escape character. The first two '$' characters are squashed to - * '$' and '${key}' is interpolated to the respective value - */ - @Test - void withValueAndEscape() - { - TestClass object = new TestClass("3.24"); - String result = new PropertyVariableInterpolator("$$${key}", object).toString(); - assertEquals("$3.24", result.toString()); - } - - /** - * - */ - @Test - void withoutValue() - { - String result = new PropertyVariableInterpolator("${key}", null).toString(); - assertEquals("${key}", result.toString()); - } - - private static class TestClass - { - private final String key; - - TestClass(String key) - { - this.key = key; - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.string.interpolator; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.apache.wicket.core.util.string.interpolator.PropertyVariableInterpolator; +import org.junit.jupiter.api.Test; + +/** + * Tests {@link PropertyVariableInterpolator} + * + * @author Gerolf Seitz + */ +class PropertyVariableInterpolatorTest +{ + /** + * + */ + @Test + void withValue() + { + TestClass object = new TestClass("value"); + String result = new PropertyVariableInterpolator("${key}", object).toString(); + assertEquals("value", result.toString()); + } + + /** + * A test that shows a usage of escape character. The first two '$' characters are squashed to + * '$' and '${key}' is interpolated to the respective value + */ + @Test + void withValueAndEscape() + { + TestClass object = new TestClass("3.24"); + String result = new PropertyVariableInterpolator("$$${key}", object).toString(); + assertEquals("$3.24", result.toString()); + } + + /** + * + */ + @Test + void withoutValue() + { + String result = new PropertyVariableInterpolator("${key}", null).toString(); + assertEquals("${key}", result.toString()); + } + + private static class TestClass + { + private final String key; + + TestClass(String key) + { + this.key = key; + } + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/template/CssTemplateTest.java similarity index 90% rename from wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/template/CssTemplateTest.java index f60cc77994a..0454409d6c2 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/template/CssTemplateTest.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.template; +package org.apache.wicket.core.util.template; import java.util.Map; +import org.apache.wicket.util.template.CssTemplate; +import org.apache.wicket.util.template.TextTemplate; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/BlockedResourceLinkPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/BlockedResourceLinkPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/BlockedResourceLinkPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/BlockedResourceLinkPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/BlockedResourceLinkPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/BlockedResourceLinkPage.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/BlockedResourceLinkPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/BlockedResourceLinkPage.java index aa12d7362a7..ed80c61e27f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/BlockedResourceLinkPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/BlockedResourceLinkPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.link.ResourceLink; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/CookiePage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/CookiePage.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/CookiePage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/CookiePage.java index 241e9f6d98d..8ae96983899 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/CookiePage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/CookiePage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -22,6 +22,7 @@ import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.http.WebResponse; +import org.apache.wicket.util.tester.DummyHomePage; /** * A test page for https://issues.apache.org/jira/browse/WICKET-4289 diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterSubmitLinkTest$TestPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterSubmitLinkTest$TestPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterSubmitLinkTest$TestPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterSubmitLinkTest$TestPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterSubmitLinkTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterSubmitLinkTest.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterSubmitLinkTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterSubmitLinkTest.java index 654fce2b893..029d03adc10 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterSubmitLinkTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterSubmitLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -33,6 +33,9 @@ import org.apache.wicket.model.PropertyModel; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; +import org.apache.wicket.util.tester.FormTester; +import org.apache.wicket.util.tester.WicketTestCase; +import org.apache.wicket.util.tester.WicketTester; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterTest.java index 3f91b2ca91f..ea83df01963 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/FormTesterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -42,8 +42,8 @@ import org.apache.wicket.util.file.File; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; -import org.apache.wicket.util.tester.MockFormFileUploadPage.MockDomainObjectFileUpload; -import org.apache.wicket.util.tester.MockFormPage.MockDomainObject; +import org.apache.wicket.util.tester.FormTester; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; /** @@ -62,7 +62,7 @@ void formTester() { tester.startPage(MockFormPage.class); MockFormPage page = (MockFormPage)tester.getLastRenderedPage(); - MockDomainObject domainObject = page.getDomainObject(); + MockFormPage.MockDomainObject domainObject = page.getDomainObject(); assertNotNull(domainObject); assertNull(domainObject.getText()); @@ -87,7 +87,7 @@ void checkboxValuesCanBeSelectedWithBoolean() { tester.startPage(MockFormPage.class); MockFormPage page = (MockFormPage)tester.getLastRenderedPage(); - MockDomainObject domainObject = page.getDomainObject(); + MockFormPage.MockDomainObject domainObject = page.getDomainObject(); assertFalse(domainObject.isCheckbox()); FormTester formTester = tester.newFormTester("form"); @@ -112,7 +112,7 @@ void addFile() { tester.startPage(MockFormFileUploadPage.class); MockFormFileUploadPage page = (MockFormFileUploadPage)tester.getLastRenderedPage(); - MockDomainObjectFileUpload domainObject = page.getDomainObject(); + MockFormFileUploadPage.MockDomainObjectFileUpload domainObject = page.getDomainObject(); assertNull(page.getFileUpload()); assertNotNull(domainObject); @@ -147,7 +147,7 @@ void addBinaryFile() { tester.startPage(MockFormFileUploadPage.class); MockFormFileUploadPage page = (MockFormFileUploadPage)tester.getLastRenderedPage(); - MockDomainObjectFileUpload domainObject = page.getDomainObject(); + MockFormFileUploadPage.MockDomainObjectFileUpload domainObject = page.getDomainObject(); assertNull(page.getFileUpload()); assertNotNull(domainObject); @@ -156,7 +156,7 @@ void addBinaryFile() FormTester formTester = tester.newFormTester("form"); formTester.setFile("file", - new File(getBasedir() + "src/test/java/org/apache/wicket/util/tester/bg.jpg"), + new File(getBasedir() + "src/test/java/org/apache/wicket/core/util/tester/bg.jpg"), "image/jpeg"); formTester.setValue("text", "Mock value"); formTester.submit(); @@ -206,7 +206,7 @@ void submitMultipartForm() { tester.startPage(MockFormFileUploadPage.class, new PageParameters().set("required", false)); MockFormFileUploadPage page = (MockFormFileUploadPage)tester.getLastRenderedPage(); - MockDomainObjectFileUpload domainObject = page.getDomainObject(); + MockFormFileUploadPage.MockDomainObjectFileUpload domainObject = page.getDomainObject(); Session.get().setLocale(Locale.US); diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockAjaxFormPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockAjaxFormPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockAjaxFormPage.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockAjaxFormPage.java index eeaf1017c1f..a290ccc4a56 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockAjaxFormPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import java.io.Serializable; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormFileUploadPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormFileUploadPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormFileUploadPage.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormFileUploadPage.java index ec5cf1e8b21..4b34d76bdb3 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormFileUploadPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import java.io.Serializable; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormPage.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormPage.java index c8c46897580..f115a54b7aa 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import java.io.Serializable; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormSubmitsPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormSubmitsPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormSubmitsPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormSubmitsPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormSubmitsPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormSubmitsPage.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormSubmitsPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormSubmitsPage.java index 05b204019ee..3c7674cd0a4 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockFormSubmitsPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockFormSubmitsPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java index 86b487addaf..349506d8add 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageAjaxSubmitLinkSubmitsWholeForm.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage$MockInnerClassPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage$MockInnerClassPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage$MockInnerClassPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage$MockInnerClassPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage.java index 3bac5946ef6..19a0465a967 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageParameterPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageParameterPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java index cf4f07d52fe..e6fc39bd303 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndAjaxFormSubmitBehavior.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import java.io.Serializable; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndCheckGroup.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndCheckGroup.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndCheckGroup.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndCheckGroup.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndCheckGroup.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndCheckGroup.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndCheckGroup.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndCheckGroup.java index 156bb7b0a74..ca20d1fd33a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithFormAndCheckGroup.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithFormAndCheckGroup.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import java.util.ArrayList; import java.util.Collection; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLabelInEnclosure.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLabelInEnclosure.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLabelInEnclosure.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLabelInEnclosure.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLabelInEnclosure.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLabelInEnclosure.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLabelInEnclosure.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLabelInEnclosure.java index 0c1d1461574..dfdbe05c8e7 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLabelInEnclosure.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLabelInEnclosure.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLinkAndLabel.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLinkAndLabel.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLinkAndLabel.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLinkAndLabel.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLinkAndLabel.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLinkAndLabel.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLinkAndLabel.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLinkAndLabel.java index b55a572a540..85ff8ec605d 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockPageWithLinkAndLabel.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockPageWithLinkAndLabel.java @@ -1,44 +1,44 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.tester; - -import org.apache.wicket.markup.html.WebPage; - -/** - * Mock page containing a link with a label inside - */ -public class MockPageWithLinkAndLabel extends WebPage -{ - private static final long serialVersionUID = 1L; - - /** - * Link wicket id - */ - public static final String LINK_ID = "link"; - - /** - * Label wicket id - */ - public static final String LABEL_ID = "label"; - - /** - * Label component path - */ - public static final String LABEL_PATH = "link:label"; - - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.tester; + +import org.apache.wicket.markup.html.WebPage; + +/** + * Mock page containing a link with a label inside + */ +public class MockPageWithLinkAndLabel extends WebPage +{ + private static final long serialVersionUID = 1L; + + /** + * Link wicket id + */ + public static final String LINK_ID = "link"; + + /** + * Label wicket id + */ + public static final String LABEL_ID = "label"; + + /** + * Label component path + */ + public static final String LABEL_PATH = "link:label"; + + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockResourceLinkPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockResourceLinkPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockResourceLinkPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockResourceLinkPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockResourceLinkPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockResourceLinkPage.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/MockResourceLinkPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockResourceLinkPage.java index 801066c3ba6..b4c390e2574 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockResourceLinkPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/MockResourceLinkPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.link.ResourceLink; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/NestedFormPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/NestedFormPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/NestedFormPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/NestedFormPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/NestedFormPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/NestedFormPage.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/NestedFormPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/NestedFormPage.java index 62b5037e449..bfca849ac61 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/NestedFormPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/NestedFormPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Button; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/StartComponentInPageRedirectToRenderTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/StartComponentInPageRedirectToRenderTest.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/StartComponentInPageRedirectToRenderTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/StartComponentInPageRedirectToRenderTest.java index 5fc8db22142..4ac8b9e43b6 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/StartComponentInPageRedirectToRenderTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/StartComponentInPageRedirectToRenderTest.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.mock.MockApplication; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.settings.RequestCycleSettings; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/TagTesterTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/TagTesterTest.java similarity index 99% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/TagTesterTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/TagTesterTest.java index 1f040f16bb9..7ae784437f2 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/TagTesterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/TagTesterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -26,6 +26,7 @@ import java.util.List; +import org.apache.wicket.util.tester.TagTester; import org.junit.jupiter.api.Test; /** @@ -466,4 +467,4 @@ void testOpenClose() { assertEquals("hr2", tags.get(1).getAttribute("id")); assertEquals("
", tags.get(1).getMarkup()); } -} \ No newline at end of file +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterClickExternalLinkTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterClickExternalLinkTest.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterClickExternalLinkTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterClickExternalLinkTest.java index 5789165b4b1..66b249eb47e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterClickExternalLinkTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterClickExternalLinkTest.java @@ -14,10 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.MockPageWithLink; import org.apache.wicket.markup.html.link.ExternalLink; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterCookieTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterCookieTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterCookieTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterCookieTest.java index c4aa53cbe5a..bd2d14eb071 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterCookieTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterCookieTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -29,11 +29,13 @@ import java.util.Map; import javax.servlet.http.Cookie; +import org.apache.wicket.core.util.tester.apps_1.CreateBook; +import org.apache.wicket.core.util.tester.cookies.CollectAllRequestCookiesPage; +import org.apache.wicket.core.util.tester.cookies.EndPage; +import org.apache.wicket.core.util.tester.cookies.SetCookiePage; import org.apache.wicket.protocol.http.mock.Cookies; -import org.apache.wicket.util.tester.apps_1.CreateBook; -import org.apache.wicket.util.tester.cookies.CollectAllRequestCookiesPage; -import org.apache.wicket.util.tester.cookies.EndPage; -import org.apache.wicket.util.tester.cookies.SetCookiePage; +import org.apache.wicket.util.tester.WicketTestCase; +import org.apache.wicket.util.tester.WicketTester; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessBase.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessBase.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessBase.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessBase.java index fb62b823cdc..4a6d253001f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessBase.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessBase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -29,6 +29,7 @@ import org.apache.wicket.model.IModel; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java index 1bfd770df1b..8c9e2686439 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessOnePassTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.mock.MockApplication; import org.apache.wicket.protocol.http.WebApplication; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java index c7f3c48a2fd..fbdf84c2189 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessRedirectToBufferTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.MarkupContainer; import org.apache.wicket.markup.IMarkupResourceStreamProvider; @@ -25,6 +25,7 @@ import org.apache.wicket.settings.RequestCycleSettings; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; +import org.apache.wicket.util.tester.FormTester; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java index 5cec01a39c0..3fc94facc12 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterLazyIsPageStatelessRedirectToRenderTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import org.apache.wicket.mock.MockApplication; import org.apache.wicket.protocol.http.WebApplication; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterSessionCreationTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterSessionCreationTest.java similarity index 91% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterSessionCreationTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterSessionCreationTest.java index efda4510cd8..800589dc7d8 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterSessionCreationTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterSessionCreationTest.java @@ -14,12 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Locale; +import org.apache.wicket.util.tester.DummyHomePage; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterSessionInvalidateTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterSessionInvalidateTest.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterSessionInvalidateTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterSessionInvalidateTest.java index ce207f4c749..09b78153a0a 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterSessionInvalidateTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterSessionInvalidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -26,6 +26,7 @@ import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java index 3799b7c44e1..c51ff1dac09 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester; +package org.apache.wicket.core.util.tester; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -44,6 +44,14 @@ import org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler; import org.apache.wicket.core.request.handler.IPageProvider; import org.apache.wicket.core.request.handler.PageProvider; +import org.apache.wicket.core.util.tester.apps_1.Book; +import org.apache.wicket.core.util.tester.apps_1.CreateBook; +import org.apache.wicket.core.util.tester.apps_1.MyMockApplication; +import org.apache.wicket.core.util.tester.apps_1.SuccessPage; +import org.apache.wicket.core.util.tester.apps_1.ViewBook; +import org.apache.wicket.core.util.tester.apps_6.LinkPage; +import org.apache.wicket.core.util.tester.apps_6.ResultPage; +import org.apache.wicket.core.util.tester.apps_8.ComponentFeedbackResourceTestingPage; import org.apache.wicket.feedback.ExactLevelFeedbackMessageFilter; import org.apache.wicket.feedback.FeedbackMessage; import org.apache.wicket.markup.ComponentTag; @@ -70,17 +78,12 @@ import org.apache.wicket.resource.DummyPage; import org.apache.wicket.session.HttpSessionStore; import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.tester.DummyHomePage; import org.apache.wicket.util.tester.DummyHomePage.TestLink; -import org.apache.wicket.util.tester.MockPageParameterPage.MockInnerClassPage; -import org.apache.wicket.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo; -import org.apache.wicket.util.tester.apps_1.Book; -import org.apache.wicket.util.tester.apps_1.CreateBook; -import org.apache.wicket.util.tester.apps_1.MyMockApplication; -import org.apache.wicket.util.tester.apps_1.SuccessPage; -import org.apache.wicket.util.tester.apps_1.ViewBook; -import org.apache.wicket.util.tester.apps_6.LinkPage; -import org.apache.wicket.util.tester.apps_6.ResultPage; -import org.apache.wicket.util.tester.apps_8.ComponentFeedbackResourceTestingPage; +import org.apache.wicket.util.tester.FormTester; +import org.apache.wicket.core.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo; +import org.apache.wicket.util.tester.Result; +import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -452,10 +455,10 @@ void pageConstructor() throws Exception @Test void constructorAndInnerPage() throws Exception { - tester.startPage(new MockInnerClassPage()); + tester.startPage(new MockPageParameterPage.MockInnerClassPage()); // assertion - tester.assertRenderedPage(MockInnerClassPage.class); + tester.assertRenderedPage(MockPageParameterPage.MockInnerClassPage.class); tester.assertComponent("title", Label.class); tester.assertContains("Hello world!"); } diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/Book.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/Book.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/Book.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/Book.java index 4121ece0f3d..a1ade7272a1 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/Book.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/Book.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_1; +package org.apache.wicket.core.util.tester.apps_1; import java.io.Serializable; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.java index ed529189767..2a8fda19ce5 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_1; +package org.apache.wicket.core.util.tester.apps_1; import org.apache.wicket.Page; import org.apache.wicket.markup.html.WebPage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.properties b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.properties similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/CreateBook.properties rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/CreateBook.properties diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication.java index e094a7bd9f2..53777a8010e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_1; +package org.apache.wicket.core.util.tester.apps_1; import org.apache.wicket.mock.MockApplication; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication.properties b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication.properties similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication.properties rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication.properties diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication_de.properties b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication_de.properties similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication_de.properties rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication_de.properties diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication_nl.properties b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication_nl.properties similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/MyMockApplication_nl.properties rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/MyMockApplication_nl.properties diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/SuccessPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/SuccessPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/SuccessPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/SuccessPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/SuccessPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/SuccessPage.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/SuccessPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/SuccessPage.java index 145727ca5d4..99a03824fac 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/SuccessPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/SuccessPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_1; +package org.apache.wicket.core.util.tester.apps_1; import org.apache.wicket.markup.html.WebPage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/ViewBook.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/ViewBook.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/ViewBook.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/ViewBook.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/ViewBook.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/ViewBook.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/ViewBook.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/ViewBook.java index ccd13bf0aa8..1c7d338e1b9 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_1/ViewBook.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_1/ViewBook.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_1; +package org.apache.wicket.core.util.tester.apps_1; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/LoginPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/LoginPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/LoginPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/LoginPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/LoginPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/LoginPage.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/LoginPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/LoginPage.java index 3e7d86a937f..5951d901ec0 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/LoginPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/LoginPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_2; +package org.apache.wicket.core.util.tester.apps_2; import org.apache.wicket.markup.html.WebPage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/RedirectPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/RedirectPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/RedirectPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/RedirectPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/RedirectPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/RedirectPage.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/RedirectPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/RedirectPage.java index cbb7a28d0ea..959eb30216d 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/RedirectPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/RedirectPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_2; +package org.apache.wicket.core.util.tester.apps_2; import org.apache.wicket.markup.html.WebPage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/Test.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/Test.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/Test.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/Test.java index fc9a5b0133a..c04e9aa125f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_2/Test.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_2/Test.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_2; +package org.apache.wicket.core.util.tester.apps_2; import org.apache.wicket.authorization.IAuthorizationStrategy; import org.apache.wicket.authorization.strategies.page.SimplePageAuthorizationStrategy; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/ChoicePage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/ChoicePage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/ChoicePage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/ChoicePage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/ChoicePage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/ChoicePage.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/ChoicePage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/ChoicePage.java index ac41e38cc1d..dad21a2bb8c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/ChoicePage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/ChoicePage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_3; +package org.apache.wicket.core.util.tester.apps_3; import java.io.Serializable; import java.util.ArrayList; @@ -39,7 +39,7 @@ import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.Model; -import org.apache.wicket.util.tester.apps_1.Book; +import org.apache.wicket.core.util.tester.apps_1.Book; /** diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/FormTesterTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/FormTesterTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/FormTesterTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/FormTesterTest.java index ff65101cf5b..6d62689ae38 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_3/FormTesterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_3/FormTesterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_3; +package org.apache.wicket.core.util.tester.apps_3; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -27,7 +27,7 @@ import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.util.tester.FormTester; import org.apache.wicket.util.tester.WicketTestCase; -import org.apache.wicket.util.tester.apps_1.Book; +import org.apache.wicket.core.util.tester.apps_1.Book; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.java index b71f1525567..b0ca9a1bc57 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_4; +package org.apache.wicket.core.util.tester.apps_4; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Form; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.properties b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.properties similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/EmailPage.properties rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/EmailPage.properties diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/FormTesterTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/FormTesterTest.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/FormTesterTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/FormTesterTest.java index 8a4b12e7bc2..b5645040e79 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_4/FormTesterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_4/FormTesterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_4; +package org.apache.wicket.core.util.tester.apps_4; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/AjaxLinkClickTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/AjaxLinkClickTest.java similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/AjaxLinkClickTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/AjaxLinkClickTest.java index cf9a8e5b5d0..650b8bbfa48 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/AjaxLinkClickTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/AjaxLinkClickTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_5; +package org.apache.wicket.core.util.tester.apps_5; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/AjaxSubmitLinkClickTest.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/AjaxSubmitLinkClickTest.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/AjaxSubmitLinkClickTest.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/AjaxSubmitLinkClickTest.java index d4820260ceb..5a940e5346c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/AjaxSubmitLinkClickTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/AjaxSubmitLinkClickTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_5; +package org.apache.wicket.core.util.tester.apps_5; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -22,7 +22,6 @@ import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink; import org.apache.wicket.util.tester.WicketTestCase; -import org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -50,7 +49,7 @@ void before() @Test void testClickLinkInsideForm_ajaxSubmitLink() { - MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo(); + MockPageWithFormAndLink.MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo(); mockPojo.setName("Mock name"); final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo); @@ -95,7 +94,7 @@ protected void onError(AjaxRequestTarget target) @Test void testClickLink_ajaxSubmitLink() { - MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo(); + MockPageWithFormAndLink.MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo(); mockPojo.setName("Mock name"); final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo); diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndContainedLink.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndContainedLink.html similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndContainedLink.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndContainedLink.html index 6f55bc8a93e..61b9b5913d1 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndContainedLink.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndContainedLink.html @@ -1,14 +1,14 @@ - - - - - -Insert title here - - -
- -Link -
- + + + + + +Insert title here + + +
+ +Link +
+ \ No newline at end of file diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndContainedLink.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndContainedLink.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndContainedLink.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndContainedLink.java index 049750ed45b..686feaa0160 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndContainedLink.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndContainedLink.java @@ -1,50 +1,50 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.tester.apps_5; - -import org.apache.wicket.markup.html.link.AbstractLink; - -/** - * Contains a form with a textfield on it and a link inside the form. Use the - * {@link #addLink(AbstractLink)} method to add a link to the form. - * - * @author Gerolf Seitz - */ -public class MockPageWithFormAndContainedLink extends MockPageWithFormAndLink -{ - - private static final long serialVersionUID = 1L; - - /** - * Construct. - * - * @param mockPojo - */ - public MockPageWithFormAndContainedLink(MockPojo mockPojo) - { - super(mockPojo); - } - - /** - * @param link - */ - public void addLink(AbstractLink link) - { - getForm().add(link); - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.tester.apps_5; + +import org.apache.wicket.markup.html.link.AbstractLink; + +/** + * Contains a form with a textfield on it and a link inside the form. Use the + * {@link #addLink(AbstractLink)} method to add a link to the form. + * + * @author Gerolf Seitz + */ +public class MockPageWithFormAndContainedLink extends MockPageWithFormAndLink +{ + + private static final long serialVersionUID = 1L; + + /** + * Construct. + * + * @param mockPojo + */ + public MockPageWithFormAndContainedLink(MockPojo mockPojo) + { + super(mockPojo); + } + + /** + * @param link + */ + public void addLink(AbstractLink link) + { + getForm().add(link); + } + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndLink.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndLink.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndLink.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndLink.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndLink.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndLink.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndLink.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndLink.java index 803d9f067ed..fe92c85ea95 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithFormAndLink.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithFormAndLink.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_5; +package org.apache.wicket.core.util.tester.apps_5; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Form; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithLink.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithLink.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithLink.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithLink.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithLink.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithLink.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithLink.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithLink.java index 2e9c30a0f80..5e61d451346 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_5/MockPageWithLink.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_5/MockPageWithLink.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_5; +package org.apache.wicket.core.util.tester.apps_5; import org.apache.wicket.markup.html.WebPage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/LinkPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/LinkPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/LinkPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/LinkPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/LinkPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/LinkPage.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/LinkPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/LinkPage.java index bc9d6de8dd4..0fbc2782bf1 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/LinkPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/LinkPage.java @@ -1,133 +1,133 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.tester.apps_6; - -import java.util.Optional; - -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; -import org.apache.wicket.ajax.markup.html.AjaxLink; -import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.util.tester.WicketTester; - -/** - * Different kinds of links, to be test the {@link WicketTester#clickLink(String, boolean)} method. - * - * Add more links when needed. - */ -public class LinkPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - /** - * Construct. - */ - public LinkPage() - { - // Link - add(new Link("linkWithSetResponsePageClass") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - getRequestCycle().setResponsePage(ResultPage.class); - } - }); - - add(new Link("linkWithSetResponsePage") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - getRequestCycle().setResponsePage(new ResultPage("A special label")); - } - }); - - // AjaxLink - add(new AjaxLink("ajaxLinkWithSetResponsePageClass") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick(AjaxRequestTarget target) - { - getRequestCycle().setResponsePage(ResultPage.class); - } - }); - - add(new AjaxLink("ajaxLinkWithSetResponsePage") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick(AjaxRequestTarget target) - { - getRequestCycle().setResponsePage(new ResultPage("A special label")); - } - }); - - // AjaxFallbackLink - add(new AjaxFallbackLink("ajaxFallbackLinkWithSetResponsePageClass") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick(Optional targetOptional) - { - getRequestCycle().setResponsePage(ResultPage.class); - } - }); - - add(new AjaxFallbackLink("ajaxFallbackLinkWithSetResponsePage") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick(Optional targetOptional) - { - getRequestCycle().setResponsePage(new ResultPage("A special label")); - } - }); - - // AjaxSubmitLink - final Form form = new Form("form"); - add(form); - final AjaxSubmitLink submit = new AjaxSubmitLink("submit") - { - private static final long serialVersionUID = 1L; - - @Override - protected void onSubmit(final AjaxRequestTarget target) - { - getRequestCycle().setResponsePage(new ResultPage("A form label")); - } - - @Override - protected void onError(AjaxRequestTarget target) - { - } - }; - form.add(submit); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.tester.apps_6; + +import java.util.Optional; + +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.util.tester.WicketTester; + +/** + * Different kinds of links, to be test the {@link WicketTester#clickLink(String, boolean)} method. + * + * Add more links when needed. + */ +public class LinkPage extends WebPage +{ + private static final long serialVersionUID = 1L; + + /** + * Construct. + */ + public LinkPage() + { + // Link + add(new Link("linkWithSetResponsePageClass") + { + private static final long serialVersionUID = 1L; + + @Override + public void onClick() + { + getRequestCycle().setResponsePage(ResultPage.class); + } + }); + + add(new Link("linkWithSetResponsePage") + { + private static final long serialVersionUID = 1L; + + @Override + public void onClick() + { + getRequestCycle().setResponsePage(new ResultPage("A special label")); + } + }); + + // AjaxLink + add(new AjaxLink("ajaxLinkWithSetResponsePageClass") + { + private static final long serialVersionUID = 1L; + + @Override + public void onClick(AjaxRequestTarget target) + { + getRequestCycle().setResponsePage(ResultPage.class); + } + }); + + add(new AjaxLink("ajaxLinkWithSetResponsePage") + { + private static final long serialVersionUID = 1L; + + @Override + public void onClick(AjaxRequestTarget target) + { + getRequestCycle().setResponsePage(new ResultPage("A special label")); + } + }); + + // AjaxFallbackLink + add(new AjaxFallbackLink("ajaxFallbackLinkWithSetResponsePageClass") + { + private static final long serialVersionUID = 1L; + + @Override + public void onClick(Optional targetOptional) + { + getRequestCycle().setResponsePage(ResultPage.class); + } + }); + + add(new AjaxFallbackLink("ajaxFallbackLinkWithSetResponsePage") + { + private static final long serialVersionUID = 1L; + + @Override + public void onClick(Optional targetOptional) + { + getRequestCycle().setResponsePage(new ResultPage("A special label")); + } + }); + + // AjaxSubmitLink + final Form form = new Form("form"); + add(form); + final AjaxSubmitLink submit = new AjaxSubmitLink("submit") + { + private static final long serialVersionUID = 1L; + + @Override + protected void onSubmit(final AjaxRequestTarget target) + { + getRequestCycle().setResponsePage(new ResultPage("A form label")); + } + + @Override + protected void onError(AjaxRequestTarget target) + { + } + }; + form.add(submit); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/ResultPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/ResultPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/ResultPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/ResultPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/ResultPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/ResultPage.java similarity index 93% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/ResultPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/ResultPage.java index f52069b0d83..3c3d6a8daa2 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_6/ResultPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_6/ResultPage.java @@ -1,49 +1,49 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.tester.apps_6; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.model.Model; - -/** - * Result page - */ -public class ResultPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - /** - * Construct. - */ - public ResultPage() - { - this("No Parameter"); - } - - /** - * Construct. - * - * @param label - */ - public ResultPage(String label) - { - super(new Model(label)); - - add(new Label("label", getDefaultModel())); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.tester.apps_6; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.model.Model; + +/** + * Result page + */ +public class ResultPage extends WebPage +{ + private static final long serialVersionUID = 1L; + + /** + * Construct. + */ + public ResultPage() + { + this("No Parameter"); + } + + /** + * Construct. + * + * @param label + */ + public ResultPage(String label) + { + super(new Model(label)); + + add(new Label("label", getDefaultModel())); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/HomePage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/HomePage.html similarity index 98% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/HomePage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/HomePage.html index 6cb2be3975a..48f52ca613f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/HomePage.html +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/HomePage.html @@ -5,12 +5,12 @@ Wicket Quickstart Archetype Homepage

- message will be here - -
- Input field: - - + message will be here + + + Input field: + +
diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/HomePage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/HomePage.java similarity index 97% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/HomePage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/HomePage.java index 0a6f6fe3cb3..ee9e37fc1cb 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/HomePage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/HomePage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_7; +package org.apache.wicket.core.util.tester.apps_7; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/TestHomePage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/TestHomePage.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/TestHomePage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/TestHomePage.java index 12460346106..da91a059326 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/TestHomePage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/TestHomePage.java @@ -1,42 +1,42 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.tester.apps_7; - -import org.apache.wicket.util.tester.WicketTestCase; -import org.junit.jupiter.api.Test; - -/** - * Simple test using the WicketTester - */ -class TestHomePage extends WicketTestCase -{ - /** */ - @Test - void testAjaxSubmitWhileAnotherButtonIsNotVisible() - { - // start and render the test page - tester.startPage(HomePage.class); - // assert rendered page class - tester.assertRenderedPage(HomePage.class); - // assert rendered label component - tester.assertLabel("message", - "If you see this message wicket is properly configured and running"); - - // execute ajax - tester.executeAjaxEvent("form:ajaxButton", "click"); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.util.tester.apps_7; + +import org.apache.wicket.util.tester.WicketTestCase; +import org.junit.jupiter.api.Test; + +/** + * Simple test using the WicketTester + */ +class TestHomePage extends WicketTestCase +{ + /** */ + @Test + void testAjaxSubmitWhileAnotherButtonIsNotVisible() + { + // start and render the test page + tester.startPage(HomePage.class); + // assert rendered page class + tester.assertRenderedPage(HomePage.class); + // assert rendered label component + tester.assertLabel("message", + "If you see this message wicket is properly configured and running"); + + // execute ajax + tester.executeAjaxEvent("form:ajaxButton", "click"); + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/WicketApplication.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/WicketApplication.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/WicketApplication.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/WicketApplication.java index e5ab674f005..555b8e46e3e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_7/WicketApplication.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_7/WicketApplication.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_7; +package org.apache.wicket.core.util.tester.apps_7; import org.apache.wicket.protocol.http.WebApplication; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/ComponentFeedbackResourceTestingPage.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/ComponentFeedbackResourceTestingPage.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/ComponentFeedbackResourceTestingPage.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/ComponentFeedbackResourceTestingPage.html diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java similarity index 95% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java index fec8efc795a..8e5fab0936e 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/ComponentFeedbackResourceTestingPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_8; +package org.apache.wicket.core.util.tester.apps_8; import org.apache.wicket.markup.html.WebPage; @@ -27,4 +27,4 @@ public ComponentFeedbackResourceTestingPage() { add(new TestResourceProvidingLabel("label")); } -} \ No newline at end of file +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/TestResourceProvidingLabel.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/TestResourceProvidingLabel.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/TestResourceProvidingLabel.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/TestResourceProvidingLabel.java index b3a30ca27cd..ff6c8276137 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/TestResourceProvidingLabel.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/TestResourceProvidingLabel.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.apps_8; +package org.apache.wicket.core.util.tester.apps_8; import org.apache.wicket.markup.html.basic.Label; @@ -38,4 +38,4 @@ protected void onBeforeRender() error(this.getString("error.msg")); info(this.getString("info.msg")); } -} \ No newline at end of file +} diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/TestResourceProvidingLabel.properties b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/TestResourceProvidingLabel.properties similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/apps_8/TestResourceProvidingLabel.properties rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/apps_8/TestResourceProvidingLabel.properties diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/bg.jpg b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/bg.jpg similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/bg.jpg rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/bg.jpg diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/CollectAllRequestCookiesPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/CollectAllRequestCookiesPage.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/CollectAllRequestCookiesPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/CollectAllRequestCookiesPage.java index 9e0e6f5bd4f..2de5aad68df 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/CollectAllRequestCookiesPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/CollectAllRequestCookiesPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.cookies; +package org.apache.wicket.core.util.tester.cookies; import java.util.List; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/EndPage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/EndPage.java similarity index 94% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/EndPage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/EndPage.java index 4bed69f9069..4b17864933d 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/EndPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/EndPage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.cookies; +package org.apache.wicket.core.util.tester.cookies; import org.apache.wicket.util.tester.DummyHomePage; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/SetCookiePage.java b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/SetCookiePage.java similarity index 96% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/SetCookiePage.java rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/SetCookiePage.java index dd2c49bd1df..c6e6f3cda9c 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/tester/cookies/SetCookiePage.java +++ b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/cookies/SetCookiePage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.tester.cookies; +package org.apache.wicket.core.util.tester.cookies; import javax.servlet.http.Cookie; diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/test.html b/wicket-core/src/test/java/org/apache/wicket/core/util/tester/test.html similarity index 100% rename from wicket-core/src/test/java/org/apache/wicket/util/tester/test.html rename to wicket-core/src/test/java/org/apache/wicket/core/util/tester/test.html diff --git a/wicket-core/src/test/java/org/apache/wicket/resource/InvalidResourceSpecificationExceptionTest.java b/wicket-core/src/test/java/org/apache/wicket/resource/InvalidResourceSpecificationExceptionTest.java index 2e370ca9d3c..c8b666e445f 100644 --- a/wicket-core/src/test/java/org/apache/wicket/resource/InvalidResourceSpecificationExceptionTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/resource/InvalidResourceSpecificationExceptionTest.java @@ -17,7 +17,7 @@ package org.apache.wicket.resource; import org.apache.wicket.WicketRuntimeException; -import org.apache.wicket.util.ExceptionTestBase; +import org.apache.wicket.core.util.ExceptionTestBase; /** diff --git a/wicket-devutils/pom.xml b/wicket-devutils/pom.xml index 94ffc1fe9fa..ccfd73fdb85 100644 --- a/wicket-devutils/pom.xml +++ b/wicket-devutils/pom.xml @@ -32,10 +32,6 @@ turned on for additional production debugging. - - org.apache.wicket.devutils - - org.apache.wicket diff --git a/wicket-devutils/src/main/java/module-info.java b/wicket-devutils/src/main/java/module-info.java new file mode 100644 index 00000000000..e9133eb37d8 --- /dev/null +++ b/wicket-devutils/src/main/java/module-info.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.devutils { + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.apache.wicket.extensions; + requires org.slf4j; + + provides org.apache.wicket.IInitializer with org.apache.wicket.devutils.debugbar.DebugBarInitializer; + + exports org.apache.wicket.devutils; + exports org.apache.wicket.devutils.debugbar; + exports org.apache.wicket.devutils.inspector; + exports org.apache.wicket.devutils.pagestore; + exports org.apache.wicket.devutils.pagestore.browser; + exports org.apache.wicket.devutils.stateless; +} diff --git a/wicket-devutils/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-devutils/src/test/java/org/apache/wicket/devutils/util/license/ApacheLicenceHeaderTest.java similarity index 91% rename from wicket-devutils/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-devutils/src/test/java/org/apache/wicket/devutils/util/license/ApacheLicenceHeaderTest.java index 7efc3af6542..cf8598ae146 100644 --- a/wicket-devutils/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-devutils/src/test/java/org/apache/wicket/devutils/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.devutils.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-devutils/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java b/wicket-devutils/src/test/java/org/apache/wicket/devutils/util/markup/xhtml/WellFormedXmlTest.java similarity index 89% rename from wicket-devutils/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java rename to wicket-devutils/src/test/java/org/apache/wicket/devutils/util/markup/xhtml/WellFormedXmlTest.java index 88d902528f6..153165b2ea0 100644 --- a/wicket-devutils/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java +++ b/wicket-devutils/src/test/java/org/apache/wicket/devutils/util/markup/xhtml/WellFormedXmlTest.java @@ -1,34 +1,35 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.markup.xhtml; - -import org.junit.jupiter.api.Test; - -/** - * Checks that the html markup files are well formed xml-s. - * - * @author akiraly - */ -public class WellFormedXmlTest extends WellFormedXmlTestCase -{ - @Test - @Override - public void markupFiles() - { - super.markupFiles(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.devutils.util.markup.xhtml; + +import org.apache.wicket.util.markup.xhtml.WellFormedXmlTestCase; +import org.junit.jupiter.api.Test; + +/** + * Checks that the html markup files are well formed xml-s. + * + * @author akiraly + */ +public class WellFormedXmlTest extends WellFormedXmlTestCase +{ + @Test + @Override + public void markupFiles() + { + super.markupFiles(); + } +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml index f9ce802a15e..37b89483f15 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml @@ -33,10 +33,6 @@ that uses the API. - - org.apache.wicket.http2.core - - org.apache.wicket diff --git a/wicket-experimental/wicket-metrics/pom.xml b/wicket-experimental/wicket-metrics/pom.xml index 35e51bbd74d..97dc2ece1a4 100644 --- a/wicket-experimental/wicket-metrics/pom.xml +++ b/wicket-experimental/wicket-metrics/pom.xml @@ -32,10 +32,6 @@ about web applications build on the web framework. - - org.apache.wicket.metrics - - javax.servlet diff --git a/wicket-experimental/wicket-metrics/src/main/java/module-info.java b/wicket-experimental/wicket-metrics/src/main/java/module-info.java new file mode 100644 index 00000000000..2706ccb5467 --- /dev/null +++ b/wicket-experimental/wicket-metrics/src/main/java/module-info.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.metrics { + requires org.apache.wicket.core; + requires org.aspectj.runtime; + requires com.codahale.metrics; + requires com.codahale.metrics.jmx; + requires javax.servlet.api; + + exports org.apache.wicket.metrics; + exports org.apache.wicket.metrics.aspects; + exports org.apache.wicket.metrics.aspects.ajax; + exports org.apache.wicket.metrics.aspects.behavior; + exports org.apache.wicket.metrics.aspects.component; + exports org.apache.wicket.metrics.aspects.markup; + exports org.apache.wicket.metrics.aspects.model; + exports org.apache.wicket.metrics.aspects.request; + exports org.apache.wicket.metrics.aspects.requesthandler; + exports org.apache.wicket.metrics.aspects.resource; + exports org.apache.wicket.metrics.aspects.session; +} diff --git a/wicket-extensions/pom.xml b/wicket-extensions/pom.xml index 00373b2f621..ae557ee2c6f 100644 --- a/wicket-extensions/pom.xml +++ b/wicket-extensions/pom.xml @@ -28,10 +28,6 @@ Wicket Extensions Wicket Extensions is a rich component library for the Wicket framework. - - org.apache.wicket.extensions - - com.fasterxml.jackson.core diff --git a/wicket-extensions/src/main/java/module-info.java b/wicket-extensions/src/main/java/module-info.java new file mode 100644 index 00000000000..2edde990f00 --- /dev/null +++ b/wicket-extensions/src/main/java/module-info.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.extensions { + requires java.desktop; + requires javax.servlet.api; + requires org.slf4j; + requires com.fasterxml.jackson.databind; + requires com.github.openjson; + requires commons.fileupload; + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.danekja.jdk.serializable.functional; + + provides org.apache.wicket.IInitializer with org.apache.wicket.extensions.Initializer; + + exports org.apache.wicket.extensions; + exports org.apache.wicket.extensions.ajax; + exports org.apache.wicket.extensions.ajax.markup.html; + exports org.apache.wicket.extensions.ajax.markup.html.autocomplete; + exports org.apache.wicket.extensions.ajax.markup.html.form.upload; + exports org.apache.wicket.extensions.ajax.markup.html.modal; + exports org.apache.wicket.extensions.ajax.markup.html.modal.theme; + exports org.apache.wicket.extensions.ajax.markup.html.repeater; + exports org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort; + exports org.apache.wicket.extensions.ajax.markup.html.repeater.data.table; + exports org.apache.wicket.extensions.ajax.markup.html.tabs; + exports org.apache.wicket.extensions.breadcrumb; + exports org.apache.wicket.extensions.breadcrumb.panel; + exports org.apache.wicket.extensions.captcha.kittens; + exports org.apache.wicket.extensions.markup.html.basic; + exports org.apache.wicket.extensions.markup.html.captcha; + exports org.apache.wicket.extensions.markup.html.form; + exports org.apache.wicket.extensions.markup.html.form.datetime; + exports org.apache.wicket.extensions.markup.html.form.palette; + exports org.apache.wicket.extensions.markup.html.form.palette.component; + exports org.apache.wicket.extensions.markup.html.form.palette.theme; + exports org.apache.wicket.extensions.markup.html.form.select; + exports org.apache.wicket.extensions.markup.html.image.resource; + exports org.apache.wicket.extensions.markup.html.repeater.data.grid; + exports org.apache.wicket.extensions.markup.html.repeater.data.sort; + exports org.apache.wicket.extensions.markup.html.repeater.data.table; + exports org.apache.wicket.extensions.markup.html.repeater.data.table.export; + exports org.apache.wicket.extensions.markup.html.repeater.data.table.filter; + exports org.apache.wicket.extensions.markup.html.repeater.tree; + exports org.apache.wicket.extensions.markup.html.repeater.tree.content; + exports org.apache.wicket.extensions.markup.html.repeater.tree.nested; + exports org.apache.wicket.extensions.markup.html.repeater.tree.table; + exports org.apache.wicket.extensions.markup.html.repeater.tree.theme; + exports org.apache.wicket.extensions.markup.html.repeater.util; + exports org.apache.wicket.extensions.markup.html.tabs; + exports org.apache.wicket.extensions.model; + exports org.apache.wicket.extensions.rating; + exports org.apache.wicket.extensions.requestlogger; + exports org.apache.wicket.extensions.util.encoding; + exports org.apache.wicket.extensions.validation.validator; + exports org.apache.wicket.extensions.wizard; + exports org.apache.wicket.extensions.wizard.dynamic; +} diff --git a/wicket-extensions/src/test/java/org/apache/wicket/extensions/util/license/ApacheLicenceHeaderTest.java b/wicket-extensions/src/test/java/org/apache/wicket/extensions/util/license/ApacheLicenceHeaderTest.java new file mode 100644 index 00000000000..4a0c427a784 --- /dev/null +++ b/wicket-extensions/src/test/java/org/apache/wicket/extensions/util/license/ApacheLicenceHeaderTest.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.extensions.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; + +/** + * Test that the license headers are in place in this project. The tests are run from + * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. + * + * @author Frank Bille Jensen (frankbille) + */ +public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase +{ + /** + * Construct. + */ + public ApacheLicenceHeaderTest() + { + // addHeaders = true; + } +} diff --git a/wicket-extensions/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java b/wicket-extensions/src/test/java/org/apache/wicket/extensions/util/markup/xhtml/WellFormedXmlTest.java similarity index 89% rename from wicket-extensions/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java rename to wicket-extensions/src/test/java/org/apache/wicket/extensions/util/markup/xhtml/WellFormedXmlTest.java index 88d902528f6..412dd0452ef 100644 --- a/wicket-extensions/src/test/java/org/apache/wicket/util/markup/xhtml/WellFormedXmlTest.java +++ b/wicket-extensions/src/test/java/org/apache/wicket/extensions/util/markup/xhtml/WellFormedXmlTest.java @@ -1,34 +1,35 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.markup.xhtml; - -import org.junit.jupiter.api.Test; - -/** - * Checks that the html markup files are well formed xml-s. - * - * @author akiraly - */ -public class WellFormedXmlTest extends WellFormedXmlTestCase -{ - @Test - @Override - public void markupFiles() - { - super.markupFiles(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.extensions.util.markup.xhtml; + +import org.apache.wicket.util.markup.xhtml.WellFormedXmlTestCase; +import org.junit.jupiter.api.Test; + +/** + * Checks that the html markup files are well formed xml-s. + * + * @author akiraly + */ +public class WellFormedXmlTest extends WellFormedXmlTestCase +{ + @Test + @Override + public void markupFiles() + { + super.markupFiles(); + } +} diff --git a/wicket-guice/pom.xml b/wicket-guice/pom.xml index c9c95f6b74f..d4180ac5e00 100644 --- a/wicket-guice/pom.xml +++ b/wicket-guice/pom.xml @@ -31,10 +31,6 @@ examples project for usecases. - - org.apache.wicket.guice - - com.google.inject diff --git a/wicket-guice/src/main/java/module-info.java b/wicket-guice/src/main/java/module-info.java new file mode 100644 index 00000000000..926d1e624f1 --- /dev/null +++ b/wicket-guice/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.guice { + requires javax.servlet.api; + requires org.apache.wicket.util; + requires org.apache.wicket.core; + requires org.apache.wicket.ioc; + requires javax.inject; + requires com.google.guice; + + exports org.apache.wicket.guice; +} diff --git a/wicket-ioc/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-guice/src/test/java/org/apache/wicket/guice/util/license/ApacheLicenceHeaderTest.java similarity index 91% rename from wicket-ioc/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-guice/src/test/java/org/apache/wicket/guice/util/license/ApacheLicenceHeaderTest.java index 994fb78a394..b2732c8ac23 100644 --- a/wicket-ioc/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-guice/src/test/java/org/apache/wicket/guice/util/license/ApacheLicenceHeaderTest.java @@ -1,34 +1,37 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.license; - -/** - * Test that the license headers are in place in this project. The tests are run from - * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. - * - * @author Frank Bille Jensen (frankbille) - */ -public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase -{ - /** - * Construct. - */ - public ApacheLicenceHeaderTest() - { - // addHeaders = true; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.guice.util.license; + + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; + +/** + * Test that the license headers are in place in this project. The tests are run from + * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. + * + * @author Frank Bille Jensen (frankbille) + */ +public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase +{ + /** + * Construct. + */ + public ApacheLicenceHeaderTest() + { + // addHeaders = true; + } +} diff --git a/wicket-ioc/pom.xml b/wicket-ioc/pom.xml index 106b9116bff..d34c07f6189 100644 --- a/wicket-ioc/pom.xml +++ b/wicket-ioc/pom.xml @@ -31,10 +31,6 @@ Spring, Guice, etc. - - org.apache.wicket.ioc - - cglib diff --git a/wicket-ioc/src/main/java/module-info.java b/wicket-ioc/src/main/java/module-info.java new file mode 100644 index 00000000000..6f7f7e1d124 --- /dev/null +++ b/wicket-ioc/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.ioc { + requires org.apache.wicket.util; + requires org.apache.wicket.core; + requires cglib; + requires org.objenesis; + + exports org.apache.wicket.injection; + exports org.apache.wicket.proxy; + exports org.apache.wicket.proxy.objenesis; +} diff --git a/wicket-ioc/src/test/java/org/apache/wicket/injection/util/license/ApacheLicenceHeaderTest.java b/wicket-ioc/src/test/java/org/apache/wicket/injection/util/license/ApacheLicenceHeaderTest.java new file mode 100644 index 00000000000..ec8002781f8 --- /dev/null +++ b/wicket-ioc/src/test/java/org/apache/wicket/injection/util/license/ApacheLicenceHeaderTest.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.injection.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; + +/** + * Test that the license headers are in place in this project. The tests are run from + * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. + * + * @author Frank Bille Jensen (frankbille) + */ +public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase +{ + /** + * Construct. + */ + public ApacheLicenceHeaderTest() + { + // addHeaders = true; + } +} diff --git a/wicket-jmx/pom.xml b/wicket-jmx/pom.xml index b549be87d17..15c050c3446 100644 --- a/wicket-jmx/pom.xml +++ b/wicket-jmx/pom.xml @@ -28,10 +28,6 @@ Wicket JMX Wicket Java Management Extensions - - org.apache.wicket.jmx - - cglib diff --git a/wicket-jmx/src/main/java/module-info.java b/wicket-jmx/src/main/java/module-info.java new file mode 100644 index 00000000000..d07942dc633 --- /dev/null +++ b/wicket-jmx/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.jmx { + requires java.management; + requires org.apache.wicket.util; + requires org.apache.wicket.core; + requires org.slf4j; + requires cglib; + + provides org.apache.wicket.IInitializer with org.apache.wicket.jmx.Initializer; + exports org.apache.wicket.jmx; + exports org.apache.wicket.jmx.wrapper; +} diff --git a/wicket-guice/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-jmx/src/test/java/org/apache/wicket/jmx/util/license/ApacheLicenceHeaderTest.java similarity index 91% rename from wicket-guice/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-jmx/src/test/java/org/apache/wicket/jmx/util/license/ApacheLicenceHeaderTest.java index 07e18e8ba4e..99a576d9c7a 100644 --- a/wicket-guice/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-jmx/src/test/java/org/apache/wicket/jmx/util/license/ApacheLicenceHeaderTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.jmx.util.license; +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-jmx/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-jmx/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java deleted file mode 100644 index 7efc3af6542..00000000000 --- a/wicket-jmx/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.license; - -/** - * Test that the license headers are in place in this project. The tests are run from - * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. - * - * @author Frank Bille Jensen (frankbille) - */ -public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase -{ - /** - * Construct. - */ - public ApacheLicenceHeaderTest() - { - // addHeaders = true; - } -} diff --git a/wicket-native-websocket/wicket-native-websocket-core/pom.xml b/wicket-native-websocket/wicket-native-websocket-core/pom.xml index 460b745c82b..fc2def4c644 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-core/pom.xml @@ -30,10 +30,6 @@ Wicket Native WebSocket Core Provides the common code needed for the different integrations with web container's WebSocket implementations - - org.apache.wicket.websocket.core - - org.apache.wicket diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/module-info.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/module-info.java new file mode 100644 index 00000000000..756e180c6c6 --- /dev/null +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/module-info.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.websocket.core { + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires javax.servlet.api; + requires org.slf4j; + + exports org.apache.wicket.protocol.ws; + exports org.apache.wicket.protocol.ws.api; + exports org.apache.wicket.protocol.ws.api.event; + exports org.apache.wicket.protocol.ws.api.message; + exports org.apache.wicket.protocol.ws.api.registry; + exports org.apache.wicket.protocol.ws.concurrent; + exports org.apache.wicket.protocol.ws.util.tester; +} diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml index 9855dd5adb0..b0e6c26b78b 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml @@ -28,10 +28,6 @@ Wicket Native WebSocket Javax Provides the common code needed for the different integrations with web container's WebSocket implementations - - org.apache.wicket.websocket.javax - - jakarta.websocket diff --git a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/module-info.java b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/module-info.java new file mode 100644 index 00000000000..7c985adaca7 --- /dev/null +++ b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.websocket.javax { + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.apache.wicket.websocket.core; + requires javax.servlet.api; + requires jakarta.websocket.api; + requires org.slf4j; + + exports org.apache.wicket.protocol.ws.javax; +} diff --git a/wicket-objectsizeof-agent/pom.xml b/wicket-objectsizeof-agent/pom.xml index e0cd694e089..df41dde57cc 100644 --- a/wicket-objectsizeof-agent/pom.xml +++ b/wicket-objectsizeof-agent/pom.xml @@ -28,10 +28,6 @@ Wicket Objects Sizeof Agent Agent for pluggin in object size measurements using instrumentation - - org.apache.wicket.objectsizeof.agent - - org.apache.wicket diff --git a/wicket-objectsizeof-agent/src/main/java/module-info.java b/wicket-objectsizeof-agent/src/main/java/module-info.java new file mode 100644 index 00000000000..5b298674a71 --- /dev/null +++ b/wicket-objectsizeof-agent/src/main/java/module-info.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.objectsizeof.agent { + requires java.instrument; + requires org.slf4j; + requires org.apache.wicket.core; + + exports org.apache.wicket.util.instrument; +} diff --git a/wicket-request/src/main/java/module-info.java b/wicket-request/src/main/java/module-info.java new file mode 100644 index 00000000000..cc2fe4ec289 --- /dev/null +++ b/wicket-request/src/main/java/module-info.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.request { + requires java.sql; + requires org.apache.wicket.util; + requires org.slf4j; + requires javax.servlet.api; + + exports org.apache.wicket.request; + exports org.apache.wicket.request.flow; + exports org.apache.wicket.request.handler; + exports org.apache.wicket.request.handler.logger; + exports org.apache.wicket.request.http; + exports org.apache.wicket.request.http.flow; + exports org.apache.wicket.request.http.handler; + exports org.apache.wicket.request.mapper; + exports org.apache.wicket.request.mapper.info; + exports org.apache.wicket.request.mapper.parameter; + exports org.apache.wicket.request.parameter; +} diff --git a/wicket-spring/src/main/java/module-info.java b/wicket-spring/src/main/java/module-info.java new file mode 100644 index 00000000000..71feeb7aeb8 --- /dev/null +++ b/wicket-spring/src/main/java/module-info.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.spring { + requires org.apache.wicket.util; + requires org.apache.wicket.core; + requires org.apache.wicket.ioc; + requires javax.inject; + requires javax.servlet.api; + requires spring.beans; + requires spring.context; + requires spring.core; + requires spring.web; + + exports org.apache.wicket.spring; + exports org.apache.wicket.spring.injection.annot; + exports org.apache.wicket.spring.test; +} diff --git a/wicket-extensions/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-spring/src/test/java/org/apache/wicket/spring/util/license/ApacheLicenceHeaderTest.java similarity index 91% rename from wicket-extensions/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-spring/src/test/java/org/apache/wicket/spring/util/license/ApacheLicenceHeaderTest.java index 7efc3af6542..b7fc2053338 100644 --- a/wicket-extensions/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-spring/src/test/java/org/apache/wicket/spring/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.spring.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-spring/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-spring/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java deleted file mode 100644 index 7efc3af6542..00000000000 --- a/wicket-spring/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.license; - -/** - * Test that the license headers are in place in this project. The tests are run from - * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. - * - * @author Frank Bille Jensen (frankbille) - */ -public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase -{ - /** - * Construct. - */ - public ApacheLicenceHeaderTest() - { - // addHeaders = true; - } -} diff --git a/wicket-util/pom.xml b/wicket-util/pom.xml index 5a681e2a1ce..d8f843a7b12 100755 --- a/wicket-util/pom.xml +++ b/wicket-util/pom.xml @@ -34,6 +34,7 @@ commons-fileupload + commons-fileupload diff --git a/wicket-util/src/main/java/module-info.java b/wicket-util/src/main/java/module-info.java new file mode 100644 index 00000000000..0e4275f24ad --- /dev/null +++ b/wicket-util/src/main/java/module-info.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.util { + requires java.base; + requires java.management; + requires java.sql; + requires java.xml; + requires java.desktop; + requires org.apache.commons.io; + requires org.apache.commons.collections4; + requires commons.fileupload; + requires org.slf4j; + requires javax.servlet.api; + requires org.junit.jupiter.api; + + exports org.apache.wicket.util; + exports org.apache.wicket.util.collections; + exports org.apache.wicket.util.convert; + exports org.apache.wicket.util.convert.converter; + exports org.apache.wicket.util.crypt; + exports org.apache.wicket.util.diff; + exports org.apache.wicket.util.diff.myers; + exports org.apache.wicket.util.encoding; + exports org.apache.wicket.util.file; + exports org.apache.wicket.util.io; + exports org.apache.wicket.util.lang; + exports org.apache.wicket.util.license; + exports org.apache.wicket.util.listener; + exports org.apache.wicket.util.markup.xhtml; + exports org.apache.wicket.util.parse.metapattern; + exports org.apache.wicket.util.parse.metapattern.parsers; + exports org.apache.wicket.util.resource; + exports org.apache.wicket.util.string; + exports org.apache.wicket.util.string.interpolator; + exports org.apache.wicket.util.thread; + exports org.apache.wicket.util.time; + exports org.apache.wicket.util.value; + exports org.apache.wicket.util.visit; + exports org.apache.wicket.util.watch; + exports org.apache.wicket.util.xml; +} diff --git a/wicket-velocity/src/main/java/module-info.java b/wicket-velocity/src/main/java/module-info.java new file mode 100644 index 00000000000..5ec61a05391 --- /dev/null +++ b/wicket-velocity/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.velocity { + requires javax.servlet.api; + requires org.apache.wicket.util; + requires org.apache.wicket.core; + requires org.slf4j; + requires velocity.engine.core; + + exports org.apache.wicket.velocity; +} diff --git a/wicket-velocity/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-velocity/src/test/java/org/apache/wicket/contrib/util/license/ApacheLicenceHeaderTest.java similarity index 91% rename from wicket-velocity/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-velocity/src/test/java/org/apache/wicket/contrib/util/license/ApacheLicenceHeaderTest.java index 340000abed8..30a6c607ae0 100644 --- a/wicket-velocity/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-velocity/src/test/java/org/apache/wicket/contrib/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.contrib.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from From d0b8d6934a943637d6b2c3cfc97bdd9b782f1f62 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 16 Jul 2021 15:25:44 +0300 Subject: [PATCH 42/88] WICKET-6903 Replace maven-clirr-plugin with something newer Replace Clirr with Japicmp --- archetypes/quickstart/pom.xml | 5 + pom.xml | 98 ++++++++++++------- testing/wicket-common-tests/pom.xml | 2 +- testing/wicket-js-tests/pom.xml | 2 +- testing/wicket-threadtest/pom.xml | 2 +- wicket-examples/pom.xml | 1 + wicket-experimental/pom.xml | 2 +- .../request/flow/RedirectToUrlException.java | 1 - wicket-user-guide/pom.xml | 2 +- 9 files changed, 71 insertions(+), 44 deletions(-) diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml index c8d3bca67e7..01e4641118b 100644 --- a/archetypes/quickstart/pom.xml +++ b/archetypes/quickstart/pom.xml @@ -26,6 +26,11 @@ wicket-archetype-quickstart maven-archetype Wicket Quickstart Archetype + + + true + + diff --git a/pom.xml b/pom.xml index c6d5c31adc4..feac4143d78 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ 2.3 - 2.8 + 0.15.3 3.2.0 5.1.2 3.8.1 @@ -763,8 +763,8 @@ true - org.codehaus.mojo - clirr-maven-plugin + com.github.siom79.japicmp + japicmp-maven-plugin org.apache.maven.plugins @@ -808,6 +808,60 @@ + + com.github.siom79.japicmp + japicmp-maven-plugin + ${japicmp-maven-plugin.version} + + + + ${project.groupId} + ${project.artifactId} + 9.0.0 + jar + + + + + ${project.build.directory}/${project.artifactId}-${project.version}.jar + + + + true + true + true + true + true + true + + + + org.apache.wicket.markup.html.form.EnumChoiceRenderer + + + + + METHOD_ABSTRACT_NOW_DEFAULT + true + true + + + METHOD_NEW_DEFAULT + true + true + + + + + + + verify + + cmp + + + + de.thetaphi forbiddenapis @@ -1126,38 +1180,6 @@ ${project.artifactId} - - org.codehaus.mojo - clirr-maven-plugin - ${clirr-maven-plugin.version} - - 9.0.0 - true - true - - - - 7012 - org/apache/wicket/page/IPageManager - void end() - - - 7012 - org/apache/wicket/pageStore/IPageStore - void end(org.apache.wicket.pageStore.IPageContext) - - - - - - clirr-check - compile - - check - - - - org.eclipse.jetty jetty-maven-plugin @@ -1190,9 +1212,9 @@ - org.codehaus.mojo - clirr-maven-plugin - [2.6.1,) + com.github.siom79.japicmp + japicmp-maven-plugin + [0.15.3,) check diff --git a/testing/wicket-common-tests/pom.xml b/testing/wicket-common-tests/pom.xml index 2253110dc2b..7e2f13ad3ca 100644 --- a/testing/wicket-common-tests/pom.xml +++ b/testing/wicket-common-tests/pom.xml @@ -29,7 +29,7 @@ Tests for all Wicket modules - true + true diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml index be0ef7f0a42..70114b42aa3 100644 --- a/testing/wicket-js-tests/pom.xml +++ b/testing/wicket-js-tests/pom.xml @@ -29,7 +29,7 @@ JavaScript tests for all Wicket modules - true + true diff --git a/testing/wicket-threadtest/pom.xml b/testing/wicket-threadtest/pom.xml index b5c399bce8b..2f5f311a83a 100644 --- a/testing/wicket-threadtest/pom.xml +++ b/testing/wicket-threadtest/pom.xml @@ -30,7 +30,7 @@ org.apache.wicket.thread.tests - true + true diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index 5dc9e60097f..24e82bceae4 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -33,6 +33,7 @@ 1.4.13 + true diff --git a/wicket-experimental/pom.xml b/wicket-experimental/pom.xml index 3708ee35a9f..9f06be90977 100644 --- a/wicket-experimental/pom.xml +++ b/wicket-experimental/pom.xml @@ -34,6 +34,6 @@ - true + true diff --git a/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java b/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java index 98a45cb3268..c9d6ba2119e 100644 --- a/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java +++ b/wicket-request/src/main/java/org/apache/wicket/request/flow/RedirectToUrlException.java @@ -57,7 +57,6 @@ public RedirectToUrlException(final String redirectUrl, final int statusCode) super(new RedirectRequestHandler(redirectUrl, statusCode), true); } - /** * Construct. * diff --git a/wicket-user-guide/pom.xml b/wicket-user-guide/pom.xml index b1f4e1087c7..f3053a980ac 100644 --- a/wicket-user-guide/pom.xml +++ b/wicket-user-guide/pom.xml @@ -33,7 +33,7 @@ org.apache.wicket.userguide 1.5.5 - true + true 1.7.21 From a10180858b72804b8239ae858419bdd0fe4c372e Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 16 Jul 2021 16:27:54 +0300 Subject: [PATCH 43/88] WICKET-6904 Make Apache Wicket fully supporting Java9+ module system JPMS-ize the http2 modules (this commit won't be cherry-picked to wicket-10.x) --- wicket-experimental/wicket-http2/pom.xml | 11 ++++++ .../src/main/java/module-info.java | 27 ++++++++++++++ .../util/license/ApacheLicenceHeaderTest.java | 4 ++- .../wicket-http2/wicket-http2-jetty/pom.xml | 4 +++ .../src/main/java/module-info.java | 27 ++++++++++++++ .../util/license/ApacheLicenceHeaderTest.java | 4 ++- .../src/main/java/module-info.java | 26 ++++++++++++++ .../util/license/ApacheLicenceHeaderTest.java | 4 ++- .../wicket-http2/wicket-http2-tomcat/pom.xml | 4 +++ .../src/main/java/module-info.java | 27 ++++++++++++++ .../util/license/ApacheLicenceHeaderTest.java | 4 ++- .../wicket-http2-undertow/pom.xml | 4 +++ .../src/main/java/module-info.java | 27 ++++++++++++++ .../util/license/ApacheLicenceHeaderTest.java | 36 +++++++++++++++++++ .../util/license/ApacheLicenceHeaderTest.java | 34 ------------------ 15 files changed, 205 insertions(+), 38 deletions(-) create mode 100644 wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/module-info.java rename wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/{ => http2/markup}/util/license/ApacheLicenceHeaderTest.java (90%) create mode 100644 wicket-experimental/wicket-http2/wicket-http2-jetty/src/main/java/module-info.java rename wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/{ => http2/markup/head/jetty}/util/license/ApacheLicenceHeaderTest.java (90%) create mode 100644 wicket-experimental/wicket-http2/wicket-http2-servlet4/src/main/java/module-info.java rename wicket-experimental/wicket-http2/{wicket-http2-tomcat/src/test/java/org/apache/wicket => wicket-http2-servlet4/src/test/java/org/apache/wicket/http2/markup/head/servlet4}/util/license/ApacheLicenceHeaderTest.java (89%) create mode 100644 wicket-experimental/wicket-http2/wicket-http2-tomcat/src/main/java/module-info.java rename wicket-experimental/wicket-http2/{wicket-http2-servlet4/src/test/java/org/apache/wicket => wicket-http2-tomcat/src/test/java/org/apache/wicket/http2/markup/head/tomcat}/util/license/ApacheLicenceHeaderTest.java (90%) create mode 100644 wicket-experimental/wicket-http2/wicket-http2-undertow/src/main/java/module-info.java create mode 100644 wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/http2/markup/head/undertow/util/license/ApacheLicenceHeaderTest.java delete mode 100644 wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java diff --git a/wicket-experimental/wicket-http2/pom.xml b/wicket-experimental/wicket-http2/pom.xml index 33e0db796a2..871d5597843 100644 --- a/wicket-experimental/wicket-http2/pom.xml +++ b/wicket-experimental/wicket-http2/pom.xml @@ -38,4 +38,15 @@ wicket-http2-tomcat wicket-http2-undertow + + + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/module-info.java b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/module-info.java new file mode 100644 index 00000000000..b18f0df9fe5 --- /dev/null +++ b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.http2.core { + requires org.apache.wicket.util; + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.slf4j; + requires javax.servlet.api; + + exports org.apache.wicket.http2; + exports org.apache.wicket.http2.markup.head; +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/http2/markup/util/license/ApacheLicenceHeaderTest.java similarity index 90% rename from wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/http2/markup/util/license/ApacheLicenceHeaderTest.java index 7efc3af6542..c37435a0284 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-experimental/wicket-http2/wicket-http2-core/src/test/java/org/apache/wicket/http2/markup/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.http2.markup.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml index 9dfcab65c90..ec1b9c95f5c 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml @@ -38,6 +38,10 @@ + + javax.servlet + javax.servlet-api + org.eclipse.jetty jetty-server diff --git a/wicket-experimental/wicket-http2/wicket-http2-jetty/src/main/java/module-info.java b/wicket-experimental/wicket-http2/wicket-http2-jetty/src/main/java/module-info.java new file mode 100644 index 00000000000..5bb2da0bb97 --- /dev/null +++ b/wicket-experimental/wicket-http2/wicket-http2-jetty/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.http2.jetty { + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.apache.wicket.http2.core; + requires org.slf4j; + requires javax.servlet.api; + requires org.eclipse.jetty.server; + + exports org.apache.wicket.http2.markup.head.jetty; +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/http2/markup/head/jetty/util/license/ApacheLicenceHeaderTest.java similarity index 90% rename from wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/http2/markup/head/jetty/util/license/ApacheLicenceHeaderTest.java index 7efc3af6542..8ce043c7fc5 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-experimental/wicket-http2/wicket-http2-jetty/src/test/java/org/apache/wicket/http2/markup/head/jetty/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.http2.markup.head.jetty.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/main/java/module-info.java b/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/main/java/module-info.java new file mode 100644 index 00000000000..bb6963d7e76 --- /dev/null +++ b/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.http2.servlet4 { + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.apache.wicket.http2.core; + requires org.slf4j; + requires javax.servlet.api; + + exports org.apache.wicket.http2.markup.head.servlet4; +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/test/java/org/apache/wicket/http2/markup/head/servlet4/util/license/ApacheLicenceHeaderTest.java similarity index 89% rename from wicket-experimental/wicket-http2/wicket-http2-tomcat/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-experimental/wicket-http2/wicket-http2-servlet4/src/test/java/org/apache/wicket/http2/markup/head/servlet4/util/license/ApacheLicenceHeaderTest.java index 7efc3af6542..e0bf2f9cddc 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/test/java/org/apache/wicket/http2/markup/head/servlet4/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.http2.markup.head.servlet4.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml index 5fc03feec69..00847fb8343 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml @@ -49,6 +49,10 @@ + + javax.servlet + javax.servlet-api + org.apache.tomcat tomcat-catalina diff --git a/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/main/java/module-info.java b/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/main/java/module-info.java new file mode 100644 index 00000000000..42b4b716707 --- /dev/null +++ b/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.http2.tomcat { + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.apache.wicket.http2.core; + requires org.slf4j; + requires javax.servlet.api; + requires tomcat.catalina; + + exports org.apache.wicket.http2.markup.head.tomcat; +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/test/java/org/apache/wicket/http2/markup/head/tomcat/util/license/ApacheLicenceHeaderTest.java similarity index 90% rename from wicket-experimental/wicket-http2/wicket-http2-servlet4/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java rename to wicket-experimental/wicket-http2/wicket-http2-tomcat/src/test/java/org/apache/wicket/http2/markup/head/tomcat/util/license/ApacheLicenceHeaderTest.java index 7efc3af6542..6d21e770697 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-servlet4/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ b/wicket-experimental/wicket-http2/wicket-http2-tomcat/src/test/java/org/apache/wicket/http2/markup/head/tomcat/util/license/ApacheLicenceHeaderTest.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.util.license; +package org.apache.wicket.http2.markup.head.tomcat.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; /** * Test that the license headers are in place in this project. The tests are run from diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml index 20c81940de3..51f9cb0ec69 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml @@ -53,6 +53,10 @@ io.undertow undertow-servlet + + javax.servlet + javax.servlet-api + org.apache.wicket.experimental.wicket9 wicket-http2-core diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/src/main/java/module-info.java b/wicket-experimental/wicket-http2/wicket-http2-undertow/src/main/java/module-info.java new file mode 100644 index 00000000000..1eacbdb9ed8 --- /dev/null +++ b/wicket-experimental/wicket-http2/wicket-http2-undertow/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.wicket.http2.undertow { + requires org.apache.wicket.request; + requires org.apache.wicket.core; + requires org.apache.wicket.http2.core; + requires org.slf4j; + requires javax.servlet.api; + requires undertow.servlet; + + exports org.apache.wicket.http2.markup.head.undertow; +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/http2/markup/head/undertow/util/license/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/http2/markup/head/undertow/util/license/ApacheLicenceHeaderTest.java new file mode 100644 index 00000000000..5bea4fd50bf --- /dev/null +++ b/wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/http2/markup/head/undertow/util/license/ApacheLicenceHeaderTest.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.http2.markup.head.undertow.util.license; + +import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase; + +/** + * Test that the license headers are in place in this project. The tests are run from + * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. + * + * @author Frank Bille Jensen (frankbille) + */ +public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase +{ + /** + * Construct. + */ + public ApacheLicenceHeaderTest() + { + // addHeaders = true; + } +} diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java deleted file mode 100644 index 7efc3af6542..00000000000 --- a/wicket-experimental/wicket-http2/wicket-http2-undertow/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.util.license; - -/** - * Test that the license headers are in place in this project. The tests are run from - * {@link ApacheLicenseHeaderTestCase}, but you can add project specific tests here if needed. - * - * @author Frank Bille Jensen (frankbille) - */ -public class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase -{ - /** - * Construct. - */ - public ApacheLicenceHeaderTest() - { - // addHeaders = true; - } -} From d4e9fb4fb2ce2c0557fb5abfebeb06f3d93f685c Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Sun, 18 Jul 2021 23:20:49 +0300 Subject: [PATCH 44/88] Fix failing test by updating the resource url scheme to HTTPS --- .../java/org/apache/wicket/util/io/ConnectionsTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java b/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java index 5ea6f25fc51..548b84c3bf3 100644 --- a/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java +++ b/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java @@ -28,15 +28,15 @@ * Tests for {@link Connections} */ @Tag(WicketTestTag.SLOW) -public class ConnectionsTest +class ConnectionsTest { /** * https://issues.apache.org/jira/browse/WICKET-5838 */ @Test - public void getLastModified() throws Exception + void getLastModified() throws Exception { - URL url = new URL("http://wicket.apache.org/learn/books/wia.png"); + URL url = new URL("https://wicket.apache.org/learn/books/wia.png"); Instant lastModified = Connections.getLastModified(url); assertNotNull(lastModified); assertNotEquals(lastModified.toEpochMilli(), 0L); From f542c4d50a4a689b6d8719db006cb186d3186a8b Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 19 Jul 2021 00:05:04 +0300 Subject: [PATCH 45/88] WICKET-6901 Rename ITagModifier.NoOp to NO_OP To follow Java naming conventions. Remove some implicit Java modifiers for constants in interface class --- .../wicket/bean/validation/BeanValidationConfiguration.java | 4 ++-- .../java/org/apache/wicket/bean/validation/ITagModifier.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java index 625939c2424..d115819b85f 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/BeanValidationConfiguration.java @@ -88,9 +88,9 @@ public BeanValidationConfiguration() * Registers a tag modifier for a specific constraint annotation. *

* By default {@link Size} constraints are automatically mapped to maxlength of text inputs, - * this can be disabled by registering a {@link ITagModifier#NoOp} instead: + * this can be disabled by registering a {@link ITagModifier#NO_OP} instead: * - * configuration.register(Size.class, ITagModifier.NoOp}); + * configuration.register(Size.class, ITagModifier.NO_OP}); * * * @param annotationType diff --git a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java index 6c37caccd83..5627f7ccf4a 100644 --- a/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java +++ b/wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/ITagModifier.java @@ -46,6 +46,6 @@ public interface ITagModifier */ void modify(FormComponent component, ComponentTag tag, T annotation); - public static final ITagModifier NoOp = (component, tag, annotation) -> { + ITagModifier NO_OP = (component, tag, annotation) -> { }; -} \ No newline at end of file +} From 23c1584636d374ee380a8f5b9fb25aef969ee3f8 Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Sat, 17 Jul 2021 00:18:02 +0200 Subject: [PATCH 46/88] WICKET-6902 allow prepend and append up-to including #onAfterRespond() --- .../wicket/ajax/AjaxRequestHandler.java | 12 +--- .../apache/wicket/ajax/AjaxRequestTarget.java | 45 ++++++++++---- .../apache/wicket/page/PartialPageUpdate.java | 22 ++++++- .../wicket/ajax/AjaxRequestHandlerTest.java | 58 ++++++++++++++----- 4 files changed, 98 insertions(+), 39 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java index 78699bf6ede..fd54daa9dc0 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java @@ -145,19 +145,9 @@ protected void onAfterRespond(final Response response) final Map components = Collections .unmodifiableMap(markupIdToComponent); - // create response that will be used by listeners to append javascript - final AjaxRequestTarget.IJavaScriptResponse jsresponse = new AjaxRequestTarget.IJavaScriptResponse() - { - @Override - public void addJavaScript(String script) - { - writeEvaluations(response, Collections. singleton(script)); - } - }; - for (AjaxRequestTarget.IListener listener : listeners) { - listener.onAfterRespond(components, jsresponse); + listener.onAfterRespond(components, AjaxRequestHandler.this); } } } diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java index 6c874dc1453..2e1efb6736d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java @@ -38,34 +38,53 @@ public interface AjaxRequestTarget extends IPartialPageRequestHandler, ILoggable interface IListener { /** - * Triggered before ajax request target begins its response cycle + * Triggered before the target begins writing components. * * @param map * modifiable map (markupId -> component) of components already added to the target * @param target * the target itself. Could be used to add components or to append/prepend - * javascript + * JavaScript * */ default void onBeforeRespond(Map map, AjaxRequestTarget target) {} /** - * Triggered after ajax request target is done with its response cycle. At this point only - * additional javascript can be output to the response using the provided - * {@link AjaxRequestTarget.IJavaScriptResponse} object + * Triggered after the target has written components. At this point only + * additional JavaScript can be added to the response. * - * NOTE: During this stage of processing any calls to target that manipulate the response - * (adding components, javascript) will have no effect + * NOTE: During this stage of processing any calls that manipulate components will result in + * an exception. * * @param map * read-only map:markupId->component of components already added to the target * @param response - * response object that can be used to output javascript + * response object that can be used to output JavaScript + * + * @deprecated implement {@link #onAfterRespond(Map, AjaxRequestTarget)} instead */ + @Deprecated default void onAfterRespond(Map map, AjaxRequestTarget.IJavaScriptResponse response) {} + /** + * Triggered after the target has written components. At this point only + * additional JavaScript can be added to the response. + * + * NOTE: During this stage of processing any calls that manipulate components will result in + * an exception. After notification of all listeners no JavaScript can be added any longer. + * + * @param map + * read-only map:markupId->component of components already added to the target + * @param target + * the target itself. Could be used to append/prepend JavaScript + */ + default void onAfterRespond(Map map, AjaxRequestTarget target) + { + onAfterRespond(map, script -> target.appendJavaScript(script)); + } + /** * Triggered for every Ajax behavior. Can be used to configure common settings. * @@ -80,19 +99,23 @@ default void updateAjaxAttributes(AbstractDefaultAjaxBehavior behavior, AjaxRequ } /** - * An ajax javascript response that allows users to add javascript to be executed on the client + * An ajax JavaScript response that allows users to add JavaScript to be executed on the client * side * * @author ivaynberg + * + * @deprecated use {@link AjaxRequestTargetprependJavaScript(CharSequence)} and + * {@link AjaxRequestTarget#appendJavaScript(CharSequence)} instead */ + @Deprecated @FunctionalInterface interface IJavaScriptResponse { /** - * Adds more javascript to the ajax response that will be executed on the client side + * Adds more JavaScript to the ajax response that will be executed on the client side * * @param script - * javascript + * JavaScript */ void addJavaScript(String script); } diff --git a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java index 1712dc83f02..f95c9593008 100644 --- a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java +++ b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java @@ -103,6 +103,12 @@ public abstract class PartialPageUpdate */ protected transient boolean componentsFrozen; + /** + * A flag that indicates that javascripts cannot be added anymore. + * See https://issues.apache.org/jira/browse/WICKET-6902 + */ + protected transient boolean javascriptsFrozen; + /** * Buffer of response body. */ @@ -161,12 +167,14 @@ public void writeTo(final Response response, final String encoding) // process added components writeComponents(response, encoding); + onAfterRespond(response); + + javascriptsFrozen = true; + // queue up prepend javascripts. unlike other steps these are executed out of order so that // components can contribute them from during rendering. writePriorityEvaluations(response, prependJavaScripts); - onAfterRespond(response); - // execute the dom ready javascripts as first javascripts // after component replacement List evaluationScripts = new ArrayList<>(); @@ -493,6 +501,11 @@ public final void appendJavaScript(final CharSequence javascript) { Args.notNull(javascript, "javascript"); + if (javascriptsFrozen) + { + throw new IllegalStateException("A partial update of the page is being rendered, JavaScript can no longer be added"); + } + appendJavaScripts.add(javascript); } @@ -505,6 +518,11 @@ public final void appendJavaScript(final CharSequence javascript) public final void prependJavaScript(CharSequence javascript) { Args.notNull(javascript, "javascript"); + + if (javascriptsFrozen) + { + throw new IllegalStateException("A partial update of the page is being rendered, JavaScript can no longer be added"); + } prependJavaScripts.add(javascript); } diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestHandlerTest.java b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestHandlerTest.java index 66cc73d3fc1..f2c12362e93 100644 --- a/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestHandlerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestHandlerTest.java @@ -21,14 +21,15 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; + import java.io.IOException; import java.lang.reflect.Constructor; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.apache.wicket.Component; import org.apache.wicket.MarkupContainer; import org.apache.wicket.MockPageWithLink; @@ -38,6 +39,9 @@ import org.apache.wicket.markup.IMarkupResourceStreamProvider; import org.apache.wicket.markup.html.WebComponent; import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.request.IRequestHandler; +import org.apache.wicket.request.cycle.IRequestCycleListener; +import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.util.encoding.UrlEncoder; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; @@ -260,20 +264,24 @@ void defaultEventRaisedOnAjaxResponse() } /** - * @see WICKET-3263 + * WICKET-3263
+ * WICKET-6902 */ @Test void globalAjaxRequestTargetListeners() { - final ValidatingAjaxRequestTargetListener listener = new ValidatingAjaxRequestTargetListener(); - + JavaScriptPrependerAppender listener = new JavaScriptPrependerAppender(); + tester.getApplication().getAjaxRequestTargetListeners().add(listener); + tester.getApplication().getRequestCycleListeners().add(listener); tester.startPage(TestEventPage.class); tester.clickLink(MockPageWithLinkAndComponent.LINK_ID, true); - assertTrue(listener.onBeforeRespondExecuted); - assertTrue(listener.onAfterRespondExecuted); + tester.assertContains("BEFORE_RESPOND_PREPEND"); + tester.assertContains("BEFORE_RESPOND_APPEND"); + tester.assertContains("AFTER_RESPOND_PREPEND"); + tester.assertContains("AFTER_RESPOND_APPEND"); } /** @@ -396,23 +404,43 @@ public IResourceStream getMarkupResourceStream(MarkupContainer container, } } - private static class ValidatingAjaxRequestTargetListener implements AjaxRequestTarget.IListener + /** + * Listener to AjaxRequestTarget and RequestCycle to test prepending and appending of + * JavaScript. + */ + private static class JavaScriptPrependerAppender implements AjaxRequestTarget.IListener, IRequestCycleListener { - boolean onBeforeRespondExecuted = false; - boolean onAfterRespondExecuted = false; - @Override public void onBeforeRespond(Map map, AjaxRequestTarget target) { - onBeforeRespondExecuted = true; - + target.prependJavaScript("BEFORE_RESPOND_PREPEND"); + target.appendJavaScript("BEFORE_RESPOND_APPEND"); } @Override - public void onAfterRespond(Map map, - AjaxRequestTarget.IJavaScriptResponse response) + public void onAfterRespond(Map map, AjaxRequestTarget target) { - onAfterRespondExecuted = true; + target.prependJavaScript("AFTER_RESPOND_PREPEND"); + target.appendJavaScript("AFTER_RESPOND_APPEND"); + } + + @Override + public void onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler) { + if (handler instanceof AjaxRequestHandler) { + try { + ((AjaxRequestHandler) handler).appendJavaScript("FAIL"); + + fail("appendJavaScript should not be allowed at this state"); + } catch (IllegalStateException javascriptFrozen) { + } + + try { + ((AjaxRequestHandler) handler).prependJavaScript("FAIL"); + + fail("prependJavaScript should not be allowed at this state"); + } catch (IllegalStateException javascriptFrozen) { + } + } } } From 6227f156f101315090221aac2b3e9e17359fe776 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 20 Jul 2021 15:52:54 +0300 Subject: [PATCH 47/88] Minor non-functional changes. Use method reference. Fix link in Javadoc. Fix spelling in Javadoc. --- .../main/java/org/apache/wicket/ajax/AjaxRequestTarget.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java index 2e1efb6736d..ce6ab2530ca 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java @@ -82,7 +82,7 @@ default void onAfterRespond(Map map, AjaxRequestTarget.IJavaS */ default void onAfterRespond(Map map, AjaxRequestTarget target) { - onAfterRespond(map, script -> target.appendJavaScript(script)); + onAfterRespond(map, target::appendJavaScript); } /** @@ -104,7 +104,7 @@ default void updateAjaxAttributes(AbstractDefaultAjaxBehavior behavior, AjaxRequ * * @author ivaynberg * - * @deprecated use {@link AjaxRequestTargetprependJavaScript(CharSequence)} and + * @deprecated use {@link AjaxRequestTarget#prependJavaScript(CharSequence)} and * {@link AjaxRequestTarget#appendJavaScript(CharSequence)} instead */ @Deprecated @@ -131,7 +131,7 @@ interface IJavaScriptResponse interface ITargetRespondListener { /** - * Invoked when AjaxRequestTarget is about the respond. + * Invoked when AjaxRequestTarget is about to respond. * * @param target */ From e3958b25642b90dbe011419a5aa0e489ce7774b3 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 23 Jul 2021 09:20:54 +0300 Subject: [PATCH 48/88] INFRA-22136 Replace bintray.io with apache.jfrog.io --- wicket-examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index 24e82bceae4..e3386182ed8 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -314,7 +314,7 @@ dockerfile-maven-plugin ${dockerfile-maven-plugin.version} - apache-docker-wicket-docker.bintray.io/wicket-examples + apache.jfrog.io/wicket-docker/wicket-examples LATEST-9 From 42dd2b96d6ed82aad58670d2844b4bcf79a85ab4 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 27 Jul 2021 10:11:48 +0300 Subject: [PATCH 49/88] WICKET-6909 Link to Javadoc for 9.x is broken on the website Pretend it is pre-JPMS for generating the javadoc. The issue with the Java modules is that 'mvn javadoc:aggregate' tries to create the Javadoc for the parent/pom Maven modules and it complains that there are no Java modules for their children Maven modules... --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index feac4143d78..c28530592d8 100644 --- a/pom.xml +++ b/pom.xml @@ -1067,7 +1067,7 @@ false none ${javadoc.additionalJOption} - ${java.specification.version} + 8 From 5256d3c1d7549658666994792e831cf68e0c3341 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 27 Jul 2021 11:55:39 +0300 Subject: [PATCH 50/88] Fix javadoc errors Enable failOnError=true for javadoc. Enable all javadoc lints but 'html'. --- pom.xml | 4 +- .../java/org/apache/wicket/Component.java | 1 + .../org/apache/wicket/IGenericComponent.java | 2 +- .../org/apache/wicket/MarkupContainer.java | 5 ++- .../main/java/org/apache/wicket/Session.java | 38 ++++++++++--------- .../ajax/attributes/AjaxAttributeName.java | 10 ++--- .../core/request/mapper/ResourceMapper.java | 7 ++-- .../core/util/crypt/AbstractJceCrypt.java | 1 - .../apache/wicket/markup/ComponentTag.java | 2 +- .../org/apache/wicket/markup/MarkupCache.java | 4 +- .../wicket/markup/html/CrossOrigin.java | 8 ++-- .../html/SecurePackageResourceGuard.java | 1 + .../markup/html/image/ExternalImage.java | 4 +- .../wicket/markup/html/image/Image.java | 2 +- .../apache/wicket/markup/html/link/Link.java | 4 +- .../markup/html/media/MediaComponent.java | 16 ++++---- .../wicket/markup/html/media/Source.java | 4 +- .../wicket/markup/html/media/Track.java | 2 +- .../wicket/markup/parser/XmlPullParser.java | 2 +- .../wicket/pageStore/CryptingPageStore.java | 2 +- .../protocol/http/ClientProperties.java | 2 +- .../protocol/http/ReloadingWicketFilter.java | 12 +++--- .../wicket/protocol/http/WicketServlet.java | 4 +- ...redRemoteAddressRequestWrapperFactory.java | 1 + .../http/servlet/WicketSessionFilter.java | 2 - .../XForwardedRequestWrapperFactory.java | 5 +++ .../caching/IStaticCacheableResource.java | 2 +- .../version/CachingResourceVersion.java | 2 +- .../version/MessageDigestResourceVersion.java | 1 - .../TextTemplateResourceReference.java | 2 +- .../wicket/util/tester/WicketTester.java | 3 +- .../http2/markup/head/PushHeaderItem.java | 3 +- .../wicket/http2/markup/head/PushItem.java | 6 +-- .../autocomplete/AutoCompleteSettings.java | 1 + .../ajax/markup/html/modal/ModalDialog.java | 2 +- .../wicket/request/http/WebResponse.java | 1 - .../spring/test/ApplicationContextMock.java | 2 +- .../org/apache/wicket/util/diff/AddDelta.java | 15 -------- .../apache/wicket/util/diff/ChangeDelta.java | 15 -------- .../apache/wicket/util/diff/DeleteDelta.java | 15 -------- .../org/apache/wicket/util/diff/Delta.java | 2 - .../wicket/util/diff/myers/MyersDiff.java | 2 - 42 files changed, 89 insertions(+), 130 deletions(-) diff --git a/pom.xml b/pom.xml index c28530592d8..d03923576ea 100644 --- a/pom.xml +++ b/pom.xml @@ -1064,8 +1064,8 @@ ${javadoc.jdk.apidocs.link} true - false - none + true + all,-html ${javadoc.additionalJOption} 8 diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index 83618f3d9b1..16f8e4407a2 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -206,6 +206,7 @@ *

  • Security - All components are subject to an {@link IAuthorizationStrategy} which * controls instantiation, visibility and enabling. See {@link SimplePageAuthorizationStrategy} for * a simple implementation.
  • + * * * @author Jonathan Locke * @author Chris Turner diff --git a/wicket-core/src/main/java/org/apache/wicket/IGenericComponent.java b/wicket-core/src/main/java/org/apache/wicket/IGenericComponent.java index d208e4d191d..59dd46015c1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/IGenericComponent.java +++ b/wicket-core/src/main/java/org/apache/wicket/IGenericComponent.java @@ -23,7 +23,7 @@ * for the model and its object. * *

    - * Usage:
    + * Usage:
    * * public class MyComponent<T> extends AnotherComponent implements IGenericComponent<T, MyComponent<T>> { ... } * diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java index d0309ffd322..5893186a4cb 100644 --- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java @@ -70,13 +70,14 @@ * nested container "b" which held a nested component "c", then a.get("b:c") would return the * Component with id "c". The number of children in a MarkupContainer can be determined by calling * size(), and the whole hierarchy of children held by a MarkupContainer can be traversed by calling - * visitChildren(), passing in an implementation of IVisitor. + * visitChildren(), passing in an implementation of IVisitor. * *

  • Markup Rendering - A MarkupContainer also holds/references associated markup which is * used to render the container. As the markup stream for a container is rendered, component * references in the markup are resolved by using the container to look up Components in the * container's component map by id. Each component referenced by the markup stream is given an - * opportunity to render itself using the markup stream. + * opportunity to render itself using the markup stream.
  • + * *

    * Components may alter their referring tag, replace the tag's body or insert markup after the tag. * But components cannot remove tags from the markup stream. This is an important guarantee because diff --git a/wicket-core/src/main/java/org/apache/wicket/Session.java b/wicket-core/src/main/java/org/apache/wicket/Session.java index 9906da1d7f2..c4152c9f6d6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Session.java +++ b/wicket-core/src/main/java/org/apache/wicket/Session.java @@ -56,30 +56,31 @@ *

  • Access - the Session can be retrieved either by {@link Component#getSession()} * or by directly calling the static method Session.get(). All classes which extend directly or indirectly * {@link org.apache.wicket.markup.html.WebMarkupContainer} can also use its convenience method - * {@link org.apache.wicket.markup.html.WebMarkupContainer#getWebSession()} + * {@link org.apache.wicket.markup.html.WebMarkupContainer#getWebSession()}
  • * *
  • Locale - A session has a Locale property to support localization. The Locale for a * session can be set by calling {@link Session#setLocale(Locale)}. The Locale for a Session - * determines how localized resources are found and loaded. + * determines how localized resources are found and loaded.
  • * *
  • Style - Besides having an appearance based on locale, resources can also have * different looks in the same locale (a.k.a. "skins"). The style for a session determines the look * which is used within the appropriate locale. The session style ("skin") can be set with the - * setStyle() method. + * setStyle() method.
  • * *
  • Resource Loading - Based on the Session locale and style, searching for resources * occurs in the following order (where sourcePath is set via the ApplicationSettings object for the * current Application, and style and locale are Session properties): - *
      - * 1. [sourcePath]/name[style][locale].[extension]
      - * 2. [sourcePath]/name[locale].[extension]
      - * 3. [sourcePath]/name[style].[extension]
      - * 4. [sourcePath]/name.[extension]
      - * 5. [classPath]/name[style][locale].[extension]
      - * 6. [classPath]/name[locale].[extension]
      - * 7. [classPath]/name[style].[extension]
      - * 8. [classPath]/name.[extension]
      - *
    + *
      + *
    1. [sourcePath]/name[style][locale].[extension]
    2. + *
    3. [sourcePath]/name[locale].[extension]
    4. + *
    5. [sourcePath]/name[style].[extension]
    6. + *
    7. [sourcePath]/name.[extension]
    8. + *
    9. [classPath]/name[style][locale].[extension]
    10. + *
    11. [classPath]/name[locale].[extension]
    12. + *
    13. [classPath]/name[style].[extension]
    14. + *
    15. [classPath]/name.[extension]
    16. + *
    + *
  • * *
  • Session Properties - Arbitrary objects can be attached to a Session by installing a * session factory on your Application class which creates custom Session subclasses that have @@ -87,20 +88,21 @@ * discourage non-typesafe access to Session properties, no setProperty() or getProperty() method is * provided. In a clustered environment, you should take care to call the dirty() method when you * change a property on your own. This way the session will be reset again in the http session so - * that the http session knows the session is changed. + * that the http session knows the session is changed.
  • * *
  • Class Resolver - Sessions have a class resolver ( {@link IClassResolver}) - * implementation that is used to locate classes for components such as pages. + * implementation that is used to locate classes for components such as pages.
  • * *
  • Page Factory - A pluggable implementation of {@link IPageFactory} is used to - * instantiate pages for the session. + * instantiate pages for the session.
  • * *
  • Removal - Pages can be removed from the Session forcibly by calling clear(), - * although such an action should rarely be necessary. + * although such an action should rarely be necessary.
  • * *
  • Flash Messages - Flash messages are messages that are stored in session and are removed * after they are displayed to the user. Session acts as a store for these messages because they can - * last across requests. + * last across requests.
  • + * * * @author Jonathan Locke * @author Eelco Hillenius diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxAttributeName.java b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxAttributeName.java index 45b0b73dc31..26d8f2a87a5 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxAttributeName.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/AjaxAttributeName.java @@ -190,7 +190,7 @@ public enum AjaxAttributeName { /** * the indicator id, if any found (i) * - * @see AbstractDefaultAjaxBehavior#findIndicatorId() + * See AbstractDefaultAjaxBehavior#findIndicatorId() */ INDICATOR_ID("i"), @@ -218,7 +218,7 @@ public enum AjaxAttributeName { /** * markup id of behavior attached component (c) * - * @see AbstractDefaultAjaxBehavior#renderAjaxAttributes(org.apache.wicket.Component) + * See AbstractDefaultAjaxBehavior#renderAjaxAttributes(Component) */ MARKUP_ID("c"), @@ -230,17 +230,17 @@ public enum AjaxAttributeName { METHOD("m"), /** - * @see AbstractDefaultAjaxBehavior#getCallbackUrl(); + * @see AbstractDefaultAjaxBehavior#getCallbackUrl() */ URL("u"), /** - * @see AjaxRequestAttributes#childSelector + * @see AjaxRequestAttributes#setChildSelector(CharSequence) */ CHILD_SELECTOR("sel"), /** - * @see AjaxRequestAttributes#serializeRecursively + * @see AjaxRequestAttributes#setSerializeRecursively(boolean) */ SERIALIZE_RECURSIVELY("sr"); diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java b/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java index 4f96213d4fc..99a5d8c9bcb 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/ResourceMapper.java @@ -47,14 +47,15 @@ *
  • maps named parameters to query string arguments or placeholder path segments
  • * * - * sample structure of url - * + * Sample structure of url + *

    *

      *    /myresources/${category}/images/[indexed-param-0]/[indexed-param-1]?[named-param-1=value]&[named-param-2=value2]
      * 
    * - *

    sample usage

    + * Sample usage * + *

    * in your wicket application's init() method use a statement like this *

    * diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java index fd1f630a0b8..66be7bf2fb1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/AbstractJceCrypt.java @@ -88,7 +88,6 @@ public final String encryptUrlSafe(final String plainText) * @param plainBytes * text to encrypt * @return the string encrypted - * @throws GeneralSecurityException */ abstract protected byte[] encrypt(final byte[] plainBytes); diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/ComponentTag.java b/wicket-core/src/main/java/org/apache/wicket/markup/ComponentTag.java index b2f50efd016..4bd97081282 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/ComponentTag.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/ComponentTag.java @@ -225,8 +225,8 @@ public final boolean hasBehaviors() /** * @return read only iterator over added behaviors - * @TODO change to return unmodifiable list which will never be null. See Component.getBehavior */ + // TODO change to return unmodifiable list which will never be null. See Component.getBehavior public final Iterator getBehaviors() { if (behaviors == null) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java b/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java index d73ba86d42c..3caa46f1de2 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java @@ -75,8 +75,8 @@ public class MarkupCache implements IMarkupCache /** * A convenient helper to get the markup cache registered with the application. * - * @see {@link Application#getMarkupSettings()} - * @see {@link MarkupFactory#getMarkupCache()} + * @see Application#getMarkupSettings() + * @see MarkupFactory#getMarkupCache() * * @return The markup cache registered with the {@link Application} */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/CrossOrigin.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/CrossOrigin.java index 9151eee6dd9..940ca4d3ee3 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/CrossOrigin.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/CrossOrigin.java @@ -16,10 +16,12 @@ */ package org.apache.wicket.markup.html; +import org.apache.wicket.markup.head.ISubresourceHeaderItem; + /** * To be used for the crossOrigin attribute * - * @see {@link #setCrossOrigin(CrossOrigin)} + * @see ISubresourceHeaderItem#setCrossOrigin(org.apache.wicket.markup.html.CrossOrigin) */ public enum CrossOrigin { /** @@ -37,7 +39,7 @@ public enum CrossOrigin { private final String realName; - private CrossOrigin(String realName) + CrossOrigin(String realName) { this.realName = realName; } @@ -51,4 +53,4 @@ public String getRealName() { return realName; } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java index 957ba805826..7b6a65b837b 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java @@ -44,6 +44,7 @@ *

    * Examples: * + * * * * diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java index ed650a5279e..bcde8ce8d0b 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java @@ -282,7 +282,7 @@ public void removeXValues() /** * Gets the cross origin settings * - * @see {@link org.apache.wicket.markup.html.image.Image#setCrossOrigin(CrossOrigin)} + * @see org.apache.wicket.markup.html.image.Image#setCrossOrigin(CrossOrigin) * * @return the cross origins settings */ @@ -294,7 +294,7 @@ public CrossOrigin getCrossOrigin() /** * Sets the cross origin settings * - * @see {@link org.apache.wicket.markup.html.image.Image#setCrossOrigin(CrossOrigin)} + * @see org.apache.wicket.markup.html.image.Image#setCrossOrigin(CrossOrigin) * @param crossOrigin * the cross origins settings to set */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java index e2ee91968b7..c6e625b15bb 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java @@ -564,7 +564,7 @@ public boolean canCallListener() /** * Gets the cross origin settings * - * @see {@link #setCrossOrigin(CrossOrigin)} + * @see #setCrossOrigin(CrossOrigin) * * @return the cross origins settings */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/link/Link.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/link/Link.java index 305f1ed3243..a374db164f5 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/link/Link.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/link/Link.java @@ -57,7 +57,7 @@ * <td wicket:id="myLink">my clickable column</td> * * - *

    + *

    * The following snippet shows how to pass a parameter from the Page creating the Page to the Page * responded by the Link. * @@ -441,4 +441,4 @@ protected boolean useJSEventBindingWhenNeeded() { return true; } -} \ No newline at end of file +} diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/media/MediaComponent.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/media/MediaComponent.java index cb1b4cfb74f..069af58794d 100755 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/media/MediaComponent.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/media/MediaComponent.java @@ -39,7 +39,7 @@ public abstract class MediaComponent extends WebMarkupContainer /** * To be used for the crossorigin attribute * - * @see {@link #setCrossOrigin(Cors)} + * @see #setCrossOrigin(Cors) */ public enum Cors { /** @@ -76,7 +76,7 @@ public String getRealName() /** * To be used for the preload attribute * - * @see {@link #setPreload(Preload)} + * @see #setPreload(Preload) */ public enum Preload { /** @@ -94,7 +94,7 @@ public enum Preload { private final String realName; - private Preload(String realname) + Preload(String realname) { realName = realname; } @@ -455,7 +455,7 @@ public void setControls(Boolean controls) /** * The type of preload * - * @see {@link #setPreload(Preload)} + * @see #setPreload(Preload) * * @return the preload */ @@ -491,7 +491,7 @@ public void setPreload(Preload preload) /** * Gets the position at which the media component starts the playback * - * @see {@link #setStartTime(String)} + * @see #setStartTime(String) * * @return the time at which position the media component starts the playback */ @@ -528,7 +528,7 @@ public void setStartTime(String startTime) /** * Gets the position at which the media component stops the playback * - * @see {@link #setEndTime(String)} + * @see #setEndTime(String) * * @return the time at which position the media component stops the playback */ @@ -586,7 +586,7 @@ public void setMediaGroup(String mediaGroup) /** * Gets the cross origin settings * - * @see {@link #setCrossOrigin(Cors)} + * @see #setCrossOrigin(Cors) * * @return the cross origins settings */ @@ -620,7 +620,7 @@ public void setCrossOrigin(Cors crossOrigin) /** * Gets the type * - * @see {@link #setType(String)} + * @see #setType(String) * * @return the type of this media element */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Source.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Source.java index bf960c5882f..b11704292f0 100755 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Source.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Source.java @@ -239,7 +239,7 @@ public void setDisplayType(boolean displayType) /** * Gets the type * - * @see {@link #setType(String)} + * @see #setType(String) * * @return the type of this media element */ @@ -299,7 +299,7 @@ public void setType(String type) /** * The media for which the content of this source should be shown * - * @See {@link #setMedia(String)} + * @see #setMedia(String) * @return The media for which the content of this source should be shown */ public String getMedia() diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Track.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Track.java index da167389df8..6b848ac4855 100755 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Track.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/media/Track.java @@ -264,7 +264,7 @@ else if (resourceReference != null && resourceReference.getLocale() != null) /** * Gets the kind of the track belongs to the media component * - * @see {@link #setKind(Kind)} + * @see #setKind(Kind) * * @return the kind */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java index 46dc2b0a743..a4383e09c1b 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/XmlPullParser.java @@ -576,7 +576,7 @@ public void parse(final CharSequence string) throws IOException * The input stream to read and parse * @throws IOException * - * @see {@link #parse(InputStream, String)} + * @see #parse(InputStream, String) */ @Override public void parse(final InputStream in) throws IOException diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java index 5b697b65108..b8e26ac9e9d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/CryptingPageStore.java @@ -36,7 +36,7 @@ * achieve this with *

      *
    • a {@link SerializingPageStore} delegating to this store and
    • - *
    • delegating to a store that does not deserialize its pages, e.g. a {@link DiskPageStore}.
    • . + *
    • delegating to a store that does not deserialize its pages, e.g. a {@link DiskPageStore}.
    • *
    */ public class CryptingPageStore extends DelegatingPageStore diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java index c16aa1e9540..c37573e7a6d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/ClientProperties.java @@ -43,7 +43,7 @@ * getRequestCycleSettings().setGatherExtendedBrowserInfo(true); * * - *

    + *

    * * WARNING: Be sure you think about the dangers of depending on information you pull from the client * too much. They may be easily spoofed or inaccurate in other ways, and properties like window and diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/ReloadingWicketFilter.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/ReloadingWicketFilter.java index 8b5dc39db50..2cce1405acf 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/ReloadingWicketFilter.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/ReloadingWicketFilter.java @@ -58,8 +58,8 @@ * * *

    - * NOTE. If you wish to reload com.company.search.Form, you have to make sure to - * include all classes that reference com.company.search.Form. In particular, if it + * NOTE If you wish to reload com.company.search.Form, you have to make sure to + * include all classes that reference com.company.search.Form. In particular, if it * is referenced in com.company.Application, you will also have to include the latter. And this is * viral, as for every class you include, you must check that all classes that reference it are also * included. @@ -67,7 +67,7 @@ * *

    * It is also possible to add an extra URL to watch for changes using - * ReloadingClassLoader.addLocation() . By default, all the URLs returned by the parent + * ReloadingClassLoader.addLocation() . By default, all the URLs returned by the parent * class loader (ie all {@link URL} returned by {@link ClassLoader#getResources(String)} with empty * {@link String}) are registered. *

    @@ -82,7 +82,7 @@ *
  • Don't forget that inner classes are named after YourClass$1, so take that into account when * setting up the patterns, eg include YourClass*, not just YourClass
  • *
  • To enable back-button support for the reloading mechanism, be sure to put - * Objects.setObjectStreamFactory(new WicketObjectStreamFactory()); in your application's + * Objects.setObjectStreamFactory(new WicketObjectStreamFactory()); in your application's * {@link WebApplication#init()} method. Native JDK object serialization will break the reloading * mechanism when navigating in the browser's history.
  • *
  • It is advisable to exclude subclasses of {@link Session} from the the reloading @@ -103,14 +103,14 @@ * *

    * WARNING. Be careful that when using Spring or other component managers, you will get - * ClassCastException if a given class is loaded two times, one time by the normal + * ClassCastException if a given class is loaded two times, one time by the normal * classloader, and another time by the reloading classloader. You need to ensure that your Spring * beans are properly excluded from the reloading class loader and that only the Wicket components * are included. When getting a cryptic error with regard to class loading, class instantiation or * class comparison, first disable the reloading class loader to rule out the possibility of * a classloader conflict. Please keep in mind that two classes are equal if and only if they have * the same name and are loaded in the same classloader. Same goes for errors like - * LinkageError: Class FooBar violates loader constraints, better be safe and disable the + * LinkageError: Class FooBar violates loader constraints, better be safe and disable the * reloading feature. *

    * diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketServlet.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketServlet.java index 5768c4fd012..5dda99a5a14 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketServlet.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketServlet.java @@ -57,7 +57,7 @@ * Note that the applicationClassName parameter you specify must be the fully qualified name of a * class that extends WebApplication. If your class cannot be found, does not extend WebApplication * or cannot be instantiated, a runtime exception of type WicketRuntimeException will be thrown. - *

    + *

    * As an alternative, you can configure an application factory instead. This looks like: * *

    @@ -97,7 +97,7 @@
      *     ...
      * 
    * - *

    + *

    * In order to support frameworks like Spring, the class is non-final and the variable * webApplication is protected instead of private. Thus subclasses may provide their own means of * providing the application object. diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/SecuredRemoteAddressRequestWrapperFactory.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/SecuredRemoteAddressRequestWrapperFactory.java index eb1dbaeb605..370ebddf8b5 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/SecuredRemoteAddressRequestWrapperFactory.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/SecuredRemoteAddressRequestWrapperFactory.java @@ -37,6 +37,7 @@ *

    * Configuration parameters: *

  • Examples
    +*.gifAll gif files in all directories
    + * * * * diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java index 030ffa4bb8b..18843c62e5a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java @@ -104,8 +104,6 @@ * } * * - *

    - * * @author Eelco Hillenius */ public class WicketSessionFilter implements Filter diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/XForwardedRequestWrapperFactory.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/XForwardedRequestWrapperFactory.java index 761f56754db..63d46ebd4fc 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/XForwardedRequestWrapperFactory.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/XForwardedRequestWrapperFactory.java @@ -64,6 +64,7 @@ *

    * Configuration parameters: *

    Configuration parameters
    XForwardedFilter propertyDescription
    + * * * * @@ -184,6 +185,7 @@ *

    * Request values: *

    Configuration parameters
    XForwardedFilter propertyDescription
    + * * * * @@ -262,6 +264,7 @@ *

    * Request values: *

    Request values
    propertyValue Before XForwardedFilter
    + * * * * @@ -320,6 +323,7 @@ *

    * Request values: *

    Request values
    propertyValue Before XForwardedFilter
    + * * * * @@ -380,6 +384,7 @@ *

    * Request values: *

    Request values
    propertyValue Before XForwardedFilter
    + * * * * diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java index 09c888e0bd5..05293701657 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/IStaticCacheableResource.java @@ -33,7 +33,7 @@ public interface IStaticCacheableResource extends IResource /** * controls whether caching of the resource is enabled or disabled * - * @return @{code true} if caching is enabled + * @return {@code true} if caching is enabled */ boolean isCachingEnabled(); diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/CachingResourceVersion.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/CachingResourceVersion.java index c94ad0cc43b..4ee03bd3547 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/CachingResourceVersion.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/CachingResourceVersion.java @@ -31,7 +31,7 @@ * this instance. It will expire the oldest entries if the maximum number * of entries is exceeded. * - * @autor Peter Ertl + * @author Peter Ertl * * @since 1.5 */ diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/MessageDigestResourceVersion.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/MessageDigestResourceVersion.java index 96a22c010a9..6c371499e26 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/MessageDigestResourceVersion.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/version/MessageDigestResourceVersion.java @@ -190,7 +190,6 @@ protected MessageDigest getMessageDigest() * * @return binary message digest * - * @throws ResourceStreamNotFoundException * @throws IOException */ protected byte[] computeDigest(InputStream inputStream) throws IOException diff --git a/wicket-core/src/main/java/org/apache/wicket/resource/TextTemplateResourceReference.java b/wicket-core/src/main/java/org/apache/wicket/resource/TextTemplateResourceReference.java index 1a9089a9899..21ddf9386bd 100644 --- a/wicket-core/src/main/java/org/apache/wicket/resource/TextTemplateResourceReference.java +++ b/wicket-core/src/main/java/org/apache/wicket/resource/TextTemplateResourceReference.java @@ -35,7 +35,7 @@ /** * A class which adapts a {@link PackageTextTemplate} to a {@link ResourceReference}. * - * @see {@link "https://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html"} + * See Dynamically generate a CSS stylesheet * * @author James Carman */ diff --git a/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java b/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java index 2146cb0b8da..823e3cb68f7 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/tester/WicketTester.java @@ -146,7 +146,7 @@ * separating each ID with a ':'. * *

    Cookie handling

    - *

    + * * There are some expectations about wicket tester cookie handling which should match as best as * it can be with a real client server request response cycle: *

      @@ -159,7 +159,6 @@ *
    • all valid cookies (maxAge!=0) from the last response should be added to * the next request cookies (tester.getRequest().getCookies())
    • *
    - *

    * * @author Ingram Chen * @author Juergen Donnerstag diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java index a8b8a0a5b8d..2ac12de02ea 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java +++ b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java @@ -431,8 +431,7 @@ public boolean isHttp2(HttpServletRequest request) * the request to get the container request from. The container request is checked if * it is instance of {@link HttpServletRequest} * @return the container request get from the given request casted to {@link HttpServletRequest} - * @throw {@link WicketRuntimeException} if the container request is not a - * {@link HttpServletRequest} + * @throws WicketRuntimeException - if the container request is not a {@link HttpServletRequest} */ public HttpServletRequest checkHttpServletRequest(Request request) { diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushItem.java b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushItem.java index 1e73af91fc4..49ecf9d6575 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushItem.java +++ b/wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushItem.java @@ -122,7 +122,7 @@ public Object getObject() * * @param object * the object to extract the push URL information from - * @see {@link org.apache.wicket.request.cycle.RequestCycle} (urlFor methods) + * @see org.apache.wicket.request.cycle.RequestCycle (urlFor methods) * @return the push item */ public PushItem setObject(Serializable object) @@ -157,7 +157,7 @@ public PushItem setPageParameters(PageParameters pageParameters) /** * Gets the URL composed within the push header item * - * @see {@link org.apache.wicket.http2.markup.head.PushHeaderItem#push(List)} + * @see org.apache.wicket.http2.markup.head.PushHeaderItem#push(List) * @return the URL to be pushed */ public String getUrl() @@ -168,7 +168,7 @@ public String getUrl() /** * Sets the URL composed within the push header item * - * @see {@link org.apache.wicket.http2.markup.head.PushHeaderItem#push(List)} + * @see org.apache.wicket.http2.markup.head.PushHeaderItem#push(List) * @param url * the URL used to push the resource * @return the push item diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java index 339c14e4a72..c9c43ceac8a 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteSettings.java @@ -24,6 +24,7 @@ *

    * Default settings: *

    Request values
    propertyValue Before XForwardedFilter
    + * * * * diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalDialog.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalDialog.java index 8fa02b48505..8579f07aa29 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalDialog.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalDialog.java @@ -259,7 +259,7 @@ protected CharSequence getPrecondition() /** * Convenience method to trap focus inside the overlay. * - * @see {@link TrapFocusBehavior} + * @see TrapFocusBehavior * * @return this */ diff --git a/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java b/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java index fd4133c7591..924b58227ab 100644 --- a/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java +++ b/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java @@ -199,7 +199,6 @@ private String encodeDispositionHeaderValue(final String filename) * * @param sc * @param msg - * @throws IOException */ public abstract void sendError(int sc, String msg); diff --git a/wicket-spring/src/main/java/org/apache/wicket/spring/test/ApplicationContextMock.java b/wicket-spring/src/main/java/org/apache/wicket/spring/test/ApplicationContextMock.java index 5d285f788f1..d82e6a26fda 100644 --- a/wicket-spring/src/main/java/org/apache/wicket/spring/test/ApplicationContextMock.java +++ b/wicket-spring/src/main/java/org/apache/wicket/spring/test/ApplicationContextMock.java @@ -375,7 +375,7 @@ public String[] getAliases(final String name) throws NoSuchBeanDefinitionExcepti } /** - * @see org.springframework.beans.factory.HierarchicalBeanFactory# getParentBeanFactory() + * @see org.springframework.beans.factory.HierarchicalBeanFactory#getParentBeanFactory() */ @Override public BeanFactory getParentBeanFactory() diff --git a/wicket-util/src/main/java/org/apache/wicket/util/diff/AddDelta.java b/wicket-util/src/main/java/org/apache/wicket/util/diff/AddDelta.java index 0350112c3ee..41bc1f3a8b3 100644 --- a/wicket-util/src/main/java/org/apache/wicket/util/diff/AddDelta.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/diff/AddDelta.java @@ -81,9 +81,6 @@ public AddDelta(final int origpos, final Chunk rev) init(new Chunk(origpos, 0), rev); } - /** - * @see org.apache.wicket.util.diff.Delta#verify(java.util.List) - */ @Override public void verify(final List target) throws PatchFailedException { @@ -93,18 +90,12 @@ public void verify(final List target) throws PatchFailedException } } - /** - * @see org.apache.wicket.util.diff.Delta#applyTo(java.util.List) - */ @Override public void applyTo(final List target) { revised.applyAdd(original.first(), target); } - /** - * @see org.apache.wicket.util.diff.Delta#toString(StringBuilder) - */ @Override public void toString(final StringBuilder s) { @@ -115,9 +106,6 @@ public void toString(final StringBuilder s) revised.toString(s, "> ", Diff.NL); } - /** - * @see org.apache.wicket.util.diff.Delta#toRCSString(StringBuilder, String) - */ @Override public void toRCSString(final StringBuilder s, final String EOL) { @@ -129,9 +117,6 @@ public void toRCSString(final StringBuilder s, final String EOL) revised.toString(s, "", EOL); } - /** - * @see org.apache.wicket.util.diff.Delta#accept(org.apache.wicket.util.diff.RevisionVisitor) - */ @Override public void accept(final RevisionVisitor visitor) { diff --git a/wicket-util/src/main/java/org/apache/wicket/util/diff/ChangeDelta.java b/wicket-util/src/main/java/org/apache/wicket/util/diff/ChangeDelta.java index 19cbcd5868d..390cd618aa9 100644 --- a/wicket-util/src/main/java/org/apache/wicket/util/diff/ChangeDelta.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/diff/ChangeDelta.java @@ -87,9 +87,6 @@ public ChangeDelta(final Chunk orig, final Chunk rev) init(orig, rev); } - /** - * @see org.apache.wicket.util.diff.Delta#verify(java.util.List) - */ @Override public void verify(final List target) throws PatchFailedException { @@ -103,9 +100,6 @@ public void verify(final List target) throws PatchFailedException } } - /** - * @see org.apache.wicket.util.diff.Delta#applyTo(java.util.List) - */ @Override public void applyTo(final List target) { @@ -113,9 +107,6 @@ public void applyTo(final List target) revised.applyAdd(original.first(), target); } - /** - * @see org.apache.wicket.util.diff.Delta#toString(StringBuilder) - */ @Override public void toString(final StringBuilder s) { @@ -129,9 +120,6 @@ public void toString(final StringBuilder s) revised.toString(s, "> ", "\n"); } - /** - * @see org.apache.wicket.util.diff.Delta#toRCSString(java.lang.StringBuilder, java.lang.String) - */ @Override public void toRCSString(final StringBuilder s, final String EOL) { @@ -148,9 +136,6 @@ public void toRCSString(final StringBuilder s, final String EOL) revised.toString(s, "", EOL); } - /** - * @see org.apache.wicket.util.diff.Delta#accept(org.apache.wicket.util.diff.RevisionVisitor) - */ @Override public void accept(final RevisionVisitor visitor) { diff --git a/wicket-util/src/main/java/org/apache/wicket/util/diff/DeleteDelta.java b/wicket-util/src/main/java/org/apache/wicket/util/diff/DeleteDelta.java index 30b8e370f23..da945830976 100644 --- a/wicket-util/src/main/java/org/apache/wicket/util/diff/DeleteDelta.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/diff/DeleteDelta.java @@ -80,9 +80,6 @@ public DeleteDelta(final Chunk orig) init(orig, null); } - /** - * @see org.apache.wicket.util.diff.Delta#verify(java.util.List) - */ @Override public void verify(final List target) throws PatchFailedException { @@ -92,18 +89,12 @@ public void verify(final List target) throws PatchFailedException } } - /** - * @see org.apache.wicket.util.diff.Delta#applyTo(java.util.List) - */ @Override public void applyTo(final List target) { original.applyDelete(target); } - /** - * @see org.apache.wicket.util.diff.Delta#toString(java.lang.StringBuilder) - */ @Override public void toString(final StringBuilder s) { @@ -114,9 +105,6 @@ public void toString(final StringBuilder s) original.toString(s, "< ", Diff.NL); } - /** - * @see org.apache.wicket.util.diff.Delta#toRCSString(java.lang.StringBuilder, java.lang.String) - */ @Override public void toRCSString(final StringBuilder s, final String EOL) { @@ -127,9 +115,6 @@ public void toRCSString(final StringBuilder s, final String EOL) s.append(EOL); } - /** - * @see org.apache.wicket.util.diff.Delta#accept(org.apache.wicket.util.diff.RevisionVisitor) - */ @Override public void accept(final RevisionVisitor visitor) { diff --git a/wicket-util/src/main/java/org/apache/wicket/util/diff/Delta.java b/wicket-util/src/main/java/org/apache/wicket/util/diff/Delta.java index a48ff3d5c26..c06a5831775 100644 --- a/wicket-util/src/main/java/org/apache/wicket/util/diff/Delta.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/diff/Delta.java @@ -191,8 +191,6 @@ public final void patch(final List target) throws PatchFailedException * * @param target * the text to patch. - * @throws PatchFailedException - * if the patch cannot be applied. */ public abstract void applyTo(List target); diff --git a/wicket-util/src/main/java/org/apache/wicket/util/diff/myers/MyersDiff.java b/wicket-util/src/main/java/org/apache/wicket/util/diff/myers/MyersDiff.java index a07928c290f..55706211430 100644 --- a/wicket-util/src/main/java/org/apache/wicket/util/diff/myers/MyersDiff.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/diff/myers/MyersDiff.java @@ -196,8 +196,6 @@ public static PathNode buildPath(final Object[] orig, final Object[] rev) * @param rev * The revised sequence. * @return A {@link Revision} script corresponding to the path. - * @throws DifferentiationFailedException - * if a {@link Revision} could not be built from the given path. */ public static Revision buildRevision(PathNode path, final Object[] orig, final Object[] rev) { From b1c2d67d656970111407d384feabda87050b8ecd Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Mon, 26 Jul 2021 21:37:01 +0200 Subject: [PATCH 51/88] WICKET-6908 wrap exceptions for log data --- .../handler/logger/ListenerLogData.java | 79 ++++------------ .../request/handler/logger/PageLogData.java | 27 +++--- .../handler/logger/ListenerLogDataTest.java | 92 +++++++++++++++++++ 3 files changed, 125 insertions(+), 73 deletions(-) create mode 100644 wicket-core/src/test/java/org/apache/wicket/core/request/handler/logger/ListenerLogDataTest.java diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/ListenerLogData.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/ListenerLogData.java index c0f41657d4c..da4887ba906 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/ListenerLogData.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/ListenerLogData.java @@ -35,9 +35,9 @@ public class ListenerLogData extends PageLogData private final Class componentClass; private final String componentPath; private final Integer behaviorIndex; - private Class behaviorClass; - private Class submittingComponentClass; - private String submittingComponentPath; + private final Class behaviorClass; + private final Class submittingComponentClass; + private final String submittingComponentPath; /** * Construct. @@ -48,68 +48,24 @@ public class ListenerLogData extends PageLogData public ListenerLogData(IPageAndComponentProvider pageAndComponentProvider, Integer behaviorIndex) { super(pageAndComponentProvider); - componentClass = tryToGetComponentClass(pageAndComponentProvider); - componentPath = tryToGetComponentPath(pageAndComponentProvider); + this.behaviorIndex = behaviorIndex; - if (behaviorIndex != null && componentClass != null) + + componentClass = optional(() -> pageAndComponentProvider.getComponent().getClass()); + componentPath = optional(() -> pageAndComponentProvider.getComponentPath()); + + if (behaviorIndex != null) { - try - { - behaviorClass = pageAndComponentProvider.getComponent() + behaviorClass = optional(() -> pageAndComponentProvider.getComponent() .getBehaviorById(behaviorIndex) - .getClass(); - } - catch (Exception ignore) - { - behaviorClass = null; - } + .getClass()); } else { behaviorClass = null; } - final Component formSubmitter = tryToGetFormSubmittingComponent(pageAndComponentProvider); - if (formSubmitter != null) - { - submittingComponentClass = formSubmitter.getClass(); - submittingComponentPath = formSubmitter.getPageRelativePath(); - } - } - - private static Class tryToGetComponentClass( - IPageAndComponentProvider pageAndComponentProvider) - { - try - { - return pageAndComponentProvider.getComponent().getClass(); - } - catch (Exception e) - { - // getComponent might fail if the page does not exist (ie session timeout) - return null; - } - } - - - private static String tryToGetComponentPath(IPageAndComponentProvider pageAndComponentProvider) - { - try - { - return pageAndComponentProvider.getComponentPath(); - } - catch (Exception e) - { - // getComponentPath might fail if the page does not exist (ie session timeout) - return null; - } - } - - private static Component tryToGetFormSubmittingComponent( - IPageAndComponentProvider pageAndComponentProvider) - { - try - { + final Component formSubmitter = optional(() -> { final IRequestableComponent component = pageAndComponentProvider.getComponent(); if (component instanceof Form) { @@ -117,11 +73,14 @@ private static Component tryToGetFormSubmittingComponent( return submitter instanceof Component ? (Component)submitter : null; } return null; - } - catch (Exception e) + }); + if (formSubmitter != null) { - // getComponent might fail if the page does not exist (ie session timeout) - return null; + submittingComponentClass = formSubmitter.getClass(); + submittingComponentPath = formSubmitter.getPageRelativePath(); + } else { + submittingComponentClass = null; + submittingComponentPath = null; } } diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/PageLogData.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/PageLogData.java index fd3b53f01c8..e27d1da09da 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/PageLogData.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/logger/PageLogData.java @@ -16,6 +16,8 @@ */ package org.apache.wicket.core.request.handler.logger; +import java.util.function.Supplier; + import org.apache.wicket.Page; import org.apache.wicket.core.request.handler.IPageClassRequestHandler; import org.apache.wicket.core.request.handler.IPageProvider; @@ -46,21 +48,20 @@ public class PageLogData implements ILogData */ public PageLogData(IPageProvider pageProvider) { - pageClass = tryToGetPageClass(pageProvider); - pageId = pageProvider.getPageId(); - pageParameters = pageProvider.getPageParameters(); - renderCount = pageProvider.getRenderCount(); + pageId = optional(pageProvider::getPageId); + renderCount = optional(pageProvider::getRenderCount); + pageClass = optional(pageProvider::getPageClass); + pageParameters = optional(pageProvider::getPageParameters); } - private static Class tryToGetPageClass(IPageProvider pageProvider) - { - try - { - return pageProvider.getPageClass(); - } - catch (Exception e) - { - // getPageClass might fail if the page does not exist (ie session timeout) + /** + * Wrapper for optional values that might fail if the page does not exist + * (i.e. session timeout). + */ + protected T optional(Supplier function) { + try { + return function.get(); + } catch (Exception ex) { return null; } } diff --git a/wicket-core/src/test/java/org/apache/wicket/core/request/handler/logger/ListenerLogDataTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/logger/ListenerLogDataTest.java new file mode 100644 index 00000000000..88c4976883d --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/logger/ListenerLogDataTest.java @@ -0,0 +1,92 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.core.request.handler.logger; + +import org.apache.wicket.core.request.handler.IPageAndComponentProvider; +import org.apache.wicket.protocol.http.PageExpiredException; +import org.apache.wicket.request.component.IRequestableComponent; +import org.apache.wicket.request.component.IRequestablePage; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.junit.jupiter.api.Test; + +class ListenerLogDataTest { + + /** + * Test for WICKET-6908. + */ + @Test + void neverFails() { + IPageAndComponentProvider provider = new IPageAndComponentProvider() { + + @Override + public boolean wasExpired() { + throw new IllegalStateException(); + } + + @Override + public boolean hasPageInstance() { + throw new IllegalStateException(); + } + + @Override + public Integer getRenderCount() { + throw new IllegalStateException(); + } + + @Override + public PageParameters getPageParameters() throws PageExpiredException { + throw new IllegalStateException(); + } + + @Override + public IRequestablePage getPageInstance() throws PageExpiredException { + throw new IllegalStateException(); + } + + @Override + public Integer getPageId() { + throw new IllegalStateException(); + } + + @Override + public Class getPageClass() throws PageExpiredException { + throw new IllegalStateException(); + } + + @Override + public boolean doesProvideNewPage() { + throw new IllegalStateException(); + } + + @Override + public void detach() { + } + + @Override + public String getComponentPath() { + throw new IllegalStateException(); + } + + @Override + public IRequestableComponent getComponent() { + throw new IllegalStateException(); + } + }; + + new ListenerLogData(provider, 1); + } +} From 6c88207455fb7e523b598c5fed760917ca6f00b5 Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Mon, 26 Jul 2021 22:03:05 +0200 Subject: [PATCH 52/88] WICKET-6908 detach all handlers even if one throws a RuntimeException --- .../wicket/request/RequestHandlerExecutor.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wicket-request/src/main/java/org/apache/wicket/request/RequestHandlerExecutor.java b/wicket-request/src/main/java/org/apache/wicket/request/RequestHandlerExecutor.java index f60b27a18fc..47df808c42f 100644 --- a/wicket-request/src/main/java/org/apache/wicket/request/RequestHandlerExecutor.java +++ b/wicket-request/src/main/java/org/apache/wicket/request/RequestHandlerExecutor.java @@ -132,21 +132,27 @@ public void detach() active = null; } + RuntimeException rethrow = null;; for (IRequestHandler handler : inactiveRequestHandlers) { try { detach(handler); } - catch (RuntimeException exception) - { - throw exception; - } catch (Exception exception) { - log.error("Error detaching RequestHandler", exception); + if (rethrow == null && exception instanceof RuntimeException) { + rethrow = (RuntimeException) exception; + } else { + log.error("Error detaching RequestHandler", exception); + } } } + if (rethrow != null) { + // WICKET-6001 runtime exceptions are rethrown + // TODO obsolete should component-queueing be removed + throw rethrow; + } } /** From 82b111e79789709fa70e8c5043ac78f34e5e0e14 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 9 Aug 2021 11:06:16 +0300 Subject: [PATCH 53/88] Fix some more javadoc issues. Re-disable javadoc 'missing' linter because there are many errors which I didn't notice before. (cherry picked from commit f03f778a6a01347c938fb38c1e83326548ed3013) --- pom.xml | 2 +- .../apache/wicket/feedback/FeedbackMessagesModel.java | 1 - .../java/org/apache/wicket/markup/html/form/Form.java | 4 ++-- .../wicket/request/cycle/IRequestCycleListener.java | 5 ++--- .../request/cycle/RequestCycleListenerCollection.java | 8 ++++---- .../org/apache/wicket/settings/ResourceSettings.java | 2 -- .../java/org/apache/wicket/AttributeModifierTest.java | 4 ++-- .../java/org/apache/wicket/util/io/BOMInputStream.java | 9 ++++----- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index d03923576ea..6982d900a5b 100644 --- a/pom.xml +++ b/pom.xml @@ -1065,7 +1065,7 @@ true true - all,-html + all,-html,-missing ${javadoc.additionalJOption} 8 diff --git a/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java b/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java index c056deed4a7..5a2c0862974 100644 --- a/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java +++ b/wicket-core/src/main/java/org/apache/wicket/feedback/FeedbackMessagesModel.java @@ -194,7 +194,6 @@ public void detach() * See {@link FeedbackCollector#setIncludeSession} and {@link Session#getFeedbackMessages} * * @param includeSession - * @return * @return {@code this} for chaining */ public FeedbackMessagesModel setIncludeSession(boolean includeSession) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java index 3116c1ca9dd..edf7a378130 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java @@ -1444,8 +1444,8 @@ else if (component instanceof FormComponent) } /** - * Handles multi-part processing of the submitted data.

    - * WARNING

    If this method is overridden it can break {@link FileUploadField}s on this form + * Handles multi-part processing of the submitted data. + * WARNING If this method is overridden it can break {@link FileUploadField}s on this form * * @return false if form is multipart and upload failed */ diff --git a/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java b/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java index 1bb1a040679..06cf42e146f 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/cycle/IRequestCycleListener.java @@ -32,7 +32,7 @@ * NOTE: a listener implementation is a singleton and hence needs to ensure proper handling * of multi-threading issues. *

    - *

    Call order

    + * Call order *

    * The interface methods are ordered in the execution order as Wicket goes through the request * cycle: @@ -53,8 +53,7 @@ *

  • {@link #onException(RequestCycle, Exception)}, followed by * {@link #onExceptionRequestHandlerResolved(RequestCycle, org.apache.wicket.request.IRequestHandler, Exception)}
  • * - * - *

    Example

    + * *

    * A short example of a request counter. *

    diff --git a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java index 04349136120..4e755286c8c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java @@ -29,16 +29,16 @@ * Composite {@link IRequestCycleListener} that notifies all registered listeners with each * IRequestCycleListener event. *

    - *

    Order of notification

    - *

    + * Order of notification + * * {@link #onBeginRequest(RequestCycle)}, {@link #onRequestHandlerScheduled(RequestCycle, IRequestHandler)} and * {@link #onRequestHandlerResolved(RequestCycle, IRequestHandler)} are notified in first in, first out order. *

    * {@link #onEndRequest(RequestCycle)} and {@link #onDetach(RequestCycle)} are notified in last in * first out order (i.e. reversed order). So for these events the collection functions as a stack. *

    - *

    Exception handling

    - *

    + * Exception handling + * * The {@code RequestCycleListenerCollection} will use the first exception handler that is returned * from all listeners in {@link #onException(RequestCycle, Exception)} */ diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java index 863940279d6..8e10c4efb5c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java +++ b/wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java @@ -562,7 +562,6 @@ public IJavaScriptCompressor getJavaScriptCompressor() * @param compressor * The implementation to be used * @return The old value - * @return {@code this} object for chaining */ public IJavaScriptCompressor setJavaScriptCompressor(IJavaScriptCompressor compressor) { @@ -592,7 +591,6 @@ public ICssCompressor getCssCompressor() * @param compressor * The implementation to be used * @return The old value - * @return {@code this} object for chaining */ public ICssCompressor setCssCompressor(ICssCompressor compressor) { diff --git a/wicket-core/src/test/java/org/apache/wicket/AttributeModifierTest.java b/wicket-core/src/test/java/org/apache/wicket/AttributeModifierTest.java index a01ff29cfcd..927933bc1d5 100644 --- a/wicket-core/src/test/java/org/apache/wicket/AttributeModifierTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/AttributeModifierTest.java @@ -347,7 +347,7 @@ void deserializeAdd() AttributeModifier appender = AttributeModifier.append("class", AttributeModifier.VALUELESS_ATTRIBUTE_ADD); final AttributeModifier copy = WicketObjects.cloneObject(appender); final IModel replaceModel = copy.getReplaceModel(); - assertThat(replaceModel.getObject()).isEqualToComparingFieldByField(AttributeModifier.VALUELESS_ATTRIBUTE_ADD); + assertThat(replaceModel.getObject()).usingRecursiveComparison().isEqualTo(AttributeModifier.VALUELESS_ATTRIBUTE_ADD); } @@ -360,6 +360,6 @@ void deserializeRemove() AttributeModifier appender = AttributeModifier.append("class", AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE); final AttributeModifier copy = WicketObjects.cloneObject(appender); final IModel replaceModel = copy.getReplaceModel(); - assertThat(replaceModel.getObject()).isEqualToComparingFieldByField(AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE); + assertThat(replaceModel.getObject()).usingRecursiveComparison().isEqualTo(AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE); } } diff --git a/wicket-util/src/main/java/org/apache/wicket/util/io/BOMInputStream.java b/wicket-util/src/main/java/org/apache/wicket/util/io/BOMInputStream.java index 6762721c045..9461ebd2393 100644 --- a/wicket-util/src/main/java/org/apache/wicket/util/io/BOMInputStream.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/io/BOMInputStream.java @@ -36,9 +36,8 @@ *

  • UTF-32BE - {@link ByteOrderMark#UTF_32LE}
  • *
  • UTF-32LE - {@link ByteOrderMark#UTF_32BE}
  • * - * - * - *

    Example 1 - Detect and exclude a UTF-8 BOM

    + * + *

    Example 1 - Detect and exclude a UTF-8 BOM * *

      * BOMInputStream bomIn = new BOMInputStream(in);
    @@ -47,7 +46,7 @@
      * }
      * 
    * - *

    Example 2 - Detect a UTF-8 BOM (but don't exclude it)

    + *

    Example 2 - Detect a UTF-8 BOM (but don't exclude it) * *

      * boolean include = true;
    @@ -57,7 +56,7 @@
      * }
      * 
    * - *

    Example 3 - Detect Multiple BOMs

    + *

    Example 3 - Detect Multiple BOMs * *

      * BOMInputStream bomIn = new BOMInputStream(in, 
    
    From ca682779b202d0126f6383769b03baeceb002e79 Mon Sep 17 00:00:00 2001
    From: Martin Tzvetanov Grigorov 
    Date: Mon, 9 Aug 2021 11:42:11 +0300
    Subject: [PATCH 54/88] Fix one more Javadoc lint issue that is specific only
     for wicket-9.x and older branches.
    
    CsrfPreventionRequestCycleListener is deprecated in 9.x and already removed in 10.x
    ---
     .../protocol/http/CsrfPreventionRequestCycleListener.java     | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java
    index f8a7c28fbfc..6b02681d2ff 100644
    --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java
    +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/CsrfPreventionRequestCycleListener.java
    @@ -37,7 +37,7 @@
      * HTTP headers for cross domain requests. By default only checks requests that try to perform an
      * action on a component, such as a form submit, or link click.
      * 

    - *

    Installation

    + * Installation *

    * You can enable this CSRF prevention filter by adding it to the request cycle listeners in your * {@link WebApplication#init() application's init method}: @@ -52,7 +52,7 @@ * } *

    *

    - *

    Configuration

    + * Configuration *

    * When the {@code Origin} or {@code Referer} HTTP header is present but doesn't match the requested * URL this listener will by default throw a HTTP error ( {@code 400 BAD REQUEST}) and abort the From b665112ce69e3eef5bc1991c13a6ed199c1ac90d Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 9 Aug 2021 22:58:36 +0300 Subject: [PATCH 55/88] Fix spelling in javadocs --- .../wicket/markup/html/form/AbstractTextComponent.java | 8 +------- .../org/apache/wicket/markup/html/form/FormComponent.java | 7 ++----- .../apache/wicket/markup/html/form/PasswordTextField.java | 6 +++--- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java index 916ec86e956..4d0ef5fb311 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/AbstractTextComponent.java @@ -22,9 +22,6 @@ import org.apache.wicket.model.IModel; import org.apache.wicket.model.IObjectClassAwareModel; import org.apache.wicket.util.string.Strings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Abstract base class for TextArea and TextField. @@ -36,12 +33,9 @@ */ public abstract class AbstractTextComponent extends FormComponent { - // Flag for the type resolving. FLAG_RESERVED1-3 is taken by form component + // Flag for the type resolving. FLAG_RESERVED1-3 are taken by form component private static final int TYPE_RESOLVED = Component.FLAG_RESERVED4; - /** Log for reporting. */ - private static final Logger log = LoggerFactory.getLogger(AbstractTextComponent.class); - /** * */ diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java index 6ba10e9b9a3..28d3cd4d775 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java @@ -117,9 +117,6 @@ private class MessageSource implements IErrorMessageSource { private final Set triedKeys = new LinkedHashSet<>(); - /** - * @see org.apache.wicket.validation.IErrorMessageSource#getMessage(String, java.util.Map) - */ @Override public String getMessage(String key, Map vars) { @@ -771,12 +768,12 @@ public String[] getInputAsArray() { if (values != null && values.length == 1 && values[0] == null) { - // we the key got passed in (otherwise values would be null), + // the key got passed in (otherwise values would be null), // but the value was set to null. // As the servlet spec isn't clear on what to do with 'empty' // request values - most return an empty string, but some null - // we have to workaround here and deliberately set to an empty - // string if the the component is not nullable (text components) + // string if the component is not nullable (text components) return EMPTY_STRING_ARRAY; } } diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java index 5530e406cd3..d5d0fe94ef6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java @@ -65,7 +65,7 @@ public PasswordTextField(final String id, IModel model) /** * Should password be reset, see {@link #setResetPassword(boolean)}. * - * @return should password be resetted + * @return should password be reset */ public final boolean getResetPassword() { @@ -74,7 +74,7 @@ public final boolean getResetPassword() /** * Flag indicating whether the password should be reset after each request. - * Additionally any present value is not rendered into the markup. + * Additionally, any present value is not rendered into the markup. *
    * If true, the model object is set to null after each request to prevent it * being serialized along with the containing page. This is default and highly recommended @@ -116,7 +116,7 @@ protected String[] getInputTypes() } /** - * Overriden to nullify the password. + * Overridden to nullify the password. */ @Override protected void onDetach() From b1460b73c2647115dcb574c5ecb4642f45e86d59 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 12 Aug 2021 11:39:30 +0300 Subject: [PATCH 56/88] Fix a typo in javadoc --- .../java/org/apache/wicket/markup/html/form/FormComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java index 28d3cd4d775..64d5ae6ef8a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java @@ -946,7 +946,7 @@ public final void invalid() * Gets whether this component's input can be null. By default, components that do not get input * will have null values passed in for input. However, component TextField is an example * (possibly the only one) that never gets a null passed in, even if the field is left empty - * UNLESS it had attribute disabled="disabled" set. + * UNLESS it has attribute disabled="disabled" set. * * @return True if this component's input can be null. Returns true by default. */ From 06e9f53dbe79a11bf6512263351edc9481dd5619 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 16 Aug 2021 11:43:36 +0300 Subject: [PATCH 57/88] WICKET-6914 Visibility change of "File Upload" via ajax causes "missing" form-data Update the
    's enctype whenever a multipart form component is repainted via Ajax --- .../http/MultipartFormComponentListener.java | 52 ++++++++++++ .../wicket/protocol/http/WebApplication.java | 6 +- .../MultipartFormComponentListenerBean.java | 58 ++++++++++++++ .../MultipartFormComponentListenerPage.html | 17 ++++ .../MultipartFormComponentListenerPage.java | 80 +++++++++++++++++++ .../MultipartFormComponentListenerTest.java | 51 ++++++++++++ 6 files changed, 262 insertions(+), 2 deletions(-) create mode 100644 wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java new file mode 100644 index 00000000000..f5572ed2e9e --- /dev/null +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.protocol.http; + +import java.util.Map; + +import org.apache.wicket.Component; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.FormComponent; +import org.apache.wicket.util.visit.IVisitor; + +/** + * This listener updates the {@link Form}'s enctype whenever a multipart {@link FormComponent} + * is added to the {@code AjaxRequestTarget}. + * This is needed because the multipart form component may change its visibility/enablement and thus + * change the multipart-ness of the whole form. + */ +public class MultipartFormComponentListener implements AjaxRequestTarget.IListener +{ + static final String ENCTYPE_URL_ENCODED = "application/x-www-form-urlencoded"; + + @Override + public void onBeforeRespond(final Map map, final AjaxRequestTarget target) + { + target.getPage().visitChildren(FormComponent.class, (IVisitor, Void>) (formComponent, visit) -> { + if (formComponent.isMultiPart()) + { + Form form = formComponent.getForm(); + boolean multiPart = form.isMultiPart(); + String enctype = multiPart ? Form.ENCTYPE_MULTIPART_FORM_DATA : ENCTYPE_URL_ENCODED; + target.appendJavaScript(String.format("Wicket.$('%s').form.enctype='%s'", + formComponent.getMarkupId(), enctype)); + visit.stop(); + } + }); + } +} diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java index c4987c80cf0..a7fe07eb08e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java @@ -758,8 +758,10 @@ protected void internalInit() setSessionStoreProvider(HttpSessionStore::new); setAjaxRequestTargetProvider(AjaxRequestHandler::new); - getAjaxRequestTargetListeners().add(new AjaxEnclosureListener()); - + AjaxRequestTargetListenerCollection ajaxRequestTargetListeners = getAjaxRequestTargetListeners(); + ajaxRequestTargetListeners.add(new AjaxEnclosureListener()); + ajaxRequestTargetListeners.add(new MultipartFormComponentListener()); + // Configure the app. configure(); if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java new file mode 100644 index 00000000000..41b6ca49890 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.protocol.http; + +import java.io.Serializable; + +public class MultipartFormComponentListenerBean implements Serializable { + private String textField; + private String dropDown; + + /** + * @return the textField + */ + public String getTextField() { + return textField; + } + + + /** + * @return the dropDown + */ + public String getDropDown() { + return dropDown; + } + + + /** + * @param textField + * the textField to set + */ + public void setTextField(String textField) { + this.textField = textField; + } + + + /** + * @param dropDown + * the dropDown to set + */ + public void setDropDown(String dropDown) { + this.dropDown = dropDown; + } + +} diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html new file mode 100644 index 00000000000..eb741e8f980 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html @@ -0,0 +1,17 @@ + + + + +Apache Wicket 6914 + + + +
    +
    +
    +


    + + content of textfield or error:

    + + + diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java new file mode 100644 index 00000000000..d0b78428c28 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.protocol.http; + +import java.util.ArrayList; + +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.OnChangeAjaxBehavior; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.RequiredTextField; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.model.Model; + +public class MultipartFormComponentListenerPage extends WebPage { + private static final long serialVersionUID = 1L; + + public MultipartFormComponentListenerPage() { + CompoundPropertyModel model = new CompoundPropertyModel<>(new MultipartFormComponentListenerBean()); + Form form = new Form<>("form", model); + add(form); + + RequiredTextField textField = new RequiredTextField<>("textField"); + form.add(textField); + + ArrayList list = new ArrayList<>(); + list.add("Option 1"); + list.add("Option 2"); + + FileUploadField fileUpload = new FileUploadField("fileUpload", new Model<>(new ArrayList<>())); + fileUpload.setOutputMarkupPlaceholderTag(true); + form.add(fileUpload); + + DropDownChoice dropDown = new DropDownChoice<>("dropDown", list); + dropDown.add(new OnChangeAjaxBehavior() { + + @Override + protected void onUpdate(AjaxRequestTarget target) { + fileUpload.setVisible(!fileUpload.isVisible()); + target.add(fileUpload); + + } + }); + form.add(dropDown); + + final Label label = new Label("label"); + add(label); + + form.add(new Button("submitButton") { + @Override + public void onSubmit() { + label.setDefaultModel(new Model<>(model.getObject().getTextField())); + } + + @Override + public void onError() { + label.setDefaultModel(new Model<>("Validation Error...")); + } + }); + + } +} diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java new file mode 100644 index 00000000000..b5cbf266ee3 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.protocol.http; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.util.tester.TagTester; +import org.apache.wicket.util.tester.WicketTestCase; +import org.junit.jupiter.api.Test; + +/** + * https://issues.apache.org/jira/browse/WICKET-6914 + */ +class MultipartFormComponentListenerTest extends WicketTestCase +{ + @Test + void updateFormEnctype() + { + tester.startPage(MultipartFormComponentListenerPage.class); + tester.assertRenderedPage(MultipartFormComponentListenerPage.class); + + TagTester formTagTester = tester.getTagByWicketId("form"); + assertEquals(Form.ENCTYPE_MULTIPART_FORM_DATA, formTagTester.getAttribute("enctype")); + + tester.getRequest().setAttribute("form:dropDown", 1); + tester.executeAjaxEvent("form:dropDown", "change"); + String ajaxResponse = tester.getLastResponseAsString(); + assertTrue(ajaxResponse.contains(".form.enctype='" + MultipartFormComponentListener.ENCTYPE_URL_ENCODED + "'})();")); + + tester.getRequest().setAttribute("form:dropDown", 2); + tester.executeAjaxEvent("form:dropDown", "change"); + ajaxResponse = tester.getLastResponseAsString(); + assertTrue(ajaxResponse.contains(".form.enctype='" + Form.ENCTYPE_MULTIPART_FORM_DATA + "'})();")); + } +} From 66b35ade4b3999025e58580bc683e7f7c32cafa9 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 16 Aug 2021 12:12:22 +0300 Subject: [PATCH 58/88] Simplify JUnit assertions Non-functional change! --- .../markup/html/form/FormMultiPartTest.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java index 4c273b0ce31..6a9f755c9af 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java @@ -17,6 +17,8 @@ package org.apache.wicket.markup.html.form; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.wicket.util.tester.WicketTestCase; import org.junit.jupiter.api.Test; @@ -36,7 +38,7 @@ void multipartHard() assertEquals(0, page.asked); - assertEquals(true, page.form.isMultiPart()); + assertTrue(page.form.isMultiPart()); } @Test @@ -47,17 +49,17 @@ void multipartHint() page.multiPart = false; tester.startPage(page); assertEquals(1, page.asked); - assertEquals(false, page.form.isMultiPart()); + assertFalse(page.form.isMultiPart()); page.multiPart = true; tester.newFormTester("form").submit(page.button1); assertEquals(2, page.asked); - assertEquals(true, page.form.isMultiPart()); + assertTrue(page.form.isMultiPart()); page.multiPart = false; tester.newFormTester("form").submit(page.button1); assertEquals(3, page.asked); - assertEquals(false, page.form.isMultiPart()); + assertFalse(page.form.isMultiPart()); } @Test @@ -68,16 +70,16 @@ void multipartHintAjax() page.multiPart = false; tester.startPage(page); assertEquals(1, page.asked); - assertEquals(false, page.form.isMultiPart()); + assertFalse(page.form.isMultiPart()); page.multiPart = true; tester.executeAjaxEvent(page.button1, "click"); assertEquals(2, page.asked); - assertEquals(true, page.form.isMultiPart()); + assertTrue(page.form.isMultiPart()); page.multiPart = false; tester.executeAjaxEvent(page.button1, "click"); assertEquals(3, page.asked); - assertEquals(false, page.form.isMultiPart()); + assertFalse(page.form.isMultiPart()); } } From f9c98737fb9ed798c9c8cb25e87c3f7f6e87bfb2 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 16 Aug 2021 12:17:21 +0300 Subject: [PATCH 59/88] WICKET-6914 Visibility change of "File Upload" via ajax causes "missing" form-data Update test expectations. FormComponent#isMultipart() is called now by MultipartFormComponentListener in Ajax requests --- .../org/apache/wicket/markup/html/form/FormMultiPartTest.java | 4 ++-- .../org/apache/wicket/markup/html/form/MultiPartFormPage.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java index 6a9f755c9af..4b25655cfd9 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java @@ -74,12 +74,12 @@ void multipartHintAjax() page.multiPart = true; tester.executeAjaxEvent(page.button1, "click"); - assertEquals(2, page.asked); + assertEquals(3, page.asked); assertTrue(page.form.isMultiPart()); page.multiPart = false; tester.executeAjaxEvent(page.button1, "click"); - assertEquals(3, page.asked); + assertEquals(5, page.asked); assertFalse(page.form.isMultiPart()); } } diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java index 86af38277ea..27de9ae4982 100644 --- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java @@ -49,7 +49,7 @@ public MultiPartFormPage() form = new Form("form"); add(form.setOutputMarkupId(true)); - input = new TextField("input", Model.of("")) + input = new TextField<>("input", Model.of("")) { @Override public boolean isMultiPart() { @@ -80,4 +80,4 @@ protected void onSubmit(Optional target) }; form.add(button2); } -} \ No newline at end of file +} From 86b02b99718255c9ccbbe7e9f2d819d3ca4eba86 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 16 Aug 2021 13:51:39 +0300 Subject: [PATCH 60/88] Explicitly install OpenJDK 11 and Maven (cherry picked from commit 866fefc7f81f2ac71c9cd52c1b9602af88405965) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9ba78f6af88..927a3ffc18c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ cache: before_install: - lscpu - - sudo apt-get install -y chromium-browser fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libappindicator3-1 libgbm1 + - sudo apt-get install -y openjdk-11-jdk maven chromium-browser fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libappindicator3-1 libgbm1 - export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-${TRAVIS_CPU_ARCH}" - export PATH="$JAVA_HOME/bin:$PATH" - java -version From 483a5ee7ada467dd8d56e80dd9ff89cf7cc5401b Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 23 Aug 2021 11:43:28 +0300 Subject: [PATCH 61/88] Update Mockito to 3.12.1 (cherry picked from commit 1255320863c6bc51817ae744e8db6a35fc9e73fd) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6982d900a5b..b4cbc767904 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ 6.2.0.Final 1.7.3 4.1.19 - 3.11.2 + 3.12.1 3.2 1.0.12 2.0.0-alpha2 From 04b3440df6affbd11b0286de5ed54f587ff55f52 Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Fri, 20 Aug 2021 19:34:33 +0200 Subject: [PATCH 62/88] WICKET-6916 replace proxies with StandardMBean --- wicket-jmx/pom.xml | 8 -- wicket-jmx/src/main/java/module-info.java | 1 - .../org/apache/wicket/jmx/Initializer.java | 93 +++++++++---------- 3 files changed, 42 insertions(+), 60 deletions(-) diff --git a/wicket-jmx/pom.xml b/wicket-jmx/pom.xml index 15c050c3446..9c6facb9ba7 100644 --- a/wicket-jmx/pom.xml +++ b/wicket-jmx/pom.xml @@ -29,17 +29,9 @@ Wicket Java Management Extensions - - cglib - cglib - org.apache.wicket wicket-core - - org.ow2.asm - asm - diff --git a/wicket-jmx/src/main/java/module-info.java b/wicket-jmx/src/main/java/module-info.java index d07942dc633..b646aaf0cbc 100644 --- a/wicket-jmx/src/main/java/module-info.java +++ b/wicket-jmx/src/main/java/module-info.java @@ -20,7 +20,6 @@ requires org.apache.wicket.util; requires org.apache.wicket.core; requires org.slf4j; - requires cglib; provides org.apache.wicket.IInitializer with org.apache.wicket.jmx.Initializer; exports org.apache.wicket.jmx; diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java b/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java index ca990acae86..6b896baa9c2 100644 --- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java +++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java @@ -17,10 +17,12 @@ package org.apache.wicket.jmx; import java.lang.management.ManagementFactory; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Callable; +import javax.management.Attribute; +import javax.management.AttributeList; import javax.management.InstanceAlreadyExistsException; import javax.management.InstanceNotFoundException; import javax.management.MBeanRegistrationException; @@ -29,10 +31,7 @@ import javax.management.MalformedObjectNameException; import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; - -import net.sf.cglib.core.DefaultNamingPolicy; -import net.sf.cglib.core.Predicate; -import net.sf.cglib.proxy.Enhancer; +import javax.management.StandardMBean; import org.apache.wicket.IInitializer; import org.apache.wicket.ThreadContext; @@ -229,24 +228,39 @@ public String toString() * @throws MBeanRegistrationException * @throws InstanceAlreadyExistsException */ - private void register(final org.apache.wicket.Application application, final Object o, + private void register(final org.apache.wicket.Application application, final T o, final ObjectName objectName) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { - Object proxy = createProxy(application, o); - mbeanServer.registerMBean(proxy, objectName); - registered.add(objectName); - } - - private Object createProxy(final org.apache.wicket.Application application, final Object o) - { - Enhancer e = new Enhancer(); - e.setInterfaces(o.getClass().getInterfaces()); - e.setSuperclass(Object.class); - e.setCallback(new net.sf.cglib.proxy.InvocationHandler() - { + StandardMBean bean = new StandardMBean(o, (Class)o.getClass().getInterfaces()[0]) { + @Override + public Object getAttribute(String attribute) + { + return withApplication(() -> super.getAttribute(attribute)); + } + @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable + public void setAttribute(Attribute attribute) + { + withApplication(() -> { + super.setAttribute(attribute); + return null; + }); + } + + @Override + public AttributeList setAttributes(AttributeList attributes) + { + return withApplication(() -> super.setAttributes(attributes)); + } + + @Override + public Object invoke(String actionName, Object[] params, String[] signature) + { + return withApplication(() -> super.invoke(actionName, params, signature)); + } + + private R withApplication(Callable callable) { boolean existed = ThreadContext.exists(); @@ -257,7 +271,11 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl try { - return method.invoke(o, args); + return callable.call(); + } + catch (Exception ex) + { + throw new WicketRuntimeException(ex); } finally { @@ -267,35 +285,8 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } } } - }); - e.setNamingPolicy(new DefaultNamingPolicy() - { - @Override - public String getClassName(final String prefix, final String source, final Object key, - final Predicate names) - { - return o.getClass().getName().replace(".wrapper", ""); - } - }); - e.setClassLoader(resolveClassLoader()); - - return e.create(); - } - - private static ClassLoader resolveClassLoader() - { - ClassLoader classLoader = null; - if (org.apache.wicket.Application.exists()) - { - classLoader = org.apache.wicket.Application.get().getApplicationSettings() - .getClassResolver().getClassLoader(); - } - - if (classLoader == null) { - classLoader = Thread.currentThread().getContextClassLoader(); - } - - return classLoader; + }; + mbeanServer.registerMBean(bean, objectName); + registered.add(objectName); } - -} +} \ No newline at end of file From eb42b157a0f856b9e6a37b82a0102cd0f1c5cf7b Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Mon, 23 Aug 2021 14:04:22 +0200 Subject: [PATCH 63/88] WICKET-6913 move package private works fine with cglib already --- .../proxy/LazyInitProxyFactoryTest.java | 85 ++------------ .../PackagePrivateConcreteObject.java | 4 +- .../packageprivate/PackagePrivateTest.java | 109 ++++++++++++++++++ 3 files changed, 120 insertions(+), 78 deletions(-) rename wicket-ioc/src/test/java/org/apache/wicket/proxy/{ => packageprivate}/PackagePrivateConcreteObject.java (91%) create mode 100644 wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateTest.java diff --git a/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java b/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java index 5483ce4b210..ff6c96ad9af 100644 --- a/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java +++ b/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java @@ -16,6 +16,15 @@ */ package org.apache.wicket.proxy; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.ObjectStreamException; +import java.lang.reflect.Proxy; + import org.apache.wicket.core.util.lang.WicketObjects; import org.apache.wicket.proxy.LazyInitProxyFactory.ProxyReplacement; import org.apache.wicket.proxy.util.ConcreteObject; @@ -25,14 +34,6 @@ import org.apache.wicket.proxy.util.ObjectMethodTester; import org.junit.jupiter.api.Test; -import java.lang.reflect.Proxy; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotSame; -import static org.junit.jupiter.api.Assertions.assertSame; -import static org.junit.jupiter.api.Assertions.assertTrue; - /** * Tests lazy init proxy factory * @@ -45,8 +46,6 @@ public class LazyInitProxyFactoryTest private static ConcreteObject concreteObject = new ConcreteObject("concrete"); - private static final PackagePrivateConcreteObject PACKAGE_PRIVATE_CONCRETE_OBJECT = new PackagePrivateConcreteObject("package-private-concrete"); - private static IProxyTargetLocator interfaceObjectLocator = new IProxyTargetLocator() { private static final long serialVersionUID = 1L; @@ -69,17 +68,6 @@ public Object locateProxyTarget() } }; - private final static IProxyTargetLocator PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR = new IProxyTargetLocator() - { - private static final long serialVersionUID = 1L; - - @Override - public Object locateProxyTarget() - { - return LazyInitProxyFactoryTest.PACKAGE_PRIVATE_CONCRETE_OBJECT; - } - }; - private static IProxyTargetLocator stringObjectLocator = new IProxyTargetLocator() { private static final long serialVersionUID = 1L; @@ -192,61 +180,6 @@ public Object locateProxyTarget() } /** - * Tests lazy init proxy to represent package private concrete objects - * - * https://issues.apache.org/jira/browse/WICKET-4324 - */ - @Test - public void testPackagePrivateConcreteProxy() - { - PackagePrivateConcreteObject proxy = (PackagePrivateConcreteObject)LazyInitProxyFactory.createProxy( - PackagePrivateConcreteObject.class, PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR); - - // test proxy implements ILazyInitProxy - assertTrue(proxy instanceof ILazyInitProxy); - assertTrue(((ILazyInitProxy)proxy).getObjectLocator() == PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR); - - // test we do not have a jdk dynamic proxy - assertFalse(Proxy.isProxyClass(proxy.getClass())); - - // test method invocation - assertEquals(proxy.getMessage(), "package-private-concrete"); - - // test serialization - PackagePrivateConcreteObject proxy2 = WicketObjects.cloneObject(proxy); - assertTrue(proxy != proxy2); - assertEquals(proxy2.getMessage(), "package-private-concrete"); - - // test equals/hashcode method interception - final IObjectMethodTester tester = new ObjectMethodTester(); - assertTrue(tester.isValid()); - - // test only a single class is generated, - // otherwise permgen space will fill up with each proxy - assertSame(proxy.getClass(), LazyInitProxyFactory.createProxy( - PackagePrivateConcreteObject.class, PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR).getClass()); - - IProxyTargetLocator testerLocator = new IProxyTargetLocator() - { - private static final long serialVersionUID = 1L; - - @Override - public Object locateProxyTarget() - { - return tester; - } - }; - - ObjectMethodTester testerProxy = (ObjectMethodTester)LazyInitProxyFactory.createProxy( - ObjectMethodTester.class, testerLocator); - testerProxy.equals(this); - testerProxy.hashCode(); - testerProxy.toString(); - assertTrue(tester.isValid()); - } - - /** - * Tests lazy init concrete replacement replacement */ @Test public void testCGLibInterceptorReplacement() diff --git a/wicket-ioc/src/test/java/org/apache/wicket/proxy/PackagePrivateConcreteObject.java b/wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateConcreteObject.java similarity index 91% rename from wicket-ioc/src/test/java/org/apache/wicket/proxy/PackagePrivateConcreteObject.java rename to wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateConcreteObject.java index 3b31e6365e3..e11dc581c14 100644 --- a/wicket-ioc/src/test/java/org/apache/wicket/proxy/PackagePrivateConcreteObject.java +++ b/wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateConcreteObject.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.proxy; +package org.apache.wicket.proxy.packageprivate; /** * Mock dependency that does not implement an interface. - * Its visibility is package private (to {@link LazyInitProxyFactoryTest}) to test a bug + * Its visibility is package private (to {@link PackagePrivateTest}) to test a bug * described at https://issues.apache.org/jira/browse/WICKET-4324 */ class PackagePrivateConcreteObject diff --git a/wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateTest.java b/wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateTest.java new file mode 100644 index 00000000000..f7c82dcdd7c --- /dev/null +++ b/wicket-ioc/src/test/java/org/apache/wicket/proxy/packageprivate/PackagePrivateTest.java @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.packageprivate; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.lang.reflect.Proxy; + +import org.apache.wicket.core.util.lang.WicketObjects; +import org.apache.wicket.proxy.ILazyInitProxy; +import org.apache.wicket.proxy.IProxyTargetLocator; +import org.apache.wicket.proxy.LazyInitProxyFactory; +import org.apache.wicket.proxy.util.IObjectMethodTester; +import org.apache.wicket.proxy.util.ObjectMethodTester; +import org.junit.jupiter.api.Test; + +/** + * Tests lazy init proxy factory + * + * @author Igor Vaynberg (ivaynberg) + * + */ +class PackagePrivateTest +{ + private static final PackagePrivateConcreteObject PACKAGE_PRIVATE_CONCRETE_OBJECT = new PackagePrivateConcreteObject("package-private-concrete"); + + private final static IProxyTargetLocator PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR = new IProxyTargetLocator() + { + private static final long serialVersionUID = 1L; + + @Override + public Object locateProxyTarget() + { + return PackagePrivateTest.PACKAGE_PRIVATE_CONCRETE_OBJECT; + } + }; + + /** + * Tests lazy init proxy to represent package private concrete objects + * + * https://issues.apache.org/jira/browse/WICKET-4324 + */ + @Test + void testPackagePrivateConcreteProxy() + { + PackagePrivateConcreteObject proxy = (PackagePrivateConcreteObject)LazyInitProxyFactory.createProxy( + PackagePrivateConcreteObject.class, PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR); + + // test proxy implements ILazyInitProxy + assertTrue(proxy instanceof ILazyInitProxy); + assertSame(((ILazyInitProxy)proxy).getObjectLocator(), PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR); + + // test we do not have a jdk dynamic proxy + assertFalse(Proxy.isProxyClass(proxy.getClass())); + + // test method invocation + assertEquals("package-private-concrete", proxy.getMessage()); + + // test serialization + PackagePrivateConcreteObject proxy2 = WicketObjects.cloneObject(proxy); + assertNotSame(proxy, proxy2); + assertEquals("package-private-concrete", proxy2.getMessage()); + + // test equals/hashcode method interception + final IObjectMethodTester tester = new ObjectMethodTester(); + assertTrue(tester.isValid()); + + // test only a single class is generated, + // otherwise permgen space will fill up with each proxy + assertSame(proxy.getClass(), LazyInitProxyFactory.createProxy( + PackagePrivateConcreteObject.class, PACKAGE_PRIVATE_CONCRETE_OBJECT_LOCATOR).getClass()); + + IProxyTargetLocator testerLocator = new IProxyTargetLocator() + { + private static final long serialVersionUID = 1L; + + @Override + public Object locateProxyTarget() + { + return tester; + } + }; + + ObjectMethodTester testerProxy = (ObjectMethodTester)LazyInitProxyFactory.createProxy( + ObjectMethodTester.class, testerLocator); + testerProxy.equals(this); + testerProxy.hashCode(); + testerProxy.toString(); + assertTrue(tester.isValid()); + } +} From 5892a6009ac6933c36062ab1f2264ba11dbfcc1b Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Mon, 23 Aug 2021 15:02:31 +0200 Subject: [PATCH 64/88] WICKET-6913 backport bytebuddy and objenesis improvements to wicket-9.x --- NOTICE | 7 +- README.md | 3 +- pom.xml | 6 + .../src/main/resources/META-INF/NOTICE | 9 +- wicket-ioc/pom.xml | 6 +- wicket-ioc/src/main/java/module-info.java | 2 + .../apache/wicket/proxy/IProxyFactory.java | 34 ++ .../wicket/proxy/LazyInitProxyFactory.java | 327 ++++-------------- .../proxy/bytebuddy/ByteBuddyInterceptor.java | 112 ++++++ .../bytebuddy/ByteBuddyProxyFactory.java | 211 +++++++++++ .../wicket/proxy/cglib/CglibProxyFactory.java | 186 ++++++++++ .../wicket/proxy/jdk/JdkProxyFactory.java | 196 +++++++++++ .../wicket/proxy/objenesis/IInstantiator.java | 52 +++ .../objenesis/ObjenesisCGLibInterceptor.java | 12 +- .../objenesis/ObjenesisInstantiator.java | 34 ++ .../objenesis/ObjenesisProxyFactory.java | 30 +- .../objenesis/ObjenesisProxyReplacement.java | 55 --- .../wicket/injection/util/MockDependency.java | 5 +- .../proxy/LazyInitProxyFactoryTest.java | 65 +++- .../proxy/util/NoDefaultConstructor.java | 28 ++ .../annot/SpringBeanWithGenericsTest.java | 2 +- .../src/main/asciidoc/jee/jee_4.adoc | 16 + 22 files changed, 1013 insertions(+), 385 deletions(-) create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyInterceptor.java create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java create mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java delete mode 100644 wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyReplacement.java create mode 100644 wicket-ioc/src/test/java/org/apache/wicket/proxy/util/NoDefaultConstructor.java diff --git a/NOTICE b/NOTICE index 3e462dbdc4f..bc97306eda3 100644 --- a/NOTICE +++ b/NOTICE @@ -56,8 +56,11 @@ src/./wicket-examples This product includes software developed by the CGLib Project (http://cglib.sourceforge.net). - This product includes ASM, released under a BSD style license (http://asm.objectweb.org). - Copyright (c) 2000-2005 INRIA, France Telecom + This product includes ASM, released under a BSD style license (https://asm.ow2.io/). + Copyright (c) 2000-2011 INRIA, France Telecom + + This product includes software developed by the ByteBuddy Project + (https://bytebuddy.net/). This product includes jhighlight (https://jhighlight.dev.java.net/) which is released under CDDL 1.0 license (http://www.opensource.org/licenses/cddl1.php). diff --git a/README.md b/README.md index 01e9982250c..8faa041a1b6 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,8 @@ the src/ folder. - wicket-ioc: cglib 3.1 (http://cglib.sourceforge.net/) and - asm-util 5.0.3 (http://asm.objectweb.org/) + asm-util 9.1 (https://asm.ow2.io/) + byte-buddy 1.11.12 (https://bytebuddy.net/) and - wicket-spring: diff --git a/pom.xml b/pom.xml index b4cbc767904..589c2a8de89 100644 --- a/pom.xml +++ b/pom.xml @@ -139,6 +139,7 @@ 3.19.0 4.1.0 3.3.0 + 1.11.12 3.2.2 4.4 1.4 @@ -320,6 +321,11 @@ 1.2.17 true + + net.bytebuddy + byte-buddy + ${byte-buddy.version} + org.apache.commons commons-collections4 diff --git a/wicket-examples/src/main/resources/META-INF/NOTICE b/wicket-examples/src/main/resources/META-INF/NOTICE index 619dd9174d9..3598cb344e8 100644 --- a/wicket-examples/src/main/resources/META-INF/NOTICE +++ b/wicket-examples/src/main/resources/META-INF/NOTICE @@ -29,8 +29,11 @@ This product includes software developed by the CGLib Project (http://cglib.sourceforge.net). - This product includes ASM, released under a BSD style license (http://asm.objectweb.org). - Copyright (c) 2000-2005 INRIA, France Telecom + This product includes ASM, released under a BSD style license (https://asm.ow2.io/). + Copyright (c) 2000-2011 INRIA, France Telecom + + This product includes software developed by the ByteBuddy Project + (https://bytebuddy.net/). This product includes jhighlight (https://jhighlight.dev.java.net/) which is released under CDDL 1.0 license (http://www.opensource.org/licenses/cddl1.php). @@ -42,4 +45,4 @@ jQuery Foundation, Inc, http://jquery.org/license Contains qunit.css released under a MIT style license. - jQuery Foundation, Inc, http://jquery.org/license \ No newline at end of file + jQuery Foundation, Inc, http://jquery.org/license diff --git a/wicket-ioc/pom.xml b/wicket-ioc/pom.xml index d34c07f6189..8ccb68467cd 100644 --- a/wicket-ioc/pom.xml +++ b/wicket-ioc/pom.xml @@ -40,10 +40,14 @@ javax.inject javax.inject + + net.bytebuddy + byte-buddy + true + org.apache.wicket wicket-core - ${project.version} org.objenesis diff --git a/wicket-ioc/src/main/java/module-info.java b/wicket-ioc/src/main/java/module-info.java index 6f7f7e1d124..c9366dee005 100644 --- a/wicket-ioc/src/main/java/module-info.java +++ b/wicket-ioc/src/main/java/module-info.java @@ -18,7 +18,9 @@ module org.apache.wicket.ioc { requires org.apache.wicket.util; requires org.apache.wicket.core; + requires org.slf4j; requires cglib; + requires net.bytebuddy; requires org.objenesis; exports org.apache.wicket.injection; diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java new file mode 100644 index 00000000000..ef5f63811cf --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy; + +/** + * A factory of proxies. + */ +public interface IProxyFactory +{ + /** + * Create a proxy. + * + * @param type + * the target type + * @param locator + * the locator of the target + * @return a proxy + */ + public Object createProxy(final Class type, final IProxyTargetLocator locator); +} diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java index ccc7769a41f..e83a18ef011 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java @@ -18,31 +18,24 @@ import java.io.ObjectStreamException; import java.io.Serializable; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.Proxy; import java.util.Arrays; import java.util.List; -import net.sf.cglib.core.DefaultNamingPolicy; -import net.sf.cglib.core.Predicate; -import net.sf.cglib.proxy.Callback; -import net.sf.cglib.proxy.CallbackFilter; -import net.sf.cglib.proxy.Enhancer; -import net.sf.cglib.proxy.MethodInterceptor; -import net.sf.cglib.proxy.MethodProxy; -import net.sf.cglib.proxy.NoOp; - -import org.apache.wicket.Application; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.core.util.lang.WicketObjects; import org.apache.wicket.model.IModel; -import org.apache.wicket.proxy.objenesis.ObjenesisProxyFactory; +import org.apache.wicket.proxy.bytebuddy.ByteBuddyProxyFactory; +import org.apache.wicket.proxy.cglib.CglibProxyFactory; +import org.apache.wicket.proxy.jdk.JdkProxyFactory; import org.apache.wicket.util.io.IClusterable; -import org.apache.wicket.util.string.Strings; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import net.sf.cglib.core.DefaultNamingPolicy; +import net.sf.cglib.proxy.MethodInterceptor; +import net.sf.cglib.proxy.MethodProxy; +import net.sf.cglib.proxy.NoOp; /** * A factory class that creates lazy init proxies given a type and a {@link IProxyTargetLocator} @@ -53,7 +46,7 @@ * forwarded. *

    * This factory creates two kinds of proxies: A standard dynamic proxy when the specified type is an - * interface, and a CGLib proxy when the specified type is a concrete class. + * interface, and a cglib proxy when the specified type is a concrete class. *

    * The general use case for such a proxy is to represent a dependency that should not be serialized * with a wicket page or {@link IModel}. The solution is to serialize the proxy and the @@ -109,19 +102,30 @@ */ public class LazyInitProxyFactory { + private static final Logger log = LoggerFactory.getLogger(LazyInitProxyFactory.class); + /** * Primitive java types and their object wrappers */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - private static final List PRIMITIVES = Arrays.asList(String.class, byte.class, Byte.class, + private static final List> PRIMITIVES = Arrays.asList(String.class, byte.class, Byte.class, short.class, Short.class, int.class, Integer.class, long.class, Long.class, float.class, Float.class, double.class, Double.class, char.class, Character.class, boolean.class, Boolean.class); - - private static final int CGLIB_CALLBACK_NO_OVERRIDE = 0; - private static final int CGLIB_CALLBACK_HANDLER = 1; - - private static final boolean IS_OBJENESIS_AVAILABLE = isObjenesisAvailable(); + + private static final IProxyFactory proxyFactory = initProxyFactory(); + + private static IProxyFactory initProxyFactory() { + IProxyFactory proxyFactory = null; + + if ("true".equals(System.getProperty("wicket.ioc.useByteBuddy"))) { + log.info("using Byte Buddy proxy factory"); + proxyFactory = new ByteBuddyProxyFactory(); + } else { + proxyFactory = new CglibProxyFactory(); + } + + return proxyFactory; + } /** * Create a lazy init proxy for the specified type. The target object will be located using the @@ -145,70 +149,14 @@ public static Object createProxy(final Class type, final IProxyTargetLocator } else if (type.isInterface()) { - JdkHandler handler = new JdkHandler(type, locator); - - try - { - return Proxy.newProxyInstance(resolveClassLoader(), - new Class[] { type, Serializable.class, ILazyInitProxy.class, - IWriteReplace.class }, handler); - } - catch (IllegalArgumentException e) - { - /* - * STW: In some clustering environments it appears the context classloader fails to - * load the proxied interface (currently seen in BEA WLS 9.x clusters). If this - * happens, we can try and fall back to the classloader (current) that actually - * loaded this class. - */ - return Proxy.newProxyInstance(LazyInitProxyFactory.class.getClassLoader(), - new Class[] { type, Serializable.class, ILazyInitProxy.class, - IWriteReplace.class }, handler); - } - + return new JdkProxyFactory().createProxy(type, locator); } - else if (IS_OBJENESIS_AVAILABLE && !hasNoArgConstructor(type)) - { - return ObjenesisProxyFactory.createProxy(type, locator, WicketNamingPolicy.INSTANCE); - } - else - { - CGLibInterceptor handler = new CGLibInterceptor(type, locator); - - Callback[] callbacks = new Callback[2]; - callbacks[CGLIB_CALLBACK_NO_OVERRIDE] = SerializableNoOpCallback.INSTANCE; - callbacks[CGLIB_CALLBACK_HANDLER] = handler; - - Enhancer e = new Enhancer(); - e.setClassLoader(resolveClassLoader()); - e.setInterfaces(new Class[] { Serializable.class, ILazyInitProxy.class, - IWriteReplace.class }); - e.setSuperclass(type); - e.setCallbackFilter(NoOpForProtectedMethodsCGLibCallbackFilter.INSTANCE); - e.setCallbacks(callbacks); - e.setNamingPolicy(WicketNamingPolicy.INSTANCE); - - return e.create(); + else { + return proxyFactory.createProxy(type, locator); } } - - private static ClassLoader resolveClassLoader() - { - ClassLoader classLoader = null; - if (Application.exists()) - { - classLoader = Application.get().getApplicationSettings() - .getClassResolver().getClassLoader(); - } - - if (classLoader == null) { - classLoader = Thread.currentThread().getContextClassLoader(); - } - - return classLoader; - } - - /** + + /** * This interface is used to make the proxy forward writeReplace() call to the handler instead * of invoking it on itself. This allows us to serialize the replacement object instead of the * proxy itself in case the proxy subclass is deserialized on a VM that does not have it @@ -237,7 +185,7 @@ public interface IWriteReplace * @author Igor Vaynberg (ivaynberg) * */ - static class ProxyReplacement implements IClusterable + public static final class ProxyReplacement implements IClusterable { private static final long serialVersionUID = 1L; @@ -292,6 +240,7 @@ private Object readResolve() throws ObjectStreamException * @author Igor Vaynberg (ivaynberg) * */ + @Deprecated(forRemoval = true) public abstract static class AbstractCGLibInterceptor implements MethodInterceptor, @@ -372,24 +321,7 @@ public IProxyTargetLocator getObjectLocator() { return locator; } - } - /** - * Method interceptor for proxies representing concrete object not backed by an interface. These - * proxies are representing by cglib proxies. - * - * @author Igor Vaynberg (ivaynberg) - */ - protected static class CGLibInterceptor extends AbstractCGLibInterceptor - { - public CGLibInterceptor(Class type, IProxyTargetLocator locator) - { - super(type, locator); - } - - /** - * @see org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace#writeReplace() - */ @Override public Object writeReplace() throws ObjectStreamException { @@ -398,153 +330,40 @@ public Object writeReplace() throws ObjectStreamException } /** - * Serializable implementation of the NoOp callback. - */ - public static class SerializableNoOpCallback implements NoOp, Serializable - { - private static final long serialVersionUID = 1L; - - private static final NoOp INSTANCE = new SerializableNoOpCallback(); - } - - /** - * CGLib callback filter which does not intercept protected methods. - * - * Protected methods need to be called with invokeSuper() instead of invoke(). - * When invoke() is called on a protected method, it throws an "IllegalArgumentException: - * Protected method" exception. - * That being said, we do not need to intercept the protected methods so this callback filter - * is designed to use a NoOp callback for protected methods. - * - * @see Discussion about - * this very issue in Spring AOP - * @see The WicketStuff - * SpringReference project which worked around this issue - */ - private static class NoOpForProtectedMethodsCGLibCallbackFilter implements CallbackFilter - { - private static final CallbackFilter INSTANCE = new NoOpForProtectedMethodsCGLibCallbackFilter(); - - @Override - public int accept(Method method) { - if (Modifier.isProtected(method.getModifiers())) - { - return CGLIB_CALLBACK_NO_OVERRIDE; - } - else - { - return CGLIB_CALLBACK_HANDLER; - } - } - } - - /** - * Invocation handler for proxies representing interface based object. For interface backed - * objects dynamic jdk proxies are used. + * Method interceptor for proxies representing concrete object not backed by an interface. These + * proxies are represented by cglib proxies. * * @author Igor Vaynberg (ivaynberg) * */ - private static class JdkHandler - implements - InvocationHandler, - ILazyInitProxy, - Serializable, - IWriteReplace + public static class CGLibInterceptor extends AbstractCGLibInterceptor { private static final long serialVersionUID = 1L; - private final IProxyTargetLocator locator; - - private final String typeName; - - private transient Object target; - /** * Constructor * * @param type - * class of object this handler will represent + * class of the object this proxy was created for * * @param locator * object locator used to locate the object this proxy represents */ - public JdkHandler(final Class type, final IProxyTargetLocator locator) - { - super(); - this.locator = locator; - typeName = type.getName(); - } - - /** - * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, - * java.lang.reflect.Method, java.lang.Object[]) - */ - @Override - public Object invoke(final Object proxy, final Method method, final Object[] args) - throws Throwable + public CGLibInterceptor(final Class type, final IProxyTargetLocator locator) { - if (isFinalizeMethod(method)) - { - // swallow finalize call - return null; - } - else if (isEqualsMethod(method)) - { - return (equals(args[0])) ? Boolean.TRUE : Boolean.FALSE; - } - else if (isHashCodeMethod(method)) - { - return hashCode(); - } - else if (isToStringMethod(method)) - { - return toString(); - } - else if (method.getDeclaringClass().equals(ILazyInitProxy.class)) - { - return getObjectLocator(); - } - else if (isWriteReplaceMethod(method)) - { - return writeReplace(); - } - - if (target == null) - { - - target = locator.locateProxyTarget(); - } - try - { - method.setAccessible(true); - return method.invoke(target, args); - } - catch (InvocationTargetException e) - { - throw e.getTargetException(); - } - } - - /** - * @see org.apache.wicket.proxy.ILazyInitProxy#getObjectLocator() - */ - @Override - public IProxyTargetLocator getObjectLocator() - { - return locator; - } - - /** - * @see org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace#writeReplace() - */ - @Override - public Object writeReplace() throws ObjectStreamException - { - return new ProxyReplacement(typeName, locator); + super(type, locator); } } - + + /** + * @deprecated no longer used + */ + @Deprecated(forRemoval = true) + public static class SerializableNoOpCallback implements NoOp, Serializable + { + public static final NoOp INSTANCE = new SerializableNoOpCallback(); + } + /** * Checks if the method is derived from Object.equals() * @@ -610,47 +429,17 @@ public static boolean isWriteReplaceMethod(final Method method) return (method.getReturnType() == Object.class) && (method.getParameterTypes().length == 0) && method.getName().equals("writeReplace"); } - - public static final class WicketNamingPolicy extends DefaultNamingPolicy + + /** + * @deprecated no longer used + */ + @Deprecated(forRemoval = true) + public static class WicketNamingPolicy extends DefaultNamingPolicy { public static final WicketNamingPolicy INSTANCE = new WicketNamingPolicy(); private WicketNamingPolicy() { - super(); - } - - @Override - public String getClassName(final String prefix, final String source, final Object key, - final Predicate names) - { - int lastIdxOfDot = prefix.lastIndexOf('.'); - String packageName = prefix.substring(0, lastIdxOfDot); - String className = prefix.substring(lastIdxOfDot + 1); - String newPrefix = packageName + ".Wicket_Proxy_" + className; - return super.getClassName(newPrefix, source, key, names); - } - } - - - private static boolean hasNoArgConstructor(Class type) - { - for (Constructor constructor : type.getDeclaredConstructors()) - { - if (constructor.getParameterTypes().length == 0) - return true; - } - - return false; - } - - private static boolean isObjenesisAvailable() - { - try { - Class.forName("org.objenesis.ObjenesisStd"); - return true; - } catch (Exception ignored) { - return false; } } } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyInterceptor.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyInterceptor.java new file mode 100644 index 00000000000..3ac3f25d440 --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyInterceptor.java @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.bytebuddy; + +import java.io.ObjectStreamException; +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.function.Function; + +import org.apache.wicket.proxy.ILazyInitProxy; +import org.apache.wicket.proxy.IProxyTargetLocator; +import org.apache.wicket.proxy.LazyInitProxyFactory; +import org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace; +import org.apache.wicket.proxy.LazyInitProxyFactory.ProxyReplacement; + +import net.bytebuddy.implementation.bind.annotation.AllArguments; +import net.bytebuddy.implementation.bind.annotation.Origin; +import net.bytebuddy.implementation.bind.annotation.Pipe; +import net.bytebuddy.implementation.bind.annotation.RuntimeType; + +/** + * Method interceptor for proxies representing concrete object not backed by an interface. + * These proxies are represented by ByteBuddy proxies. + * + * @author Igor Vaynberg (ivaynberg) + */ +public class ByteBuddyInterceptor + implements + ILazyInitProxy, + Serializable, + IWriteReplace +{ + private static final long serialVersionUID = 1L; + + protected final IProxyTargetLocator locator; + + protected final String typeName; + + private transient Object target; + + /** + * Constructor + * + * @param type + * class of the object this proxy was created for + * + * @param locator + * object locator used to locate the object this proxy represents + */ + public ByteBuddyInterceptor(final Class type, final IProxyTargetLocator locator) + { + super(); + + this.typeName = type.getName(); + this.locator = locator; + } + + @RuntimeType + public Object intercept(@Origin Method method, @AllArguments Object[] args, @Pipe Function pipe) throws Exception + { + if (LazyInitProxyFactory.isFinalizeMethod(method)) + { + // swallow finalize call + return null; + } + else if (LazyInitProxyFactory.isEqualsMethod(method)) + { + return (equals(args[0])) ? Boolean.TRUE : Boolean.FALSE; + } + else if (LazyInitProxyFactory.isHashCodeMethod(method)) + { + return hashCode(); + } + else if (LazyInitProxyFactory.isToStringMethod(method)) + { + return toString(); + } + + if (target == null) + { + target = locator.locateProxyTarget(); + } + + return pipe.apply(target); + } + + @Override + public IProxyTargetLocator getObjectLocator() + { + return locator; + } + + @Override + public Object writeReplace() throws ObjectStreamException + { + return new ProxyReplacement(typeName, locator); + } +} \ No newline at end of file diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java new file mode 100644 index 00000000000..836f296161a --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.bytebuddy; + +import java.io.Serializable; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.function.Function; + +import org.apache.wicket.Application; +import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.proxy.ILazyInitProxy; +import org.apache.wicket.proxy.IProxyFactory; +import org.apache.wicket.proxy.IProxyTargetLocator; +import org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace; +import org.apache.wicket.proxy.objenesis.IInstantiator; + +import net.bytebuddy.ByteBuddy; +import net.bytebuddy.NamingStrategy; +import net.bytebuddy.TypeCache; +import net.bytebuddy.description.modifier.Visibility; +import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.dynamic.loading.ClassLoadingStrategy; +import net.bytebuddy.implementation.FieldAccessor; +import net.bytebuddy.implementation.MethodDelegation; +import net.bytebuddy.implementation.bind.annotation.Pipe; +import net.bytebuddy.matcher.ElementMatchers; + +/** + * A factory class that creates bytebuddy proxies. + */ +public class ByteBuddyProxyFactory implements IProxyFactory +{ + /** + * A cache used to store the dynamically generated classes by ByteBuddy. + * Without this cache a new class will be generated for each proxy creation + * and this will fill up the metaspace + */ + private static final TypeCache DYNAMIC_CLASS_CACHE = new TypeCache.WithInlineExpunction<>(TypeCache.Sort.SOFT); + + private static final ByteBuddy BYTE_BUDDY = new ByteBuddy().with(WicketNamingStrategy.INSTANCE); + + private static IInstantiator instantiator = IInstantiator.getInstantiator(); + + /** + * Create a lazy init proxy for the specified type. The target object will be located using the + * provided locator upon first method invocation. + * + * @param type + * type that proxy will represent + * + * @param locator + * object locator that will locate the object the proxy represents + * + * @return lazily initializable proxy + */ + @Override + public Object createProxy(final Class type, final IProxyTargetLocator locator) + { + Class proxyClass = createOrGetProxyClass(type); + + Object instance; + + if (!hasNoArgConstructor(type)) + { + instance = instantiator.newInstance(proxyClass); + } + else + { + try + { + instance = proxyClass.getDeclaredConstructor().newInstance(); + } + catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) + { + throw new WicketRuntimeException(e); + } + } + + ByteBuddyInterceptor interceptor = new ByteBuddyInterceptor(type, locator); + ((InterceptorMutator) instance).setInterceptor(interceptor); + + return instance; + } + + public static Class createOrGetProxyClass(Class type) + { + ClassLoader classLoader = resolveClassLoader(); + return DYNAMIC_CLASS_CACHE.findOrInsert(classLoader, + new TypeCache.SimpleKey(type), + () -> BYTE_BUDDY + .subclass(type) + .method(ElementMatchers.isPublic()) + .intercept( + MethodDelegation + .withDefaultConfiguration() + .withBinders(Pipe.Binder.install(Function.class)) + .toField("interceptor")) + .defineField("interceptor", ByteBuddyInterceptor.class, Visibility.PRIVATE) + .implement(InterceptorMutator.class).intercept(FieldAccessor.ofBeanProperty()) + .implement(Serializable.class, IWriteReplace.class, ILazyInitProxy.class).intercept(MethodDelegation.toField("interceptor")) + .make() + .load(classLoader, ClassLoadingStrategy.Default.INJECTION) + .getLoaded()); + } + + private static ClassLoader resolveClassLoader() + { + ClassLoader classLoader = null; + if (Application.exists()) + { + classLoader = Application.get().getApplicationSettings() + .getClassResolver().getClassLoader(); + } + + if (classLoader == null) { + classLoader = Thread.currentThread().getContextClassLoader(); + } + + return classLoader; + } + + /** + * An interface used to set the Byte Buddy interceptor after creating an + * instance of the dynamically created proxy class. + * We need to set the interceptor as a field in the proxy class so that + * we could use different interceptors for proxied classes with generics. + * For example: a {@link org.apache.wicket.Component} may need to inject + * two beans with the same raw type but different generic type(s) ( + * ArrayList<String> and ArrayList<Integer>). + * Since the generic types are erased at runtime, and we use caching for the + * dynamic proxy classes we need to be able to set different interceptors + * after instantiating the proxy class. + */ + public interface InterceptorMutator + { + void setInterceptor(ByteBuddyInterceptor interceptor); + } + + /** + * A strategy that decides what should be the fully qualified name of the generated + * classes. Since it is not possible to create new classes in the java.** + * package we modify the package name by prefixing it with bytebuddy_generated_wicket_proxy.. + * For classes in any other packages we modify just the class name by prefixing + * it with WicketProxy_. This way the generated proxy class could still + * access package-private members of sibling classes. + */ + private static final class WicketNamingStrategy extends NamingStrategy.AbstractBase + { + public static final WicketNamingStrategy INSTANCE = new WicketNamingStrategy(); + + private WicketNamingStrategy() + { + super(); + } + + @Override + protected String name(TypeDescription superClass) { + String prefix = superClass.getName(); + int lastIdxOfDot = prefix.lastIndexOf('.'); + String packageName = prefix.substring(0, lastIdxOfDot); + String className = prefix.substring(lastIdxOfDot + 1); + String name = packageName + "."; + if (prefix.startsWith("java.")) + { + name = "bytebuddy_generated_wicket_proxy." + name + className; + } + else + { + name += "WicketProxy_" + className; + } + return name; + } + + @Override + public String redefine(TypeDescription typeDescription) { + return typeDescription.getName(); + } + + @Override + public String rebase(TypeDescription typeDescription) { + return typeDescription.getName(); + } + } + + + private static boolean hasNoArgConstructor(Class type) + { + for (Constructor constructor : type.getDeclaredConstructors()) + { + if (constructor.getParameterTypes().length == 0) + return true; + } + + return false; + } +} diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java new file mode 100644 index 00000000000..e90e128e115 --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java @@ -0,0 +1,186 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.cglib; + +import java.io.Serializable; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import org.apache.wicket.Application; +import org.apache.wicket.proxy.ILazyInitProxy; +import org.apache.wicket.proxy.IProxyFactory; +import org.apache.wicket.proxy.IProxyTargetLocator; +import org.apache.wicket.proxy.LazyInitProxyFactory.CGLibInterceptor; +import org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace; +import org.apache.wicket.proxy.objenesis.IInstantiator; + +import net.sf.cglib.core.DefaultNamingPolicy; +import net.sf.cglib.core.Predicate; +import net.sf.cglib.proxy.Callback; +import net.sf.cglib.proxy.CallbackFilter; +import net.sf.cglib.proxy.Enhancer; +import net.sf.cglib.proxy.Factory; +import net.sf.cglib.proxy.NoOp; + +/** + * A factory class that creates cglib proxies. + */ +public class CglibProxyFactory implements IProxyFactory +{ + private static final int CGLIB_CALLBACK_NO_OVERRIDE = 0; + private static final int CGLIB_CALLBACK_HANDLER = 1; + + private static IInstantiator instantiator = IInstantiator.getInstantiator(); + + /** + * Create a lazy init proxy for the specified type. The target object will be located using the + * provided locator upon first method invocation. + * + * @param type + * type that proxy will represent + * + * @param locator + * object locator that will locate the object the proxy represents + * + * @return lazily initializable proxy + */ + @Override + public Object createProxy(final Class type, final IProxyTargetLocator locator) + { + CGLibInterceptor handler = new CGLibInterceptor(type, locator); + + Callback[] callbacks = new Callback[2]; + callbacks[CGLIB_CALLBACK_NO_OVERRIDE] = SerializableNoOpCallback.INSTANCE; + callbacks[CGLIB_CALLBACK_HANDLER] = handler; + + Enhancer e = new Enhancer(); + e.setClassLoader(resolveClassLoader()); + e.setInterfaces(new Class[] { Serializable.class, ILazyInitProxy.class, + IWriteReplace.class }); + e.setSuperclass(type); + e.setCallbackFilter(NoOpForProtectedMethodsCGLibCallbackFilter.INSTANCE); + e.setNamingPolicy(WicketNamingPolicy.INSTANCE); + + if (!hasNoArgConstructor(type)) + { + e.setCallbackTypes(new Class[] {callbacks[0].getClass(), callbacks[1].getClass()}); + + Object instance = instantiator.newInstance(e.createClass()); + + // set callbacks directly (WICKET-6607) + ((Factory) instance).setCallbacks(callbacks); + + return instance; + } + else + { + e.setCallbacks(callbacks); + + return e.create(); + } + } + + private static ClassLoader resolveClassLoader() + { + ClassLoader classLoader = null; + if (Application.exists()) + { + classLoader = Application.get().getApplicationSettings() + .getClassResolver().getClassLoader(); + } + + if (classLoader == null) { + classLoader = Thread.currentThread().getContextClassLoader(); + } + + return classLoader; + } + + /** + * CGLib callback filter which does not intercept protected methods. + * + * Protected methods need to be called with invokeSuper() instead of invoke(). + * When invoke() is called on a protected method, it throws an "IllegalArgumentException: + * Protected method" exception. + * That being said, we do not need to intercept the protected methods so this callback filter + * is designed to use a NoOp callback for protected methods. + * + * @see Discussion about + * this very issue in Spring AOP + * @see The WicketStuff + * SpringReference project which worked around this issue + */ + private static class NoOpForProtectedMethodsCGLibCallbackFilter implements CallbackFilter + { + private static final CallbackFilter INSTANCE = new NoOpForProtectedMethodsCGLibCallbackFilter(); + + @Override + public int accept(Method method) { + if (Modifier.isProtected(method.getModifiers())) + { + return CGLIB_CALLBACK_NO_OVERRIDE; + } + else + { + return CGLIB_CALLBACK_HANDLER; + } + } + } + + /** + * Serializable implementation of the NoOp callback. + */ + private static class SerializableNoOpCallback implements NoOp, Serializable + { + private static final long serialVersionUID = 1L; + + public static final NoOp INSTANCE = new SerializableNoOpCallback(); + } + + private static class WicketNamingPolicy extends DefaultNamingPolicy + { + public static final WicketNamingPolicy INSTANCE = new WicketNamingPolicy(); + + private WicketNamingPolicy() + { + super(); + } + + @Override + public String getClassName(final String prefix, final String source, final Object key, + final Predicate names) + { + int lastIdxOfDot = prefix.lastIndexOf('.'); + String packageName = prefix.substring(0, lastIdxOfDot); + String className = prefix.substring(lastIdxOfDot + 1); + String newPrefix = packageName + ".Wicket_Proxy_" + className; + return super.getClassName(newPrefix, source, key, names); + } + } + + private static boolean hasNoArgConstructor(Class type) + { + for (Constructor constructor : type.getDeclaredConstructors()) + { + if (constructor.getParameterTypes().length == 0) + return true; + } + + return false; + } +} diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java new file mode 100644 index 00000000000..66ecda0e838 --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.jdk; + +import java.io.ObjectStreamException; +import java.io.Serializable; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +import org.apache.wicket.Application; +import org.apache.wicket.proxy.ILazyInitProxy; +import org.apache.wicket.proxy.IProxyTargetLocator; +import org.apache.wicket.proxy.LazyInitProxyFactory; +import org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace; +import org.apache.wicket.proxy.LazyInitProxyFactory.ProxyReplacement; + +/** + * A factory class that creates jdk dynamic proxies. + */ +public class JdkProxyFactory +{ + /** + * Create a lazy init proxy for the specified type. The target object will be located using the + * provided locator upon first method invocation. + * + * @param type + * type that proxy will represent + * + * @param locator + * object locator that will locate the object the proxy represents + * + * @return lazily initializable proxy + */ + public Object createProxy(final Class type, final IProxyTargetLocator locator) + { + JdkHandler handler = new JdkHandler(type, locator); + + try + { + return Proxy.newProxyInstance(resolveClassLoader(), + new Class[] { type, Serializable.class, ILazyInitProxy.class, + IWriteReplace.class }, handler); + } + catch (IllegalArgumentException e) + { + /* + * STW: In some clustering environments it appears the context classloader fails to + * load the proxied interface (currently seen in BEA WLS 9.x clusters). If this + * happens, we can try and fall back to the classloader (current) that actually + * loaded this class. + */ + return Proxy.newProxyInstance(LazyInitProxyFactory.class.getClassLoader(), + new Class[] { type, Serializable.class, ILazyInitProxy.class, + IWriteReplace.class }, handler); + } + } + + private ClassLoader resolveClassLoader() + { + ClassLoader classLoader = null; + if (Application.exists()) + { + classLoader = Application.get().getApplicationSettings() + .getClassResolver().getClassLoader(); + } + + if (classLoader == null) { + classLoader = Thread.currentThread().getContextClassLoader(); + } + + return classLoader; + } + + /** + * Invocation handler for proxies representing interface based object. For interface backed + * objects dynamic jdk proxies are used. + * + * @author Igor Vaynberg (ivaynberg) + * + */ + private static class JdkHandler + implements + InvocationHandler, + ILazyInitProxy, + Serializable, + IWriteReplace + { + private static final long serialVersionUID = 1L; + + private final IProxyTargetLocator locator; + + private final String typeName; + + private transient Object target; + + /** + * Constructor + * + * @param type + * class of object this handler will represent + * + * @param locator + * object locator used to locate the object this proxy represents + */ + public JdkHandler(final Class type, final IProxyTargetLocator locator) + { + super(); + this.locator = locator; + typeName = type.getName(); + } + + /** + * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, + * java.lang.reflect.Method, java.lang.Object[]) + */ + @Override + public Object invoke(final Object proxy, final Method method, final Object[] args) + throws Throwable + { + if (LazyInitProxyFactory.isFinalizeMethod(method)) + { + // swallow finalize call + return null; + } + else if (LazyInitProxyFactory.isEqualsMethod(method)) + { + return (equals(args[0])) ? Boolean.TRUE : Boolean.FALSE; + } + else if (LazyInitProxyFactory.isHashCodeMethod(method)) + { + return hashCode(); + } + else if (LazyInitProxyFactory.isToStringMethod(method)) + { + return toString(); + } + else if (method.getDeclaringClass().equals(ILazyInitProxy.class)) + { + return getObjectLocator(); + } + else if (LazyInitProxyFactory.isWriteReplaceMethod(method)) + { + return writeReplace(); + } + + if (target == null) + { + + target = locator.locateProxyTarget(); + } + try + { + method.setAccessible(true); + return method.invoke(target, args); + } + catch (InvocationTargetException e) + { + throw e.getTargetException(); + } + } + + /** + * @see org.apache.wicket.proxy.ILazyInitProxy#getObjectLocator() + */ + @Override + public IProxyTargetLocator getObjectLocator() + { + return locator; + } + + /** + * @see org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace#writeReplace() + */ + @Override + public Object writeReplace() throws ObjectStreamException + { + return new ProxyReplacement(typeName, locator); + } + } +} \ No newline at end of file diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java new file mode 100644 index 00000000000..03557e4d26d --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.objenesis; + +import org.apache.wicket.WicketRuntimeException; + +/** + * Instantiator for Objects without default constructor. + */ +@FunctionalInterface +public interface IInstantiator +{ + /** + * Create a new instance. + * + * @param type + * type of instance + * @return instance + */ + public Object newInstance(Class type); + + public static IInstantiator getInstantiator() + { + try + { + return new ObjenesisInstantiator(); + } + catch (NoClassDefFoundError e) + { + return (type) -> { + throw new WicketRuntimeException(String.format( + "Can't create proxy for %s without default constructor" + + " - you can remedy this by adding Objenesis to your project dependencies.", + type.getName())); + }; + } + } +} diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisCGLibInterceptor.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisCGLibInterceptor.java index 63975a0e4e2..9c8063f385c 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisCGLibInterceptor.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisCGLibInterceptor.java @@ -16,24 +16,16 @@ */ package org.apache.wicket.proxy.objenesis; -import java.io.ObjectStreamException; - import org.apache.wicket.proxy.IProxyTargetLocator; import org.apache.wicket.proxy.LazyInitProxyFactory; /** - * Method interceptor for proxies representing concrete object not backed by an interface. These - * proxies are representing by cglib proxies. + * @deprecated no longer used */ +@Deprecated(forRemoval = true) public class ObjenesisCGLibInterceptor extends LazyInitProxyFactory.AbstractCGLibInterceptor { public ObjenesisCGLibInterceptor(Class type, IProxyTargetLocator locator) { super(type, locator); } - - @Override - public Object writeReplace() throws ObjectStreamException - { - return new ObjenesisProxyReplacement(typeName, locator); - } } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java new file mode 100644 index 00000000000..2a8fedef35f --- /dev/null +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.objenesis; + +import org.objenesis.ObjenesisStd; + +/** + * Wrapper around Objenesis to allow optional creation of objects without + * default constructor. + *
    + * Note: This class fails to load if Objenesis is not on the classpath. + */ +class ObjenesisInstantiator implements IInstantiator +{ + private final ObjenesisStd OBJENESIS = new ObjenesisStd(false); + + public Object newInstance(Class type) { + return OBJENESIS.newInstance(type); + } +} diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyFactory.java index 730da6b340a..a9751773855 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyFactory.java @@ -16,38 +16,18 @@ */ package org.apache.wicket.proxy.objenesis; -import java.io.Serializable; - -import org.apache.wicket.proxy.ILazyInitProxy; import org.apache.wicket.proxy.IProxyTargetLocator; -import org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace; -import org.objenesis.ObjenesisStd; import net.sf.cglib.core.NamingPolicy; -import net.sf.cglib.proxy.Callback; -import net.sf.cglib.proxy.Enhancer; -import net.sf.cglib.proxy.Factory; +/** + * @deprecated no longer used + */ +@Deprecated(forRemoval = true) public class ObjenesisProxyFactory { - private static final ObjenesisStd OBJENESIS = new ObjenesisStd(false); - public static Object createProxy(final Class type, final IProxyTargetLocator locator, NamingPolicy namingPolicy) { - ObjenesisCGLibInterceptor handler = new ObjenesisCGLibInterceptor(type, locator); - - Enhancer e = new Enhancer(); - e.setInterfaces(new Class[]{Serializable.class, ILazyInitProxy.class, IWriteReplace.class}); - e.setSuperclass(type); - e.setCallbackType(handler.getClass()); - e.setNamingPolicy(namingPolicy); - Class proxyClass = e.createClass(); - - Object instance = OBJENESIS.newInstance(proxyClass); - - // set callbacks directly (WICKET-6607) - ((Factory) instance).setCallbacks(new Callback[]{handler}); - - return instance; + return null; } } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyReplacement.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyReplacement.java deleted file mode 100644 index cbffee8f24a..00000000000 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisProxyReplacement.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.proxy.objenesis; - -import java.io.ObjectStreamException; - -import org.apache.wicket.WicketRuntimeException; -import org.apache.wicket.core.util.lang.WicketObjects; -import org.apache.wicket.proxy.IProxyTargetLocator; -import org.apache.wicket.proxy.LazyInitProxyFactory; -import org.apache.wicket.util.io.IClusterable; - -/** - * Object that replaces the proxy when it is serialized. Upon deserialization this object will - * create a new proxy with the same locator. - */ -class ObjenesisProxyReplacement implements IClusterable -{ - private static final long serialVersionUID = 1L; - - private final IProxyTargetLocator locator; - - private final String type; - - ObjenesisProxyReplacement(final String type, final IProxyTargetLocator locator) { - this.type = type; - this.locator = locator; - } - - protected Object readResolve() throws ObjectStreamException - { - Class clazz = WicketObjects.resolveClass(type); - if (clazz == null) { - ClassNotFoundException cause = new ClassNotFoundException( - "Could not resolve type [" + type + - "] with the currently configured org.apache.wicket.application.IClassResolver"); - throw new WicketRuntimeException(cause); - } - return ObjenesisProxyFactory.createProxy(clazz, locator, LazyInitProxyFactory.WicketNamingPolicy.INSTANCE); - } -} diff --git a/wicket-ioc/src/test/java/org/apache/wicket/injection/util/MockDependency.java b/wicket-ioc/src/test/java/org/apache/wicket/injection/util/MockDependency.java index cc221350a2e..6afeeccc70a 100644 --- a/wicket-ioc/src/test/java/org/apache/wicket/injection/util/MockDependency.java +++ b/wicket-ioc/src/test/java/org/apache/wicket/injection/util/MockDependency.java @@ -16,6 +16,8 @@ */ package org.apache.wicket.injection.util; +import org.apache.wicket.proxy.LazyInitProxyFactory; + /** * Mock dependency that does not implement an interface * @@ -27,7 +29,8 @@ public class MockDependency private String message; /** - * Empty default constructor. It is required by cglib to create a proxy. + * Empty default constructor. It is required by {@link LazyInitProxyFactory} + * to create a proxy. */ public MockDependency() { diff --git a/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java b/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java index ff6c96ad9af..d142e4164d2 100644 --- a/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java +++ b/wicket-ioc/src/test/java/org/apache/wicket/proxy/LazyInitProxyFactoryTest.java @@ -31,6 +31,7 @@ import org.apache.wicket.proxy.util.IInterface; import org.apache.wicket.proxy.util.IObjectMethodTester; import org.apache.wicket.proxy.util.InterfaceObject; +import org.apache.wicket.proxy.util.NoDefaultConstructor; import org.apache.wicket.proxy.util.ObjectMethodTester; import org.junit.jupiter.api.Test; @@ -40,11 +41,13 @@ * @author Igor Vaynberg (ivaynberg) * */ -public class LazyInitProxyFactoryTest +class LazyInitProxyFactoryTest { - private static InterfaceObject interfaceObject = new InterfaceObject("interface"); + private static final InterfaceObject interfaceObject = new InterfaceObject("interface"); - private static ConcreteObject concreteObject = new ConcreteObject("concrete"); + private static final ConcreteObject concreteObject = new ConcreteObject("concrete"); + + private static final NoDefaultConstructor noDefaultConstructor = new NoDefaultConstructor("argument"); private static IProxyTargetLocator interfaceObjectLocator = new IProxyTargetLocator() { @@ -57,7 +60,18 @@ public Object locateProxyTarget() } }; - private static IProxyTargetLocator concreteObjectLocator = new IProxyTargetLocator() + private static IProxyTargetLocator noDefaultConstructorLocator = new IProxyTargetLocator() + { + private static final long serialVersionUID = 1L; + + @Override + public Object locateProxyTarget() + { + return LazyInitProxyFactoryTest.noDefaultConstructor; + } + }; + + private static final IProxyTargetLocator concreteObjectLocator = new IProxyTargetLocator() { private static final long serialVersionUID = 1L; @@ -66,6 +80,11 @@ public Object locateProxyTarget() { return LazyInitProxyFactoryTest.concreteObject; } + + // This method is needed to prevent (de)serialization of this locator instance in #testByteBuddyInterceptorReplacement() + private Object readResolve() throws ObjectStreamException { + return concreteObjectLocator; + } }; private static IProxyTargetLocator stringObjectLocator = new IProxyTargetLocator() @@ -83,7 +102,7 @@ public Object locateProxyTarget() * Tests lazy init proxy to represent interfaces */ @Test - public void testInterfaceProxy() + void testInterfaceProxy() { // test proxy creation for an interface class IInterface proxy = (IInterface)LazyInitProxyFactory.createProxy(IInterface.class, @@ -94,15 +113,15 @@ public void testInterfaceProxy() // test proxy implements ILazyInitProxy assertTrue(proxy instanceof ILazyInitProxy); - assertTrue(((ILazyInitProxy)proxy).getObjectLocator() == interfaceObjectLocator); + assertSame(((ILazyInitProxy) proxy).getObjectLocator(), interfaceObjectLocator); // test method invocation - assertEquals(proxy.getMessage(), "interface"); + assertEquals("interface", proxy.getMessage()); // test serialization IInterface proxy2 = WicketObjects.cloneObject(proxy); - assertTrue(proxy != proxy2); - assertEquals(proxy2.getMessage(), "interface"); + assertNotSame(proxy, proxy2); + assertEquals("interface", proxy2.getMessage()); // test equals/hashcode method interception final IObjectMethodTester tester = new ObjectMethodTester(); @@ -131,32 +150,33 @@ public Object locateProxyTarget() * Tests lazy init proxy to represent concrete objects */ @Test - public void testConcreteProxy() + void testConcreteProxy() { ConcreteObject proxy = (ConcreteObject)LazyInitProxyFactory.createProxy( ConcreteObject.class, concreteObjectLocator); // test proxy implements ILazyInitProxy assertTrue(proxy instanceof ILazyInitProxy); - assertSame(((ILazyInitProxy) proxy).getObjectLocator(), concreteObjectLocator); + final IProxyTargetLocator objectLocator = ((ILazyInitProxy) proxy).getObjectLocator(); + assertSame(objectLocator, concreteObjectLocator); // test we do not have a jdk dynamic proxy assertFalse(Proxy.isProxyClass(proxy.getClass())); // test method invocation - assertEquals(proxy.getMessage(), "concrete"); + assertEquals("concrete", proxy.getMessage()); // test serialization ConcreteObject proxy2 = WicketObjects.cloneObject(proxy); assertNotSame(proxy, proxy2); - assertEquals(proxy2.getMessage(), "concrete"); + assertEquals("concrete", proxy2.getMessage()); // test equals/hashcode method interception final IObjectMethodTester tester = new ObjectMethodTester(); assertTrue(tester.isValid()); // test only a single class is generated, - // otherwise permgen space will fill up with each proxy + // otherwise meta space will fill up with each proxy assertSame(proxy.getClass(), LazyInitProxyFactory.createProxy( ConcreteObject.class, concreteObjectLocator).getClass()); @@ -180,22 +200,23 @@ public Object locateProxyTarget() } /** + * Tests lazy init concrete replacement */ @Test - public void testCGLibInterceptorReplacement() + void testInterceptorReplacement() { ProxyReplacement ser = new ProxyReplacement(ConcreteObject.class.getName(), concreteObjectLocator); Object proxy2 = WicketObjects.cloneObject(ser); - assertEquals(((ConcreteObject)proxy2).getMessage(), "concrete"); + assertEquals("concrete", ((ConcreteObject)proxy2).getMessage()); } /** * Tests String beans. */ @Test - public void testStringProxy() + void testStringProxy() { // We special-case String objects to avoid proxying them, as they're // final. @@ -203,4 +224,14 @@ public void testStringProxy() String proxy = (String)LazyInitProxyFactory.createProxy(String.class, stringObjectLocator); assertEquals("StringLiteral", proxy); } + + /** + * Test construction via objenesis. + */ + @Test + void testNoDefaultConstructor() + { + NoDefaultConstructor proxy = (NoDefaultConstructor)LazyInitProxyFactory.createProxy( + NoDefaultConstructor.class, concreteObjectLocator); + } } diff --git a/wicket-ioc/src/test/java/org/apache/wicket/proxy/util/NoDefaultConstructor.java b/wicket-ioc/src/test/java/org/apache/wicket/proxy/util/NoDefaultConstructor.java new file mode 100644 index 00000000000..267e357e84a --- /dev/null +++ b/wicket-ioc/src/test/java/org/apache/wicket/proxy/util/NoDefaultConstructor.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.proxy.util; + +/** + * Mock dependency that does not implement have a default constructor. + */ +public class NoDefaultConstructor +{ + + public NoDefaultConstructor(String args) + { + } +} diff --git a/wicket-spring/src/test/java/org/apache/wicket/spring/injection/annot/SpringBeanWithGenericsTest.java b/wicket-spring/src/test/java/org/apache/wicket/spring/injection/annot/SpringBeanWithGenericsTest.java index 653a93cd4c0..ac743c143cb 100644 --- a/wicket-spring/src/test/java/org/apache/wicket/spring/injection/annot/SpringBeanWithGenericsTest.java +++ b/wicket-spring/src/test/java/org/apache/wicket/spring/injection/annot/SpringBeanWithGenericsTest.java @@ -290,7 +290,7 @@ public BeanWithGeneric integerBean() @Bean public List stringsList() { - return Arrays.asList("foo", "bar", "baz"); + return List.of("foo", "bar", "baz"); } @Bean diff --git a/wicket-user-guide/src/main/asciidoc/jee/jee_4.adoc b/wicket-user-guide/src/main/asciidoc/jee/jee_4.adoc index 84656d74190..46df4c8761c 100644 --- a/wicket-user-guide/src/main/asciidoc/jee/jee_4.adoc +++ b/wicket-user-guide/src/main/asciidoc/jee/jee_4.adoc @@ -1,4 +1,20 @@ +During their lifecycle Wicket components are serialized into the session or some secondary storage. +But in most cases injected dependencies are not serializable, as these are typically singletons like services and repositories. +Because of this Wicket uses https://github.com/cglib/cglib[cglib] to generate proxies that are injected instead. +These will serialize a replacement and re-lookup the dependency after deserialization. + +For compatibility with Java 15+ runtimes, Wicket 10.x will use https://bytebuddy.net/#/[Byte Buddy] instead +- this proxy generation was backported to Wicket 9.x and can optionally be used by specifying the `wicket.ioc.useByteBuddy` environment variable: + +[source,bash] +---- +-Dwicket.ioc.useByteBuddy=true +---- + +NOTE: By default injected types need a default constructor without arguments, otherwise proxies can not be instantiated. +You can remedy this limitation by adding http://objenesis.org[Objenesis] to your project depencencies. + In this chapter we have seen how to integrate Wicket applications with Spring and with an EJB container. Module wicket-examples contains also an example of integration with Guice (see application class _org.apache.wicket.examples.guice.GuiceApplication_). From fe84d7a1b5102068e0a88c187b60d200adeb659c Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 1 Sep 2021 14:19:39 +0300 Subject: [PATCH 65/88] WICKET-6913 Add generic type to IProxyFactory#createProxy() Small syntatic sugar. JdkProxyFactory now also implements IProxyFactory. (cherry picked from commit e7aeb829ddac76c5626318d5f73a9fd4703d9d56) --- .../apache/wicket/proxy/IProxyFactory.java | 2 +- .../wicket/proxy/IProxyTargetLocator.java | 2 +- .../wicket/proxy/LazyInitProxyFactory.java | 33 +++++++++++-------- .../bytebuddy/ByteBuddyProxyFactory.java | 22 +++++++------ .../wicket/proxy/cglib/CglibProxyFactory.java | 11 ++++--- .../wicket/proxy/jdk/JdkProxyFactory.java | 12 ++++--- .../wicket/proxy/objenesis/IInstantiator.java | 20 +++++++---- .../objenesis/ObjenesisInstantiator.java | 5 +-- 8 files changed, 62 insertions(+), 45 deletions(-) diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java index ef5f63811cf..1a29ccbb603 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyFactory.java @@ -30,5 +30,5 @@ public interface IProxyFactory * the locator of the target * @return a proxy */ - public Object createProxy(final Class type, final IProxyTargetLocator locator); + T createProxy(final Class type, final IProxyTargetLocator locator); } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyTargetLocator.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyTargetLocator.java index 2b8eb252bc7..7598c6a69b0 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyTargetLocator.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/IProxyTargetLocator.java @@ -55,5 +55,5 @@ public interface IProxyTargetLocator extends IClusterable * * @return retrieved object */ - Object locateProxyTarget(); + T locateProxyTarget(); } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java index e83a18ef011..ec2300130fd 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java @@ -112,18 +112,22 @@ public class LazyInitProxyFactory Float.class, double.class, Double.class, char.class, Character.class, boolean.class, Boolean.class); - private static final IProxyFactory proxyFactory = initProxyFactory(); - + private static final IProxyFactory JDK_PROXY_FACTORY = new JdkProxyFactory(); + private static final IProxyFactory CLASS_PROXY_FACTORY = initProxyFactory(); + private static IProxyFactory initProxyFactory() { - IProxyFactory proxyFactory = null; - - if ("true".equals(System.getProperty("wicket.ioc.useByteBuddy"))) { - log.info("using Byte Buddy proxy factory"); + IProxyFactory proxyFactory; + + if (Boolean.getBoolean("wicket.ioc.useByteBuddy")) + { + log.info("Using Byte Buddy proxy factory"); proxyFactory = new ByteBuddyProxyFactory(); - } else { + } + else + { proxyFactory = new CglibProxyFactory(); } - + return proxyFactory; } @@ -139,20 +143,21 @@ private static IProxyFactory initProxyFactory() { * * @return lazily initializable proxy */ - public static Object createProxy(final Class type, final IProxyTargetLocator locator) + public static T createProxy(final Class type, final IProxyTargetLocator locator) { if (PRIMITIVES.contains(type) || Enum.class.isAssignableFrom(type)) { // We special-case primitives as sometimes people use these as // SpringBeans (WICKET-603, WICKET-906). Go figure. - return locator.locateProxyTarget(); + return (T) locator.locateProxyTarget(); } else if (type.isInterface()) { - return new JdkProxyFactory().createProxy(type, locator); + return JDK_PROXY_FACTORY.createProxy(type, locator); } - else { - return proxyFactory.createProxy(type, locator); + else + { + return CLASS_PROXY_FACTORY.createProxy(type, locator); } } @@ -185,7 +190,7 @@ public interface IWriteReplace * @author Igor Vaynberg (ivaynberg) * */ - public static final class ProxyReplacement implements IClusterable + public static class ProxyReplacement implements IClusterable { private static final long serialVersionUID = 1L; diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java index 836f296161a..4d53be283ba 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/bytebuddy/ByteBuddyProxyFactory.java @@ -53,8 +53,9 @@ public class ByteBuddyProxyFactory implements IProxyFactory private static final TypeCache DYNAMIC_CLASS_CACHE = new TypeCache.WithInlineExpunction<>(TypeCache.Sort.SOFT); private static final ByteBuddy BYTE_BUDDY = new ByteBuddy().with(WicketNamingStrategy.INSTANCE); + private static final String INTERCEPTOR_FIELD_NAME = "interceptor"; - private static IInstantiator instantiator = IInstantiator.getInstantiator(); + private static final IInstantiator INSTANTIATOR = IInstantiator.getInstantiator(); /** * Create a lazy init proxy for the specified type. The target object will be located using the @@ -69,15 +70,15 @@ public class ByteBuddyProxyFactory implements IProxyFactory * @return lazily initializable proxy */ @Override - public Object createProxy(final Class type, final IProxyTargetLocator locator) + public T createProxy(final Class type, final IProxyTargetLocator locator) { - Class proxyClass = createOrGetProxyClass(type); + Class proxyClass = createOrGetProxyClass(type); - Object instance; + T instance; if (!hasNoArgConstructor(type)) { - instance = instantiator.newInstance(proxyClass); + instance = INSTANTIATOR.newInstance(proxyClass); } else { @@ -97,10 +98,11 @@ public Object createProxy(final Class type, final IProxyTargetLocator locator return instance; } - public static Class createOrGetProxyClass(Class type) + @SuppressWarnings("unchecked") + public static Class createOrGetProxyClass(Class type) { ClassLoader classLoader = resolveClassLoader(); - return DYNAMIC_CLASS_CACHE.findOrInsert(classLoader, + return (Class) DYNAMIC_CLASS_CACHE.findOrInsert(classLoader, new TypeCache.SimpleKey(type), () -> BYTE_BUDDY .subclass(type) @@ -109,10 +111,10 @@ public static Class createOrGetProxyClass(Class type) MethodDelegation .withDefaultConfiguration() .withBinders(Pipe.Binder.install(Function.class)) - .toField("interceptor")) - .defineField("interceptor", ByteBuddyInterceptor.class, Visibility.PRIVATE) + .toField(INTERCEPTOR_FIELD_NAME)) + .defineField(INTERCEPTOR_FIELD_NAME, ByteBuddyInterceptor.class, Visibility.PRIVATE) .implement(InterceptorMutator.class).intercept(FieldAccessor.ofBeanProperty()) - .implement(Serializable.class, IWriteReplace.class, ILazyInitProxy.class).intercept(MethodDelegation.toField("interceptor")) + .implement(Serializable.class, IWriteReplace.class, ILazyInitProxy.class).intercept(MethodDelegation.toField(INTERCEPTOR_FIELD_NAME)) .make() .load(classLoader, ClassLoadingStrategy.Default.INJECTION) .getLoaded()); diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java index e90e128e115..40e06d997c1 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/cglib/CglibProxyFactory.java @@ -45,7 +45,7 @@ public class CglibProxyFactory implements IProxyFactory private static final int CGLIB_CALLBACK_NO_OVERRIDE = 0; private static final int CGLIB_CALLBACK_HANDLER = 1; - private static IInstantiator instantiator = IInstantiator.getInstantiator(); + private static final IInstantiator INSTANTIATOR = IInstantiator.getInstantiator(); /** * Create a lazy init proxy for the specified type. The target object will be located using the @@ -60,7 +60,8 @@ public class CglibProxyFactory implements IProxyFactory * @return lazily initializable proxy */ @Override - public Object createProxy(final Class type, final IProxyTargetLocator locator) + @SuppressWarnings("unchecked") + public T createProxy(final Class type, final IProxyTargetLocator locator) { CGLibInterceptor handler = new CGLibInterceptor(type, locator); @@ -80,18 +81,18 @@ public Object createProxy(final Class type, final IProxyTargetLocator locator { e.setCallbackTypes(new Class[] {callbacks[0].getClass(), callbacks[1].getClass()}); - Object instance = instantiator.newInstance(e.createClass()); + Object instance = INSTANTIATOR.newInstance(e.createClass()); // set callbacks directly (WICKET-6607) ((Factory) instance).setCallbacks(callbacks); - return instance; + return (T) instance; } else { e.setCallbacks(callbacks); - return e.create(); + return (T) e.create(); } } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java index 66ecda0e838..3e75e2cc3d9 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/jdk/JdkProxyFactory.java @@ -25,6 +25,7 @@ import org.apache.wicket.Application; import org.apache.wicket.proxy.ILazyInitProxy; +import org.apache.wicket.proxy.IProxyFactory; import org.apache.wicket.proxy.IProxyTargetLocator; import org.apache.wicket.proxy.LazyInitProxyFactory; import org.apache.wicket.proxy.LazyInitProxyFactory.IWriteReplace; @@ -33,7 +34,7 @@ /** * A factory class that creates jdk dynamic proxies. */ -public class JdkProxyFactory +public class JdkProxyFactory implements IProxyFactory { /** * Create a lazy init proxy for the specified type. The target object will be located using the @@ -47,13 +48,14 @@ public class JdkProxyFactory * * @return lazily initializable proxy */ - public Object createProxy(final Class type, final IProxyTargetLocator locator) + @SuppressWarnings("unchecked") + public T createProxy(final Class type, final IProxyTargetLocator locator) { JdkHandler handler = new JdkHandler(type, locator); try { - return Proxy.newProxyInstance(resolveClassLoader(), + return (T) Proxy.newProxyInstance(resolveClassLoader(), new Class[] { type, Serializable.class, ILazyInitProxy.class, IWriteReplace.class }, handler); } @@ -65,7 +67,7 @@ public Object createProxy(final Class type, final IProxyTargetLocator locator * happens, we can try and fall back to the classloader (current) that actually * loaded this class. */ - return Proxy.newProxyInstance(LazyInitProxyFactory.class.getClassLoader(), + return (T) Proxy.newProxyInstance(LazyInitProxyFactory.class.getClassLoader(), new Class[] { type, Serializable.class, ILazyInitProxy.class, IWriteReplace.class }, handler); } @@ -193,4 +195,4 @@ public Object writeReplace() throws ObjectStreamException return new ProxyReplacement(typeName, locator); } } -} \ No newline at end of file +} diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java index 03557e4d26d..8e86c8b5f89 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/IInstantiator.java @@ -17,6 +17,7 @@ package org.apache.wicket.proxy.objenesis; import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.util.lang.Classes; /** * Instantiator for Objects without default constructor. @@ -31,9 +32,9 @@ public interface IInstantiator * type of instance * @return instance */ - public Object newInstance(Class type); + T newInstance(Class type); - public static IInstantiator getInstantiator() + static IInstantiator getInstantiator() { try { @@ -41,11 +42,16 @@ public static IInstantiator getInstantiator() } catch (NoClassDefFoundError e) { - return (type) -> { - throw new WicketRuntimeException(String.format( - "Can't create proxy for %s without default constructor" - + " - you can remedy this by adding Objenesis to your project dependencies.", - type.getName())); + return new IInstantiator() + { + @Override + public T newInstance(Class type) + { + throw new WicketRuntimeException(String.format( + "Can't create proxy for %s without default constructor" + + " - you can remedy this by adding Objenesis to your project dependencies.", + Classes.name(type))); + } }; } } diff --git a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java index 2a8fedef35f..af499ea2d41 100644 --- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java +++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/objenesis/ObjenesisInstantiator.java @@ -26,9 +26,10 @@ */ class ObjenesisInstantiator implements IInstantiator { - private final ObjenesisStd OBJENESIS = new ObjenesisStd(false); + private static final ObjenesisStd OBJENESIS = new ObjenesisStd(false); - public Object newInstance(Class type) { + public T newInstance(Class type) + { return OBJENESIS.newInstance(type); } } From 98d8d2de6810238d72a8007e56e5dc56840f3299 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Mon, 6 Sep 2021 20:07:50 +0200 Subject: [PATCH 66/88] Added CHANGELOG for release 9.5.0 --- CHANGELOG-9.x | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG-9.x b/CHANGELOG-9.x index e23ceb74842..bcee3b1c008 100644 --- a/CHANGELOG-9.x +++ b/CHANGELOG-9.x @@ -2,6 +2,30 @@ This file contains all changes done in releases for Apache Wicket 9.x. ======================================================================= +Release Notes - Wicket - Version 9.5.0 + +** Bug + + * [WICKET-6884] - Wicket API 9.x refers to 10.0.0-M1-SNAPSHOT API + * [WICKET-6902] - Change of PartialPageUpdate order of onAfterResponse and writePriorityEvaluations makes IListener.onAfterResponde ignore prepended javascripts + * [WICKET-6908] - Possible bug / edge case where page is not detached + * [WICKET-6909] - Link to Javadoc for 9.x is broken on the website + * [WICKET-6913] - Java 17 compatibility with cglib + * [WICKET-6914] - Visibility change of "File Upload" via ajax causes "missing" form-data + +** Improvement + + * [WICKET-6901] - PropertyValidator improve configuration doc + * [WICKET-6911] - wicket-spring throws an error when a spring bean uses ctor injection + +** Task + + * [WICKET-6903] - Replace maven-clirr-plugin with something newer + * [WICKET-6904] - Make Apache Wicket fully supporting Java9+ module system + * [WICKET-6916] - Simplify JMX with StandardMBean + +======================================================================= + Release Notes - Wicket - Version 9.4.0 ** Bug From fb29027efe97daf1f5b70d6fa0af589662e1ba44 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Sun, 12 Sep 2021 13:06:26 +0200 Subject: [PATCH 67/88] Start next development version --- archetypes/quickstart/pom.xml | 2 +- pom.xml | 46 +++++++++---------- testing/wicket-common-tests/pom.xml | 2 +- testing/wicket-js-tests/pom.xml | 2 +- wicket-auth-roles/pom.xml | 2 +- wicket-bean-validation/pom.xml | 2 +- wicket-cdi/pom.xml | 2 +- wicket-core/pom.xml | 2 +- wicket-devutils/pom.xml | 2 +- wicket-examples/pom.xml | 2 +- wicket-experimental/pom.xml | 2 +- wicket-experimental/wicket-http2/pom.xml | 4 +- .../wicket-http2/wicket-http2-core/pom.xml | 2 +- .../wicket-http2/wicket-http2-jetty/pom.xml | 2 +- .../wicket-http2-servlet4/pom.xml | 2 +- .../wicket-http2/wicket-http2-tomcat/pom.xml | 2 +- .../wicket-http2-undertow/pom.xml | 2 +- wicket-experimental/wicket-metrics/pom.xml | 4 +- wicket-extensions/pom.xml | 2 +- wicket-guice/pom.xml | 2 +- wicket-ioc/pom.xml | 2 +- wicket-jmx/pom.xml | 2 +- wicket-native-websocket/pom.xml | 2 +- .../wicket-native-websocket-core/pom.xml | 2 +- .../wicket-native-websocket-javax/pom.xml | 2 +- wicket-objectsizeof-agent/pom.xml | 2 +- wicket-request/pom.xml | 2 +- wicket-spring/pom.xml | 2 +- wicket-user-guide/pom.xml | 2 +- wicket-util/pom.xml | 2 +- wicket-velocity/pom.xml | 2 +- wicket/pom.xml | 2 +- 32 files changed, 56 insertions(+), 56 deletions(-) diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml index 01e4641118b..07aafda72d4 100644 --- a/archetypes/quickstart/pom.xml +++ b/archetypes/quickstart/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../../pom.xml wicket-archetype-quickstart diff --git a/pom.xml b/pom.xml index 589c2a8de89..d2461ee12df 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT pom Wicket Parent Wicket is a Java-based open source component web application framework. @@ -344,37 +344,37 @@ org.apache.wicket wicket - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT pom org.apache.wicket wicket-auth-roles - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-bean-validation - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-cdi - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-core - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-devutils - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar @@ -385,97 +385,97 @@ org.apache.wicket wicket-extensions - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-guice - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-ioc - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-jmx - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-native-websocket-core - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-native-websocket-javax - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-request - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-spring - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-util - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket wicket-velocity - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-core - 0.16-SNAPSHOT + 0.17-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-jetty - 0.16-SNAPSHOT + 0.17-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-servlet4 - 0.16-SNAPSHOT + 0.17-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-tomcat - 0.16-SNAPSHOT + 0.17-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-undertow - 0.16-SNAPSHOT + 0.17-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-metrics - 0.17-SNAPSHOT + 0.18-SNAPSHOT jar diff --git a/testing/wicket-common-tests/pom.xml b/testing/wicket-common-tests/pom.xml index 7e2f13ad3ca..890f71a12a9 100644 --- a/testing/wicket-common-tests/pom.xml +++ b/testing/wicket-common-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../../pom.xml wicket-common-tests diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml index 70114b42aa3..8d7aa8540eb 100644 --- a/testing/wicket-js-tests/pom.xml +++ b/testing/wicket-js-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../../pom.xml wicket-js-tests diff --git a/wicket-auth-roles/pom.xml b/wicket-auth-roles/pom.xml index 013b5badbd0..5e416f0e01f 100644 --- a/wicket-auth-roles/pom.xml +++ b/wicket-auth-roles/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-auth-roles diff --git a/wicket-bean-validation/pom.xml b/wicket-bean-validation/pom.xml index 1ae5a1be1c7..ffab91c4033 100644 --- a/wicket-bean-validation/pom.xml +++ b/wicket-bean-validation/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-bean-validation diff --git a/wicket-cdi/pom.xml b/wicket-cdi/pom.xml index 8c3b4594a02..1e894a4629a 100644 --- a/wicket-cdi/pom.xml +++ b/wicket-cdi/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-cdi diff --git a/wicket-core/pom.xml b/wicket-core/pom.xml index 23c5900198b..dd9b0065ac0 100644 --- a/wicket-core/pom.xml +++ b/wicket-core/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-core diff --git a/wicket-devutils/pom.xml b/wicket-devutils/pom.xml index ccfd73fdb85..ad8c10f0eee 100644 --- a/wicket-devutils/pom.xml +++ b/wicket-devutils/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-devutils diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index e3386182ed8..bd98cb587e7 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-examples diff --git a/wicket-experimental/pom.xml b/wicket-experimental/pom.xml index 9f06be90977..30b2e37ff17 100644 --- a/wicket-experimental/pom.xml +++ b/wicket-experimental/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml org.apache.wicket.experimental.wicket9 diff --git a/wicket-experimental/wicket-http2/pom.xml b/wicket-experimental/wicket-http2/pom.xml index 871d5597843..b7f5e1d4a7f 100644 --- a/wicket-experimental/wicket-http2/pom.xml +++ b/wicket-experimental/wicket-http2/pom.xml @@ -20,11 +20,11 @@ org.apache.wicket.experimental.wicket9 wicket-experimental - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-http2 - 0.16-SNAPSHOT + 0.17-SNAPSHOT pom Wicket Http/2 diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml index 37b89483f15..b4382946e08 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.16-SNAPSHOT + 0.17-SNAPSHOT ../pom.xml wicket-http2-core diff --git a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml index ec1b9c95f5c..a613e86b55c 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.16-SNAPSHOT + 0.17-SNAPSHOT ../pom.xml wicket-http2-jetty diff --git a/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml index 24ddf9d9d54..9e591a36721 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.16-SNAPSHOT + 0.17-SNAPSHOT ../pom.xml wicket-http2-servlet4 diff --git a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml index 00847fb8343..d133f9d5658 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.16-SNAPSHOT + 0.17-SNAPSHOT ../pom.xml wicket-http2-tomcat diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml index 51f9cb0ec69..f04505b564a 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.16-SNAPSHOT + 0.17-SNAPSHOT ../pom.xml wicket-http2-undertow diff --git a/wicket-experimental/wicket-metrics/pom.xml b/wicket-experimental/wicket-metrics/pom.xml index 97dc2ece1a4..fa1fec2d103 100644 --- a/wicket-experimental/wicket-metrics/pom.xml +++ b/wicket-experimental/wicket-metrics/pom.xml @@ -20,11 +20,11 @@ org.apache.wicket.experimental.wicket9 wicket-experimental - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-metrics - 0.17-SNAPSHOT + 0.18-SNAPSHOT bundle Wicket Metrics diff --git a/wicket-extensions/pom.xml b/wicket-extensions/pom.xml index ae557ee2c6f..51463a3932e 100644 --- a/wicket-extensions/pom.xml +++ b/wicket-extensions/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-extensions diff --git a/wicket-guice/pom.xml b/wicket-guice/pom.xml index d4180ac5e00..595c5ebef2d 100644 --- a/wicket-guice/pom.xml +++ b/wicket-guice/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-guice diff --git a/wicket-ioc/pom.xml b/wicket-ioc/pom.xml index 8ccb68467cd..036e7ec6156 100644 --- a/wicket-ioc/pom.xml +++ b/wicket-ioc/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-ioc diff --git a/wicket-jmx/pom.xml b/wicket-jmx/pom.xml index 9c6facb9ba7..db33b377f6a 100644 --- a/wicket-jmx/pom.xml +++ b/wicket-jmx/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-jmx diff --git a/wicket-native-websocket/pom.xml b/wicket-native-websocket/pom.xml index 042e5e9b882..22ed8553cf9 100644 --- a/wicket-native-websocket/pom.xml +++ b/wicket-native-websocket/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-native-websocket diff --git a/wicket-native-websocket/wicket-native-websocket-core/pom.xml b/wicket-native-websocket/wicket-native-websocket-core/pom.xml index fc2def4c644..0f24ee2884e 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-core/pom.xml @@ -21,7 +21,7 @@ org.apache.wicket wicket-native-websocket - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml index b0e6c26b78b..5aa4cbd8733 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-native-websocket - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-native-websocket-javax diff --git a/wicket-objectsizeof-agent/pom.xml b/wicket-objectsizeof-agent/pom.xml index df41dde57cc..744231ceacc 100644 --- a/wicket-objectsizeof-agent/pom.xml +++ b/wicket-objectsizeof-agent/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-objectsizeof-agent diff --git a/wicket-request/pom.xml b/wicket-request/pom.xml index 1f871c3dd6c..ed8ce5b2a18 100755 --- a/wicket-request/pom.xml +++ b/wicket-request/pom.xml @@ -20,7 +20,7 @@ wicket-parent org.apache.wicket - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT wicket-request bundle diff --git a/wicket-spring/pom.xml b/wicket-spring/pom.xml index 31898ba5939..5f68c59f0b8 100644 --- a/wicket-spring/pom.xml +++ b/wicket-spring/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-spring diff --git a/wicket-user-guide/pom.xml b/wicket-user-guide/pom.xml index f3053a980ac..fc0855aa86e 100644 --- a/wicket-user-guide/pom.xml +++ b/wicket-user-guide/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-user-guide diff --git a/wicket-util/pom.xml b/wicket-util/pom.xml index d8f843a7b12..c26e5c25e1d 100755 --- a/wicket-util/pom.xml +++ b/wicket-util/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-util diff --git a/wicket-velocity/pom.xml b/wicket-velocity/pom.xml index 33829a0b889..d7eeff0cd29 100644 --- a/wicket-velocity/pom.xml +++ b/wicket-velocity/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket-velocity diff --git a/wicket/pom.xml b/wicket/pom.xml index 5d337be31d0..a0dc1857267 100644 --- a/wicket/pom.xml +++ b/wicket/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.5.0-SNAPSHOT + 9.6.0-SNAPSHOT ../pom.xml wicket From 99ac0226c41f338e34b8de19e4017e2a6fab2741 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 13 Sep 2021 09:34:54 +0300 Subject: [PATCH 68/88] WICKET-6918 Update the version to 9.0.0 --- wicket-core/src/main/resources/META-INF/wicket.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-core/src/main/resources/META-INF/wicket.xsd b/wicket-core/src/main/resources/META-INF/wicket.xsd index 52e91ac1a2c..84ee6c671a8 100644 --- a/wicket-core/src/main/resources/META-INF/wicket.xsd +++ b/wicket-core/src/main/resources/META-INF/wicket.xsd @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/MarkUp/SCHEMA/xhtml-basic10.xsd" elementFormDefault="qualified" - version="8.0.0"> + version="9.0.0"> From 87f12fcadc2ee6e1f079cd5fc68d280b385cc5ec Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 13 Sep 2021 10:23:48 +0300 Subject: [PATCH 69/88] WICKET-6919 Improve EnclosureContainer's javadoc to explain that it should not be used with --- .../wicket/markup/html/basic/EnclosureContainer.java | 12 +++++++++--- .../html/panel/DefaultMarkupSourcingStrategy.java | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/basic/EnclosureContainer.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/basic/EnclosureContainer.java index 48c9391da95..32b7fb41f29 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/basic/EnclosureContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/basic/EnclosureContainer.java @@ -25,8 +25,8 @@ * <wicket:enclosure> is nice and prevents that users have to add boilerplate to * their application. But it is not without problems. The child components are children in the * markup, but the auto-component generated for the enclosure tag will not magically re-parent the - * child components. Thus the markup hierarchy and the component hierarchy will be out of sync. The - * automatically created enclosure container will be created along side its "children" with both + * child components. Thus, the markup hierarchy and the component hierarchy will be out of sync. The + * automatically created enclosure container will be created alongside its "children" with both * attached to the very same parent container. That leads to a tricky situation since e.g. * onBeforeRender() will be called for enclosure children even if the enclosure is made * invisible by it controlling child. @@ -41,6 +41,12 @@ * which basically does the same. But instead of adding the children to the Page, Panel whatever, * you must add the children to this container in order to keep the component hierarchy in sync. *

    + * + *

    + * Note: Make sure the markup element associated with this {@link EnclosureContainer} + * is anything but <wicket:enclosure>, e.g. a <div>, a <span> or even a + * <wicket:container> + *

    * * @author Juergen Donnerstag * @since 1.5 @@ -72,7 +78,7 @@ public EnclosureContainer(final String id, final Component child) } /** - * Overriden to set the visibility depending on childs {@link #determineVisibility()}. + * Overridden to set the visibility depending on children {@link #determineVisibility()}. */ @Override protected void onConfigure() diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/DefaultMarkupSourcingStrategy.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/DefaultMarkupSourcingStrategy.java index 7506d236d63..08c975d9fd4 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/DefaultMarkupSourcingStrategy.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/DefaultMarkupSourcingStrategy.java @@ -76,7 +76,7 @@ public void onComponentTagBody(final Component component, final MarkupStream mar @Override public IMarkupFragment getMarkup(final MarkupContainer container, final Component child) { - // If the sourcing strategy did not provide one, than ask the component. + // If the sourcing strategy did not provide one, then ask the component. // Get the markup for the container IMarkupFragment containerMarkup = container.getMarkup(); if (containerMarkup == null) From 6666f9ad8a78b1213b8eb36782b9b4fc069bc1ac Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 13 Sep 2021 12:08:44 +0300 Subject: [PATCH 70/88] WICKET-6920 Improve the examples to use the browser's light/dark mode --- .../main/resources/org/apache/wicket/examples/style.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css b/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css index 7f4cad881ce..fed53be121d 100644 --- a/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css +++ b/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css @@ -20,7 +20,9 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq border: 0; font-size: 100%; font: inherit; - vertical-align: baseline; } + vertical-align: baseline; + color-scheme: light dark +} *, *:after, @@ -40,7 +42,6 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq text-shadow: none; } html { - color: #3f4542; font: 300 15px "Source Sans Pro", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -1413,4 +1414,4 @@ div.wicket-aa ul li.selected { .light-grey { background-color: lightgrey; -} \ No newline at end of file +} From c348f905993065431461c8dc4e75cc28dba5ffaf Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 13 Sep 2021 12:33:31 +0300 Subject: [PATCH 71/88] WICKET-6920 Improve the examples to use the browser's light/dark mode Add missing semicolon at the end --- .../src/main/resources/org/apache/wicket/examples/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css b/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css index fed53be121d..f27f2c2dac9 100644 --- a/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css +++ b/wicket-examples/src/main/resources/org/apache/wicket/examples/style.css @@ -21,7 +21,7 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq font-size: 100%; font: inherit; vertical-align: baseline; - color-scheme: light dark + color-scheme: light dark; } *, From bb832b79d09d7b62a92705cf4bda443cefb84d2e Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 14 Sep 2021 10:17:13 +0300 Subject: [PATCH 72/88] Bump JUnit to 5.8.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d2461ee12df..9ac953caabe 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ 3.1.0 1.9.0 9.4.42.v20210604 - 5.8.0-M1 + 5.8.0 3.0.2 1.2.3 2.2 From 72d48d169be887dd284fa940c6a0dd6ce6fe1245 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 15 Sep 2021 13:47:24 +0300 Subject: [PATCH 73/88] Use the ROOT locale when parsing the date in WicketFilterTest org.apache.wicket.protocol.http.WicketFilterTest#notModifiedResponseIncludesExpiresHeader() fails with JDK 18 b14 with Locale.UK (cherry picked from commit e8066ac04421247d0501e3e97ba5b1f0ccf47087) --- .../java/org/apache/wicket/protocol/http/WicketFilterTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java index cf754cbafbc..cf8e0e9c092 100644 --- a/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java @@ -88,7 +88,7 @@ public class WicketFilterTest { private static WebApplication application; private final DateFormat headerDateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", - Locale.UK); + Locale.ROOT); /** * @throws Exception From e77bfa21dfb774db6d895c13bb19d9552449d00d Mon Sep 17 00:00:00 2001 From: Mathieu Mitchell Date: Tue, 21 Sep 2021 10:02:21 -0400 Subject: [PATCH 74/88] WICKET-6921 Avoid updating hidden forms (#478) Currently, MultipartFormComponentListener ensures form enctype is correct on the client-side when visibility for multipart-enabling components is toggled. It does so by visiting all form components, detecting multipart-enabling components and emitting javascript code to refresh the encoding type on the client-side. There are a few issues solved by this commit: - The identified form component could be part of a hidden hierarchy. This prevents finding it in the DOM, and using it's form attribute to set the form enctype. - There could be more than one form with multipart-enabling components which would require an enctype refresh on the client-side. This commit modifies MultipartFormComponentListener to find all forms, ensure they are visible in the hierarchy, then visiting all form components to find multipart-enabling. A single statement is emitted per form. (cherry picked from commit 9bfb7794d18ff441590ff86ae0e0dc35d9f2048f) --- .../http/MultipartFormComponentListener.java | 20 ++++++++++--------- .../MultipartFormComponentListenerPage.html | 5 +++-- .../MultipartFormComponentListenerPage.java | 9 +++++++++ .../MultipartFormComponentListenerTest.java | 12 +++++++++-- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java index f5572ed2e9e..37f01d6447b 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java @@ -37,15 +37,17 @@ public class MultipartFormComponentListener implements AjaxRequestTarget.IListen @Override public void onBeforeRespond(final Map map, final AjaxRequestTarget target) { - target.getPage().visitChildren(FormComponent.class, (IVisitor, Void>) (formComponent, visit) -> { - if (formComponent.isMultiPart()) - { - Form form = formComponent.getForm(); - boolean multiPart = form.isMultiPart(); - String enctype = multiPart ? Form.ENCTYPE_MULTIPART_FORM_DATA : ENCTYPE_URL_ENCODED; - target.appendJavaScript(String.format("Wicket.$('%s').form.enctype='%s'", - formComponent.getMarkupId(), enctype)); - visit.stop(); + target.getPage().visitChildren(Form.class, (IVisitor, Void>) (form, formVisitor) -> { + if (form.isVisibleInHierarchy()) { + form.visitFormComponents((formComponent, visit) -> { + if (formComponent.isMultiPart()) { + String enctype = form.isMultiPart() ? Form.ENCTYPE_MULTIPART_FORM_DATA : ENCTYPE_URL_ENCODED; + target.appendJavaScript(String.format("Wicket.$('%s').enctype='%s'", form.getMarkupId(), enctype)); + visit.stop(); + } + }); + } else { + formVisitor.dontGoDeeper(); } }); } diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html index eb741e8f980..c713696525b 100644 --- a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html @@ -8,10 +8,11 @@


    -
    +



    content of textfield or error:
    - + + Toggle form visibility diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java index d0b78428c28..0473f6a52d5 100644 --- a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java @@ -20,6 +20,8 @@ import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.OnChangeAjaxBehavior; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Button; @@ -76,5 +78,12 @@ public void onError() { } }); + add(new AjaxLink<>("toggleVisibility") { + @Override + public void onClick(AjaxRequestTarget target) { + form.setVisible(!form.isVisible()); + target.add(form); + } + }); } } diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java index b5cbf266ee3..4c87ddb13e8 100644 --- a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java @@ -17,6 +17,7 @@ package org.apache.wicket.protocol.http; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.wicket.markup.html.form.Form; @@ -26,6 +27,7 @@ /** * https://issues.apache.org/jira/browse/WICKET-6914 + * https://issues.apache.org/jira/browse/WICKET-6921 */ class MultipartFormComponentListenerTest extends WicketTestCase { @@ -36,16 +38,22 @@ void updateFormEnctype() tester.assertRenderedPage(MultipartFormComponentListenerPage.class); TagTester formTagTester = tester.getTagByWicketId("form"); + String formMarkupId = formTagTester.getAttribute("id"); + assertEquals(Form.ENCTYPE_MULTIPART_FORM_DATA, formTagTester.getAttribute("enctype")); tester.getRequest().setAttribute("form:dropDown", 1); tester.executeAjaxEvent("form:dropDown", "change"); String ajaxResponse = tester.getLastResponseAsString(); - assertTrue(ajaxResponse.contains(".form.enctype='" + MultipartFormComponentListener.ENCTYPE_URL_ENCODED + "'})();")); + assertTrue(ajaxResponse.contains("Wicket.$('"+formMarkupId+"').enctype='" + MultipartFormComponentListener.ENCTYPE_URL_ENCODED + "'})();")); tester.getRequest().setAttribute("form:dropDown", 2); tester.executeAjaxEvent("form:dropDown", "change"); ajaxResponse = tester.getLastResponseAsString(); - assertTrue(ajaxResponse.contains(".form.enctype='" + Form.ENCTYPE_MULTIPART_FORM_DATA + "'})();")); + assertTrue(ajaxResponse.contains("Wicket.$('"+formMarkupId+"').enctype='" + Form.ENCTYPE_MULTIPART_FORM_DATA + "'})();")); + + tester.clickLink("toggleVisibility"); + ajaxResponse = tester.getLastResponseAsString(); + assertFalse(ajaxResponse.contains("Wicket.$('"+formMarkupId+"').enctype="), "enctype should not be pushed on hidden elements"); } } From 3f836dda45fb6f61e0dc0d9dee0b52eccf14c0aa Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 7 Oct 2021 09:01:54 +0300 Subject: [PATCH 75/88] Remove useless javadoc Remove 'final' from a method in a 'final class' Fix typos in javadoc --- .../authentication/AuthenticatedWebApplication.java | 9 --------- .../authentication/AuthenticatedWebSession.java | 2 +- .../authroles/authentication/panel/SignInPanel.java | 5 +---- .../wicket/authentication/IAuthenticationStrategy.java | 2 +- .../org/apache/wicket/protocol/http/WebApplication.java | 7 ------- 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebApplication.java b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebApplication.java index b3b673a0d46..4d8c12eb788 100644 --- a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebApplication.java +++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebApplication.java @@ -42,9 +42,6 @@ public abstract class AuthenticatedWebApplication extends WebApplication IRoleCheckingStrategy, IUnauthorizedComponentInstantiationListener { - /** - * @see org.apache.wicket.protocol.http.WebApplication#init() - */ @Override protected void init() { @@ -55,9 +52,6 @@ protected void init() getSecuritySettings().setUnauthorizedComponentInstantiationListener(this); } - /** - * @see IRoleCheckingStrategy#hasAnyRole(Roles) - */ @Override public final boolean hasAnyRole(final Roles roles) { @@ -65,9 +59,6 @@ public final boolean hasAnyRole(final Roles roles) return (sessionRoles != null) && sessionRoles.hasAnyRole(roles); } - /** - * @see IUnauthorizedComponentInstantiationListener#onUnauthorizedInstantiation(Component) - */ @Override public final void onUnauthorizedInstantiation(final Component component) { diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java index 3fa0aad9821..8cd97c0dfa2 100644 --- a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java +++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/AuthenticatedWebSession.java @@ -54,7 +54,7 @@ public AuthenticatedWebSession(Request request) } /** - * Try to logon the user. It'll call {@link #authenticate(String, String)} to do the real work + * Try to sign in the user. It'll call {@link #authenticate(String, String)} to do the real work * and that is what you need to subclass to provide your own authentication mechanism. * * @param username diff --git a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/panel/SignInPanel.java b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/panel/SignInPanel.java index 4e2923de989..8e106309c3b 100644 --- a/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/panel/SignInPanel.java +++ b/wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authentication/panel/SignInPanel.java @@ -293,11 +293,8 @@ public SignInForm(final String id) rememberMeContainer.setVisible(includeRememberMe); } - /** - * @see org.apache.wicket.markup.html.form.Form#onSubmit() - */ @Override - public final void onSubmit() + public void onSubmit() { IAuthenticationStrategy strategy = getApplication().getSecuritySettings() .getAuthenticationStrategy(); diff --git a/wicket-core/src/main/java/org/apache/wicket/authentication/IAuthenticationStrategy.java b/wicket-core/src/main/java/org/apache/wicket/authentication/IAuthenticationStrategy.java index dacbafe73c1..c75a25c69a5 100644 --- a/wicket-core/src/main/java/org/apache/wicket/authentication/IAuthenticationStrategy.java +++ b/wicket-core/src/main/java/org/apache/wicket/authentication/IAuthenticationStrategy.java @@ -52,7 +52,7 @@ public interface IAuthenticationStrategy void save(final String credential, final String... extraCredentials); /** - * When the user logs out (session invalidation), than remove username and password from the + * When the user logs out (session invalidation), then remove username and password from the * persistence store */ void remove(); diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java index a7fe07eb08e..df719e52ba1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java @@ -646,19 +646,12 @@ WebResponse createWebResponse(final WebRequest webRequest, return shouldBufferResponse ? new HeaderBufferingWebResponse(webResponse) : webResponse; } - /** - * @see org.apache.wicket.Application#newSession(org.apache.wicket.request.Request, - * org.apache.wicket.request.Response) - */ @Override public Session newSession(Request request, Response response) { return new WebSession(request); } - /** - * @see org.apache.wicket.Application#sessionUnbound(java.lang.String) - */ @Override public void sessionUnbound(final String sessionId) { From 7065c328287abf6a489653d2266946d95c1cbd00 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 7 Oct 2021 09:05:44 +0300 Subject: [PATCH 76/88] Bump japicmp to 0.15.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9ac953caabe..1d777379f86 100644 --- a/pom.xml +++ b/pom.xml @@ -177,7 +177,7 @@ 2.3 - 0.15.3 + 0.15.4 3.2.0 5.1.2 3.8.1 From f52357faaeffb4c734384db8870c00be517c0928 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 11 Oct 2021 12:18:42 +0300 Subject: [PATCH 77/88] Bump Mockito to 4.0.0 https://github.com/mockito/mockito/releases/tag/v4.0.0 (cherry picked from commit 1176afb86088a81bdc87558b56e572fd10f5e4fb) --- pom.xml | 2 +- .../handler/ComponentRenderingRequestHandler.java | 1 - .../wicket/markup/html/image/ExternalImage.java | 12 ++++-------- .../wicket/markup/html/image/NonCachingImage.java | 5 +---- .../request/resource/DynamicImageResource.java | 2 -- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 1d777379f86..5ed64e8c309 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ 6.2.0.Final 1.7.3 4.1.19 - 3.12.1 + 4.0.0 3.2 1.0.12 2.0.0-alpha2 diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ComponentRenderingRequestHandler.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ComponentRenderingRequestHandler.java index e6d58747d24..a6aff591e49 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ComponentRenderingRequestHandler.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/ComponentRenderingRequestHandler.java @@ -17,7 +17,6 @@ package org.apache.wicket.core.request.handler; import org.apache.wicket.Component; -import org.apache.wicket.Page; import org.apache.wicket.request.IRequestCycle; import org.apache.wicket.request.component.IRequestableComponent; import org.apache.wicket.request.http.WebResponse; diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java index bcde8ce8d0b..528e23680d4 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java @@ -65,7 +65,7 @@ public class ExternalImage extends WebComponent */ public ExternalImage(String id) { - this(id, null, Model.ofList(Collections. emptyList())); + this(id, null, Model.ofList(Collections.emptyList())); } /** @@ -106,7 +106,7 @@ public ExternalImage(String id, Serializable src, List srcSet) */ public ExternalImage(String id, IModel srcModel) { - this(id, srcModel, Model.ofList(Collections. emptyList())); + this(id, srcModel, Model.ofList(Collections.emptyList())); } /** @@ -131,16 +131,12 @@ protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); - if ("source".equals(tag.getName())) - { - buildSrcSetAttribute(tag, getSrcSetModel()); - } - else + if (!"source".equals(tag.getName())) { checkComponentTag(tag, "img"); buildSrcAttribute(tag, getDefaultModel()); - buildSrcSetAttribute(tag, getSrcSetModel()); } + buildSrcSetAttribute(tag, getSrcSetModel()); buildSizesAttribute(tag); diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java index 99991326fb1..ec3a4bed634 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/NonCachingImage.java @@ -31,9 +31,6 @@ */ public class NonCachingImage extends Image { - /** - * - */ private static final long serialVersionUID = 1L; /** @@ -117,7 +114,7 @@ public NonCachingImage(String id) } /** - * Overriden to precent caching. + * Overridden to prevent caching. * * @return always {@code true} */ diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java index a6a3ec30332..a6d6501d645 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/DynamicImageResource.java @@ -124,10 +124,8 @@ protected byte[] toImageData(final BufferedImage image) */ protected abstract byte[] getImageData(Attributes attributes); - protected void configureResponse(final ResourceResponse response, final Attributes attributes) { - } @Override From 14b04aa3127610d1e33eb1afecbc415181996de3 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 12 Oct 2021 10:38:50 +0300 Subject: [PATCH 78/88] WICKET-6924 Allow image/avif in SecurePackageResourceGuard --- .../apache/wicket/markup/html/SecurePackageResourceGuard.java | 1 + 1 file changed, 1 insertion(+) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java index 7b6a65b837b..e1dc2e892ae 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/SecurePackageResourceGuard.java @@ -122,6 +122,7 @@ public SecurePackageResourceGuard(final ConcurrentMap cache) addPattern("+*.swf"); addPattern("+*.bmp"); addPattern("+*.svg"); + addPattern("+*.avif"); // allow web fonts addPattern("+*.eot"); From b0b96e9c51307e3463424874b8274c0959d4356f Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 18 Oct 2021 09:49:51 +0300 Subject: [PATCH 79/88] WICKET-6925 Deprecate AbstractWrapModel --- .../wicket/model/AbstractWrapModel.java | 23 ++--------------- .../org/apache/wicket/model/IWrapModel.java | 25 ++++++++++++++++++- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/model/AbstractWrapModel.java b/wicket-core/src/main/java/org/apache/wicket/model/AbstractWrapModel.java index 1b563cea1a5..347886822b4 100644 --- a/wicket-core/src/main/java/org/apache/wicket/model/AbstractWrapModel.java +++ b/wicket-core/src/main/java/org/apache/wicket/model/AbstractWrapModel.java @@ -27,30 +27,11 @@ * * @param * The Model object type + * @deprecated Use {@link IWrapModel} */ +@Deprecated public abstract class AbstractWrapModel implements IWrapModel { private static final long serialVersionUID = 1L; - @Override - public T getObject() - { - return null; - } - - @Override - public void setObject(T object) - { - } - - /** - * Calls getWrappedModel().detach(); - * - * @see org.apache.wicket.model.IDetachable#detach() - */ - @Override - public void detach() - { - getWrappedModel().detach(); - } } diff --git a/wicket-core/src/main/java/org/apache/wicket/model/IWrapModel.java b/wicket-core/src/main/java/org/apache/wicket/model/IWrapModel.java index b91bb579937..48e9d5de705 100644 --- a/wicket-core/src/main/java/org/apache/wicket/model/IWrapModel.java +++ b/wicket-core/src/main/java/org/apache/wicket/model/IWrapModel.java @@ -17,7 +17,7 @@ package org.apache.wicket.model; /** - * A marker interface that represents a model that serves as a wrapper for another. Typically these + * A marker interface that represents a model that serves as a wrapper for another. Typically, these * models are produced by the following methods: * {@link IComponentAssignedModel#wrapOnAssignment(org.apache.wicket.Component)} and * {@link IComponentInheritedModel#wrapOnInheritance(org.apache.wicket.Component)} @@ -38,4 +38,27 @@ public interface IWrapModel extends IModel * @return The wrapped model */ IModel getWrappedModel(); + + /** + * Calls getWrappedModel().detach(); + * + * @see org.apache.wicket.model.IDetachable#detach() + */ + @Override + default void detach() + { + getWrappedModel().detach(); + } + + @Override + default void setObject(T object) + { + } + + @Override + default T getObject() + { + return null; + } + } From c4a7c8794c2317d621a1ac6c8cdf611023631c45 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 20 Oct 2021 10:47:31 +0300 Subject: [PATCH 80/88] WICKET-6927 Get rid of java.security.AccessController --- .../apache/wicket/util/string/Strings.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java b/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java index d0cda0f35b6..2b7095ad886 100755 --- a/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java +++ b/wicket-util/src/main/java/org/apache/wicket/util/string/Strings.java @@ -18,8 +18,6 @@ import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -53,8 +51,11 @@ public final class Strings { /** * The line separator for the current platform. + * + * @deprecated Use {@link System#lineSeparator()} */ - public static final String LINE_SEPARATOR; + @Deprecated + public static final String LINE_SEPARATOR = System.lineSeparator(); /** A table of hex digits */ private static final char[] HEX_DIGIT = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', @@ -78,18 +79,6 @@ public final class Strings */ private static final String SESSION_ID_PARAM = ';' + SESSION_ID_PARAM_NAME + '='; - static - { - LINE_SEPARATOR = AccessController.doPrivileged(new PrivilegedAction() - { - @Override - public String run() - { - return System.getProperty("line.separator"); - } - }); - } - /** * Private constructor prevents construction. */ From 415d0c1d55c5465d7d146f5d2c78d6b82a4a74ca Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 20 Oct 2021 10:51:38 +0300 Subject: [PATCH 81/88] JDK 17 is stable since a month JDK 18+ should point to early_access url for javadoc (cherry picked from commit 7c68a150edec0b74c2bb203bf0a18fef7fd1fbfa) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ed64e8c309..a1d894e3132 100644 --- a/pom.xml +++ b/pom.xml @@ -1575,7 +1575,7 @@ on-jdk-early-access - [17,) + [18,) https://download.java.net/java/early_access/jdk${java.specification.version}/docs/api/ From 6d7013154e577727732cc22899f69d51fc9a8778 Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Fri, 29 Oct 2021 21:36:59 +0200 Subject: [PATCH 82/88] Added CHANGELOG for release 9.6.0 --- CHANGELOG-9.x | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG-9.x b/CHANGELOG-9.x index bcee3b1c008..a64e79cc36b 100644 --- a/CHANGELOG-9.x +++ b/CHANGELOG-9.x @@ -2,6 +2,26 @@ This file contains all changes done in releases for Apache Wicket 9.x. ======================================================================= +Release Notes - Wicket - Version 9.6.0 + +** Bug + + * [WICKET-6921] - MultipartFormComponentListener breaks on hidden components + +** Improvement + + * [WICKET-6920] - Improve the examples to use the browser's light/dark mode + * [WICKET-6924] - Allow image/avif in SecurePackageResourceGuard + * [WICKET-6927] - Get rid of java.security.AccessController + +** Task + + * [WICKET-6918] - Add links to latest wicket.xsd to the web site + * [WICKET-6919] - Improve EnclosureContainer's javadoc to explain that it should not be used with + * [WICKET-6925] - Deprecate AbstractWrapModel + +======================================================================= + Release Notes - Wicket - Version 9.5.0 ** Bug From 725c13a3f7beaa43f88e043bac0b84404dc7479c Mon Sep 17 00:00:00 2001 From: Andrea Del Bene Date: Tue, 2 Nov 2021 22:10:28 +0100 Subject: [PATCH 83/88] Start next development version --- archetypes/quickstart/pom.xml | 2 +- pom.xml | 46 +++++++++---------- testing/wicket-common-tests/pom.xml | 2 +- testing/wicket-js-tests/pom.xml | 2 +- wicket-auth-roles/pom.xml | 2 +- wicket-bean-validation/pom.xml | 2 +- wicket-cdi/pom.xml | 2 +- wicket-core/pom.xml | 2 +- wicket-devutils/pom.xml | 2 +- wicket-examples/pom.xml | 2 +- wicket-experimental/pom.xml | 2 +- wicket-experimental/wicket-http2/pom.xml | 4 +- .../wicket-http2/wicket-http2-core/pom.xml | 2 +- .../wicket-http2/wicket-http2-jetty/pom.xml | 2 +- .../wicket-http2-servlet4/pom.xml | 2 +- .../wicket-http2/wicket-http2-tomcat/pom.xml | 2 +- .../wicket-http2-undertow/pom.xml | 2 +- wicket-experimental/wicket-metrics/pom.xml | 4 +- wicket-extensions/pom.xml | 2 +- wicket-guice/pom.xml | 2 +- wicket-ioc/pom.xml | 2 +- wicket-jmx/pom.xml | 2 +- wicket-native-websocket/pom.xml | 2 +- .../wicket-native-websocket-core/pom.xml | 2 +- .../wicket-native-websocket-javax/pom.xml | 2 +- wicket-objectsizeof-agent/pom.xml | 2 +- wicket-request/pom.xml | 2 +- wicket-spring/pom.xml | 2 +- wicket-user-guide/pom.xml | 2 +- wicket-util/pom.xml | 2 +- wicket-velocity/pom.xml | 2 +- wicket/pom.xml | 2 +- 32 files changed, 56 insertions(+), 56 deletions(-) diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml index 07aafda72d4..0191cfb2810 100644 --- a/archetypes/quickstart/pom.xml +++ b/archetypes/quickstart/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../../pom.xml wicket-archetype-quickstart diff --git a/pom.xml b/pom.xml index a1d894e3132..6c0686fea19 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT pom Wicket Parent Wicket is a Java-based open source component web application framework. @@ -344,37 +344,37 @@ org.apache.wicket wicket - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT pom org.apache.wicket wicket-auth-roles - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-bean-validation - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-cdi - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-core - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-devutils - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar @@ -385,97 +385,97 @@ org.apache.wicket wicket-extensions - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-guice - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-ioc - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-jmx - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-native-websocket-core - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-native-websocket-javax - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-request - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-spring - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-util - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket wicket-velocity - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-core - 0.17-SNAPSHOT + 0.18-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-jetty - 0.17-SNAPSHOT + 0.18-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-servlet4 - 0.17-SNAPSHOT + 0.18-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-tomcat - 0.17-SNAPSHOT + 0.18-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-http2-undertow - 0.17-SNAPSHOT + 0.18-SNAPSHOT jar org.apache.wicket.experimental.wicket9 wicket-metrics - 0.18-SNAPSHOT + 0.19-SNAPSHOT jar diff --git a/testing/wicket-common-tests/pom.xml b/testing/wicket-common-tests/pom.xml index 890f71a12a9..8560884ab32 100644 --- a/testing/wicket-common-tests/pom.xml +++ b/testing/wicket-common-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../../pom.xml wicket-common-tests diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml index 8d7aa8540eb..e54fa837eee 100644 --- a/testing/wicket-js-tests/pom.xml +++ b/testing/wicket-js-tests/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../../pom.xml wicket-js-tests diff --git a/wicket-auth-roles/pom.xml b/wicket-auth-roles/pom.xml index 5e416f0e01f..52c0b2f54d9 100644 --- a/wicket-auth-roles/pom.xml +++ b/wicket-auth-roles/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-auth-roles diff --git a/wicket-bean-validation/pom.xml b/wicket-bean-validation/pom.xml index ffab91c4033..97fa2b4fd0e 100644 --- a/wicket-bean-validation/pom.xml +++ b/wicket-bean-validation/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-bean-validation diff --git a/wicket-cdi/pom.xml b/wicket-cdi/pom.xml index 1e894a4629a..5a72446fa46 100644 --- a/wicket-cdi/pom.xml +++ b/wicket-cdi/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-cdi diff --git a/wicket-core/pom.xml b/wicket-core/pom.xml index dd9b0065ac0..7fb42320e42 100644 --- a/wicket-core/pom.xml +++ b/wicket-core/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-core diff --git a/wicket-devutils/pom.xml b/wicket-devutils/pom.xml index ad8c10f0eee..7f418329be5 100644 --- a/wicket-devutils/pom.xml +++ b/wicket-devutils/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-devutils diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index bd98cb587e7..56e7096394f 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-examples diff --git a/wicket-experimental/pom.xml b/wicket-experimental/pom.xml index 30b2e37ff17..2a968750c20 100644 --- a/wicket-experimental/pom.xml +++ b/wicket-experimental/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml org.apache.wicket.experimental.wicket9 diff --git a/wicket-experimental/wicket-http2/pom.xml b/wicket-experimental/wicket-http2/pom.xml index b7f5e1d4a7f..0a45431b8b5 100644 --- a/wicket-experimental/wicket-http2/pom.xml +++ b/wicket-experimental/wicket-http2/pom.xml @@ -20,11 +20,11 @@ org.apache.wicket.experimental.wicket9 wicket-experimental - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-http2 - 0.17-SNAPSHOT + 0.18-SNAPSHOT pom Wicket Http/2 diff --git a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml index b4382946e08..2297e8fe128 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-core/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.17-SNAPSHOT + 0.18-SNAPSHOT ../pom.xml wicket-http2-core diff --git a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml index a613e86b55c..f4efada2888 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-jetty/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.17-SNAPSHOT + 0.18-SNAPSHOT ../pom.xml wicket-http2-jetty diff --git a/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml index 9e591a36721..9d21f80c70f 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-servlet4/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.17-SNAPSHOT + 0.18-SNAPSHOT ../pom.xml wicket-http2-servlet4 diff --git a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml index d133f9d5658..ab1880a4998 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-tomcat/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.17-SNAPSHOT + 0.18-SNAPSHOT ../pom.xml wicket-http2-tomcat diff --git a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml index f04505b564a..6433dca6bc1 100644 --- a/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml +++ b/wicket-experimental/wicket-http2/wicket-http2-undertow/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket.experimental.wicket9 wicket-http2 - 0.17-SNAPSHOT + 0.18-SNAPSHOT ../pom.xml wicket-http2-undertow diff --git a/wicket-experimental/wicket-metrics/pom.xml b/wicket-experimental/wicket-metrics/pom.xml index fa1fec2d103..3d9e964e848 100644 --- a/wicket-experimental/wicket-metrics/pom.xml +++ b/wicket-experimental/wicket-metrics/pom.xml @@ -20,11 +20,11 @@ org.apache.wicket.experimental.wicket9 wicket-experimental - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-metrics - 0.18-SNAPSHOT + 0.19-SNAPSHOT bundle Wicket Metrics diff --git a/wicket-extensions/pom.xml b/wicket-extensions/pom.xml index 51463a3932e..b42d209cde2 100644 --- a/wicket-extensions/pom.xml +++ b/wicket-extensions/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-extensions diff --git a/wicket-guice/pom.xml b/wicket-guice/pom.xml index 595c5ebef2d..787eb17ba01 100644 --- a/wicket-guice/pom.xml +++ b/wicket-guice/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-guice diff --git a/wicket-ioc/pom.xml b/wicket-ioc/pom.xml index 036e7ec6156..682590c97f9 100644 --- a/wicket-ioc/pom.xml +++ b/wicket-ioc/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-ioc diff --git a/wicket-jmx/pom.xml b/wicket-jmx/pom.xml index db33b377f6a..9e05d23730f 100644 --- a/wicket-jmx/pom.xml +++ b/wicket-jmx/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-jmx diff --git a/wicket-native-websocket/pom.xml b/wicket-native-websocket/pom.xml index 22ed8553cf9..3187ca14438 100644 --- a/wicket-native-websocket/pom.xml +++ b/wicket-native-websocket/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-native-websocket diff --git a/wicket-native-websocket/wicket-native-websocket-core/pom.xml b/wicket-native-websocket/wicket-native-websocket-core/pom.xml index 0f24ee2884e..c4f4121c890 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-core/pom.xml @@ -21,7 +21,7 @@ org.apache.wicket wicket-native-websocket - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml index 5aa4cbd8733..4528bc0df4d 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml +++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-native-websocket - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-native-websocket-javax diff --git a/wicket-objectsizeof-agent/pom.xml b/wicket-objectsizeof-agent/pom.xml index 744231ceacc..5725aa604a3 100644 --- a/wicket-objectsizeof-agent/pom.xml +++ b/wicket-objectsizeof-agent/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-objectsizeof-agent diff --git a/wicket-request/pom.xml b/wicket-request/pom.xml index ed8ce5b2a18..71e0eb5ec1f 100755 --- a/wicket-request/pom.xml +++ b/wicket-request/pom.xml @@ -20,7 +20,7 @@ wicket-parent org.apache.wicket - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT wicket-request bundle diff --git a/wicket-spring/pom.xml b/wicket-spring/pom.xml index 5f68c59f0b8..b3f87ac3601 100644 --- a/wicket-spring/pom.xml +++ b/wicket-spring/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-spring diff --git a/wicket-user-guide/pom.xml b/wicket-user-guide/pom.xml index fc0855aa86e..a5129b2b4c4 100644 --- a/wicket-user-guide/pom.xml +++ b/wicket-user-guide/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-user-guide diff --git a/wicket-util/pom.xml b/wicket-util/pom.xml index c26e5c25e1d..8e5741a02eb 100755 --- a/wicket-util/pom.xml +++ b/wicket-util/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-util diff --git a/wicket-velocity/pom.xml b/wicket-velocity/pom.xml index d7eeff0cd29..47447a184f1 100644 --- a/wicket-velocity/pom.xml +++ b/wicket-velocity/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket-velocity diff --git a/wicket/pom.xml b/wicket/pom.xml index a0dc1857267..a6e3e620a73 100644 --- a/wicket/pom.xml +++ b/wicket/pom.xml @@ -20,7 +20,7 @@ org.apache.wicket wicket-parent - 9.6.0-SNAPSHOT + 9.7.0-SNAPSHOT ../pom.xml wicket From 24f19bbba3c3ed34e6070eca0653647b7c0e9c0a Mon Sep 17 00:00:00 2001 From: Michael Burgardt Date: Mon, 8 Nov 2021 11:21:22 +0100 Subject: [PATCH 84/88] Change wrong 'to determinate' into correct 'to determine' (#480) (cherry picked from commit fcec670558e9b8d01467748ea46c778321ecb4a4) --- wicket-user-guide/src/main/asciidoc/forms2/forms2_9.adoc | 2 +- wicket-user-guide/src/main/asciidoc/i18n/i18n_5.adoc | 2 +- .../src/main/asciidoc/keepControl/keepControl_1.adoc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wicket-user-guide/src/main/asciidoc/forms2/forms2_9.adoc b/wicket-user-guide/src/main/asciidoc/forms2/forms2_9.adoc index 4df568242ba..a49771c4cbd 100644 --- a/wicket-user-guide/src/main/asciidoc/forms2/forms2_9.adoc +++ b/wicket-user-guide/src/main/asciidoc/forms2/forms2_9.adoc @@ -63,7 +63,7 @@ public class TemperatureDegreeField extends FormComponentPanel { } ---- -Inside the onInitialize method we have created a read-only model for the label that displays the letter corresponding to the user's temperature scale. To determinate which temperature scale is in use, we retrieve the Locale from the session by calling Component's getLocale() method (we will talk more about this method in +Inside the onInitialize method we have created a read-only model for the label that displays the letter corresponding to the user's temperature scale. To determine which temperature scale is in use, we retrieve the Locale from the session by calling Component's getLocale() method (we will talk more about this method in <<_internationalization_with_wicket,Chapter 15>>). Then, if locale is the one corresponding to the United States, the chosen scale will be Fahrenheit, otherwise it will be considered as Celsius. In the final part of onInitialize() we add the two components to our custom form component. You may have noticed that we have explicitly set the type of model object for the text field to double. This is necessary as the starting model object is a null reference and this prevents the component from automatically determining the type of its model object. diff --git a/wicket-user-guide/src/main/asciidoc/i18n/i18n_5.adoc b/wicket-user-guide/src/main/asciidoc/i18n/i18n_5.adoc index 40c88ddbb77..b2e9e96910c 100644 --- a/wicket-user-guide/src/main/asciidoc/i18n/i18n_5.adoc +++ b/wicket-user-guide/src/main/asciidoc/i18n/i18n_5.adoc @@ -77,7 +77,7 @@ Order order = new Order(new Date(), ORDER_STATUS.IN_PROGRESS); add(new Label("orderStatus", new StringResourceModel("orderStatus.${status.code}", Model.of(order)))); ---- -As we can see in the code above also the key contains a property expression (${status.code}) which makes its value dynamic. In this way the state of an object (an Order in our example) can determinate which resource will be loaded by StringResourceModel. If we don't use properties expressions we can provide a null value as model and in this case StringResourceModel will behave exactly as a ResourceModel. StringResourceModel supports also the same parameter substitution used by standard class _java.text.MessageFormat_. +As we can see in the code above also the key contains a property expression (${status.code}) which makes its value dynamic. In this way the state of an object (an Order in our example) can determine which resource will be loaded by StringResourceModel. If we don't use properties expressions we can provide a null value as model and in this case StringResourceModel will behave exactly as a ResourceModel. StringResourceModel supports also the same parameter substitution used by standard class _java.text.MessageFormat_. Parameters can be generic objects but if we use a model as parameter, StringResourceModel will use the data object inside it as actual value (it will call getObject on the model). Parameters are passed as a vararg argument with method _setParameters(Object... parameters)_. Here is an example of usage of parameter substitution: diff --git a/wicket-user-guide/src/main/asciidoc/keepControl/keepControl_1.adoc b/wicket-user-guide/src/main/asciidoc/keepControl/keepControl_1.adoc index c5579f19865..d546fd0747e 100644 --- a/wicket-user-guide/src/main/asciidoc/keepControl/keepControl_1.adoc +++ b/wicket-user-guide/src/main/asciidoc/keepControl/keepControl_1.adoc @@ -1,8 +1,8 @@ At the end of the previous chapter we have seen how to hide a component calling its method _setVisible_. In a similar fashion, we can also decide to disable a component using method _setEnabled_. When a component is disabled all the links inside it will be in turn disabled (they will be rendered as __) and it can not fire JavaScript events. -Class _Component_ provides two getter methods to determinate if a component is visible or enabled: _isVisible_ and _isEnabled_. +Class _Component_ provides two getter methods to determine if a component is visible or enabled: _isVisible_ and _isEnabled_. -Even if nothing prevents us from overriding these two methods to implement a custom logic to determinate the state of a component, we should keep in mind that methods _isVisible_ and _isEnabled_ are called multiple times before a component is fully rendered. Hence, if we place non-trivial code inside these two methods, we can sensibly deteriorate the responsiveness of our pages. +Even if nothing prevents us from overriding these two methods to implement a custom logic to determine the state of a component, we should keep in mind that methods _isVisible_ and _isEnabled_ are called multiple times before a component is fully rendered. Hence, if we place non-trivial code inside these two methods, we can sensibly deteriorate the responsiveness of our pages. -As we will see in the next chapter, class _Component_ provides method _onConfigure_ which is more suited to contain code that contributes to determinate component states because it is called just once during rendering phase of a request. +As we will see in the next chapter, class _Component_ provides method _onConfigure_ which is more suited to contain code that contributes to determine component states because it is called just once during rendering phase of a request. From 04aaa7f3a29f96d35c7eaf76cd1c3cf126eb437a Mon Sep 17 00:00:00 2001 From: ernestosemedy Date: Thu, 20 May 2021 12:00:23 +0300 Subject: [PATCH 85/88] WICKET-6930: This commit adds: 1) allow to skip sending empty WS messages 2) pass page class as a kind of context that can be used to send a web socket to different pages + example of updating a component in a given page (not dependent on page ID) --- .../apache/wicket/page/PartialPageUpdate.java | 8 + .../wicket/examples/websocket/HomePage.html | 1 + .../examples/websocket/JSR356Application.java | 12 +- .../examples/websocket/JSR356Session.java | 66 +++++++ .../websocket/WebSocketBehaviorDemoPage.java | 2 - .../WebSocketMultiTabResourceDemoPage.java | 2 - .../WebSocketPushUpdateProgressDemoPage.html | 8 + .../WebSocketPushUpdateProgressDemoPage.java | 29 +++ .../websocket/WebSocketResourceDemoPage.java | 2 - .../progress/ProgressBarTogglePanel.html | 26 +++ .../progress/ProgressBarTogglePanel.java | 111 +++++++++++ .../websocket/progress/ProgressUpdater.java | 177 ++++++++++++++++++ .../ws/api/AbstractWebSocketConnection.java | 2 +- .../ws/api/AbstractWebSocketProcessor.java | 33 ++-- .../ws/api/BaseWebSocketBehavior.java | 12 ++ .../ws/api/WebSocketPushBroadcaster.java | 68 +++++++ .../ws/api/WebSocketRequestHandler.java | 17 +- .../protocol/ws/api/registry/AbstractKey.java | 33 ++++ .../wicket/protocol/ws/api/registry/IKey.java | 8 +- .../IWebSocketConnectionRegistry.java | 26 ++- .../protocol/ws/api/registry/PageIdKey.java | 13 +- .../ws/api/registry/ResourceNameKey.java | 8 +- .../ws/api/registry/ResourceNameTokenKey.java | 9 +- .../SimpleWebSocketConnectionRegistry.java | 26 +++ .../ws/api/res/js/wicket-websocket-jquery.js | 4 + .../api/res/js/wicket-websocket-setup.js.tmpl | 2 +- .../util/tester/TestWebSocketProcessor.java | 17 +- .../tester/WebSocketTesterBehaviorTest.java | 2 +- .../ws/javax/JavaxWebSocketConnection.java | 2 +- .../protocol/ws/javax/WicketEndpoint.java | 1 - 30 files changed, 692 insertions(+), 35 deletions(-) create mode 100644 wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Session.java create mode 100644 wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.html create mode 100644 wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.java create mode 100644 wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.html create mode 100644 wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.java create mode 100644 wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressUpdater.java create mode 100644 wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/AbstractKey.java diff --git a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java index f95c9593008..f5cef0236ba 100644 --- a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java +++ b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java @@ -149,6 +149,14 @@ public PartialPageUpdate(final Page page) headerBuffer = new ResponseBuffer(response); } + /** + * @return returns true if and only if nothing has being added to partial update. + */ + public boolean isEmpty() + { + return prependJavaScripts.isEmpty() && appendJavaScripts.isEmpty() && domReadyJavaScripts.isEmpty() && markupIdToComponent.isEmpty(); + } + /** * Serializes this object to the response. * diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/HomePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/HomePage.html index 3821f6769d4..0207e5262fb 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/HomePage.html +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/HomePage.html @@ -29,6 +29,7 @@
  • demo with WebSocketBehavior
  • demo with WebSocketResource
  • demo with WebSocketResource and multiple tabs
  • +
  • Update a component via server-side initiated notifications
  • diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Application.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Application.java index bb38205fc6c..e178f7c6847 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Application.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Application.java @@ -16,12 +16,15 @@ */ package org.apache.wicket.examples.websocket; +import org.apache.wicket.Session; import org.apache.wicket.examples.WicketExampleApplication; import org.apache.wicket.examples.websocket.charts.ChartWebSocketResource; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.protocol.https.HttpsConfig; import org.apache.wicket.protocol.https.HttpsMapper; import org.apache.wicket.protocol.ws.WebSocketSettings; +import org.apache.wicket.request.Request; +import org.apache.wicket.request.Response; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -50,6 +53,7 @@ public void init() setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig(8080, 8443))); mountPage("/behavior", WebSocketBehaviorDemoPage.class); + mountPage("/push", WebSocketPushUpdateProgressDemoPage.class); mountPage("/resource", WebSocketResourceDemoPage.class); mountPage("/resource-multi-tab", WebSocketMultiTabResourceDemoPage.class); @@ -69,7 +73,13 @@ public void init() getCspSettings().blocking().disabled(); } - @Override + @Override + public Session newSession(Request request, Response response) + { + return new JSR356Session(request); + } + + @Override protected void onDestroy() { scheduledExecutorService.shutdownNow(); diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Session.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Session.java new file mode 100644 index 00000000000..71910a260d4 --- /dev/null +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/JSR356Session.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.wicket.examples.websocket; + + +import java.util.concurrent.ScheduledExecutorService; + +import org.apache.wicket.examples.websocket.progress.ProgressUpdater; +import org.apache.wicket.protocol.http.WebSession; +import org.apache.wicket.request.Request; + +public class JSR356Session extends WebSession +{ + private ProgressUpdater.ProgressUpdateTask progressUpdateTask; + + public JSR356Session(Request request) + { + super(request); + } + + public ProgressUpdater.ProgressUpdateTask getProgressUpdateTask() + { + return progressUpdateTask; + } + + private synchronized void startTask() { + if (progressUpdateTask != null && progressUpdateTask.isRunning()) + { + return; + } + + JSR356Application application = JSR356Application.get(); + ScheduledExecutorService service = application.getScheduledExecutorService(); + progressUpdateTask = ProgressUpdater.start(application, getId(), service); + } + + public synchronized void startOrCancelTask() { + if (progressUpdateTask != null && progressUpdateTask.isRunning() && !progressUpdateTask.isCanceled()) + { + progressUpdateTask.cancel(); + } + else + { + startTask(); + } + } + + public static JSR356Session get() { + return (JSR356Session)WebSession.get(); + } +} diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketBehaviorDemoPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketBehaviorDemoPage.java index 8d038aa8919..c6bff98458a 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketBehaviorDemoPage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketBehaviorDemoPage.java @@ -25,7 +25,6 @@ import org.apache.wicket.examples.websocket.charts.WebSocketChart; import org.apache.wicket.extensions.ajax.AjaxDownloadBehavior; import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.protocol.https.RequireHttps; import org.apache.wicket.protocol.ws.api.WebSocketBehavior; import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler; import org.apache.wicket.protocol.ws.api.message.ConnectedMessage; @@ -36,7 +35,6 @@ import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; -@RequireHttps public class WebSocketBehaviorDemoPage extends WicketExamplePage { private static final long serialVersionUID = 1L; diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketMultiTabResourceDemoPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketMultiTabResourceDemoPage.java index 03ec5d6ced9..534906c0f96 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketMultiTabResourceDemoPage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketMultiTabResourceDemoPage.java @@ -19,12 +19,10 @@ import org.apache.wicket.examples.WicketExamplePage; import org.apache.wicket.examples.websocket.charts.ChartWebSocketResource; import org.apache.wicket.examples.websocket.charts.WebSocketChart; -import org.apache.wicket.protocol.https.RequireHttps; import org.apache.wicket.protocol.ws.api.BaseWebSocketBehavior; import java.util.UUID; -@RequireHttps public class WebSocketMultiTabResourceDemoPage extends WicketExamplePage { public WebSocketMultiTabResourceDemoPage() diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.html new file mode 100644 index 00000000000..55210d31040 --- /dev/null +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.html @@ -0,0 +1,8 @@ + + + + +
    +
    + + \ No newline at end of file diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.java new file mode 100644 index 00000000000..a61ed6681c5 --- /dev/null +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketPushUpdateProgressDemoPage.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.examples.websocket; + +import org.apache.wicket.examples.WicketExamplePage; +import org.apache.wicket.examples.websocket.progress.ProgressBarTogglePanel; +import org.apache.wicket.examples.websocket.progress.ProgressUpdater; + +public class WebSocketPushUpdateProgressDemoPage extends WicketExamplePage implements ProgressUpdater.ITaskProgressListener +{ + public WebSocketPushUpdateProgressDemoPage() + { + add(new ProgressBarTogglePanel("progressPanel")); + } +} diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketResourceDemoPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketResourceDemoPage.java index d8aef4d600c..079bff9c968 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketResourceDemoPage.java +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/WebSocketResourceDemoPage.java @@ -19,10 +19,8 @@ import org.apache.wicket.examples.WicketExamplePage; import org.apache.wicket.examples.websocket.charts.ChartWebSocketResource; import org.apache.wicket.examples.websocket.charts.WebSocketChart; -import org.apache.wicket.protocol.https.RequireHttps; import org.apache.wicket.protocol.ws.api.BaseWebSocketBehavior; -@RequireHttps public class WebSocketResourceDemoPage extends WicketExamplePage { public WebSocketResourceDemoPage() diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.html b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.html new file mode 100644 index 00000000000..971f7f299e3 --- /dev/null +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.html @@ -0,0 +1,26 @@ + + + + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.java new file mode 100644 index 00000000000..dc7078e6772 --- /dev/null +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressBarTogglePanel.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.examples.websocket.progress; + +import java.util.concurrent.ScheduledExecutorService; + +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.event.IEvent; +import org.apache.wicket.examples.websocket.JSR356Application; +import org.apache.wicket.examples.websocket.JSR356Session; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.protocol.ws.api.WebSocketBehavior; +import org.apache.wicket.protocol.ws.api.event.WebSocketPushPayload; +import org.apache.wicket.protocol.ws.api.message.ConnectedMessage; + +public class ProgressBarTogglePanel extends Panel +{ + + private int progress = 0; + private boolean showProgress = true; + + + public ProgressBarTogglePanel(String id) + { + super(id); + + setOutputMarkupId(true); + + add(new WebSocketBehavior() + { + }); + + add(new AjaxLink("hideShowProgress") + { + @Override + public void onClick(AjaxRequestTarget target) + { + showProgress = !showProgress; + target.add(ProgressBarTogglePanel.this); + } + }.setBody((IModel) () -> showProgress ? "Hide progress" : "Show progress")); + + add(new AjaxLink("cancelRestartTask") + { + @Override + public void onClick(AjaxRequestTarget target) + { + JSR356Session.get().startOrCancelTask(); + target.add(ProgressBarTogglePanel.this); + } + }.setBody((IModel) () -> { + ProgressUpdater.ProgressUpdateTask progressUpdateTask = JSR356Session.get().getProgressUpdateTask(); + return progressUpdateTask != null && progressUpdateTask.isRunning() && !progressUpdateTask.isCanceled() + ? "Cancel task" : + "Restart task"; + })); + + add(new Label("progressBar", (IModel) () -> { + ProgressUpdater.ProgressUpdateTask progressUpdateTask = JSR356Session.get().getProgressUpdateTask(); + return progressUpdateTask != null && progressUpdateTask.isRunning() + ? "Background Task is " + progress + "% completed" + : "No task is running"; + }) + { + @Override + protected void onConfigure() + { + super.onConfigure(); + setVisible(showProgress); + } + }); + } + + + @Override + public void onEvent(IEvent event) + { + if (event.getPayload() instanceof WebSocketPushPayload) + { + WebSocketPushPayload wsEvent = (WebSocketPushPayload) event.getPayload(); + if (wsEvent.getMessage() instanceof ProgressUpdater.ProgressUpdate) + { + ProgressUpdater.ProgressUpdate progressUpdate = (ProgressUpdater.ProgressUpdate)wsEvent.getMessage(); + progress = progressUpdate.getProgress(); + wsEvent.getHandler().add(this); + } + else if (wsEvent.getMessage() instanceof ProgressUpdater.TaskCanceled) + { + // task was canceled + wsEvent.getHandler().add(this); + } + } + } +} diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressUpdater.java b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressUpdater.java new file mode 100644 index 00000000000..48f98488692 --- /dev/null +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/progress/ProgressUpdater.java @@ -0,0 +1,177 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.examples.websocket.progress; + +import java.io.Serializable; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import org.apache.wicket.Application; +import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.application.IClassResolver; +import org.apache.wicket.page.IManageablePage; +import org.apache.wicket.protocol.ws.WebSocketSettings; +import org.apache.wicket.protocol.ws.api.IWebSocketConnection; +import org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster; +import org.apache.wicket.protocol.ws.api.message.ConnectedMessage; +import org.apache.wicket.protocol.ws.api.message.IWebSocketPushMessage; +import org.apache.wicket.protocol.ws.api.registry.IKey; +import org.apache.wicket.protocol.ws.api.registry.IWebSocketConnectionRegistry; +import org.apache.wicket.protocol.ws.api.registry.PageIdKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A helper class that uses the web connection to push components updates to the client. + */ +public class ProgressUpdater +{ + /** + * Marks a page as a listener to task progress. + */ + public interface ITaskProgressListener { + + } + + private static final Logger LOGGER = LoggerFactory.getLogger(ProgressUpdater.class); + + public static ProgressUpdateTask start(Application application, String session, ScheduledExecutorService scheduledExecutorService) + { + // create an asynchronous task that will write the data to the client + ProgressUpdateTask progressUpdateTask = new ProgressUpdateTask(application, session); + scheduledExecutorService.schedule(progressUpdateTask, 1, TimeUnit.SECONDS); + return progressUpdateTask; + } + + /** + * Signal task was canceled. + */ + public static class TaskCanceled implements IWebSocketPushMessage + { + } + + /** + * A push message used to update progress. + */ + public static class ProgressUpdate implements IWebSocketPushMessage + { + + private final int progress; + + public ProgressUpdate(int progress) + { + this.progress = progress; + } + + public int getProgress() + { + return progress; + } + } + + /** + * A task that sends data to the client by pushing it to the web socket connection + */ + public static class ProgressUpdateTask implements Runnable, Serializable + { + /** + * The following fields are needed to be able to lookup the IWebSocketConnection from + * IWebSocketConnectionRegistry + */ + private final String applicationName; + private final String sessionId; + + private volatile boolean canceled = false; + private volatile boolean running = false; + + private ProgressUpdateTask(Application application, String sessionId) + { + this.applicationName = application.getName(); + this.sessionId = sessionId; + } + + @Override + public void run() + { + running = true; + Application application = Application.get(applicationName); + WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); + + int progress = 0; + + while (progress <= 100) + { + try + { + WebSocketPushBroadcaster broadcaster = + new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry()); + + if (canceled) + { + canceled = false; + running = false; + broadcaster.broadcastAllMatchingFilter(application, (sessionId, key) -> + ProgressUpdateTask.this.sessionId.equals(sessionId) && key instanceof PageIdKey + && ITaskProgressListener.class.isAssignableFrom(getPageClass(application, key)), + new TaskCanceled()); + return; + } + broadcaster.broadcastAllMatchingFilter(application, (sessionId, key) -> + ProgressUpdateTask.this.sessionId.equals(sessionId) && key instanceof PageIdKey && + ITaskProgressListener.class.isAssignableFrom(getPageClass(application, key)), + new ProgressUpdate(progress)); + + // sleep for a while to simulate work + TimeUnit.SECONDS.sleep(1); + progress++; + } + catch (InterruptedException x) + { + Thread.currentThread().interrupt(); + break; + } + catch (Exception e) + { + LOGGER.error("unexpected exception", e); + break; + } + } + running = false; + } + + protected Class getPageClass(Application application, IKey iKey) { + try { + return application.getApplicationSettings().getClassResolver().resolveClass(iKey.getContext()); + } catch (ClassNotFoundException e) { + throw new WicketRuntimeException(e); + } + } + + public boolean isRunning() { + return running; + } + + public boolean isCanceled() { + return canceled; + } + + public void cancel() { + this.canceled = true; + this.running = false; + } + } +} diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketConnection.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketConnection.java index 8726d56a335..3cd0f627d43 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketConnection.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketConnection.java @@ -50,7 +50,7 @@ public AbstractWebSocketConnection(AbstractWebSocketProcessor webSocketProcessor @Override public void sendMessage(IWebSocketPushMessage message) { - webSocketProcessor.broadcastMessage(message); + webSocketProcessor.broadcastMessage(message, this); } @Override diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java index f891751635b..bf5a6a812d4 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java @@ -81,9 +81,11 @@ public abstract class AbstractWebSocketProcessor implements IWebSocketProcessor * A pageId indicating that the endpoint is WebSocketResource */ static final int NO_PAGE_ID = -1; + static final String NO_PAGE_CLASS = "_NO_PAGE"; private final WebRequest webRequest; private final int pageId; + private final String context; private final String resourceName; private final String connectionToken; private final Url baseUrl; @@ -112,6 +114,7 @@ public AbstractWebSocketProcessor(final HttpServletRequest request, final WebApp } this.sessionId = httpSession.getId(); String pageId = request.getParameter("pageId"); + this.context = request.getParameter("context"); this.resourceName = request.getParameter("resourceName"); this.connectionToken = request.getParameter("connectionToken"); if (Strings.isEmpty(pageId) && Strings.isEmpty(resourceName)) @@ -181,7 +184,7 @@ protected final void onConnect(final IWebSocketConnection connection) { } } - broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key)); + broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key), connection); } @Override @@ -203,6 +206,13 @@ public void onError(Throwable t) } } + public final void broadcastMessage(final IWebSocketMessage message) + { + IKey key = getRegistryKey(); + IWebSocketConnection connection = connectionRegistry.getConnection(application, sessionId, key); + broadcastMessage(message, connection); + } + /** * Exports the Wicket thread locals and broadcasts the received message from the client to all * interested components and behaviors in the page with id {@code #pageId} @@ -215,11 +225,8 @@ public void onError(Throwable t) * @param message * the message to broadcast */ - public final void broadcastMessage(final IWebSocketMessage message) + public final void broadcastMessage(final IWebSocketMessage message, IWebSocketConnection connection) { - IKey key = getRegistryKey(); - IWebSocketConnection connection = connectionRegistry.getConnection(application, sessionId, key); - if (connection != null && (connection.isOpen() || isSpecialMessage(message))) { Application oldApplication = ThreadContext.getApplication(); @@ -249,8 +256,8 @@ public final void broadcastMessage(final IWebSocketMessage message) if (session == null) { - connectionRegistry.removeConnection(application, sessionId, key); - LOG.debug("No Session could be found for session id '{}' and key '{}'!", sessionId, key); + connectionRegistry.removeConnection(application, sessionId, connection.getKey()); + LOG.debug("No Session could be found for session id '{}' and key '{}'!", sessionId, connection.getKey()); return; } @@ -261,7 +268,7 @@ public final void broadcastMessage(final IWebSocketMessage message) { WebSocketRequestHandler requestHandler = webSocketSettings.newWebSocketRequestHandler(page, connection); - WebSocketPayload payload = createEventPayload(message, requestHandler); + WebSocketPayload payload = createEventPayload(message, requestHandler); if (!(message instanceof ConnectedMessage || isSpecialMessage(message))) { requestCycle.scheduleRequestHandlerAfterCurrent(requestHandler); @@ -356,9 +363,9 @@ protected final String getSessionId() return sessionId; } - private WebSocketPayload createEventPayload(IWebSocketMessage message, WebSocketRequestHandler handler) + private WebSocketPayload createEventPayload(IWebSocketMessage message, WebSocketRequestHandler handler) { - final WebSocketPayload payload; + final WebSocketPayload payload; if (message instanceof TextMessage) { payload = new WebSocketTextPayload((TextMessage) message, handler); @@ -399,15 +406,15 @@ protected IKey getRegistryKey() IKey key; if (Strings.isEmpty(resourceName)) { - key = new PageIdKey(pageId); + key = new PageIdKey(pageId, context); } else { if (Strings.isEmpty(connectionToken)) { - key = new ResourceNameKey(resourceName); + key = new ResourceNameKey(resourceName, context); } else { - key = new ResourceNameTokenKey(resourceName, connectionToken); + key = new ResourceNameTokenKey(resourceName, connectionToken, context); } } return key; diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/BaseWebSocketBehavior.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/BaseWebSocketBehavior.java index c0a1f18dd75..6bf3b4af4a0 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/BaseWebSocketBehavior.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/BaseWebSocketBehavior.java @@ -120,9 +120,21 @@ protected String getWebSocketSetupScript(Map parameters) { return webSocketSetupTemplate.asString(parameters); } + /** + * Override to return a context. By default, this is the page class name. + * + * @param component the {@link org.apache.wicket.Component} + * @return the context for this websocket behavior. + */ + protected String getContext(Component component) { + return component.getPage().getClass().getName(); + } + private Map getParameters(Component component) { Map variables = Generics.newHashMap(); + variables.put("context", getContext(component)); + // set falsy JS values for the non-used parameter if (Strings.isEmpty(resourceName)) { diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketPushBroadcaster.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketPushBroadcaster.java index db653d20e7b..c5f6d78e029 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketPushBroadcaster.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketPushBroadcaster.java @@ -109,6 +109,74 @@ public void broadcastAll(Application application, IWebSocketPushMessage message) process(application, wsConnections, message); } + /** + * Processes the given message in all pages in a given session that have active Web Socket connections. + * The message is sent as an event to the Page and components of the session allowing the components + * to be updated. + * + * This method can be invoked from any thread, even a non-wicket thread. By default all processing + * is done in the caller thread. Use + * {@link WebSocketSettings#setWebSocketPushMessageExecutor(org.apache.wicket.protocol.ws.concurrent.Executor)} + * to move processing to background threads. + * + * If some connections are not in valid state they are silently ignored. + * + * @param application + * The wicket application + * + * @param sessionId + * The session ID + * @param message + * The push message event + */ + public void broadcastAllInSession(Application application, String sessionId, IWebSocketPushMessage message) + { + Args.notNull(application, "application"); + Args.notNull(message, "message"); + Args.notNull(sessionId, "sessionId"); + + Collection wsConnections = registry.getConnections(application, sessionId); + if (wsConnections == null || wsConnections.isEmpty()) + { + return; + } + process(application, wsConnections, message); + } + + /** + * Processes the given message in all pages in a given session that have active Web Socket connections and match + * the given filter. The message is sent as an event to the Page and components of the session allowing the components + * to be updated. + * + * This method can be invoked from any thread, even a non-wicket thread. By default all processing + * is done in the caller thread. Use + * {@link WebSocketSettings#setWebSocketPushMessageExecutor(org.apache.wicket.protocol.ws.concurrent.Executor)} + * to move processing to background threads. + * + * If some connections are not in valid state they are silently ignored. + * + * @param application + * The wicket application + * + * @param connectionsFilter + * the {@link org.apache.wicket.protocol.ws.api.registry.IWebSocketConnectionRegistry.IConnectionsFilter} + * @param message + * The push message event + */ + public void broadcastAllMatchingFilter(Application application, IWebSocketConnectionRegistry.IConnectionsFilter connectionsFilter, IWebSocketPushMessage message) + { + Args.notNull(application, "application"); + Args.notNull(message, "message"); + Args.notNull(connectionsFilter, "connectionsFilter"); + + Collection wsConnections = registry.getConnections(application, connectionsFilter); + if (wsConnections == null || wsConnections.isEmpty()) + { + return; + } + process(application, wsConnections, message); + } + private void process(final Application application, final Collection wsConnections, final IWebSocketPushMessage message) { diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java index 7df3735033f..7ce1f620b5f 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java @@ -97,7 +97,17 @@ public void push(byte[] message, int offset, int length) } } - + /** + * @return if true then EMPTY partial updates will se send. If false then EMPTY + * partial updates will be skipped. A possible use case is: a page receives and a push event but no one is + * listening to it, and nothing is added to {@link org.apache.wicket.protocol.ws.api.WebSocketRequestHandler} + * thus no real push to client is needed. For compatibilities this is set to true. Thus EMPTY updates are sent + * by default. + */ + protected boolean shouldPushWhenEmpty() + { + return true; + } protected PartialPageUpdate getUpdate() { if (update == null) { @@ -129,7 +139,10 @@ public void respond(IRequestCycle requestCycle) { if (update != null) { - update.writeTo(requestCycle.getResponse(), "UTF-8"); + if (shouldPushWhenEmpty() || !update.isEmpty()) + { + update.writeTo(requestCycle.getResponse(), "UTF-8"); + } } } diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/AbstractKey.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/AbstractKey.java new file mode 100644 index 00000000000..afe2eaf1345 --- /dev/null +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/AbstractKey.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.protocol.ws.api.registry; + +public class AbstractKey implements IKey +{ + + private final String context; + + public AbstractKey(String context) + { + this.context = context; + } + + @Override + public String getContext() { + return context; + } +} diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IKey.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IKey.java index b0774dca0ad..25a5196dab7 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IKey.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IKey.java @@ -23,4 +23,10 @@ * connection in {@link IWebSocketConnectionRegistry} */ public interface IKey extends IClusterable -{} +{ + /** + * @return return a context for the key. This could be, for instance, a page class name or a resource class name. + * I.e. something that allow to discriminate keys along different pages. + */ + String getContext(); +} diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IWebSocketConnectionRegistry.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IWebSocketConnectionRegistry.java index 2782a93b01c..76656082467 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IWebSocketConnectionRegistry.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/IWebSocketConnectionRegistry.java @@ -28,6 +28,18 @@ */ public interface IWebSocketConnectionRegistry { + /** + * Interface allowing to filter web-sockets connections. This could be used for use cases like the + * following: you need to deliver messages to all page instances satisfying certain conditions (e.g. + * they contain some progress reporting component). + */ + interface IConnectionsFilter + { + + boolean accept(String sessionId, IKey key); + + } + /** * @param application * the web application to look in @@ -44,11 +56,23 @@ public interface IWebSocketConnectionRegistry * the web application to look in * @param sessionId * the http session id - * @return collection of web socket connection used by a client with the given session id + * @return collection of web socket connections used by a client with the given session id */ Collection getConnections(Application application, String sessionId); + /** + * + * @param application + * the web application to look in + * @param connectionsFilter + * the {@link org.apache.wicket.protocol.ws.api.registry.IWebSocketConnectionRegistry.IConnectionsFilter} + * + * @return collection of web socket connections that match certain filter + */ + Collection getConnections(Application application, IConnectionsFilter connectionsFilter); + + /** * @param application * the web application to look in diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/PageIdKey.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/PageIdKey.java index 84eee23ce4f..2aa7de0b7d6 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/PageIdKey.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/PageIdKey.java @@ -16,20 +16,29 @@ */ package org.apache.wicket.protocol.ws.api.registry; +import org.apache.wicket.Session; +import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.page.IManageablePage; import org.apache.wicket.util.lang.Args; /** * A key based on page's id */ -public class PageIdKey implements IKey +public class PageIdKey extends AbstractKey { private final Integer pageId; public PageIdKey(Integer pageId) { - this.pageId = Args.notNull(pageId, "pageId"); + this(pageId, null); } + public PageIdKey(Integer pageId, String context) + { + super(context); + this.pageId = Args.notNull(pageId, "pageId"); + } + @Override public boolean equals(Object o) { diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameKey.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameKey.java index 4f45aedc3ee..c5f4bc42c93 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameKey.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameKey.java @@ -21,12 +21,18 @@ /** * A key based on shared resource's name */ -public class ResourceNameKey implements IKey +public class ResourceNameKey extends AbstractKey { private final String resourceName; public ResourceNameKey(String resourceName) { + this(resourceName, null); + } + + public ResourceNameKey(String resourceName, String context) + { + super(context); this.resourceName = Args.notNull(resourceName, "resourceName"); } diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameTokenKey.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameTokenKey.java index be76c123157..e4b890a2bea 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameTokenKey.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/ResourceNameTokenKey.java @@ -23,13 +23,20 @@ /** * A key based on shared resource's name and a token */ -public class ResourceNameTokenKey implements IKey +public class ResourceNameTokenKey extends AbstractKey { private final String resourceName; private final String connectionToken; + public ResourceNameTokenKey(String resourceName, String connectionToken) { + this(resourceName, connectionToken, null); + } + + public ResourceNameTokenKey(String resourceName, String connectionToken, String context) + { + super(context); this.resourceName = Args.notNull(resourceName, "resourceName"); this.connectionToken = Args.notNull(connectionToken, "connectionToken"); } diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/SimpleWebSocketConnectionRegistry.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/SimpleWebSocketConnectionRegistry.java index b5005aae81a..1a175905464 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/SimpleWebSocketConnectionRegistry.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/registry/SimpleWebSocketConnectionRegistry.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Map; import java.util.concurrent.ConcurrentMap; import org.apache.wicket.Application; @@ -79,6 +80,31 @@ public Collection getConnections(Application application, return connections; } + @Override + public Collection getConnections(Application application, IConnectionsFilter connectionsFilter) + { + Args.notNull(application, "application"); + Args.notNull(connectionsFilter, "connectionsFilter"); + + Collection connections = new ArrayList<>(); + ConcurrentMap> connectionsBySession = application.getMetaData(KEY); + if (connectionsBySession != null) + { + for (Map.Entry> connectionsByPage : connectionsBySession.entrySet()) + { + for (Map.Entry connectionEntry: connectionsByPage.getValue().entrySet()) + { + if (connectionsFilter.accept(connectionsByPage.getKey(), connectionEntry.getKey())) + { + connections.add(connectionEntry.getValue()); + } + } + + } + } + return connections; + } + /** * Returns a collection of currently active websockets. The connections might close at any time. * diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js index cd06ad5ee74..93b73867943 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js @@ -81,6 +81,10 @@ } } + if (WWS.context) { + url += '&context=' + encodeURIComponent(WWS.context); + } + url += '&wicket-ajax-baseurl=' + encodeURIComponent(WWS.baseUrl); url += '&wicket-app-name=' + encodeURIComponent(WWS.appName); diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-setup.js.tmpl b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-setup.js.tmpl index 1533cbf24d8..98e9bc8ebcc 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-setup.js.tmpl +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-setup.js.tmpl @@ -2,7 +2,7 @@ 'use strict'; if (typeof(Wicket.WebSocket.appName) === "undefined") { - jQuery.extend(Wicket.WebSocket, { pageId: ${pageId}, resourceName: '${resourceName}', connectionToken: '${connectionToken}', + jQuery.extend(Wicket.WebSocket, { pageId: ${pageId}, context: '${context}', resourceName: '${resourceName}', connectionToken: '${connectionToken}', baseUrl: '${baseUrl}', contextPath: '${contextPath}', appName: '${applicationName}', port: ${port}, securePort: ${securePort}, filterPrefix: '${filterPrefix}', sessionId: '${sessionId}' }); Wicket.WebSocket.createDefaultConnection(); diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/util/tester/TestWebSocketProcessor.java b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/util/tester/TestWebSocketProcessor.java index e48b9084ffd..cc121e6b7a8 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/util/tester/TestWebSocketProcessor.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/util/tester/TestWebSocketProcessor.java @@ -61,6 +61,17 @@ public TestWebSocketProcessor(final WicketTester wicketTester, final Page page) super(createRequest(wicketTester, page), (WebApplication) page.getApplication()); } + /** + * Constructor. + * + * @param resourceName + * the name of the shared resource that will handle the web socket messages + */ + public TestWebSocketProcessor(final WicketTester wicketTester, final String resourceName, Page page) + { + super(createRequest(wicketTester, resourceName, page), wicketTester.getApplication()); + } + /** * Constructor. * @@ -69,7 +80,7 @@ public TestWebSocketProcessor(final WicketTester wicketTester, final Page page) */ public TestWebSocketProcessor(final WicketTester wicketTester, final String resourceName) { - super(createRequest(wicketTester, resourceName), wicketTester.getApplication()); + super(createRequest(wicketTester, resourceName, null), wicketTester.getApplication()); } /** @@ -84,6 +95,7 @@ private static HttpServletRequest createRequest(final WicketTester wicketTester, Args.notNull(page, "page"); MockHttpServletRequest request = createRequest(wicketTester); request.addParameter("pageId", page.getId()); + request.addParameter("context", page.getClass().getName()); return request; } @@ -94,11 +106,12 @@ private static HttpServletRequest createRequest(final WicketTester wicketTester, * the page that may have registered {@link org.apache.wicket.protocol.ws.api.WebSocketBehavior} * @return a mock http request */ - private static HttpServletRequest createRequest(final WicketTester wicketTester, final String resourceName) + private static HttpServletRequest createRequest(final WicketTester wicketTester, final String resourceName, final Page page) { Args.notNull(resourceName, "resourceName"); MockHttpServletRequest request = createRequest(wicketTester); request.addParameter("resourceName", resourceName); + request.addParameter("context", page != null ? page.getClass().getName() : ""); return request; } diff --git a/wicket-native-websocket/wicket-native-websocket-core/src/test/java/org/apache/wicket/protocol/ws/util/tester/WebSocketTesterBehaviorTest.java b/wicket-native-websocket/wicket-native-websocket-core/src/test/java/org/apache/wicket/protocol/ws/util/tester/WebSocketTesterBehaviorTest.java index 29ec707d6ff..912cec5ff3c 100644 --- a/wicket-native-websocket/wicket-native-websocket-core/src/test/java/org/apache/wicket/protocol/ws/util/tester/WebSocketTesterBehaviorTest.java +++ b/wicket-native-websocket/wicket-native-websocket-core/src/test/java/org/apache/wicket/protocol/ws/util/tester/WebSocketTesterBehaviorTest.java @@ -131,7 +131,7 @@ protected void onOutMessage(String message) } }; webSocketTester.broadcast(tester.getApplication(), tester.getHttpSession().getId(), - new PageIdKey(page.getPageId()), broadcastMessage); + new PageIdKey(page.getPageId(), page.getClass().getName()), broadcastMessage); assertTrue(messageReceived.get()); webSocketTester.destroy(); diff --git a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/JavaxWebSocketConnection.java b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/JavaxWebSocketConnection.java index 41fa3044b4c..f7e4ca440b4 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/JavaxWebSocketConnection.java +++ b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/JavaxWebSocketConnection.java @@ -49,7 +49,7 @@ public class JavaxWebSocketConnection extends AbstractWebSocketConnection public JavaxWebSocketConnection(Session session, AbstractWebSocketProcessor webSocketProcessor) { super(webSocketProcessor); - this.session = Args.notNull(session, "connection"); + this.session = Args.notNull(session, "session"); } @Override diff --git a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java index 0636831f9da..4808dbd1304 100644 --- a/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java +++ b/wicket-native-websocket/wicket-native-websocket-javax/src/main/java/org/apache/wicket/protocol/ws/javax/WicketEndpoint.java @@ -123,7 +123,6 @@ private String getApplicationName(Session session) { String appName = null; - @SuppressWarnings("unchecked") Map> parameters = session.getRequestParameterMap(); if (parameters != null) { From 76a28ef384a07c9afa738a6b53897847e0a95f87 Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Wed, 10 Nov 2021 22:11:55 +0100 Subject: [PATCH 86/88] WICKET-6933 use separate key for the default instance --- .../wicket/DefaultPageManagerProvider.java | 25 ++++++++++++++++++- .../wicket/pageStore/InSessionPageStore.java | 5 ++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/DefaultPageManagerProvider.java b/wicket-core/src/main/java/org/apache/wicket/DefaultPageManagerProvider.java index 0b4407331a7..11eeff1309a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/DefaultPageManagerProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/DefaultPageManagerProvider.java @@ -147,7 +147,7 @@ protected IPageStore newRequestStore(IPageStore pageStore) */ protected IPageStore newCachingStore(IPageStore pageStore) { - return new CachingPageStore(pageStore, new InSessionPageStore(1)); + return new CachingPageStore(pageStore, new InSessionCache()); } /** @@ -210,4 +210,27 @@ protected IPageStore newPersistentStore() return new DiskPageStore(application.getName(), fileStoreFolder, maxSizePerSession); } + + private static class InSessionCache extends InSessionPageStore { + + private static final MetaDataKey KEY = new MetaDataKey<>() + { + private static final long serialVersionUID = 1L; + }; + + InSessionCache() + { + super(1); + } + + /** + * Use a separate key, so this store does not interfere with any additional {@link InSessionPageStore} + * the application might set up. + */ + @Override + protected MetaDataKey getKey() + { + return KEY; + } + } } \ No newline at end of file diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/InSessionPageStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/InSessionPageStore.java index 5aaf563da5f..d2b3653662e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/pageStore/InSessionPageStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/InSessionPageStore.java @@ -172,9 +172,8 @@ private SessionData getSessionData(IPageContext context, boolean create) /** * Session data is stored under a {@link MetaDataKey}. *

    - * In cases where more than one instance is used in an application (e.g. as a fast cache - * and a persistent store of serialized pages in the session), this method has to be - * overridden to provide a separate key for each instance. + * In the unlikely case that an application utilizes more than one instance of this store, + * this method has to be overridden to provide a separate key for each instance. */ protected MetaDataKey getKey() { From 6abc8fddc2f76bfe947eaae6a75fffb8ce481866 Mon Sep 17 00:00:00 2001 From: reiern70 Date: Sat, 13 Nov 2021 10:50:01 +0300 Subject: [PATCH 87/88] WICKET-6935] several minor datatable improvements --- .../table/AjaxFallbackDefaultDataTable.java | 11 ++++- .../data/table/NavigationToolbar.java | 48 ++++++++++++++----- .../repeater/data/table/NavigatorLabel.java | 2 +- 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/data/table/AjaxFallbackDefaultDataTable.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/data/table/AjaxFallbackDefaultDataTable.java index 0cf9af3ab2c..795cef75e98 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/data/table/AjaxFallbackDefaultDataTable.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/repeater/data/table/AjaxFallbackDefaultDataTable.java @@ -71,8 +71,17 @@ public AjaxFallbackDefaultDataTable(final String id, final List dataProvider) + { addTopToolbar(new AjaxNavigationToolbar(this)); - addTopToolbar(new AjaxFallbackHeadersToolbar(this, dataProvider)); + addTopToolbar(new AjaxFallbackHeadersToolbar<>(this, dataProvider)); addBottomToolbar(new NoRecordsToolbar(this)); } diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java index 70515dececd..ec0c74b733f 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java @@ -17,8 +17,10 @@ package org.apache.wicket.extensions.markup.html.repeater.data.table; import org.apache.wicket.AttributeModifier; +import org.apache.wicket.Component; import org.apache.wicket.markup.html.WebComponent; import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.navigation.paging.IPageableItems; import org.apache.wicket.markup.html.navigation.paging.PagingNavigator; import org.apache.wicket.model.IModel; @@ -44,17 +46,18 @@ public NavigationToolbar(final DataTable table) WebMarkupContainer span = new WebMarkupContainer("span"); add(span); - span.add(AttributeModifier.replace("colspan", new IModel() - { - @Override - public String getObject() - { - return String.valueOf(table.getColumns().size()).intern(); - } - })); + span.add(AttributeModifier.replace("colspan", (IModel) () -> String.valueOf(table.getColumns().size()).intern())); span.add(newPagingNavigator("navigator", table)); - span.add(newNavigatorLabel("navigatorLabel", table)); + Component complexLabel = newComplexNavigatorLabel("navigatorLabel", table); + if (complexLabel != null) + { + span.add(complexLabel); + } + else + { + span.add(newNavigatorLabel("navigatorLabel", table)); + } } /** @@ -73,12 +76,14 @@ protected PagingNavigator newPagingNavigator(final String navigatorId, } /** - * Factory method used to create the navigator label that will be used by the datatable + * Factory method used to create the navigator label that will be used by the datatable. + * Use {@link NavigationToolbar#newComplexNavigatorLabel(String, IPageableItems)} instead if you + * want to override label with a more complex component. * * @param navigatorId * component id navigator label should be created with * @param table - * dataview used by datatable + * DataTable used by datatable * @return navigator label that will be used to navigate the data table * */ @@ -87,6 +92,27 @@ protected WebComponent newNavigatorLabel(final String navigatorId, final DataTab return new NavigatorLabel(navigatorId, table); } + /** + * Factory method used to create the navigator component in place of label that will be used by the datatable. + * This method takes precedence over {@link NavigationToolbar#newNavigatorLabel(String, DataTable)}. + * By default it returns null. + * + * NOTE: This is just a HACK to not break API in wicket 9.x and support use case of a more + * complex component as label. In wicket 10.x we will simply change the return type of + * NavigationToolbar#newNavigatorLabel(String, DataTable). + * + * @param navigatorId + * component id navigator label should be created with + * @param table + * DataTable used by label + * @return navigator label that will be used to navigate the data table + * + */ + protected Component newComplexNavigatorLabel(final String navigatorId, final IPageableItems table) + { + return null; + } + /** {@inheritDoc} */ @Override protected void onConfigure() diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigatorLabel.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigatorLabel.java index 283118e1a31..617e47b709e 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigatorLabel.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigatorLabel.java @@ -50,7 +50,7 @@ public NavigatorLabel(final String id, final IPageableItems pageable) new Model<>(new LabelModelObject(pageable)))); } - private static class LabelModelObject implements IClusterable + public static class LabelModelObject implements IClusterable { private static final long serialVersionUID = 1L; private final IPageableItems pageable; From 6e35fdf5e35c8c1870aaa14698e3c3ebaad398ae Mon Sep 17 00:00:00 2001 From: reiern70 Date: Thu, 18 Nov 2021 13:06:45 +0300 Subject: [PATCH 88/88] allow to override write channel creation --- .../wicket/pageStore/FilePageStore.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/FilePageStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/FilePageStore.java index 4462b1bae8b..a1fcb1a0073 100644 --- a/wicket-core/src/main/java/org/apache/wicket/pageStore/FilePageStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/FilePageStore.java @@ -23,6 +23,7 @@ import java.nio.channels.FileChannel; import java.nio.channels.FileChannel.MapMode; import java.nio.charset.Charset; +import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.nio.file.attribute.UserDefinedFileAttributeView; import java.util.ArrayList; @@ -185,8 +186,7 @@ private void writeFile(String sessionIdentifier, int pageId, String pageType, by File file = getPageFile(sessionIdentifier, pageId, true); try { - FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.CREATE, - StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE); + FileChannel channel = createWriteFileChannel(file.toPath()); try { ByteBuffer buffer = ByteBuffer.wrap(data); @@ -205,6 +205,21 @@ private void writeFile(String sessionIdentifier, int pageId, String pageType, by setPageType(file, pageType); } + /** + * Factory method for write channels. Mind StandardOpenOption.TRUNCATE_EXISTING may produce problems in + * Windows operating system. If removed default java serialization will still work but files will not shrink. + * Please be careful if you use another serialization method. + * + * @param path The Path of the file. + * @return FileChannel + * @throws IOException + */ + protected FileChannel createWriteFileChannel(Path path) throws IOException + { + return FileChannel.open(path, StandardOpenOption.CREATE, + StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE); + } + private void checkMaxSize(String sessionIdentifier) { File[] files = folders.get(sessionIdentifier, true).listFiles();

    Default settings
    settingdefault value