[picocontainer-scm] [scm-git][2/12] fix sporatic failure while testing container-debug.
Michael Rimov <git-yCVjj/[email protected]> Thu, 8 Aug 2013 23:09:25 -0500 (CDT)
| Newsgroups | gmane.comp.java.picocontainer.cvs |
|---|---|
| Message-ID | <[email protected]> |
--bee280d7eb67f550bbc6ffa8f9a59368d66db802 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline commit 55891a76b1b48b9114678dbb41112e1150327ea8=0AAuthor: Michael Rimov= <[email protected]>=0AAuthorDate: Fri, 19 Jul 2013 15:34:30 -0700= =0ACommit: Michael Rimov <[email protected]>=0ACommitDate: Fri,= 19 Jul 2013 15:34:30 -0700=0A=0A fix sporatic failure while testing con= tainer-debug.=0A=0Adiff --git a/pico/container/src/test/com/picocontainer/i= njectors/MethodInjectionTestCase.java b/pico/container/src/test/com/picocon= tainer/injectors/MethodInjectionTestCase.java=0Aindex bc8390a..10ff3b7 1006= 44=0A--- a/pico/container/src/test/com/picocontainer/injectors/MethodInject= ionTestCase.java=0A+++ b/pico/container/src/test/com/picocontainer/injector= s/MethodInjectionTestCase.java=0A@@ -79,7 +79,10 @@ public class MethodInje= ctionTestCase {=0A assertEquals("MethodInjector[inject]-class com.p= icocontainer.injectors.MethodInjectionTestCase$Foo", pico.getComponentAdapt= er(Foo.class).toString());=0A verify(cm).invoking(any(PicoContainer= .class), any(MethodInjection.MethodInjector.class), any(Method.class), any(= Foo.class), any(Bar.class), same(123));=0A //Can't quite test the a= rguments passed yet since we're using a variable arg array.=0A- veri= fy(cm).invoked(any(PicoContainer.class), any(MethodInjection.MethodInjector= .class), any(Method.class), any(Foo.class), eq(0L), isNull(), anyVararg() )= ;=0A+ //Have to have any value because debug container might end up = injecting a millisecond into=0A+ //the invocation from time to time = and cause=0A+ //spurius test failures.=0A+ verify(cm).invoked= (any(PicoContainer.class), any(MethodInjection.MethodInjector.class), any(M= ethod.class), any(Foo.class), any(Long.class), isNull(), anyVararg() );=0A = }=0A =0A @Test public void testMethodInjectionViaMethodDef() {=0A= =0A=0A=0A= --bee280d7eb67f550bbc6ffa8f9a59368d66db802 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w= 3.org/TR/REC-html40/loose.dtd">=0A<html style=3D"font-size: 12px;">=0A<head= ><meta http-equiv=3D"Content-type" content=3D"text/html; charset=3Dutf-8"><= /head>=0A<body style=3D"font-size: 12px;">=0A<style type=3D"text/css">=0Adt= :after { content: ':' !important; }=0A></style>=0A<dl class=3D"title" style= =3D"font-size: 12px; font-family: Verdana; background-color: #ddd; padding:= 10px;">=0A<dt style=3D"font-size: 12px; float: left; font-weight: bold; mi= n-width: 6em;">Commit</dt>=0A<dd style=3D"font-size: 12px;">55891a76b1b48b9= 114678dbb41112e1150327ea8</dd>=0A<dt style=3D"font-size: 12px; float: left;= font-weight: bold; min-width: 6em;">Branch</dt>=0A<dd style=3D"font-size: = 12px;">master</dd>=0A<dt style=3D"font-size: 12px; float: left; font-weight= : bold; min-width: 6em;">Author</dt>=0A<dd style=3D"font-size: 12px;">Micha= el Rimov <[email protected]></dd>=0A<dt style=3D"font-size: 1= 2px; float: left; font-weight: bold; min-width: 6em;">Date</dt>=0A<dd style= =3D"font-size: 12px;">Fri, 19 Jul 2013 15:34:30 -0700</dd>=0A<dt style=3D"f= ont-size: 12px; float: left; font-weight: bold; min-width: 6em;">Message</d= t>=0A<dd class=3D"" style=3D"font-size: 12px;">fix sporatic failure while t= esting container-debug.</dd>=0A</dl>=0A<h2 id=3D"pico/container/src/test/co= m/picocontainer/injectors/MethodInjectionTestCase.java" style=3D"font-size:= 12px; font-family: Verdana; font-weight: bold; line-height: 25px; margin-b= ottom: 2px; padding-left: 5px; background-color: #bbb;">Changed file pico/c= ontainer/src/test/com/picocontainer/injectors/MethodInjectionTestCase.java<= /h2>=0A=0A<table style=3D"font-size: 12px; width: 100%; border-collapse: co= llapse;">=0A<tr style=3D"font-size: 12px;">=0A<td class=3D"ln" style=3D"fon= t-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco'= ,'Courier',monospace; width: 23px; text-align: right; background-color: #cc= c;" align=3D"right" bgcolor=3D"#ccc">79</td>=0A<td class=3D"ln" style=3D"fo= nt-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco= ','Courier',monospace; width: 23px; text-align: right; background-color: #c= cc;" align=3D"right" bgcolor=3D"#ccc">79</td>=0A<td style=3D"font-size: 12p= x; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',= monospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0assertEqu= als("MethodInjector[inject]-class=C2=A0com.picocontainer.injectors.MethodIn= jectionTestCase$Foo",=C2=A0pico.getComponentAdapter(Foo.class).toString());= </td>=0A</tr>=0A<tr style=3D"font-size: 12px;">=0A<td class=3D"ln" style=3D= "font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Mon= aco','Courier',monospace; width: 23px; text-align: right; background-color:= #ccc;" align=3D"right" bgcolor=3D"#ccc">80</td>=0A<td class=3D"ln" style= =3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','= Monaco','Courier',monospace; width: 23px; text-align: right; background-col= or: #ccc;" align=3D"right" bgcolor=3D"#ccc">80</td>=0A<td style=3D"font-siz= e: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Cou= rier',monospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ver= ify(cm).invoking(any(PicoContainer.class),=C2=A0any(MethodInjection.MethodI= njector.class),=C2=A0any(Method.class),=C2=A0any(Foo.class),=C2=A0any(Bar.c= lass),=C2=A0same(123));</td>=0A</tr>=0A<tr style=3D"font-size: 12px;">=0A<t= d class=3D"ln" style=3D"font-size: 12px; color: #000; font-family: 'Bitstre= am Vera Sans Mono','Monaco','Courier',monospace; width: 23px; text-align: r= ight; background-color: #ccc;" align=3D"right" bgcolor=3D"#ccc">81</td>=0A<= td class=3D"ln" style=3D"font-size: 12px; color: #000; font-family: 'Bitstr= eam Vera Sans Mono','Monaco','Courier',monospace; width: 23px; text-align: = right; background-color: #ccc;" align=3D"right" bgcolor=3D"#ccc">81</td>=0A= <td style=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera San= s Mono','Monaco','Courier',monospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0//Can't=C2=A0quite=C2=A0test=C2=A0the=C2=A0arguments=C2= =A0passed=C2=A0yet=C2=A0since=C2=A0we're=C2=A0using=C2=A0a=C2=A0variable=C2= =A0arg=C2=A0array.</td>=0A</tr>=0A<tr class=3D"r" style=3D"font-size: 12px;= background-color: #fdd;" bgcolor=3D"#fdd">=0A<td class=3D"ln" style=3D"fon= t-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco'= ,'Courier',monospace; width: 23px; text-align: right; background-color: #cc= c;" align=3D"right" bgcolor=3D"#ccc">82</td>=0A<td class=3D"ln" style=3D"fo= nt-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco= ','Courier',monospace; width: 23px; text-align: right; background-color: #c= cc;" align=3D"right" bgcolor=3D"#ccc"></td>=0A<td style=3D"font-size: 12px;= color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',mo= nospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0verify(cm).= invoked(any(PicoContainer.class),=C2=A0any(MethodInjection.MethodInjector.c= lass),=C2=A0any(Method.class),=C2=A0any(Foo.class),=C2=A0<span class=3D"rr"= style=3D"font-size: 12px; background-color: #faa;">eq</span>(<span class= =3D"rr" style=3D"font-size: 12px; background-color: #faa;">0L</span>),=C2= =A0isNull(),=C2=A0anyVararg()=C2=A0);</td>=0A</tr>=0A<tr class=3D"a" style= =3D"font-size: 12px; background-color: #dfd;" bgcolor=3D"#dfd">=0A<td class= =3D"ln" style=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera= Sans Mono','Monaco','Courier',monospace; width: 23px; text-align: right; b= ackground-color: #ccc;" align=3D"right" bgcolor=3D"#ccc"></td>=0A<td class= =3D"ln" style=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera= Sans Mono','Monaco','Courier',monospace; width: 23px; text-align: right; b= ackground-color: #ccc;" align=3D"right" bgcolor=3D"#ccc">82</td>=0A<td styl= e=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono',= 'Monaco','Courier',monospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0<span class=3D"aa" style=3D"font-size: 12px; background-color: = #afa;">//Have=C2=A0to=C2=A0have=C2=A0any=C2=A0value=C2=A0because=C2=A0debug= =C2=A0container=C2=A0might=C2=A0end=C2=A0up=C2=A0injecting=C2=A0a=C2=A0mill= isecond=C2=A0into</span>=0A</td>=0A</tr>=0A<tr class=3D"a" style=3D"font-si= ze: 12px; background-color: #dfd;" bgcolor=3D"#dfd">=0A<td class=3D"ln" sty= le=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono'= ,'Monaco','Courier',monospace; width: 23px; text-align: right; background-c= olor: #ccc;" align=3D"right" bgcolor=3D"#ccc"></td>=0A<td class=3D"ln" styl= e=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono',= 'Monaco','Courier',monospace; width: 23px; text-align: right; background-co= lor: #ccc;" align=3D"right" bgcolor=3D"#ccc">83</td>=0A<td style=3D"font-si= ze: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Co= urier',monospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<s= pan class=3D"aa" style=3D"font-size: 12px; background-color: #afa;">//the= =C2=A0invocation=C2=A0from=C2=A0time=C2=A0to=C2=A0time=C2=A0and=C2=A0cause<= /span>=0A</td>=0A</tr>=0A<tr class=3D"a" style=3D"font-size: 12px; backgrou= nd-color: #dfd;" bgcolor=3D"#dfd">=0A<td class=3D"ln" style=3D"font-size: 1= 2px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier= ',monospace; width: 23px; text-align: right; background-color: #ccc;" align= =3D"right" bgcolor=3D"#ccc"></td>=0A<td class=3D"ln" style=3D"font-size: 12= px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier'= ,monospace; width: 23px; text-align: right; background-color: #ccc;" align= =3D"right" bgcolor=3D"#ccc">84</td>=0A<td style=3D"font-size: 12px; color: = #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace;= ">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span class=3D"aa" = style=3D"font-size: 12px; background-color: #afa;">//spurius=C2=A0test=C2= =A0failures.</span>=0A</td>=0A</tr>=0A<tr class=3D"a" style=3D"font-size: 1= 2px; background-color: #dfd;" bgcolor=3D"#dfd">=0A<td class=3D"ln" style=3D= "font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Mon= aco','Courier',monospace; width: 23px; text-align: right; background-color:= #ccc;" align=3D"right" bgcolor=3D"#ccc"></td>=0A<td class=3D"ln" style=3D"= font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mono','Mona= co','Courier',monospace; width: 23px; text-align: right; background-color: = #ccc;" align=3D"right" bgcolor=3D"#ccc">85</td>=0A<td style=3D"font-size: 1= 2px; color: #000; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier= ',monospace;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0verify(= cm).invoked(any(PicoContainer.class),=C2=A0any(MethodInjection.MethodInject= or.class),=C2=A0any(Method.class),=C2=A0any(Foo.class),=C2=A0<span class=3D= "aa" style=3D"font-size: 12px; background-color: #afa;">any</span>(<span cl= ass=3D"aa" style=3D"font-size: 12px; background-color: #afa;">Long.class</s= pan>),=C2=A0isNull(),=C2=A0anyVararg()=C2=A0);</td>=0A</tr>=0A<tr style=3D"= font-size: 12px;">=0A<td class=3D"ln" style=3D"font-size: 12px; color: #000= ; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; wid= th: 23px; text-align: right; background-color: #ccc;" align=3D"right" bgcol= or=3D"#ccc">83</td>=0A<td class=3D"ln" style=3D"font-size: 12px; color: #00= 0; font-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; wi= dth: 23px; text-align: right; background-color: #ccc;" align=3D"right" bgco= lor=3D"#ccc">86</td>=0A<td style=3D"font-size: 12px; color: #000; font-fami= ly: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0}</td>=0A</tr>=0A<tr style=3D"font-size: 12px;">=0A<td cl= ass=3D"ln" style=3D"font-size: 12px; color: #000; font-family: 'Bitstream V= era Sans Mono','Monaco','Courier',monospace; width: 23px; text-align: right= ; background-color: #ccc;" align=3D"right" bgcolor=3D"#ccc">84</td>=0A<td c= lass=3D"ln" style=3D"font-size: 12px; color: #000; font-family: 'Bitstream = Vera Sans Mono','Monaco','Courier',monospace; width: 23px; text-align: righ= t; background-color: #ccc;" align=3D"right" bgcolor=3D"#ccc">87</td>=0A<td = style=3D"font-size: 12px; color: #000; font-family: 'Bitstream Vera Sans Mo= no','Monaco','Courier',monospace;">=C2=A0</td>=0A</tr>=0A<tr style=3D"font-= size: 12px;">=0A<td class=3D"ln" style=3D"font-size: 12px; color: #000; fon= t-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; width: 2= 3px; text-align: right; background-color: #ccc;" align=3D"right" bgcolor=3D= "#ccc">85</td>=0A<td class=3D"ln" style=3D"font-size: 12px; color: #000; fo= nt-family: 'Bitstream Vera Sans Mono','Monaco','Courier',monospace; width: = 23px; text-align: right; background-color: #ccc;" align=3D"right" bgcolor= =3D"#ccc">88</td>=0A<td style=3D"font-size: 12px; color: #000; font-family:= 'Bitstream Vera Sans Mono','Monaco','Courier',monospace;">=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0@Test=C2=A0public=C2=A0void=C2=A0testMethodInjectionViaMetho= dDef()=C2=A0{</td>=0A</tr>=0A</table>=0A<br style=3D"font-size: 12px;"><br = style=3D"font-size: 12px;">=0A</body>=0A</html>=0A= --bee280d7eb67f550bbc6ffa8f9a59368d66db802--