You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(80) |
Nov
(42) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(11) |
Feb
(50) |
Mar
(70) |
Apr
(102) |
May
(28) |
Jun
(45) |
Jul
(14) |
Aug
(75) |
Sep
(17) |
Oct
(15) |
Nov
(11) |
Dec
(4) |
2003 |
Jan
(16) |
Feb
(19) |
Mar
(21) |
Apr
(20) |
May
(29) |
Jun
(7) |
Jul
(5) |
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(3) |
2004 |
Jan
(5) |
Feb
(4) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(6) |
Oct
(6) |
Nov
(1) |
Dec
(2) |
2005 |
Jan
(4) |
Feb
(4) |
Mar
(15) |
Apr
(1) |
May
|
Jun
(4) |
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(4) |
2006 |
Jan
|
Feb
(91) |
Mar
(47) |
Apr
(7) |
May
(4) |
Jun
(9) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
(36) |
Nov
(95) |
Dec
(12) |
2007 |
Jan
(11) |
Feb
(31) |
Mar
(45) |
Apr
(11) |
May
(9) |
Jun
(1) |
Jul
(146) |
Aug
(15) |
Sep
|
Oct
(3) |
Nov
(6) |
Dec
(1) |
2008 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(19) |
Sep
(1) |
Oct
(10) |
Nov
|
Dec
(8) |
2009 |
Jan
(3) |
Feb
(1) |
Mar
(4) |
Apr
(8) |
May
(5) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(13) |
Nov
(13) |
Dec
(4) |
2010 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(2) |
May
|
Jun
(1) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
(1) |
Feb
(4) |
Mar
(3) |
Apr
(4) |
May
|
Jun
(12) |
Jul
(16) |
Aug
(4) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
From: Mark S. <mar...@ho...> - 2008-10-14 18:04:55
|
David, I'm trying to implement different testing strategies using JUnit. So basically, I implemented my own Runner which collects custom annotations similar to the suite runner. Next I use this information to prioritize/group/etc tests in different ways. This allows me to still use the Eclipse plugin, while having my own JUnit extension. However, the problem I'm running into at the moment is that whenever I have two descriptions with the same display name, then they have the same hashcode. If you take things like "groups", then these descriptions do differ in my case because they are in different groups. One solution would be to prefix the description with the group name, but i would rather like to extend the description class and use the parent/child relations to model groups. So what's the problem? Well, if two descriptions have the same hashcode, then it becomes impossible for Eclipse to correctly show the running/finished/failed tests, because notification for description 1 and 2 are done on the same hashcode. I hope that explains the problem. My question is rather simple. Is it an option for the JUnit development team to make the Description constructor protected in their next release (or even better: nightly build). Thanks in advance, Mark > Date: Tue, 14 Oct 2008 09:00:57 -0400> From: da...@sa...> To: mar...@ho...> Subject: Re: [Junit-devel] Extending the Description class> CC: jun...@li...> > Mark,> > I'd like to understand a little better what you're doing. Are you> fine-tuning the performance of a HashMap with Descriptions as keys?> > David Saff> > On Tue, Oct 14, 2008 at 3:02 AM, Mark Stobbe <mar...@ho...> wrote:> > Hello JUnit developer team,> >> > I have a question, or rather a request: could you make the constructor (and> > possibly the fields) of org.junit.runner.Description "protected" instead of> > "private". In this way it is impossible to normally subclass Description> > with a custom implementation.> >> > Why would you like to subclass Description? Well, the latest implementation> > of Description has a rather difficult hashCode implementation, namely:> > hashCode = getDisplayName().hashCode(). This poses a problem (or not, but in> > my case it does) when you create multiple instances of the Description class> > with the same name.> >> > Hopefully you are willing to incorporate this minor modification, it would> > surely make my life easier.> >> > Big thanks,> > Mark Stobbe> > ________________________________> > Plan je evenement, nodig mensen uit en deel je foto's met Windows Live> > Events> > -------------------------------------------------------------------------> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge> > Build the coolest Linux based applications with Moblin SDK & win great> > prizes> > Grand prize is a trip for two to an Open Source event anywhere in the world> > http://moblin-contest.org/redirect.php?banner_id=100&url=/> > _______________________________________________> > Junit-devel mailing list> > Jun...@li...> > https://lists.sourceforge.net/lists/listinfo/junit-devel> >> > _________________________________________________________________ Uniek: Onbeperkt chatten op je mobiel voor maar € 2,95 per maand! http://www.overaljevriendenbijje.nl/#superdeal |
From: David S. <da...@sa...> - 2008-10-14 13:01:13
|
Mark, I'd like to understand a little better what you're doing. Are you fine-tuning the performance of a HashMap with Descriptions as keys? David Saff On Tue, Oct 14, 2008 at 3:02 AM, Mark Stobbe <mar...@ho...> wrote: > Hello JUnit developer team, > > I have a question, or rather a request: could you make the constructor (and > possibly the fields) of org.junit.runner.Description "protected" instead of > "private". In this way it is impossible to normally subclass Description > with a custom implementation. > > Why would you like to subclass Description? Well, the latest implementation > of Description has a rather difficult hashCode implementation, namely: > hashCode = getDisplayName().hashCode(). This poses a problem (or not, but in > my case it does) when you create multiple instances of the Description class > with the same name. > > Hopefully you are willing to incorporate this minor modification, it would > surely make my life easier. > > Big thanks, > Mark Stobbe > ________________________________ > Plan je evenement, nodig mensen uit en deel je foto's met Windows Live > Events > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/junit-devel > > |
From: Mark S. <mar...@ho...> - 2008-10-14 07:02:42
|
Hello JUnit developer team, I have a question, or rather a request: could you make the constructor (and possibly the fields) of org.junit.runner.Description "protected" instead of "private". In this way it is impossible to normally subclass Description with a custom implementation. Why would you like to subclass Description? Well, the latest implementation of Description has a rather difficult hashCode implementation, namely: hashCode = getDisplayName().hashCode(). This poses a problem (or not, but in my case it does) when you create multiple instances of the Description class with the same name. Hopefully you are willing to incorporate this minor modification, it would surely make my life easier. Big thanks, Mark Stobbe _________________________________________________________________ De mooiste afbeeldingen van Angelina Jolie vind je met Live Search http://search.live.com/images/results.aspx?q=angelina%20jolie&FORM=MIINTM |
From: David S. <da...@sa...> - 2008-10-13 13:26:23
|
Raj, Feel free to post a patch to the sourceforge issue tracker, and then start discussion here. Fair warning: we grow JUnit fairly slowly, partly through time commitment, partly out of a deliberate attempt not to push users too fast and hard. Be patient. Thanks, David Saff On Wed, Oct 8, 2008 at 7:08 PM, raj_sharath <raj...@ya...> wrote: > > Hi- > > I am working on enhancing the Junit. I was wondering what is the procedure/ > approval process to check-in the code > > Thanks > sharath > -- > View this message in context: http://www.nabble.com/Submit-my-enhancements-to-JUnit-tp19889352p19889352.html > Sent from the JUnit - Dev mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/junit-devel > |
From: David S. <da...@sa...> - 2008-10-13 10:27:33
|
[bcc: junit-devel, +j...@ya...] Anil, 1) Mocking frameworks like jMock are useful for just this kind of interaction testing. 2) Questions about the use of junit are better asked on the user list (ju...@ya...). Good luck, David Saff On Sun, Oct 12, 2008 at 11:44 PM, <ani...@wi...> wrote: > Hi, > > Can we throw an exception to the main class from my test class? > We have a few catch statements in our main class, to test them we need to > send those exceptions from test class, so is there any way? > > > Regards, > Anil > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/junit-devel > > |
From: <ani...@wi...> - 2008-10-13 03:45:08
|
Hi, Can we throw an exception to the main class from my test class? We have a few catch statements in our main class, to test them we need to send those exceptions from test class, so is there any way? Regards, Anil |
From: idan72 <is...@ci...> - 2008-10-10 20:34:09
|
Hi, How can I know when a beforeclass is starting? Today with the listener I can know when test start but I need to also know when @BeforeClass method and @AfterClass method starts. Thanks -- View this message in context: http://www.nabble.com/Listener-for-%40BeforeClass-tp19897763p19897763.html Sent from the JUnit - Dev mailing list archive at Nabble.com. |
From: raj_sharath <raj...@ya...> - 2008-10-08 23:08:17
|
Hi- I am working on enhancing the Junit. I was wondering what is the procedure/ approval process to check-in the code Thanks sharath -- View this message in context: http://www.nabble.com/Submit-my-enhancements-to-JUnit-tp19889352p19889352.html Sent from the JUnit - Dev mailing list archive at Nabble.com. |
From: el y. <don...@gm...> - 2008-09-10 20:30:44
|
Hi Junit-devel, I'm writting for give same sugest. I know few of every thing, also English. Well. I use parameterized with Spring, so I mad distinct kind of test and set values in a xml. The problem is the name of the test. All see the same when I run it. So a change the collection of parameters for a Map where the key is the name. I try to doit, but eclipse make security exception. Next it the code I fix. I know it is not broken. It may be usefull. Sory for may Bad English.... I'll learn more. Yory. package org.junit.runners; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.junit.runner.Runner; import org.junit.runner.notification.RunNotifier; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; import org.junit.runners.model.Statement; import org.junit.runners.model.TestClass; /** * <p> * The custom runner <code>Parameterized</code> implements parameterized tests. * When running a parameterized test class, instances are created for the * cross-product of the test methods and the test data elements. * </p> * * For example, to test a Fibonacci function, write: * * <pre> * @RunWith(Parameterized.class) * public class FibonacciTest { * @Parameters * public static Collection<Object[]> data() { * return Arrays.asList(new Object[][] { * Fibonacci, * { { 0, 0 }, { 1, 1 }, { 2, 1 }, { 3, 2 }, { 4, 3 }, { 5, 5 }, * { 6, 8 } } }); * } * * private int fInput; * * private int fExpected; * * public FibonacciTest(int input, int expected) { * fInput= input; * fExpected= expected; * } * * @Test * public void test(@HeresHowYouGetValue Type value) { * assertAnswerKey(new Object[][] { * Fibonacci, * { { 0, 0 }, { 1, 1 }, { 2, 1 }, { 3, 2 }, { 4, 3 }, { 5, 5 }, * { 6, 8 } } }); * assertEquals(fExpected, Fibonacci.compute(fInput)); * } * } * </pre> * * <p> * Each instance of <code>FibonacciTest</code> will be constructed using the * two-argument constructor and the data values in the * <code>@Parameters</code> method. * </p> */ public class Parameterized extends Suite { /** * Annotation for a method which provides parameters to be injected into the * test class constructor by <code>Parameterized</code> */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public static @interface Parameters { } private class TestClassRunnerForParameters extends BlockJUnit4ClassRunner { private final Object[] fParameterList; private final String name; TestClassRunnerForParameters(Class<?> type, Object[] parameterList, String name) throws InitializationError { super(type); fParameterList= parameterList; this.name= name; } @Override public Object createTest() throws Exception { return getTestClass().getOnlyConstructor().newInstance( computeParams()); } private Object[] computeParams() throws Exception { return fParameterList; } @Override protected String getName() { return name; } @Override protected String testName(final FrameworkMethod method) { return method.getName(); } @Override protected void validateZeroArgConstructor(List<Throwable> errors) { // constructor can, nay, should have args. } @Override protected Statement classBlock(RunNotifier notifier) { return childrenInvoker(notifier); } } private final ArrayList<Runner> runners= new ArrayList<Runner>(); /** * Only called reflectively. Do not use programmatically. */ @SuppressWarnings("unchecked") public Parameterized(Class<?> klass) throws Throwable { super(klass, Collections.<Runner>emptyList()); Object parameters= getParametersList(getTestClass()); if (parameters instanceof Map<?, ?> ) { Map<String, Object[]> parametersMap = (Map<String, Object[]>) parameters ; for (Entry<String, Object[]> e: parametersMap.entrySet()) { runners.add(new TestClassRunnerForParameters(getTestClass().getJavaClass(), e.getValue(), e.getKey())); } } else if (parameters instanceof List<?> ) { List<Object[]> parametersList = (List<Object[]>) parameters; for (int i= 0; i < parametersList.size(); i++) runners.add(new TestClassRunnerForParameters(getTestClass().getJavaClass(), parametersList.get(i), Integer.toString(i))); } } @Override protected List<Runner> getChildren() { return runners; } @SuppressWarnings("unchecked") private List<Object[]> getParametersList(TestClass klass) throws Throwable { return (List<Object[]>) getParametersMethod(klass).invokeExplosively( null); } private FrameworkMethod getParametersMethod(TestClass testClass) throws Exception { List<FrameworkMethod> methods= testClass .getAnnotatedMethods(Parameters.class); for (FrameworkMethod each : methods) { int modifiers= each.getMethod().getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)) return each; } throw new Exception("No public static parameters method on class " + testClass.getName()); } } |
From: Hale,Katherine <ha...@oc...> - 2008-08-28 19:07:29
|
I'm a developer myself, so I should be able to provide some pretty detailed information. Is this the right place to discuss a potential bug? I could just submit a ticket, but I'm hoping it's just user error on my part. I couldn't really find a description of the 4 listservs, just the names and how to subscribe. Thanks! Katherine Hale Web Applications & Software Developer Sogeti USA |
From: Marián P. <Mar...@Su...> - 2008-08-28 10:03:36
|
Hello, I found that the Javadoc published at http://junit.org/junit/javadoc/4.5/ does contain the junit.framework.* packages but the Javadoc contained in the published junit4.5.zip archive does not contain these packages. Are there any plans to update the Javadoc in junit4.5.zip archive? Thank you, Marián Petráš NetBeans developer |
From: Jack W. <ja...@we...> - 2008-08-19 16:20:36
|
David Saff wrote: > Jack, > > Can you also open a bug for the missing build.xml issue? Thanks, > Done, thanks! -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |
From: David S. <da...@sa...> - 2008-08-19 15:27:17
|
Jack, Can you also open a bug for the missing build.xml issue? Thanks, David On Tue, Aug 19, 2008 at 10:58 AM, David Saff <da...@sa...> wrote: > Sacre bleu! You're right. Looks like it's only in CVS for now. I > think it makes sense to put it in the zip, however. Stay tuned. > > David Saff > > On Mon, Aug 18, 2008 at 10:57 AM, Jack Woehr <ja...@we...> wrote: >> David Saff wrote: >>> >>> Sorry, it's in the zip. >> >> Hmm .. just downloaded http://downloads.sourceforge.net/junit/junit4.5.zip >> and there's >> no build.xml in that, either. Again, unless I'm blind :-) >> >> -- >> Jack J. Woehr # "Self-delusion is >> http://www.well.com/~jax # half the battle!" >> http://www.softwoehr.com # - Zippy the Pinhead >> >> > |
From: David S. <da...@sa...> - 2008-08-19 14:58:42
|
Sacre bleu! You're right. Looks like it's only in CVS for now. I think it makes sense to put it in the zip, however. Stay tuned. David Saff On Mon, Aug 18, 2008 at 10:57 AM, Jack Woehr <ja...@we...> wrote: > David Saff wrote: >> >> Sorry, it's in the zip. > > Hmm .. just downloaded http://downloads.sourceforge.net/junit/junit4.5.zip > and there's > no build.xml in that, either. Again, unless I'm blind :-) > > -- > Jack J. Woehr # "Self-delusion is > http://www.well.com/~jax # half the battle!" > http://www.softwoehr.com # - Zippy the Pinhead > > |
From: Jack W. <ja...@we...> - 2008-08-18 15:05:48
|
David Saff wrote: > Sorry, it's in the zip. Hmm .. just downloaded http://downloads.sourceforge.net/junit/junit4.5.zip and there's no build.xml in that, either. Again, unless I'm blind :-) -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |
From: David S. <da...@sa...> - 2008-08-18 15:04:06
|
Forgot (again) to copy list ---------- Forwarded message ---------- From: Peter Laurens <pet...@go...> Date: Mon, Aug 18, 2008 at 11:03 AM Subject: Re: [Junit-devel] JUnit "Could not find class" = Newbie Help To: David Saff <da...@sa...> Hi David, thanks that's a great help, I'll bookmark that address. I didn't actually get an answer, but I resorted to using Eclipse and having it sort out path setup and compilation with JUnit for me rather than do it by hand, and although that wasn't what I wanted to do originally, it did work. Thanks! - Peter On 18 Aug 2008, at 15:57, David Saff wrote: > Peter, > > ju...@ya... is the user list for JUnit, and is more likely > to get you quick responses to such questions. Did you find an answer? > > David > > On Thu, Feb 21, 2008 at 6:10 PM, Peter Laurens > <pet...@go...> wrote: >> >> Hi, >> >> I am seeking a little help getting up and running with JUnit - >> hopefully this is the right list. >> >> I have installed the JUnit jar in my extensions folder, and it works >> properly, however, when I run it I get the error: >> >> "Could not find class: org.xxx.powersim.ModelTest >> Time: 0 >> OK (0 tests) >> Java Result: 1" >> >> >> ModelTest has been compiled properly, and looks like this: >> >> package org.xxx.powersim; >> >> import org.junit.*; >> import static org.junit.Assert.*; >> import java.util.*; >> >> public final class ModelTest { >> >> public static void main(String args[]) { >> org.junit.runner.JUnitCore.main("org.xxx.powersim.ModelTest"); >> } >> >> @Test >> public void testJunit() { >> assertTrue(true); >> } >> } >> >> Pretty simple stuff. >> >> As you can see I'm trying to use the 'main' method of the test to >> execute the test itself... but I've tried running it via the runner >> from the command line also: "java org.junit.runner.JUnitCore >> org.xxx.powersim.ModelTest". I get the same result. >> >> It might be a package issue, so here's how I have things set up in the >> file system: >> >> /PowerSim >> /build >> /org >> /xxx >> /powersim >> - ModelTest.class >> /src >> /org >> /xxx >> /powersim >> -ModelTest.java >> >> >> >> I've tried running it within Ant, by hand, from within TextMate's >> built-in bundle - I get the same result. JUnit is installed and >> running fine, but it can't seem to see the test class - the more I >> think about it this is a package problem that I'm just not sure how to >> fix. I've tried running it by hand in the root /PowerSim directory, in >> the /build folder, and in the /powersim class where ModelTest is. I >> still get the error that "Could not find class: >> org.xxx.powersim.ModelTest". My files compile just fine with my simple >> Ant script which is as follows: >> >> >> >> <?xml version="1.0"?> >> <project name="PowerSim" default="run" basedir="."> >> <property name="src" value="./src"/> >> <property name="build" value="./build"/> >> <property name="compile.debug" value="true"/> >> >> <path id="compile.classpath"> >> <pathelement location="${mysql.jdbc}"/> >> <pathelement location="${junit.jar}"/> >> </path> >> >> <target name="build" depends="init"> >> <javac srcdir="${src}" >> destdir="${build}" >> debug="${compile.debug}" >> source="1.5"> >> <classpath refid="compile.classpath"/> >> </javac> >> </target> >> >> >> <target name="init"> >> <mkdir dir="${build}"/> >> </target> >> >> >> <target name="run" depends="build"> >> <java classname="org.xxx.powersim.Model" >> fork="true" >> dir="${build}" >> classpath="${build}" >> maxmemory="500m"> >> </java> >> </target> >> >> <target name="test" depends="build"> >> <java classname="org.xxx.powersim.ModelTest" >> fork="yes" >> dir="${build}" >> classpath="${build}" >> maxmemory="500m"> >> </java> >> </target> >> >> <target name="clean" description="Removes previous build"> >> <delete verbose="true"> >> <fileset dir="${build}"/> >> </delete> >> </target> >> >> </project> >> >> >> As you can see, I'm not sure what to try next - any help would be much >> appreciated. >> >> Thanks again, >> >> - Peter >> >> >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Junit-devel mailing list >> Jun...@li... >> https://lists.sourceforge.net/lists/listinfo/junit-devel >> |
From: David S. <da...@sa...> - 2008-08-18 14:51:52
|
Martin, Sorry you've waited so long for a response. Unfortunately, Java does not guarantee any correlation between the order in which methods are returned from a reflective query and the source-file order of the methods. Some runtimes (including, it appears, yours), do indeed happen to usually return methods in source-file order, but others may not. So that your tests can run on other runtimes, it's best not to depend on any ordering between @Before methods in the same class. If two things must happen in a given order, you can combine them into one method, or put one in a superclass. David Saff 2008/4/18 Martin Kersten <Mar...@me...>: > Dear jUnit Developers, > > I am using JUnit Version 4.4 and I was facing an unexpected behavior. > Having two @Before methods in my test case I was facing an unexpected > NullPointerException. > > Doing a 30sec digg I came up that JUnit 4 executes @Before and > @BeforeClass methods of the same class in the reverse (and so > unnatural) order. Sure the cookbook states that there is no guarantee > about the order of execution, but this isn't such kind of necessarity. > > The reason for the reverse order can be found in the method > TestCase::getAnnotatedMethods. > > The sequence is: > > foreach class of getSuperClasses(fClass) > do collect all methods annotated with the given annotation > > if annotation is @Before or @BeforeClass //runsTopToButtom > then reverse list of annotated methods. > > Since the whole list of methods is reversed the natural order > (declaration order) of the methods is not preserved and anything > would be executed bottom up even within the same class. > > To change this behavior and to preserve the natural order > (you can guarantee that after imposing the change) it is simply > to reverse the class list (getSuperClasses) rather than the > annotated methods list: > > Enhanced version preserving natural order on class level: > > public List<Method> getAnnotatedMethods( > Class<? extends Annotation> annotationClass) { > List<Method> results= new ArrayList<Method>(); > List<Class<?>> classes = getSuperClasses(fClass); > > if(runsTopToBottom(annotationClass)) > Collection.reverse(classes); > for (Class<?> eachClass : classes) { > Method[] methods= eachClass.getDeclaredMethods(); > for (Method eachMethod : methods) { > Annotation annotation= eachMethod.getAnnotation(annotationClass); > if (annotation != null && ! isShadowed(eachMethod, results)) > results.add(eachMethod); > } > } > } > > Please consider to preserve the natural order in the next release. > It is not feeling correctly and I am quite certain I am not the only one > stumbled accross. > > About backward compatibility: Since the library does not give > any guarantee about the execution order of @Before and > @BeforeClass annotated methods (beside super classes first) > such change in execution order is just a concretion. So introducing > this feature should only make problems if someone rely on an > implementation detail (reverse natural order) and therefore rely > on a non-guranteed feature. > > So please consider to correct this felt inconsitency. > > > Cheers, > > Martin (Kersten) > Email: Mar...@me... > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/junit-devel > > |
From: David S. <da...@sa...> - 2008-08-18 14:44:36
|
Sorry, it's in the zip. The src jar is only to provide source backing for IDE browsing. Can you raise a tracker bug for the website issue? The website seems to have lost 2/3rds of its navigation, so I'm going to ping ObjectMentor for what's going on. Thanks, David Saff On Mon, Aug 18, 2008 at 10:24 AM, Jack Woehr <ja...@we...> wrote: > David Saff wrote: >> >> Jack, >> >> Did you download the src jar or zip from SourceForge? There should be >> a build.xml file in the root of the archive. >> > > Yeah, one would think there would be, but there's not. junit-4.5-src.jar > contains > no build file, no instructions. The website, to the best of my perusal, > offers no > info on building it. Weird, or I'm just blind. > > -- > Jack J. Woehr # "Self-delusion is > http://www.well.com/~jax # half the battle!" > http://www.softwoehr.com # - Zippy the Pinhead > > |
From: David S. <da...@sa...> - 2008-08-18 14:33:37
|
Thanks. Patch applied in spirit, but differently worded. David Saff On Mon, Jun 9, 2008 at 9:29 AM, Nir Soffer <ni...@gm...> wrote: > This patch correct the example of how to run junit from the console. > > Index: doc/cookbook/cookbook.htm > =================================================================== > RCS file: /cvsroot/junit/junit/doc/cookbook/cookbook.htm,v > retrieving revision 1.10 > diff -u -r1.10 cookbook.htm > --- doc/cookbook/cookbook.htm 31 May 2007 14:49:09 -0000 1.10 > +++ doc/cookbook/cookbook.htm 9 Jun 2008 13:28:01 -0000 > @@ -102,7 +102,7 @@ > to define the suite to be run and to display its results. To run > tests and see the > results on the console, run: > <blockquote> > - > < > pre > > > <tt>org.junit.runner.JUnitCore.runClasses(TestClass1.class, ...); > +<pre><tt>java org.junit.runner.JUnitCore TestClass1 > TestClass2 ... > </tt></pre> > </blockquote> > You make your JUnit 4 test classes accessible to a TestRunner > designed to work with earlier versions of JUnit, > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/junit-devel > |
From: Jack W. <ja...@we...> - 2008-08-18 14:33:29
|
David Saff wrote: > Jack, > > Did you download the src jar or zip from SourceForge? There should be > a build.xml file in the root of the archive. > Yeah, one would think there would be, but there's not. junit-4.5-src.jar contains no build file, no instructions. The website, to the best of my perusal, offers no info on building it. Weird, or I'm just blind. -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |
From: David S. <da...@sa...> - 2008-08-18 13:42:13
|
Jack, Did you download the src jar or zip from SourceForge? There should be a build.xml file in the root of the archive. David On Fri, Aug 15, 2008 at 11:11 PM, Jack Woehr <ja...@we...> wrote: > Totally new to JUnit. Have visited junit.org and sourceforge ... can find > no, none, zero documentation on how to build JUnit itself. No build.xml > file, no nothing. Any tips, please? > > -- > Jack J. Woehr # "Self-delusion is > http://www.well.com/~jax # half the battle!" > http://www.softwoehr.com # - Zippy the Pinhead > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Junit-devel mailing list > Jun...@li... > https://lists.sourceforge.net/lists/listinfo/junit-devel > |
From: Jack W. <ja...@we...> - 2008-08-18 02:16:19
|
Georgina Symes wrote: > Hi - I created my own build script which im happy to share: > -Georgi :) > > Ps don't forget to download the hamcrest source code too - you'll need > this to compile jUnit. > Thank you very much Georgina for the script and the advice. -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |
From: Georgina S. <Geo...@ma...> - 2008-08-17 23:16:17
|
Hi - I created my own build script which im happy to share: -Georgi :) Ps don't forget to download the hamcrest source code too - you'll need this to compile jUnit. <?xml version="1.0"?> <project name="JUnit4.4Change" default="all"> <!-- some common default properties--> <property name="build.dir" value="${basedir}/build" /> <property name="config.dir" value="${basedir}/config" /> <property name="src.dir" value="${basedir}/src" /> <property name="test.dir" value="${basedir}/test" /> <property name="classes.dir" value="${build.dir}/classes" /> <property name="test.classes.dir" value="${build.dir}/classes-test" /> <property name="dist.dir" value="${basedir}/dist" /> <target name="all" depends="clean, init, compile, build-jar"> </target> <path id="src.path.id"> <path location="${src.dir}"/> </path> <target name="clean"> <delete dir="${dist.dir}"/> <delete dir="${build.dir}"/> </target> <target name="init"> <delete dir="${dist.dir}"/> <delete dir="${build.dir}"/> <mkdir dir="${dist.dir}" /> <mkdir dir="${build.dir}" /> <mkdir dir="${classes.dir}" /> </target> <target name="compile"> <javac destdir="${classes.dir}" source="1.5" target="1.5" debug="true"> <src refid="src.path.id" /> </javac> </target> <target name="build-jar" depends="compile"> <jar destfile="${dist.dir}/jUnit-dev.jar"> <fileset dir="${classes.dir}"> <include name="**/*.class" /> </fileset> <fileset dir="${src.dir}"> <exclude name="**/*.java" /> </fileset> </jar> </target> </project> -----Original Message----- From: jun...@li... [mailto:jun...@li...] On Behalf Of Jack Woehr Sent: Saturday, 16 August 2008 1:11 PM To: jun...@li... Subject: [Junit-devel] Building JUnit Itself Totally new to JUnit. Have visited junit.org and sourceforge ... can find no, none, zero documentation on how to build JUnit itself. No build.xml file, no nothing. Any tips, please? -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Junit-devel mailing list Jun...@li... https://lists.sourceforge.net/lists/listinfo/junit-devel NOTICE This e-mail and any attachments are confidential and may contain copyright material of Macquarie Group Limited or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Group Limited does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Group Limited. |
From: Fran H. <fra...@ie...> - 2008-08-16 07:02:25
|
I am out of the office until 18/08/2008. I will have no access to email/voice mail during this time. If your email is regarding an existing PMR, please contact the IBM ECM Support via contact numbers as listed in http://www.ibm.com/planetwide. Otherwise I will respond to your message when I return. If you have an urgent question relating to an issue please contact the FRC via the hotline and request to speak directly to my Technical Manager Pick One of the following: Hannu Lindroos (han...@ie...). Douglas Good (dou...@ie...). Colm Phelan (col...@ie...). With kind regards, Fran Hughes Note: This is an automated response to your message "Junit-devel Digest, Vol 18, Issue 1" sent on 15/8/08 20:46:35. This is the only notification you will receive while this person is away. |
From: Jack W. <ja...@we...> - 2008-08-16 03:19:43
|
Totally new to JUnit. Have visited junit.org and sourceforge ... can find no, none, zero documentation on how to build JUnit itself. No build.xml file, no nothing. Any tips, please? -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |