Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

junit · JUnit, the Java unit testing framework written by Kent Beck and Erich Gamma.

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 31224
  • Category: Java
  • Founded: Nov 6, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 23877 - 23906 of 24385   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#23877 From: "tekmonk2005" <tekmonk2005@...>
Date: Tue May 1, 2012 1:54 am
Subject: Re: tomcat deps on ant which deps on junit ... BUILD FAILED
tekmonk2005
Send Email Send Email
 
~
  I really don't know how to make sense of this, but ant does not appear to like
symbolic links ...
~
  lbrtchx
~
$ ls -l /usr/bin/ant
lrwxrwxrwx 1 root root 20 Sep 13  2011 /usr/bin/ant -> ../share/ant/bin/ant

$ ls -lH /usr/bin/ant
-rwxr-xr-x 1 root root 9903 May 19  2011 /usr/bin/ant

$ ls -l /usr/share/ant/bin/ant
-rwxr-xr-x 1 root root 9903 May 19  2011 /usr/share/ant/bin/ant

$ ANT_HOME=/usr/share/ant
$ export PATH=$ANT_HOME/bin:$PATH

$ ant -verbose -debug -Dtests.haltonfailure=false dist
Apache Ant(TM) version 1.8.3 compiled on April 30 2012
Trying the default build file: build.xml
Buildfile: /media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/build.xml
...
      [java] JUnit version 4.11-SNAPSHOT
      [java]
................................................................................\
................................................................................\
................................................................................\
.................................................................I.I............\
................................................................................\
................................................................................\
...............I................................................................\
.........................................
      [java] Time: 5.796
      [java]
      [java] OK (598 tests)
      [java]

BUILD SUCCESSFUL
Total time: 24 seconds

#23878 From: "tekmonk2005" <tekmonk2005@...>
Date: Tue May 1, 2012 1:42 am
Subject: Re: tomcat deps on ant which deps on junit ... BUILD FAILED
tekmonk2005
Send Email Send Email
 
and this error is reported as a fixed bug
~
  https://issues.apache.org/bugzilla/show_bug.cgi?id=45028
~
  lbrtchx

#23879 From: "tekmonk2005" <tekmonk2005@...>
Date: Tue May 1, 2012 12:54 am
Subject: Re: tomcat deps on ant which deps on junit ... BUILD FAILED
tekmonk2005
Send Email Send Email
 
Actually the complete failure trace is:

dist:
      [java] Executing
'/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/jdk/jdk1.7.0_04/jre/bin/java'
with arguments:
      [java] '-Dignore.this=ignored'
      [java] '-classpath'
      [java]
'/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT:/\
media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT/jun\
it-4.11-SNAPSHOT.jar'
      [java] 'org.junit.runner.JUnitCore'
      [java] 'org.junit.tests.AllTests'
      [java]
      [java] The ' characters around the executable and arguments are
      [java] not part of the command.
Execute:Java13CommandLauncher: Executing
'/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/jdk/jdk1.7.0_04/jre/bin/java'
with arguments:
'-Dignore.this=ignored'
'-classpath'
'/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT:/\
media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT/jun\
it-4.11-SNAPSHOT.jar'
'org.junit.runner.JUnitCore'
'org.junit.tests.AllTests'

The ' characters around the executable and arguments are
not part of the command.
      [java] JUnit version 4.11-SNAPSHOT
      [java]
................................................................................\
................................................................................\
................................................................................\
.................................................................I.I............\
................................................................................\
................................................................................\
...............I................................................................\
.....................................E....
      [java] Time: 5.69
      [java] There was 1 failure:
      [java] 1) testNameAsc(org.junit.internal.MethodSorterTest)
      [java] org.junit.ComparisonFailure: expected:<...(), void epsilon(), [int
gamma(), void gamma(boolean])]> but was:<...(), void epsilon(), [void
gamma(boolean), int gamma(])]>
      [java]  at org.junit.Assert.assertEquals(Assert.java:125)
      [java]  at org.junit.Assert.assertEquals(Assert.java:147)
      [java]  at
org.junit.internal.MethodSorterTest.testNameAsc(MethodSorterTest.java:93)
      [java]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java]  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [java]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
      [java]  at java.lang.reflect.Method.invoke(Method.java:601)
      [java]  at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java\
:45)
      [java]  at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
      [java]  at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:4\
2)
      [java]  at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20\
)
      [java]  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:269)
      [java]  at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69\
)
      [java]  at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48\
)
      [java]  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:237)
      [java]  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
      [java]  at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:235)
      [java]  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:51)
      [java]  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:228)
      [java]  at org.junit.runners.ParentRunner.run(ParentRunner.java:306)
      [java]  at org.junit.runners.Suite.runChild(Suite.java:128)
      [java]  at org.junit.runners.Suite.runChild(Suite.java:24)
      [java]  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:237)
      [java]  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
      [java]  at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:235)
      [java]  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:51)
      [java]  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:228)
      [java]  at org.junit.runners.ParentRunner.run(ParentRunner.java:306)
      [java]  at org.junit.runners.Suite.runChild(Suite.java:128)
      [java]  at org.junit.runners.Suite.runChild(Suite.java:24)
      [java]  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:237)
      [java]  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
      [java]  at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:235)
      [java]  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:51)
      [java]  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:228)
      [java]  at org.junit.runners.ParentRunner.run(ParentRunner.java:306)
      [java]  at org.junit.runner.JUnitCore.run(JUnitCore.java:151)
      [java]  at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
      [java]  at org.junit.runner.JUnitCore.run(JUnitCore.java:111)
      [java]  at org.junit.runner.JUnitCore.runMain(JUnitCore.java:92)
      [java]  at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:47)
      [java]  at org.junit.runner.JUnitCore.main(JUnitCore.java:38)
      [java]
      [java] FAILURES!!!
      [java] Tests run: 598,  Failures: 1
      [java]

BUILD FAILED
/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/build.xml:191: The
following error occurred while executing this line:
/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/build.xml:179: Java
returned: 1
	 at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)
	 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
	 at java.lang.reflect.Method.invoke(Method.java:601)
	 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	 at org.apache.tools.ant.Task.perform(Task.java:348)
	 at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
	 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
	 at java.lang.reflect.Method.invoke(Method.java:601)
	 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	 at org.apache.tools.ant.Task.perform(Task.java:348)
	 at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
	 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
	 at java.lang.reflect.Method.invoke(Method.java:601)
	 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	 at org.apache.tools.ant.Task.perform(Task.java:348)
	 at org.apache.tools.ant.Target.execute(Target.java:390)
	 at org.apache.tools.ant.Target.performTasks(Target.java:411)
	 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	 at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
	 at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:\
41)
	 at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	 at org.apache.tools.ant.Main.runBuild(Main.java:809)
	 at org.apache.tools.ant.Main.startAnt(Main.java:217)
	 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
	 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 25 seconds

#23880 From: "Law" <lawcab@...>
Date: Thu May 3, 2012 9:45 pm
Subject: running junit test via command line
lawcab
Send Email Send Email
 
Good Day,

I have a test that runs on eclipse. It has parameter -DinputFile=file.txt. Now I
want to run it at the command prompt. I built everything as a jar then run:

java -cp jarfile.jar org.junit.runner.JUnitCore junit.test.to.run
-DinputFile=file.txt

But I get an error of Could not find class: -DinputFile=file.txt

Am I doing something wrong?

Thanks,
Law

#23881 From: "tupari" <jks@...>
Date: Tue May 8, 2012 4:29 pm
Subject: Re: running junit test via command line
tupari
Send Email Send Email
 
Your order of arguments is wrong. -D arguments must come before the main class.
java -cp jarfile.jar -DinputFile=file.txt org.junit.runner.JUnitCore
junit.test.to.run


--- In junit@yahoogroups.com, "Law" <lawcab@...> wrote:
>
> Good Day,
>
> I have a test that runs on eclipse. It has parameter -DinputFile=file.txt. Now
I want to run it at the command prompt. I built everything as a jar then run:
>
> java -cp jarfile.jar org.junit.runner.JUnitCore junit.test.to.run
-DinputFile=file.txt
>
> But I get an error of Could not find class: -DinputFile=file.txt
>
> Am I doing something wrong?
>

#23882 From: David Saff <saff@...>
Date: Wed May 9, 2012 7:13 pm
Subject: Re: Re: parameterized test with multiple test methods
saffatgoogle
Send Email Send Email
 
Barbara,

Sorry for the long delay in responding.  What you're seeing is indeed a
bug.  Do you have time to file it at
https://github.com/KentBeck/junit/issues?  Thanks,

   David Saff

On Mon, Apr 30, 2012 at 4:49 PM, barbara_a_bennett
<barbara.bennett@...>wrote:

> **
>
>
> Maybe it is a case of me having bad expectations. I assumed that each of
> the tests would get the parameters as they are defined in the parameter
> section, not after they've been modified by a previous test method. I'm
> used to the 3.8 "every test starts out fresh" idea. That isn't happening.
> One of the parameters is "new StringBuilder()". I expected both methods to
> get an empty StringBuilder. But, the second method is getting the
> StringBuilder with the contents added in the first method.
>
> I tried resetting it in an @After method just to see what happens. The
> code to set it to a new StringBuilder is executed but the second test
> method still gets the StringBuilder with the contents added by the first
> method.
>
> Is this the expected behavior?
>
>
> --- In junit@yahoogroups.com, David Saff <saff@...> wrote:
> >
> > Hmm, that's odd. Not expected behavior.
> >
> > Were any of your parameters mutable types, such that if a value were
> shared
> > between multiple invocations, it could have been modified from one
> > invocation, with effects seen in the next?
> >
> > Any chance you could share at least a skeleton of your test case? Thanks,
> >
> > David Saff
> >
> > On Fri, Apr 27, 2012 at 11:32 AM, barbara_a_bennett <barbara.bennett@...
> > > wrote:
> >
> > > **
>
> > >
> > >
> > > Is the parameterized test class intended to have only one test method?
> > >
> > > I have created parameterized test classes with multiple test methods
> that
> > > use the same parameters with apparent success. However, when I tried it
> > > with a new test class yesterday JUnit didn't behave in the expected
> way.
> > > This is in RAD 8.0.4 using JUnit 4.8.1.
> > >
> > > The assertEquals in the second test method is reported as a failure
> even
> > > though the method being tested returned the correct results (I traced
> > > through with debug to verify). JUnit appended the result from the first
> > > test method to the result from the second test method and reported the
> > > second method as a failure because the combined result didn't match the
> > > expected result.
> > >
> > > Am I using the parameterized test incorrectly by having multiple test
> > > methods or is there a bug in JUnit?
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>


[Non-text portions of this message have been removed]

#23883 From: David Saff <saff@...>
Date: Wed May 9, 2012 7:06 pm
Subject: Re: Re: tomcat deps on ant which deps on junit ... BUILD FAILED
saffatgoogle
Send Email Send Email
 
Sorry for the long delay in responding.

Matthew,

This looks potentially related to your method-sorting patch?  (
https://github.com/KentBeck/junit/commit/c610a49727858597d9a10289bed0a0174053a69\
f
)

Can you give any advice?  Thanks,

    David Saff

On Mon, Apr 30, 2012 at 8:54 PM, tekmonk2005 <tekmonk2005@...> wrote:

> **
>
>
> Actually the complete failure trace is:
>
> dist:
> [java] Executing
> '/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/jdk/jdk1.7.0_04/jre/bin/java'
> with arguments:
> [java] '-Dignore.this=ignored'
> [java] '-classpath'
> [java]
>
'/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT:/\
media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT/jun\
it-4.11-SNAPSHOT.jar'
> [java] 'org.junit.runner.JUnitCore'
> [java] 'org.junit.tests.AllTests'
> [java]
> [java] The ' characters around the executable and arguments are
> [java] not part of the command.
> Execute:Java13CommandLauncher: Executing
> '/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/jdk/jdk1.7.0_04/jre/bin/java'
> with arguments:
> '-Dignore.this=ignored'
> '-classpath'
>
>
'/media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT:/\
media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/junit4.11-SNAPSHOT/jun\
it-4.11-SNAPSHOT.jar'
> 'org.junit.runner.JUnitCore'
> 'org.junit.tests.AllTests'
>
> The ' characters around the executable and arguments are
> not part of the command.
> [java] JUnit version 4.11-SNAPSHOT
> [java]
>
................................................................................\
................................................................................\
................................................................................\
.................................................................I.I............\
................................................................................\
................................................................................\
...............I................................................................\
.....................................E....
> [java] Time: 5.69
> [java] There was 1 failure:
> [java] 1) testNameAsc(org.junit.internal.MethodSorterTest)
> [java] org.junit.ComparisonFailure: expected:<...(), void epsilon(), [int
> gamma(), void gamma(boolean])]> but was:<...(), void epsilon(), [void
> gamma(boolean), int gamma(])]>
> [java] at org.junit.Assert.assertEquals(Assert.java:125)
> [java] at org.junit.Assert.assertEquals(Assert.java:147)
> [java] at
> org.junit.internal.MethodSorterTest.testNameAsc(MethodSorterTest.java:93)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [java] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> [java] at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
> [java] at java.lang.reflect.Method.invoke(Method.java:601)
> [java] at
>
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java\
:45)
> [java] at
>
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> [java] at
>
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:4\
2)
> [java] at
>
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20\
)
> [java] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:269)
> [java] at
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69\
)
> [java] at
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48\
)
> [java] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:237)
> [java] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
> [java] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:235)
> [java] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:51)
> [java] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:228)
> [java] at org.junit.runners.ParentRunner.run(ParentRunner.java:306)
> [java] at org.junit.runners.Suite.runChild(Suite.java:128)
> [java] at org.junit.runners.Suite.runChild(Suite.java:24)
> [java] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:237)
> [java] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
> [java] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:235)
> [java] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:51)
> [java] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:228)
> [java] at org.junit.runners.ParentRunner.run(ParentRunner.java:306)
> [java] at org.junit.runners.Suite.runChild(Suite.java:128)
> [java] at org.junit.runners.Suite.runChild(Suite.java:24)
> [java] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:237)
> [java] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
> [java] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:235)
> [java] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:51)
> [java] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:228)
> [java] at org.junit.runners.ParentRunner.run(ParentRunner.java:306)
> [java] at org.junit.runner.JUnitCore.run(JUnitCore.java:151)
> [java] at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
> [java] at org.junit.runner.JUnitCore.run(JUnitCore.java:111)
> [java] at org.junit.runner.JUnitCore.runMain(JUnitCore.java:92)
> [java] at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:47)
> [java] at org.junit.runner.JUnitCore.main(JUnitCore.java:38)
> [java]
> [java] FAILURES!!!
> [java] Tests run: 598, Failures: 1
> [java]
>
> BUILD FAILED
> /media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/build.xml:191:
> The following error occurred while executing this line:
> /media/sdb1/prjx/sw/jwebXBL/java_baseline/srcs/junit/junit/build.xml:179:
> Java returned: 1
> at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)
> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at
> org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav\
a:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at org.apache.tools.ant.Target.execute(Target.java:390)
> at org.apache.tools.ant.Target.performTasks(Target.java:411)
> at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
> at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
> at
>
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:\
41)
> at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
> at org.apache.tools.ant.Main.runBuild(Main.java:809)
> at org.apache.tools.ant.Main.startAnt(Main.java:217)
> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
>
> Total time: 25 seconds
>
>
>


[Non-text portions of this message have been removed]

#23884 From: David Saff <saff@...>
Date: Thu May 10, 2012 1:34 pm
Subject: Re: Testing of OSGi declarative services
saffatgoogle
Send Email Send Email
 
Rene,

Sorry for the late reply.  Unfortunately, I don't have a lot of experience
with declarative services, so I can't be a lot of help.  Are there
OSGi-related lists that might be more helpful?  Have you found a solution?

    David

On Sat, Apr 28, 2012 at 10:19 AM, . <tesco@...> wrote:

> Hi,
>
> I'm not able to test a OSGi declarative service with a JUnit Plugin Test
> in Eclipse.
>
> Although all necessary bundles (especially the Service, the Consumer
> with the JUnit Test class, org.eclipse.equinox.ds,
> org.eclipse.equinox.util, org.eclipse.jdt.junit.runtime and
> org.eclipse.pde.junit.runtime) are added to the Run Configuration of the
> Plugin Test and the bind/unbind methods are defined in the test class it
> comes to an Null Pointer Exception (the bind method seems to be not
> executed), if I access the Service attribute (e.g. public static
> IMyService myService) in a JUnit Test method.
>
> According to this site
>
>
http://stackoverflow.com/questions/7161338/using-osgi-declarative-services-in-th\
e-context-of-a-junit-test
> the reason for this exception is that the OSGi framework is in a race
> condition with the JUnit tests runner context. The solution there to use
> a Count Down Latch that waits in a @Before method until the needed
> service (that should be tested) is binded, seems to be not working for
> me. In my case the await() method blocks infinitely, so the test will be
> never executed. On the other hand, if I define a maximum time to wait,
> e.g. await(10, TimeUnit.SECONDS), it comes after this time again to the
> Null Pointer Exception.
>
> What is the correct way to test a OSGi declarative service with JUnit?
>
> Any help is appreciated.
>
> Regards,
> Rene
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]

#23885 From: "bhavanisridharan" <bhavanisridharan@...>
Date: Fri May 11, 2012 5:01 pm
Subject: Parameterization - of file names from directory; 1 parameter/test
bhavanisridh...
Send Email Send Email
 
@RunWith(Parameterized.class)
public class myTestClass {

     ...
         ...

     private static String homeFolder=new
String("Y:\\Development\\Testing\\myTest\\Testfiles");
     private String filename;

         public myTestClass(String filename) {
         this.filename=filename;
     }

@Parameters
public static Collection<Object[]> generateData() {
         return Arrays.asList(new Object[][]{ new File(homeFolder).list()});
}
}

The requirements is to feed the constructor with filenames from homeFolder
so each test runs with a different input.

The array of parameters, in my case, will consist of only one string, i.e.
the filename. I get a "wrong number of arguments error":
java.lang.IllegalArgumentException: wrong number of arguments
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
     at java.lang.reflect.Constructor.newInstance(Unknown Source)
     at
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
     at
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
     at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
     at
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
     at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
     at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
     at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
     at org.junit.runners.Suite.runChild(Suite.java:128)
     at org.junit.runners.Suite.runChild(Suite.java:24)
     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
     at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
     at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
     at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
     at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
     at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
     at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
     at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)

What am I doing wrong?
BSri

#23886 From: David Saff <saff@...>
Date: Fri May 11, 2012 5:55 pm
Subject: Re: Parameterization - of file names from directory; 1 parameter/test
saffatgoogle
Send Email Send Email
 
So the problem here is that you're creating a (1xN) array, but JUnit wants
an (Nx1) array.  You're creating here the equivalent of

List({ file1, file2, file3 })

but what you want is

List({ file1 }, { file 2 }, { file3 })

So you'll have to loop through the result of list[], and put each element
into its own one-element array.  Good luck,

    David Saff

On Fri, May 11, 2012 at 1:01 PM, bhavanisridharan <
bhavanisridharan@...> wrote:

> **
>
>
> @RunWith(Parameterized.class)
> public class myTestClass {
>
> ...
> ...
>
> private static String homeFolder=new
> String("Y:\\Development\\Testing\\myTest\\Testfiles");
> private String filename;
>
> public myTestClass(String filename) {
> this.filename=filename;
> }
>
> @Parameters
> public static Collection<Object[]> generateData() {
> return Arrays.asList(new Object[][]{ new File(homeFolder).list()});
> }
> }
>
> The requirements is to feed the constructor with filenames from homeFolder
> so each test runs with a different input.
>
> The array of parameters, in my case, will consist of only one string, i.e.
> the filename. I get a "wrong number of arguments error":
> java.lang.IllegalArgumentException: wrong number of arguments
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
>
>
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
> at
>
>
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
> at
>
>
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> at
>
>
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
> at
>
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
> at
>
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at org.junit.runners.Suite.runChild(Suite.java:128)
> at org.junit.runners.Suite.runChild(Suite.java:24)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
>
>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
> at
>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
>
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
> at
>
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
> at
>
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
> at
>
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)
>
> What am I doing wrong?
> BSri
>
>
>


[Non-text portions of this message have been removed]

#23887 From: "bhavanisridharan" <bhavanisridharan@...>
Date: Fri May 11, 2012 9:25 pm
Subject: Re: Parameterization - of file names from directory; 1 parameter/test
bhavanisridh...
Send Email Send Email
 
@RunWith(Parameterized.class)
public class myTestClass {

	 private WebDriver webdriver;
	 private static String homeFolder=new
String("Y:\\Development\\Testing\\myTest\\Testfiles");

	 private String filename;

	 public myTestClass(Object fname) {
		 System.out.println(fname.toString());
		 this.filename=fname.toString();

	 }

	 @Before
	 public void testSetup() {

		 // Instantiate a webDriver implementation - ignore the certificate error
		 FirefoxProfile firefoxprofile = new FirefoxProfile();
	     firefoxprofile.setAssumeUntrustedCertificateIssuer(false);
	     webdriver = new FirefoxDriver(firefoxprofile);

		 ...
                 ...

	 }
@Parameters
	 public static Collection<Object[]> generateData() {
			 File fileNames[]=new File(homeFolder).listFiles();
			 String parameterStr[][]=new String[fileNames.length][1];
			 for (int i=0;i<fileNames.length;i++) {
				 parameterStr[i][0]=fileNames[i].toString();
				 System.out.println(parameterStr[i][0]);
			 }
			 return Arrays.asList(new Object[][]{parameterStr});
    }

	 @Test
	 ...
         ...
Thanks, David. I did just that. My @Parameters goes through without any problem
but I still get java.lang.IllegalArgumentException: wrong number of arguments
	 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	 at java.lang.reflect.Constructor.newInstance(Unknown Source)
	 at
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
	 at
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
	 at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
	 at
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
	 at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
	 at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
	 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	 at org.junit.runners.Suite.runChild(Suite.java:128)
	 at org.junit.runners.Suite.runChild(Suite.java:24)
	 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	 at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
	 at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
	 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
	 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
	 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)







--- In junit@yahoogroups.com, David Saff <saff@...> wrote:
>
> So the problem here is that you're creating a (1xN) array, but JUnit wants
> an (Nx1) array.  You're creating here the equivalent of
>
> List({ file1, file2, file3 })
>
> but what you want is
>
> List({ file1 }, { file 2 }, { file3 })
>
> So you'll have to loop through the result of list[], and put each element
> into its own one-element array.  Good luck,
>
>    David Saff
>
> On Fri, May 11, 2012 at 1:01 PM, bhavanisridharan <
> bhavanisridharan@...> wrote:
>
> > **
> >
> >
> > @RunWith(Parameterized.class)
> > public class myTestClass {
> >
> > ...
> > ...
> >
> > private static String homeFolder=new
> > String("Y:\\Development\\Testing\\myTest\\Testfiles");
> > private String filename;
> >
> > public myTestClass(String filename) {
> > this.filename=filename;
> > }
> >
> > @Parameters
> > public static Collection<Object[]> generateData() {
> > return Arrays.asList(new Object[][]{ new File(homeFolder).list()});
> > }
> > }
> >
> > The requirements is to feed the constructor with filenames from homeFolder
> > so each test runs with a different input.
> >
> > The array of parameters, in my case, will consist of only one string, i.e.
> > the filename. I get a "wrong number of arguments error":
> > java.lang.IllegalArgumentException: wrong number of arguments
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> > Source)
> > at java.lang.reflect.Constructor.newInstance(Unknown Source)
> > at
> >
> >
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
> > at
> >
> >
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
> > at
> >
> >
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> > at
> >
> >
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
> > at
> >
> >
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
> > at
> >
> >
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > at org.junit.runners.Suite.runChild(Suite.java:128)
> > at org.junit.runners.Suite.runChild(Suite.java:24)
> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > at
> >
> >
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
> > at
> >
> >
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> > at
> >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
> > at
> >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
> > at
> >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
> > at
> >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)
> >
> > What am I doing wrong?
> > BSri
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>

#23888 From: "marquessilva126" <as6180416@...>
Date: Mon May 14, 2012 2:17 am
Subject: Test-Driven Development
marquessilva126
Send Email Send Email
 
Hi, I am student and beginner in TDD in JUnit4 (Java). If you please, someone
could suggest some books and/or where can I get some simple examples to learn
write unitestes?

Thank you
Marques

#23889 From: Simon Chappell <simonpeterchappell@...>
Date: Mon May 14, 2012 1:10 pm
Subject: Re: Test-Driven Development
spchappell
Send Email Send Email
 
Marques,

Have you worked your way through the JUnit FAQ?

It's available online for reading and (if my memory serves me correctly) it
would have been sent to you when you subscribed to this list.

http://junit.sourceforge.net/doc/faq/faq.htm

This is only intended to help beginners, so it doesn't cover everything,
but it should be a good start.

After that, there are a number of JUnit books available on the market.

Some example code is always good and there are often unit tests in
open-source Java projects that you can review. I have a couple of JUnit
example projects up on Github that you may care to look at. They were
specifically written to help people with learning JUnit so they have extra
comments for the tests.

https://github.com/simonpeter/Fraction
https://github.com/simonpeter/BinaryDigit

Hope this helps.

Simon
(One of the JUnit list moderators)


On Sun, May 13, 2012 at 9:17 PM, marquessilva126 <as6180416@...> wrote:

> **
>
>
> Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> someone could suggest some books and/or where can I get some simple
> examples to learn write unitestes?
>
> Thank you
> Marques
>
>
>



--
simonpeter.org | simonpeter.com | newlife-upc.org


[Non-text portions of this message have been removed]

#23890 From: Colin Vipurs <zodiaczx6@...>
Date: Mon May 14, 2012 2:47 pm
Subject: Re: Test-Driven Development
zodiac_zx6
Send Email Send Email
 
The GOOS book is what I would consider to be the best book on TDD:

http://www.amazon.co.uk/Growing-Object-Oriented-Software-Guided-Signature/dp/032\
1503627/ref=sr_1_1?ie=UTF8&qid=1337006797&sr=8-1

This was my previous favourite:

http://www.amazon.co.uk/Test-Driven-Acceptance-Java-Developers/dp/1932394850/ref\
=sr_1_5?s=books&ie=UTF8&qid=1337006854&sr=1-5

On Mon, May 14, 2012 at 3:17 AM, marquessilva126 <as6180416@...> wrote:

> **
>
>
> Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> someone could suggest some books and/or where can I get some simple
> examples to learn write unitestes?
>
> Thank you
> Marques
>
>
>



--
Maybe she awoke to see the roommate's boyfriend swinging from the
chandelier wearing a boar's head.

Something which you, I, and everyone else would call "Tuesday", of course.


[Non-text portions of this message have been removed]

#23891 From: David Saff <saff@...>
Date: Mon May 14, 2012 3:39 pm
Subject: Re: Re: Parameterization - of file names from directory; 1 parameter/test
saffatgoogle
Send Email Send Email
 
I don't know what happens when you call a multi-dimensional array
initializer with a multi-dimensional array in the middle.  The good news
is, you don't have to, and avoiding it makes the code simpler:

@Parameters
public static Collection<Object[]> generateData() {
   File fileNames[]=new File(homeFolder).listFiles();
   List<Object[]> params = new ArrayList();
   for (File file : fileNames) {
     params.add(new Object[] { file.toString() };
   }
   return params;
}

What happens if you use that?

    David Saff


On Fri, May 11, 2012 at 5:25 PM, bhavanisridharan <
bhavanisridharan@...> wrote:

> **
>
>
> @RunWith(Parameterized.class)
> public class myTestClass {
>
> private WebDriver webdriver;
>
> private static String homeFolder=new
> String("Y:\\Development\\Testing\\myTest\\Testfiles");
>
> private String filename;
>
> public myTestClass(Object fname) {
> System.out.println(fname.toString());
> this.filename=fname.toString();
>
> }
>
> @Before
> public void testSetup() {
>
> // Instantiate a webDriver implementation - ignore the certificate error
> FirefoxProfile firefoxprofile = new FirefoxProfile();
> firefoxprofile.setAssumeUntrustedCertificateIssuer(false);
> webdriver = new FirefoxDriver(firefoxprofile);
>
> ...
> ...
>
>
> }
> @Parameters
> public static Collection<Object[]> generateData() {
> File fileNames[]=new File(homeFolder).listFiles();
> String parameterStr[][]=new String[fileNames.length][1];
> for (int i=0;i<fileNames.length;i++) {
> parameterStr[i][0]=fileNames[i].toString();
> System.out.println(parameterStr[i][0]);
> }
> return Arrays.asList(new Object[][]{parameterStr});
> }
>
> @Test
> ...
> ...
> Thanks, David. I did just that. My @Parameters goes through without any
> problem but I still get java.lang.IllegalArgumentException: wrong number of
> arguments
>
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
>
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
> at
>
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
> at
>
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> at
>
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
> at
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
> at
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at org.junit.runners.Suite.runChild(Suite.java:128)
> at org.junit.runners.Suite.runChild(Suite.java:24)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)
>
>
>
>
> --- In junit@yahoogroups.com, David Saff <saff@...> wrote:
> >
> > So the problem here is that you're creating a (1xN) array, but JUnit
> wants
> > an (Nx1) array. You're creating here the equivalent of
> >
> > List({ file1, file2, file3 })
> >
> > but what you want is
> >
> > List({ file1 }, { file 2 }, { file3 })
> >
> > So you'll have to loop through the result of list[], and put each element
> > into its own one-element array. Good luck,
> >
> > David Saff
> >
> > On Fri, May 11, 2012 at 1:01 PM, bhavanisridharan <
> > bhavanisridharan@...> wrote:
> >
> > > **
>
> > >
> > >
> > > @RunWith(Parameterized.class)
> > > public class myTestClass {
> > >
> > > ...
> > > ...
> > >
> > > private static String homeFolder=new
> > > String("Y:\\Development\\Testing\\myTest\\Testfiles");
> > > private String filename;
> > >
> > > public myTestClass(String filename) {
> > > this.filename=filename;
> > > }
> > >
> > > @Parameters
> > > public static Collection<Object[]> generateData() {
> > > return Arrays.asList(new Object[][]{ new File(homeFolder).list()});
> > > }
> > > }
> > >
> > > The requirements is to feed the constructor with filenames from
> homeFolder
> > > so each test runs with a different input.
> > >
> > > The array of parameters, in my case, will consist of only one string,
> i.e.
> > > the filename. I get a "wrong number of arguments error":
> > > java.lang.IllegalArgumentException: wrong number of arguments
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> Source)
> > > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> > > Source)
> > > at java.lang.reflect.Constructor.newInstance(Unknown Source)
> > > at
> > >
> > >
>
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
> > > at
> > >
> > >
>
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
> > > at
> > >
> > >
>
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> > > at
> > >
> > >
>
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
> > > at
> > >
> > >
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
> > > at
> > >
> > >
>
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
> > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > > at org.junit.runners.Suite.runChild(Suite.java:128)
> > > at org.junit.runners.Suite.runChild(Suite.java:24)
> > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > > at
> > >
> > >
>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
> > > at
> > >
> > >
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> > > at
> > >
> > >
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
> > > at
> > >
> > >
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
> > > at
> > >
> > >
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
> > > at
> > >
> > >
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)
> > >
> > > What am I doing wrong?
> > > BSri
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>


[Non-text portions of this message have been removed]

#23892 From: Tomek Kaczanowski <kaczanowski.tomek@...>
Date: Mon May 14, 2012 3:55 pm
Subject: Re: Test-Driven Development
kaczanowski.tomek@...
Send Email Send Email
 
GOOS book is indeed a great book, but definitely not a book to begin with!

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://practicalunittesting.com

2012/5/14 Colin Vipurs <zodiaczx6@...>

> **
>
>
> The GOOS book is what I would consider to be the best book on TDD:
>
>
>
http://www.amazon.co.uk/Growing-Object-Oriented-Software-Guided-Signature/dp/032\
1503627/ref=sr_1_1?ie=UTF8&qid=1337006797&sr=8-1
>
> This was my previous favourite:
>
>
>
http://www.amazon.co.uk/Test-Driven-Acceptance-Java-Developers/dp/1932394850/ref\
=sr_1_5?s=books&ie=UTF8&qid=1337006854&sr=1-5
>
> On Mon, May 14, 2012 at 3:17 AM, marquessilva126 <as6180416@...>
> wrote:
>
> > **
>
> >
> >
> > Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> > someone could suggest some books and/or where can I get some simple
> > examples to learn write unitestes?
> >
> > Thank you
> > Marques
> >
> >
> >
>
> --
> Maybe she awoke to see the roommate's boyfriend swinging from the
> chandelier wearing a boar's head.
>
> Something which you, I, and everyone else would call "Tuesday", of course.
>
>
> [Non-text portions of this message have been removed]
>
>
>


[Non-text portions of this message have been removed]

#23893 From: "bhavanisridharan" <bhavanisridharan@...>
Date: Mon May 14, 2012 5:26 pm
Subject: Re: Parameterization - of file names from directory; 1 parameter/test
bhavanisridh...
Send Email Send Email
 
David,
It works! Thanks so much. I got confused with the idea of returning a collection
of object arrays. It looks much simpler now.. don't know what I was thinking :)
Bhavani

--- In junit@yahoogroups.com, David Saff <saff@...> wrote:
>
> I don't know what happens when you call a multi-dimensional array
> initializer with a multi-dimensional array in the middle.  The good news
> is, you don't have to, and avoiding it makes the code simpler:
>
> @Parameters
> public static Collection<Object[]> generateData() {
>   File fileNames[]=new File(homeFolder).listFiles();
>   List<Object[]> params = new ArrayList();
>   for (File file : fileNames) {
>     params.add(new Object[] { file.toString() };
>   }
>   return params;
> }
>
> What happens if you use that?
>
>    David Saff
>
>
> On Fri, May 11, 2012 at 5:25 PM, bhavanisridharan <
> bhavanisridharan@...> wrote:
>
> > **
> >
> >
> > @RunWith(Parameterized.class)
> > public class myTestClass {
> >
> > private WebDriver webdriver;
> >
> > private static String homeFolder=new
> > String("Y:\\Development\\Testing\\myTest\\Testfiles");
> >
> > private String filename;
> >
> > public myTestClass(Object fname) {
> > System.out.println(fname.toString());
> > this.filename=fname.toString();
> >
> > }
> >
> > @Before
> > public void testSetup() {
> >
> > // Instantiate a webDriver implementation - ignore the certificate error
> > FirefoxProfile firefoxprofile = new FirefoxProfile();
> > firefoxprofile.setAssumeUntrustedCertificateIssuer(false);
> > webdriver = new FirefoxDriver(firefoxprofile);
> >
> > ...
> > ...
> >
> >
> > }
> > @Parameters
> > public static Collection<Object[]> generateData() {
> > File fileNames[]=new File(homeFolder).listFiles();
> > String parameterStr[][]=new String[fileNames.length][1];
> > for (int i=0;i<fileNames.length;i++) {
> > parameterStr[i][0]=fileNames[i].toString();
> > System.out.println(parameterStr[i][0]);
> > }
> > return Arrays.asList(new Object[][]{parameterStr});
> > }
> >
> > @Test
> > ...
> > ...
> > Thanks, David. I did just that. My @Parameters goes through without any
> > problem but I still get java.lang.IllegalArgumentException: wrong number of
> > arguments
> >
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> > Source)
> > at java.lang.reflect.Constructor.newInstance(Unknown Source)
> > at
> >
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
> > at
> >
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
> > at
> >
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> > at
> >
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
> > at
> >
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
> > at
> >
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > at org.junit.runners.Suite.runChild(Suite.java:128)
> > at org.junit.runners.Suite.runChild(Suite.java:24)
> > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > at
> >
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
> > at
> >
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> > at
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
> > at
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
> > at
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
> > at
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)
> >
> >
> >
> >
> > --- In junit@yahoogroups.com, David Saff <saff@> wrote:
> > >
> > > So the problem here is that you're creating a (1xN) array, but JUnit
> > wants
> > > an (Nx1) array. You're creating here the equivalent of
> > >
> > > List({ file1, file2, file3 })
> > >
> > > but what you want is
> > >
> > > List({ file1 }, { file 2 }, { file3 })
> > >
> > > So you'll have to loop through the result of list[], and put each element
> > > into its own one-element array. Good luck,
> > >
> > > David Saff
> > >
> > > On Fri, May 11, 2012 at 1:01 PM, bhavanisridharan <
> > > bhavanisridharan@> wrote:
> > >
> > > > **
> >
> > > >
> > > >
> > > > @RunWith(Parameterized.class)
> > > > public class myTestClass {
> > > >
> > > > ...
> > > > ...
> > > >
> > > > private static String homeFolder=new
> > > > String("Y:\\Development\\Testing\\myTest\\Testfiles");
> > > > private String filename;
> > > >
> > > > public myTestClass(String filename) {
> > > > this.filename=filename;
> > > > }
> > > >
> > > > @Parameters
> > > > public static Collection<Object[]> generateData() {
> > > > return Arrays.asList(new Object[][]{ new File(homeFolder).list()});
> > > > }
> > > > }
> > > >
> > > > The requirements is to feed the constructor with filenames from
> > homeFolder
> > > > so each test runs with a different input.
> > > >
> > > > The array of parameters, in my case, will consist of only one string,
> > i.e.
> > > > the filename. I get a "wrong number of arguments error":
> > > > java.lang.IllegalArgumentException: wrong number of arguments
> > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> > Source)
> > > > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> > > > Source)
> > > > at java.lang.reflect.Constructor.newInstance(Unknown Source)
> > > > at
> > > >
> > > >
> >
org.junit.runners.Parameterized$TestClassRunnerForParameters.createTest(Paramete\
rized.java:86)
> > > > at
> > > >
> > > >
> >
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRun\
ner.java:236)
> > > > at
> > > >
> > > >
> >
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:\
15)
> > > > at
> > > >
> > > >
> >
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java\
:233)
> > > > at
> > > >
> > > >
> >
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68\
)
> > > > at
> > > >
> > > >
> >
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47\
)
> > > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > > > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > > > at org.junit.runners.Suite.runChild(Suite.java:128)
> > > > at org.junit.runners.Suite.runChild(Suite.java:24)
> > > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> > > > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> > > > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> > > > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> > > > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> > > > at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> > > > at
> > > >
> > > >
> >
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen\
ce.java:50)
> > > > at
> > > >
> > > >
> >
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> > > > at
> > > >
> > > >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:467)
> > > > at
> > > >
> > > >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner\
.java:683)
> > > > at
> > > >
> > > >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java\
:390)
> > > > at
> > > >
> > > >
> >
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav\
a:197)
> > > >
> > > > What am I doing wrong?
> > > > BSri
> > > >
> > > >
> > > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>

