George, Saw your request in my last email to run tests in the IDE via JUnit. Again, please try the spring-security examples. When they were first written I also wanted the ability to run/debug from the IDE. These actually use the Spring-Test framework - but use the SpringJUnit4ClassRunner - so that should just pop up as runnable in your IDE. But they will require that you have more dependencies in your classpath to deal with.
As the documentation states, if you write a Story class that is a JUnitStory - or a JUnitStories - that should be visible to the IDE and you just run it. But I don't think that all the examples are written that way. If you want a command line tool to run a test - it really is just as easy as Cristiano put it - even easier with Java6 classpath wildcard capabilities which he shows. And you could easily write your own runner/script if you wanted. I'm sorry that your last project had an ineffective Maven build but that also probably points to a bad Maven build and not Maven itself. Build systems are always good to know - Ant, Maven, Gradle, SBT, Rake - just like languages - can't have too many tools. I'd recommend taking on learning Maven as a key skillset to have. JBehave is used exactly as you want to code/test in quick fashion via JUnit as long as the code is configured for that. Again, I would ask that you look at the spring-security examples. I'd also ask you - and really everyone on this thread to be concious that we are all learning and part of community that is contributing for free. We are trying to help you. We are listening to you. Please be concious of what words we are all using. Hope that helps Brian ----- Original message ----- From: "George Dinwiddie" <[email protected]> To: [email protected] Date: Sat, 17 Dec 2011 13:45:42 -0500 Subject: Re: [jbehave-user] getting started Oh, Cucumber works great. I often use Ruby Cucumber running under JRuby to develop java code. That does require knowing a little Ruby, though. Cucumber-JVM isn't quite fully baked, but seems to be coming along nicely. I guess I've just become too accustomed to fast cycle times to run my tests through Ant or Maven every time. At my recent client site, it took 2.5 minutes to run a single test under Maven, and most of that time was Maven looking through all the tests and discarding the ones that didn't match the desired tag. Such a long time to run a test inhibits running them frequently. I'd expect to be running the story test every 2 to 5 minutes when programming at top speed. Clearly that's not possible with JBehave under Maven. I suspect that this could be greatly improved by running under the JUnit testrunner. It's amazing to me that, in a week of asking, all I can get are aspersions that I don't understand what a classpath is. A week is an incredibly long cycle time. - George On 12/17/11 12:43 PM, Mauro Talevi wrote: > Good luck with Cucumber. > > On 17/12/2011 18:27, George Dinwiddie wrote: >> Mauro, >> >> I'm sorry that JBehave has become a walled garden where people cannot >> get answers to simple questions. >> >> I took care of the dependencies. Having programmed in Java for over a >> decade, I quite understand classpaths. >> >> The example does not run the stories via JUnit, and I can't find >> documentation to tell me how to do that. >> >> I've seen at a client that it takes a very long time to run a single >> story via Maven. It's unacceptably long, to me. I'd hoped that I could >> offer them a better option. I guess that option may have to be >> cucumber-jvm. >> >> - George >> >> On 12/17/11 6:46 AM, Mauro Talevi wrote: >>> George, >>> >>> JBehave supports Maven and Ant as command-line tools to run stories, via >>> custom goals and tasks. >>> >>> In addition, provided you've configured your project correctly, you can >>> use JUnit within an IDE. You can also run via JUnit in command-line, if >>> you choose, but it's up to you to configure the classpath and the run >>> context. Again, you can do it via Maven or Ant. >>> >>> As already noted, you can use Maven support in Eclipse to set up your >>> project and then - once you've generated the .classpath and .project >>> files - forget about Maven. You may consider Maven as witchcraft if you >>> want, but it's witchcraft that works. It allows reproducibility in a >>> declarative way. You don't always need to understand how a tool does >>> something to use it. Various Eclipse distributions already come bundled >>> with m2e plugin, e.g. the Spring one. All you got to do is "Import >>> existing Maven project" and then use it as a normal Eclipse project. >>> >>> But you can't argue with taste. We're not here to convince you of the >>> merits of this or that tool. All we're saying is that these are the >>> tools supported by JBehave. We can only help you if you decide to use >>> them. >>> >>> On 16/12/2011 16:55, George Dinwiddie wrote: >>>> Mauro, >>>> >>>> On 12/15/11 3:49 AM, Mauro Talevi wrote: >>>>> George, >>>>> >>>>> your Eclipse project must be misconfigured. We cannot support every >>>>> possible way of configuring IDEs. This is why we use Maven which all >>>>> IDEs now support to configure projects. >>>> >>>> I'd be happy if you could tell me how to run the JBehave tests of the >>>> gameoflife example via JUnit from the command line. >>>> >>>> If JBehave can ONLY do things using the hidden magic of Maven, then >>>> just say so. If you are so wedded to Maven that you no longer know how >>>> to use JBehave without it, say that. >>>> >>>> - George >>>> >>>> >>>>> >>>>> If you do not wish to use the m2e plugin, I'm afraid we can't help >>>>> you. >>>>> >>>>> >>>>> On 15 Dec 2011, at 04:03, George Dinwiddie<[email protected]> >>>>> wrote: >>>>> >>>>>> Mauro, >>>>>> >>>>>> On 12/14/11 3:52 AM, Mauro Talevi wrote: >>>>>>> Hi George, >>>>>>> >>>>>>> I think I finally understand: you're running the unit tests - which >>>>>>> are >>>>>>> in src/test/java - instead of the stories via JUnit - which are >>>>>>> found in >>>>>>> src/main/java. Look for GridStory and its extensions, e.g. >>>>>>> ICanToggleACell. This you can run via JUnit. >>>>>> >>>>>> Again, how do I do that. When I tried, JUnit said it found no tests. >>>>>> >>>>>> - George >>>>>> >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> On 14/12/2011 04:15, George Dinwiddie wrote: >>>>>>>> Resending, as this message just bounced back from last Saturday. >>>>>>>> >>>>>>>> Mauro, >>>>>>>> >>>>>>>> On 12/10/11 11:54 AM, Mauro Talevi wrote: >>>>>>>>> Well, you gotta use some system to fetch the dependencies and set >>>>>>>>> the >>>>>>>>> classpath. >>>>>>>> >>>>>>>> Yes, I've done that. As I said, the junit tests in the gameoflife >>>>>>>> example runs. I cannot figure out how to run the jbehave story >>>>>>>> tests. >>>>>>>> >>>>>>>> I'm starting to feel like you're not reading all the way through my >>>>>>>> posts. >>>>>>>> >>>>>>>> - George >>>>>>>> >>>>>>>> >>>>>>>>> The recommendation is to use either the Maven or Ant support in >>>>>>>>> Eclipse >>>>>>>>> to do that. Else, it's very hard for us to help you. For example, >>>>>>>>> the >>>>>>>>> Maven integration in Eclipse works very well and you don't need >>>>>>>>> to be a >>>>>>>>> Maven guru to use it. It simply reads the POM to set up your >>>>>>>>> Eclipse >>>>>>>>> project and classpath. >>>>>>>>> >>>>>>>>> On Sat Dec 10 16:46:50 2011, George Dinwiddie wrote: >>>>>>>>>> Mauro, >>>>>>>>>> >>>>>>>>>> I'm trying to execute the stories via Eclipse. I'm not using Ant. >>>>>>>>>> >>>>>>>>>> - George >>>>>>>>>> >>>>>>>>>> On 12/10/11 9:24 AM, Mauro Talevi wrote: >>>>>>>>>>> George, >>>>>>>>>>> >>>>>>>>>>> the example for Ant exists already. If you look at the list of >>>>>>>>>>> examples, >>>>>>>>>>> you'll find the trader-ant example with a standalone build.xml >>>>>>>>>>> (and >>>>>>>>>>> also >>>>>>>>>>> referred to in >>>>>>>>>>> http://jbehave.org/reference/stable/running-examples.html) >>>>>>>>>>> >>>>>>>>>>> I've added a README file with further instructions, but the >>>>>>>>>>> build.xml is >>>>>>>>>>> already self-explanatory for someone familiar with Ant. >>>>>>>>>>> >>>>>>>>>>> The trader-ant example can be used both in command-line: e.g. >>>>>>>>>>> ant >>>>>>>>>>> build >>>>>>>>>>> -Djbehave.version=3.5.4 and in IDE, after adding the jars to the >>>>>>>>>>> classpath. The jars are downloaded to the target/lib directory >>>>>>>>>>> by the >>>>>>>>>>> command-line ant task. >>>>>>>>>>> >>>>>>>>>>> Note that the src of the example resides in ../trader/src/main >>>>>>>>>>> - so >>>>>>>>>>> you'll need to either copy it or point to it. The ant >>>>>>>>>>> build.xml is >>>>>>>>>>> configured to use it. >>>>>>>>>>> >>>>>>>>>>> Hope that helps. Cheers >>>>>>>>>>> >>>>>>>>>>> On 10/12/2011 05:25, George Dinwiddie wrote: >>>>>>>>>>>> Mauro, >>>>>>>>>>>> >>>>>>>>>>>> On 12/9/11 12:47 PM, Mauro Talevi wrote: >>>>>>>>>>>>> George, >>>>>>>>>>>>> >>>>>>>>>>>>> thanks for the feedback - always appreciated - but I'm rather >>>>>>>>>>>>> puzzled as >>>>>>>>>>>>> to some of your example comments. E.g. >>>>>>>>>>>>> >>>>>>>>>>>>> "I would expect >>>>>>>>>>>>> http://jbehave.org/reference/stable/running-examples.html to >>>>>>>>>>>>> tell >>>>>>>>>>>>> me how >>>>>>>>>>>>> to execute the examples, preferably in different ways". To me >>>>>>>>>>>>> that's >>>>>>>>>>>>> what the page does. >>>>>>>>>>>> >>>>>>>>>>>> Oh, it leaves me puzzled. I suppose if I were an expert at >>>>>>>>>>>> Maven, it >>>>>>>>>>>> would be clear to me. But I'm not, and becoming an expert in >>>>>>>>>>>> Maven >>>>>>>>>>>> isn't my current goal. What should I type on the command line >>>>>>>>>>>> to run >>>>>>>>>>>> the gameoflife example? >>>>>>>>>>>> >>>>>>>>>>>>> Similarly, you when you say that "it took a small note (not >>>>>>>>>>>>> prominently >>>>>>>>>>>>> displayed) on from >>>>>>>>>>>>> http://jbehave.org/reference/stable/dependencies.html >>>>>>>>>>>>> that lead me to the POM file that downloaded the >>>>>>>>>>>>> dependencies." >>>>>>>>>>>>> >>>>>>>>>>>>> On that page, under the "Apache Ant" section, it's the >>>>>>>>>>>>> first and >>>>>>>>>>>>> most >>>>>>>>>>>>> prominent things it says. >>>>>>>>>>>> >>>>>>>>>>>> Yes, I suppose if I'd been trying to use Ant, I would have >>>>>>>>>>>> notice >>>>>>>>>>>> that. I was just trying to resolve the dependencies after >>>>>>>>>>>> loading the >>>>>>>>>>>> source into Eclipse. I don't normally set up an Ant build.xml >>>>>>>>>>>> just to >>>>>>>>>>>> compile some example code. >>>>>>>>>>>> >>>>>>>>>>>>> And in the "Getting Started" page, it states under the "Run >>>>>>>>>>>>> Story" >>>>>>>>>>>>> section: >>>>>>>>>>>>> >>>>>>>>>>>>> "Be sure to check that you have all the required dependencies >>>>>>>>>>>>> <http://jbehave.org/reference/stable/dependencies.html> in >>>>>>>>>>>>> your >>>>>>>>>>>>> classpath." >>>>>>>>>>>>> >>>>>>>>>>>>> Perhaps, you could contribute some documentation that >>>>>>>>>>>>> explains the >>>>>>>>>>>>> getting started from your point of view and how you'd like it >>>>>>>>>>>>> explained. >>>>>>>>>>>>> We're always happy to improve via users' contributions. >>>>>>>>>>>> >>>>>>>>>>>> If I could get started, perhaps I could do that. >>>>>>>>>>>> >>>>>>>>>>>> A small and simple example that actually specified what I had >>>>>>>>>>>> to put >>>>>>>>>>>> on the classpath and what I had to type on the command line >>>>>>>>>>>> would >>>>>>>>>>>> go a >>>>>>>>>>>> long way. I can build on a small success. I'm stymied when it >>>>>>>>>>>> doesn't >>>>>>>>>>>> do anything at all. >>>>>>>>>>>> >>>>>>>>>>>> What is the simplest and smallest way to get started? >>>>>>>>>>>> >>>>>>>>>>>>> As for the running of examples, what's written in the Getting >>>>>>>>>>>>> Started >>>>>>>>>>>>> page is just a guideline. You should try to run an example >>>>>>>>>>>>> from the >>>>>>>>>>>>> ones >>>>>>>>>>>>> in source code and if it fails tell us how you're running >>>>>>>>>>>>> it. Or >>>>>>>>>>>>> contribute your own example. >>>>>>>>>>>> >>>>>>>>>>>> I recounted how it fails: >>>>>>>>>>>>>> It says, "Open your favourite IDE, the ICanToggleACell.java >>>>>>>>>>>>>> class >>>>>>>>>>>>>> will allow itself to run as a JUnit test." In Eclipse, >>>>>>>>>>>>>> JUnit is >>>>>>>>>>>>>> reporting "no tests found." >>>>>>>>>>>> >>>>>>>>>>>> What do you mean "allow itself to run as a JUnit test?" It >>>>>>>>>>>> seems >>>>>>>>>>>> to be >>>>>>>>>>>> hiding from JUnit, in my limited experience. >>>>>>>>>>>> >>>>>>>>>>>> - George >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> Cheers >>>>>>>>>>>>> >>>>>>>>>>>>> On 09/12/2011 16:03, George Dinwiddie wrote: >>>>>>>>>>>>>> Mauro, >>>>>>>>>>>>>> >>>>>>>>>>>>>> On 12/9/11 7:39 AM, Mauro Talevi wrote: >>>>>>>>>>>>>>> Hi George, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> have you look at >>>>>>>>>>>>>>> http://jbehave.org/reference/stable/getting-started.html? >>>>>>>>>>>>>> >>>>>>>>>>>>>> Yes, that's the page I started with. It's remarkably light on >>>>>>>>>>>>>> examples. >>>>>>>>>>>>>> >>>>>>>>>>>>>> It says, "Open your favourite IDE, the ICanToggleACell.java >>>>>>>>>>>>>> class >>>>>>>>>>>>>> will >>>>>>>>>>>>>> allow itself to run as a JUnit test." In Eclipse, JUnit is >>>>>>>>>>>>>> reporting >>>>>>>>>>>>>> "no tests found." >>>>>>>>>>>>>> >>>>>>>>>>>>>>> The http://jbehave.org is just a wordpress facade to >>>>>>>>>>>>>>> multiple >>>>>>>>>>>>>>> reference >>>>>>>>>>>>>>> guides, but it may be better to replace it with a static >>>>>>>>>>>>>>> frontend to >>>>>>>>>>>>>>> that it'd be easier to navigate to docs and control the >>>>>>>>>>>>>>> contents of >>>>>>>>>>>>>>> the >>>>>>>>>>>>>>> welcome page. >>>>>>>>>>>>>> >>>>>>>>>>>>>> If I may be so bold, I'd suggest that a reader focus might >>>>>>>>>>>>>> be more >>>>>>>>>>>>>> helpful. Think about the goals in the minds of the users who >>>>>>>>>>>>>> come to >>>>>>>>>>>>>> the site, and offer pages for those goals. >>>>>>>>>>>>>> >>>>>>>>>>>>>> For example, I would expect >>>>>>>>>>>>>> http://jbehave.org/reference/stable/running-examples.html to >>>>>>>>>>>>>> tell me >>>>>>>>>>>>>> how to execute the examples, preferably in different ways >>>>>>>>>>>>>> (e.g. >>>>>>>>>>>>>> from >>>>>>>>>>>>>> Maven, Ant, JUnit, Command Line). Instead, the information is >>>>>>>>>>>>>> rather >>>>>>>>>>>>>> sketchy. For example, it took a small note (not prominently >>>>>>>>>>>>>> displayed) >>>>>>>>>>>>>> on from >>>>>>>>>>>>>> http://jbehave.org/reference/stable/dependencies.html that >>>>>>>>>>>>>> lead me to the POM file that downloaded the dependencies. >>>>>>>>>>>>>> (More >>>>>>>>>>>>>> dependencies than I needed for getting started, even though >>>>>>>>>>>>>> a few >>>>>>>>>>>>>> failed. I suspect obsolescence in the POM.) I've spent much >>>>>>>>>>>>>> time >>>>>>>>>>>>>> wandering the website looking for tidbits of information >>>>>>>>>>>>>> that might >>>>>>>>>>>>>> prove helpful. >>>>>>>>>>>>>> >>>>>>>>>>>>>>> For the examples, they are mostly using Maven but there are >>>>>>>>>>>>>>> also >>>>>>>>>>>>>>> Ant-based ones: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> http://jbehave.org/reference/stable/examples-modules.html >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> In any case, to answer your question: yes, you can run the >>>>>>>>>>>>>>> stories in >>>>>>>>>>>>>>> multiple ways: either in IDE or in CLI, via Ant or Maven. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> You've been able to run the Story via JUnit in IDE. Have a >>>>>>>>>>>>>>> look >>>>>>>>>>>>>>> at the >>>>>>>>>>>>>>> examples for running in CLI. >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'm not yet able to run this story via JUnit in the IDE. >>>>>>>>>>>>>> That's why >>>>>>>>>>>>>> I'm asking here. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Which of the examples shows running in CLI? I don't see >>>>>>>>>>>>>> anything in >>>>>>>>>>>>>> the gameoflife example that makes that clear to me. >>>>>>>>>>>>>> >>>>>>>>>>>>>> - George >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Cheers >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> On 08/12/2011 15:39, George Dinwiddie wrote: >>>>>>>>>>>>>>>> I'm finding it surprisingly difficult to get started with >>>>>>>>>>>>>>>> JBehave, >>>>>>>>>>>>>>>> when I find Cucumber so easy to use. Mostly it's my >>>>>>>>>>>>>>>> unfamiliarity >>>>>>>>>>>>>>>> with >>>>>>>>>>>>>>>> Maven, but some of it seems to be difficulty in finding >>>>>>>>>>>>>>>> current >>>>>>>>>>>>>>>> information on jbehave.org. Please bear with my ignorant >>>>>>>>>>>>>>>> questions >>>>>>>>>>>>>>>> and >>>>>>>>>>>>>>>> help me move forward. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> I've got the gameoflife example loaded into Eclipse. It >>>>>>>>>>>>>>>> compiles >>>>>>>>>>>>>>>> and >>>>>>>>>>>>>>>> runs the junit tests. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> My current question: How can I run the stories either from >>>>>>>>>>>>>>>> the >>>>>>>>>>>>>>>> command >>>>>>>>>>>>>>>> line or within the Eclipse junit runner? >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> thanks, >>>>>>>>>>>>>>>> George >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> --------------------------------------------------------------------- >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> To unsubscribe from this list, please visit: >>>>>>>>>>> >>>>>>>>>>> http://xircles.codehaus.org/manage_email >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> --------------------------------------------------------------------- >>>>>>>>> >>>>>>>>> >>>>>>>>> To unsubscribe from this list, please visit: >>>>>>>>> >>>>>>>>> http://xircles.codehaus.org/manage_email >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> --------------------------------------------------------------------- >>>>>>> >>>>>>> To unsubscribe from this list, please visit: >>>>>>> >>>>>>> http://xircles.codehaus.org/manage_email >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> -- >>>>>> ---------------------------------------------------------------------- >>>>>> >>>>>> * George Dinwiddie * http://blog.gdinwiddie.com >>>>>> Software Development http://www.idiacomputing.com >>>>>> Consultant and Coach http://www.agilemaryland.org >>>>>> ---------------------------------------------------------------------- >>>>>> >>>>>> >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe from this list, please visit: >>>>>> >>>>>> http://xircles.codehaus.org/manage_email >>>>>> >>>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe from this list, please visit: >>>>> >>>>> http://xircles.codehaus.org/manage_email >>>>> >>>>> >>>>> >>>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >>> >> > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --- Brian Repko LearnThinkCode, Inc. http://www.learnthinkcode.com email: [email protected] phone: +1 612 229 6779 --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
