Re: JUnit test method generation
Hi Ramsey, You should try the moreUnit plug-in for Eclipse. It is capable of adding single method stubs for already existing test classes. It needs a bit of adjustment so it can find your test classes, but if you have some naming convention for your test classes you should be OK. Here's the link: http://moreunit.sourceforge.net/index.html Cheers, Katya On Dec 13, 2009, at 2:30 AM, Ramsey Lee Gurley wrote: On Dec 12, 2009, at 7:02 PM, Ray Kiddy wrote: On Dec 12, 2009, at 8:14 AM, Ramsey Lee Gurley wrote: Hi all, I'm wondering if there is an easier way to generate a JUnit test method stub for a test class that already exists. Let's say I have a class Foo with method bar(). When I generate the JUnit test FooTest in eclipse, I can select the methods and generate the source stub for testBar() and all the other methods on the class. Now if I add the method baz(), is there an easy way to generate the stub for that test method, or do I have to key them in manually ever after? Is there some way to link the two classes so that Eclipse automatically generates the test methods as new methods are added to the class? Ramsey ___ You are asking for a sort of "eogeneration" for junit tests. (In other words, the "EOGenerate" keeps a model and the java file synchronized and an analogous thing would be useful for junit tests.) This is not a bad idea. It does seem like a good idea. But, looking at what eclipse provides now, it seems clear that this is not available now. - ray It doesn't even have to go that far, really. I'm just hoping for something like 'generate getters/setters' where it gives you a list of checkboxes and greys out the ones you already have. But it doesn't appear that there's any way to choose an existing test class and insert new tests into it. It always generates a new one. Which means I have to generate a temporary one with all the methods, copy the body, paste it into the old class, then go though the thing deleting the dupes. Yuck :-/ Ramsey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/katya.yurukova%40tuparev.com This email sent to katya.yuruk...@tuparev.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: JUnit test method generation
On Dec 12, 2009, at 7:02 PM, Ray Kiddy wrote: > > On Dec 12, 2009, at 8:14 AM, Ramsey Lee Gurley wrote: > >> Hi all, >> >> I'm wondering if there is an easier way to generate a JUnit test method stub >> for a test class that already exists. Let's say I have a class Foo with >> method bar(). When I generate the JUnit test FooTest in eclipse, I can >> select the methods and generate the source stub for testBar() and all the >> other methods on the class. Now if I add the method baz(), is there an easy >> way to generate the stub for that test method, or do I have to key them in >> manually ever after? Is there some way to link the two classes so that >> Eclipse automatically generates the test methods as new methods are added to >> the class? >> >> Ramsey >> >> ___ > > You are asking for a sort of "eogeneration" for junit tests. (In other words, > the "EOGenerate" keeps a model and the java file synchronized and an > analogous thing would be useful for junit tests.) This is not a bad idea. It > does seem like a good idea. But, looking at what eclipse provides now, it > seems clear that this is not available now. > > - ray > It doesn't even have to go that far, really. I'm just hoping for something like 'generate getters/setters' where it gives you a list of checkboxes and greys out the ones you already have. But it doesn't appear that there's any way to choose an existing test class and insert new tests into it. It always generates a new one. Which means I have to generate a temporary one with all the methods, copy the body, paste it into the old class, then go though the thing deleting the dupes. Yuck :-/ Ramsey smime.p7s Description: S/MIME cryptographic signature ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: JUnit test method generation
On Dec 12, 2009, at 8:14 AM, Ramsey Lee Gurley wrote: Hi all, I'm wondering if there is an easier way to generate a JUnit test method stub for a test class that already exists. Let's say I have a class Foo with method bar(). When I generate the JUnit test FooTest in eclipse, I can select the methods and generate the source stub for testBar() and all the other methods on the class. Now if I add the method baz(), is there an easy way to generate the stub for that test method, or do I have to key them in manually ever after? Is there some way to link the two classes so that Eclipse automatically generates the test methods as new methods are added to the class? Ramsey ___ You are asking for a sort of "eogeneration" for junit tests. (In other words, the "EOGenerate" keeps a model and the java file synchronized and an analogous thing would be useful for junit tests.) This is not a bad idea. It does seem like a good idea. But, looking at what eclipse provides now, it seems clear that this is not available now. - ray ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
JUnit test method generation
Hi all, I'm wondering if there is an easier way to generate a JUnit test method stub for a test class that already exists. Let's say I have a class Foo with method bar(). When I generate the JUnit test FooTest in eclipse, I can select the methods and generate the source stub for testBar() and all the other methods on the class. Now if I add the method baz(), is there an easy way to generate the stub for that test method, or do I have to key them in manually ever after? Is there some way to link the two classes so that Eclipse automatically generates the test methods as new methods are added to the class? Ramsey smime.p7s Description: S/MIME cryptographic signature ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: JUnit4 testing of EOs: InvocationTargetException on subsequent runs
On 11/12/2009, at 6:34 PM, Paul Hoadley wrote: > On 11/12/2009, at 4:41 PM, Q wrote: > >> I ran into this recently too. It seemed to resolve itself after I did the >> following: >> >> 1. Update wonder >> 2. Ensure all tests classes that use EOF inherit from ERXTestCase > > I'm somewhat of a JUnit novice: wouldn't that result in mixing the JUnit3 and > JUnit4 APIs? ERXTestCase extends junit.framework.TestCase which has the old > prescribed method names like setUp(). I'm trying to work to JUnit4, using > the @Before, @BeforeClass, @Test annotations, and so on. Or doesn't it > matter? > The actual inheritance isn't really that important, only that Wonder / EOF is initialised correctly, which ERXTestCase does for you. >> 3. Add the framework to a test app (the tests were part of a framework) >> 4. Create a run configuration for the tests that runs from the test app's >> build folder >> >> The problem I was having seemed to stem from the model somehow being >> unsuccessfully loaded twice, how this happened, or why the failures were >> unpredictable I didn't have the time to determine. > > Thanks Q, I'll try this out. > > > -- > Paul. > > w http://logicsquad.net/ > h http://paul.hoadley.name/ > > -- Seeya...Q Quinton Dolan - qdo...@gmail.com Gold Coast, QLD, Australia (GMT+10) ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Actions from D2W pages
I've created my own custom look that removes the edit and inspect actions on a list page in favour of using a pagecontroller. I subclassed the erdcontrollerbutton to redo the list of actions as an unordered list of list suitable for css styling and it works well. I didn't then need to have direct actions so I left it at that. I need sessions so component actions work perfectly. My (naive) suggested answer (without trying it) is to use a dedicated d2w list page subclass remove all actions in favour of buttons that use direct actions. -- Dr. Mark Wardle Specialist registrar, Neurology (Sent from my mobile) On 11 Dec 2009, at 20:20, Daniel Beatty wrote: Greetings Anjo and Dave, It does answer the question. Ouch. For one paper, I can use D2W with the session based components to demonstrate the point and test the business logic. The D2JC route that Dave is suggesting may be a useful solution. The size of this database may be a prohibitive factor. In this case, what I would need the D2JC app to do is literally read information out of the ugly database , organize the data in a pretty way, and copy the data into the pretty database.Does D2JC allow for console type applications? In this case, it would be nice to use it in conjunction with a cluster/ grid. A D2JC lesson would definitely be nice. I hear that Northern Virginia is having such a thing coming up next Tuesday. If we could work the iChat telecom, we could probably work that. In any case, if I get this working it would make one heck of a success story for the WO community. Thank you, Dan Beatty, M.S. CS (B.S. EECS) Ph.D. Student Texas Tech University dan.bea...@mac.com http://venus.cs.ttu.edu/~dabeatty http://web.me.com/danielbeatty/My_Home_Page/Welcome.html On Dec 11, 2009, at 11:29 AM, Anjo Krank wrote: I have a question on this thread. In the case of a read-only part of D2W, is there a way to force all actions to be "Direct Actions" to avoid the session driven "Component Actions"? Short answer: No. The component action redirector does something different. When you use it, you still have /wo/ urls, but when the page they are on will have a direct action url. The long answer is: you need to create a lot of property level components and a lot of pages. Each time you create a link or button, you will need to. If you want to do this, you can avoid the actual /wo/ url. But you *will* need a session for D2W to work. So at the least, you need setStoresSessionInCookies(true). In this case, I happen to have a fairly gross application where the database is relational only in the sense that it is stored in a MySQL database. It has no keys of any kind (primary, foreign or skeleton). The only reason to make this app is basically to access a legacy database and supply the means to translate its data to a cleanly devise scheme with appropriate keys and relations. Not sure how this relates to your question? Cheers, Anjo ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/mark %40wardle.org This email sent to m...@wardle.org ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com