#23894 From: "marquessilva126" <as6180416@...>
Date: Tue May 15, 2012 10:40 am
Subject: Re: Test-Driven Development
marquessilva126
Send Email Send Email
 
Thank you Colin.

Marques

--- In junit@yahoogroups.com, Colin Vipurs <zodiaczx6@...> wrote:
>
> The GOOS book is what I would consider to be the best book on TDD:
>
>
http://www.amazon.co.uk/Growing-Object-Oriented-Software-Guided-Signature/dp/032\
1503627/ref=sr_1_1?ie=UTF8&qid=1337006797&sr=8-1
>
> This was my previous favourite:
>
>
http://www.amazon.co.uk/Test-Driven-Acceptance-Java-Developers/dp/1932394850/ref\
=sr_1_5?s=books&ie=UTF8&qid=1337006854&sr=1-5
>
> On Mon, May 14, 2012 at 3:17 AM, marquessilva126 <as6180416@...> wrote:
>
> > **
> >
> >
> > Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> > someone could suggest some books and/or where can I get some simple
> > examples to learn write unitestes?
> >
> > Thank you
> > Marques
> >
> >
> >
>
>
>
> --
> Maybe she awoke to see the roommate's boyfriend swinging from the
> chandelier wearing a boar's head.
>
> Something which you, I, and everyone else would call "Tuesday", of course.
>
>
> [Non-text portions of this message have been removed]
>

#23895 From: "marquessilva126" <as6180416@...>
Date: Tue May 15, 2012 10:43 am
Subject: Re: Test-Driven Development
marquessilva126
Send Email Send Email
 
Thank you Tomek

Marques

--- In junit@yahoogroups.com, Tomek Kaczanowski <kaczanowski.tomek@...> wrote:
>
> GOOS book is indeed a great book, but definitely not a book to begin with!
>
> --
> Regards / Pozdrawiam
> Tomek Kaczanowski
> http://practicalunittesting.com
>
> 2012/5/14 Colin Vipurs <zodiaczx6@...>
>
> > **
> >
> >
> > The GOOS book is what I would consider to be the best book on TDD:
> >
> >
> >
http://www.amazon.co.uk/Growing-Object-Oriented-Software-Guided-Signature/dp/032\
1503627/ref=sr_1_1?ie=UTF8&qid=1337006797&sr=8-1
> >
> > This was my previous favourite:
> >
> >
> >
http://www.amazon.co.uk/Test-Driven-Acceptance-Java-Developers/dp/1932394850/ref\
=sr_1_5?s=books&ie=UTF8&qid=1337006854&sr=1-5
> >
> > On Mon, May 14, 2012 at 3:17 AM, marquessilva126 <as6180416@...>
> > wrote:
> >
> > > **
> >
> > >
> > >
> > > Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> > > someone could suggest some books and/or where can I get some simple
> > > examples to learn write unitestes?
> > >
> > > Thank you
> > > Marques
> > >
> > >
> > >
> >
> > --
> > Maybe she awoke to see the roommate's boyfriend swinging from the
> > chandelier wearing a boar's head.
> >
> > Something which you, I, and everyone else would call "Tuesday", of course.
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>

#23896 From: Colin Vipurs <zodiaczx6@...>
Date: Mon May 14, 2012 4:56 pm
Subject: Re: Test-Driven Development
zodiac_zx6
Send Email Send Email
 
Why would you say that? :O

I would think you could pick up all the basics you need from the junit site
itself then move onto the GOOS book before you pick up too many bad habits
alot of the other literature teaches you.

On Mon, May 14, 2012 at 4:55 PM, Tomek Kaczanowski <
kaczanowski.tomek@...> wrote:

> **
>
>
> GOOS book is indeed a great book, but definitely not a book to begin with!
>
> --
> Regards / Pozdrawiam
> Tomek Kaczanowski
> http://practicalunittesting.com
>
> 2012/5/14 Colin Vipurs <zodiaczx6@...>
>
> > **
> >
> >
> > The GOOS book is what I would consider to be the best book on TDD:
> >
> >
> >
>
http://www.amazon.co.uk/Growing-Object-Oriented-Software-Guided-Signature/dp/032\
1503627/ref=sr_1_1?ie=UTF8&qid=1337006797&sr=8-1
> >
> > This was my previous favourite:
> >
> >
> >
>
http://www.amazon.co.uk/Test-Driven-Acceptance-Java-Developers/dp/1932394850/ref\
=sr_1_5?s=books&ie=UTF8&qid=1337006854&sr=1-5
> >
> > On Mon, May 14, 2012 at 3:17 AM, marquessilva126 <as6180416@...>
> > wrote:
> >
> > > **
> >
> > >
> > >
> > > Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> > > someone could suggest some books and/or where can I get some simple
> > > examples to learn write unitestes?
> > >
> > > Thank you
> > > Marques
> > >
> > >
> > >
> >
> > --
> > Maybe she awoke to see the roommate's boyfriend swinging from the
> > chandelier wearing a boar's head.
> >
> > Something which you, I, and everyone else would call "Tuesday", of
> course.
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
>
>



--
Maybe she awoke to see the roommate's boyfriend swinging from the
chandelier wearing a boar's head.

Something which you, I, and everyone else would call "Tuesday", of course.


[Non-text portions of this message have been removed]

#23897 From: Young Gu <hyysguyang@...>
Date: Tue May 15, 2012 1:18 pm
Subject: Re: Test-Driven Development
hyysguyang
Send Email Send Email
 
Just go through the junit official site, or Wikipedia, you will find more
reference.....anyway, Kent's TDD by example is a good start....
On May 14, 2012 8:59 PM, "marquessilva126" <as6180416@...> wrote:

> **
>
>
> Hi, I am student and beginner in TDD in JUnit4 (Java). If you please,
> someone could suggest some books and/or where can I get some simple
> examples to learn write unitestes?
>
> Thank you
> Marques
>
>
>


[Non-text portions of this message have been removed]

#23898 From: David Saff <david@...>
Date: Mon May 21, 2012 7:15 pm
Subject: Request for help: fix MethodSorter
dsaff
Send Email Send Email
 
Hi, JUnit users.

https://github.com/KentBeck/junit/issues/429 is a bug that needs a quick
fix in order to restore deterministic test ordering in JUnit 4.11.  Kevin
Cooney has been kind enough to even include the needed code in the comments
on the bug.  My day job is likely to keep me from checking in the quick fix
this week--if anyone's in the mood to do a good deed and open a pull
request, it would be a great help to all of us.  Thanks,

    David Saff


[Non-text portions of this message have been removed]

#23899 From: "akshay.mnit11" <akshay.mnit11@...>
Date: Tue May 22, 2012 12:27 pm
Subject: Android Notification Bar Testing
akshay.mnit11
Send Email Send Email
 
I am writing testing framework to test an application.
This application receives IM(audio/video) and then notifies the user through
notification bar.

i need an automation to click on notification item. Can you please help in this
regard.

Any help in this regard will be highly appreciated..

Thanks,
Akshay

#23900 From: David Saff <saff@...>
Date: Tue May 22, 2012 2:07 pm
Subject: Re: Android Notification Bar Testing
saffatgoogle
Send Email Send Email
 
The answer will depend a lot on the details of your app and OS.  In many
cases, teams find the most value in simulating these kinds of UI
interactions in their automated tests: when the notification is clicked, it
generates some kind of call back into the app.  Your automated test simply
verifies that the call out to the notification manager is made, and then
explicitly triggers the call back into the app.

It is true that this kind of test will not catch, for example, if you've
made a wrong assumption about the notification manager API, and are calling
it in a way that looks good in the test, but doesn't actually create an
on-screen notification.  Many teams find that occasionally manually testing
the app/UI integration is cheap and sufficient to catch these kinds of
errors.

Good luck,

    David Saff

On Tue, May 22, 2012 at 8:27 AM, akshay.mnit11 <akshay.mnit11@...>wrote:

> **
>
>
> I am writing testing framework to test an application.
> This application receives IM(audio/video) and then notifies the user
> through notification bar.
>
> i need an automation to click on notification item. Can you please help in
> this regard.
>
> Any help in this regard will be highly appreciated..
>
> Thanks,
> Akshay
>
>
>


[Non-text portions of this message have been removed]

#23901 From: "akshay.mnit11" <akshay.mnit11@...>
Date: Wed May 23, 2012 6:42 am
Subject: Re: Android Notification Bar Testing
akshay.mnit11
Send Email Send Email
 
thanks for the reply.

I need to click on notification item when it is received from my test case(then
activity will be launched and i can continue testing with robotium solo
interaction).

--- In junit@yahoogroups.com, David Saff <saff@...> wrote:
>
> The answer will depend a lot on the details of your app and OS.  In many
> cases, teams find the most value in simulating these kinds of UI
> interactions in their automated tests: when the notification is clicked, it
> generates some kind of call back into the app.  Your automated test simply
> verifies that the call out to the notification manager is made, and then
> explicitly triggers the call back into the app.
>
> It is true that this kind of test will not catch, for example, if you've
> made a wrong assumption about the notification manager API, and are calling
> it in a way that looks good in the test, but doesn't actually create an
> on-screen notification.  Many teams find that occasionally manually testing
> the app/UI integration is cheap and sufficient to catch these kinds of
> errors.
>
> Good luck,
>
>    David Saff
>
> On Tue, May 22, 2012 at 8:27 AM, akshay.mnit11 <akshay.mnit11@...>wrote:
>
> > **
> >
> >
> > I am writing testing framework to test an application.
> > This application receives IM(audio/video) and then notifies the user
> > through notification bar.
> >
> > i need an automation to click on notification item. Can you please help in
> > this regard.
> >
> > Any help in this regard will be highly appreciated..
> >
> > Thanks,
> > Akshay
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>

#23902 From: David Saff <saff@...>
Date: Wed May 23, 2012 1:07 pm
Subject: Re: Re: Android Notification Bar Testing
saffatgoogle
Send Email Send Email
 
There may be a way to do what you want using some kind of OS-specific
screen-manipulation automation framework.  As I mentioned below, I'd
recommend seeing if you can avoid that kind of testing.  If you can't, then
you might want to ask around on the robotium lists or something similar to
get a bigger chance of hearing from someone who's faced your exact problem.
  Good luck,

    David Saff

On Wed, May 23, 2012 at 2:42 AM, akshay.mnit11 <akshay.mnit11@...>wrote:

> **
>
>
> thanks for the reply.
>
> I need to click on notification item when it is received from my test
> case(then activity will be launched and i can continue testing with
> robotium solo interaction).
>
>
> --- In junit@yahoogroups.com, David Saff <saff@...> wrote:
> >
> > The answer will depend a lot on the details of your app and OS. In many
> > cases, teams find the most value in simulating these kinds of UI
> > interactions in their automated tests: when the notification is clicked,
> it
> > generates some kind of call back into the app. Your automated test simply
> > verifies that the call out to the notification manager is made, and then
> > explicitly triggers the call back into the app.
> >
> > It is true that this kind of test will not catch, for example, if you've
> > made a wrong assumption about the notification manager API, and are
> calling
> > it in a way that looks good in the test, but doesn't actually create an
> > on-screen notification. Many teams find that occasionally manually
> testing
> > the app/UI integration is cheap and sufficient to catch these kinds of
> > errors.
> >
> > Good luck,
> >
> > David Saff
> >
> > On Tue, May 22, 2012 at 8:27 AM, akshay.mnit11 <akshay.mnit11@...>wrote:
> >
> > > **
>
> > >
> > >
> > > I am writing testing framework to test an application.
> > > This application receives IM(audio/video) and then notifies the user
> > > through notification bar.
> > >
> > > i need an automation to click on notification item. Can you please
> help in
> > > this regard.
> > >
> > > Any help in this regard will be highly appreciated..
> > >
> > > Thanks,
> > > Akshay
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>


[Non-text portions of this message have been removed]

#23903 From: "akshay.mnit11" <akshay.mnit11@...>
Date: Thu May 24, 2012 9:23 am
Subject: Android Notification Bar Testing
akshay.mnit11
Send Email Send Email
 
Can i click on notification bar item .. That is, I need to drag Notification bar
down and then click on the first notification item..
Please help in this regard...

Reagrds,
Akshay

#23904 From: David Saff <saff@...>
Date: Thu May 24, 2012 1:13 pm
Subject: Re: Android Notification Bar Testing
saffatgoogle
Send Email Send Email
 
I'm assuming this is the same problem you asked about before, when you were
using Robotium for automation.  You will definitely have better odds of an
answer if you ask on a Robotium forum.

    David Saff

On Thu, May 24, 2012 at 5:23 AM, akshay.mnit11 <akshay.mnit11@...>wrote:

> **
>
>
> Can i click on notification bar item .. That is, I need to drag
> Notification bar down and then click on the first notification item..
> Please help in this regard...
>
> Reagrds,
> Akshay
>
>
>


[Non-text portions of this message have been removed]

#23905 From: "Alan" <alan_shaughnessy@...>
Date: Thu May 24, 2012 2:02 pm
Subject: cpsuite with junit 4.10 and ANT 1.8.2
alan_shaughn...
Send Email Send Email
 
I'm attempting to use cpsuite to run some tests from a jar file but it's having
trouble using the jar file. Has anybody else seen issues around this?  What am I
missing?

anytime I use the @IncludeJars(true) I start seeing failures like this

@RunWith(ClasspathSuite.class)
@IncludeJars(true)
public class AllTests

ant snippet

             <classpath>
                <pathelement path="../output/tests.jar"/>
                  <pathelement
path="../../Tools/junit/cpsuite-1.2.5/cpsuite-1.2.5.jar"/>
                <pathelement
path="../../Tools/JDBC/postgresql-8.4-702.jdbc3.jar"/>
             </classpath>



t=org.junit.runner.manipulation.NoTestsRemainException)


      [exec]     [junit] ------------- Standard Error -----------------
      [exec]     [junit] log4j:WARN JmDNS or serviceInfo class not found
      [exec]     [junit] java.lang.ClassNotFoundException: javax.jmdns.JmDNS
      [exec]     [junit]         at java.net.URLClassLoader$1.run(Unknown Source)
      [exec]     [junit]         at
java.security.AccessController.doPrivileged(Native Method)
      [exec]     [junit]         at java.net.URLClassLoader.findClass(Unknown
Source)
      [exec]     [junit]         at java.lang.ClassLoader.loadClass(Unknown
Source)
      [exec]     [junit]         at
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      [exec]     [junit]         at java.lang.ClassLoader.loadClass(Unknown
Source)
      [exec]     [junit]         at java.lang.Class.forName0(Native Method)
      [exec]     [junit]         at java.lang.Class.forName(Unknown Source)
      [exec]     [junit]         at
org.apache.log4j.net.ZeroConfSupport.initializeJMDNS(ZeroConfSupport.java:180)
      [exec]     [junit]         at
org.apache.log4j.net.ZeroConfSupport.<clinit>(ZeroConfSupport.java:29)
      [exec]     [junit]         at java.lang.Class.forName0(Native Method)
      [exec]     [junit]         at java.lang.Class.forName(Unknown Source)
      [exec]     [junit]         at
org.junit.extensions.cpsuite.ClasspathClassesFinder.gatherClasses(ClasspathClass\
esFinder.java:8
6)
      [exec]     [junit]         at
org.junit.extensions.cpsuite.ClasspathClassesFinder.gatherClassesInRoot(Classpat\
hClassesFinder.
java:66)
      [exec]     [junit]         at
org.junit.extensions.cpsuite.ClasspathClassesFinder.findClassesInRoots(Classpath\
ClassesFinder.j
ava:49)
      [exec]     [junit]         at
org.junit.extensions.cpsuite.ClasspathClassesFinder.findClassesInClasspath(Class\
pathClassesFind
er.java:43)

When I don't use the @IncludeJars(true) and just include the path to the classes
it works fine.

If I include a path to the classes directory it builds the list of tests and
runs the tests out of the jar file correctly.


@RunWith(ClasspathSuite.class)
public class AllTests

ant snippet
             <classpath>
                <pathelement path="../output/classes/tests/"/>
                <pathelement path="../output/tests.jar"/>
                  <pathelement
path="../../Tools/junit/cpsuite-1.2.5/cpsuite-1.2.5.jar"/>
                <pathelement
path="../../Tools/JDBC/postgresql-8.4-702.jdbc3.jar"/>
             </classpath>


Thanks
Al

#23906 From: David Saff <saff@...>
Date: Thu May 24, 2012 5:36 pm
Subject: Re: cpsuite with junit 4.10 and ANT 1.8.2
saffatgoogle
Send Email Send Email
 
CC:Johannes Link, the cpsuite author.

Johannes,

Any ideas on this?  Thanks,

    David Saff

On Thu, May 24, 2012 at 10:02 AM, Alan <alan_shaughnessy@...> wrote:

> **
>
>
> I'm attempting to use cpsuite to run some tests from a jar file but it's
> having trouble using the jar file. Has anybody else seen issues around
> this? What am I missing?
>
> anytime I use the @IncludeJars(true) I start seeing failures like this
>
> @RunWith(ClasspathSuite.class)
> @IncludeJars(true)
> public class AllTests
>
> ant snippet
>
> <classpath>
> <pathelement path="../output/tests.jar"/>
> <pathelement path="../../Tools/junit/cpsuite-1.2.5/cpsuite-1.2.5.jar"/>
> <pathelement path="../../Tools/JDBC/postgresql-8.4-702.jdbc3.jar"/>
> </classpath>
>
> t=org.junit.runner.manipulation.NoTestsRemainException)
>
> [exec] [junit] ------------- Standard Error -----------------
> [exec] [junit] log4j:WARN JmDNS or serviceInfo class not found
> [exec] [junit] java.lang.ClassNotFoundException: javax.jmdns.JmDNS
> [exec] [junit] at java.net.URLClassLoader$1.run(Unknown Source)
> [exec] [junit] at java.security.AccessController.doPrivileged(Native
> Method)
> [exec] [junit] at java.net.URLClassLoader.findClass(Unknown Source)
> [exec] [junit] at java.lang.ClassLoader.loadClass(Unknown Source)
> [exec] [junit] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown
> Source)
> [exec] [junit] at java.lang.ClassLoader.loadClass(Unknown Source)
> [exec] [junit] at java.lang.Class.forName0(Native Method)
> [exec] [junit] at java.lang.Class.forName(Unknown Source)
> [exec] [junit] at
> org.apache.log4j.net.ZeroConfSupport.initializeJMDNS(ZeroConfSupport.java:180)
> [exec] [junit] at
> org.apache.log4j.net.ZeroConfSupport.<clinit>(ZeroConfSupport.java:29)
> [exec] [junit] at java.lang.Class.forName0(Native Method)
> [exec] [junit] at java.lang.Class.forName(Unknown Source)
> [exec] [junit] at
>
org.junit.extensions.cpsuite.ClasspathClassesFinder.gatherClasses(ClasspathClass\
esFinder.java:8
> 6)
> [exec] [junit] at
>
org.junit.extensions.cpsuite.ClasspathClassesFinder.gatherClassesInRoot(Classpat\
hClassesFinder.
> java:66)
> [exec] [junit] at
>
org.junit.extensions.cpsuite.ClasspathClassesFinder.findClassesInRoots(Classpath\
ClassesFinder.j
> ava:49)
> [exec] [junit] at
>
org.junit.extensions.cpsuite.ClasspathClassesFinder.findClassesInClasspath(Class\
pathClassesFind
> er.java:43)
>
> When I don't use the @IncludeJars(true) and just include the path to the
> classes it works fine.
>
> If I include a path to the classes directory it builds the list of tests
> and runs the tests out of the jar file correctly.
>
> @RunWith(ClasspathSuite.class)
> public class AllTests
>
> ant snippet
> <classpath>
> <pathelement path="../output/classes/tests/"/>
> <pathelement path="../output/tests.jar"/>
> <pathelement path="../../Tools/junit/cpsuite-1.2.5/cpsuite-1.2.5.jar"/>
> <pathelement path="../../Tools/JDBC/postgresql-8.4-702.jdbc3.jar"/>
> </classpath>
>
> Thanks
> Al
>
>
>


[Non-text portions of this message have been removed]

Messages 23877 - 23906 of 24385   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help