Re: Testing existing java code with clojure tests from ant / gradle
Hi, that looks really nice, exactly what I need. I just wonder, how do you integrate the clojure source code into your projects? For example, using gradle, is it enough to have a src/test/clj folder and include the clojure jar in the gradle build as a dependency? How did you do that? Best Regards, Sven Am Donnerstag, 16. Oktober 2014 12:06:09 UTC+2 schrieb Mikera: > > I wrote cljunit (https://github.com/mikera/cljunit) to address precisely > this problem. > > cljunit lets you run any clojure.test tests using a simple JUnit test > wrapper. This means you get Eclipse integration etc. for free, and it can > integrate nicely with any build tools that have JUnit support. > > On Wednesday, 15 October 2014 20:17:05 UTC+8, Sven Richter wrote: >> >> Hi, >> >> I have the opportunity to start some clojure here in our office, we are a >> pure java team right now and as I am the only working on this currently I >> would like to run some tests in clojure. Of course, these tests will have >> to test existing java code. >> So ideally, what I would like to do is to take existing projects and add >> some unit tests. These existing projects are build with gradle or ant (we >> are switching to gradle, however, our main libs will be built with ant for >> some time). That means that theses tests will have to be run during the >> gradle / ant build. >> Additionally, as we are developing in eclipse, the tests also have to be >> part of the existing test suites. Is that possible at all? >> >> Are there any examples out there that do something similar? I would like >> to keep the barrier of using the tests as low as possible (I am not talking >> about the development of the tests). >> >> Thanks for every comment, hint, whatever, >> Sven >> > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Testing existing java code with clojure tests from ant / gradle
I wrote cljunit (https://github.com/mikera/cljunit) to address precisely this problem. cljunit lets you run any clojure.test tests using a simple JUnit test wrapper. This means you get Eclipse integration etc. for free, and it can integrate nicely with any build tools that have JUnit support. On Wednesday, 15 October 2014 20:17:05 UTC+8, Sven Richter wrote: > > Hi, > > I have the opportunity to start some clojure here in our office, we are a > pure java team right now and as I am the only working on this currently I > would like to run some tests in clojure. Of course, these tests will have > to test existing java code. > So ideally, what I would like to do is to take existing projects and add > some unit tests. These existing projects are build with gradle or ant (we > are switching to gradle, however, our main libs will be built with ant for > some time). That means that theses tests will have to be run during the > gradle / ant build. > Additionally, as we are developing in eclipse, the tests also have to be > part of the existing test suites. Is that possible at all? > > Are there any examples out there that do something similar? I would like > to keep the barrier of using the tests as low as possible (I am not talking > about the development of the tests). > > Thanks for every comment, hint, whatever, > Sven > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Testing existing java code with clojure tests from ant / gradle
maybe someone will jump in with all the answers, but in the mean time here are some pointers. if you are using clojure.test, then test-out https://github.com/arohner/lein-test-out will format the results so they can show up in continuous integration and eclipse as well if you can get something in it that reads junit reports. - that is a lein plugin of course, so maybe your first task is to make is work outside of lein. i dont have any example code to invoke clojure tests other than from lein but is must be straightforward, just have a read of the 'lein test' code for starters perhaps. with cursive for clojure it is easy to run clj tests from the ide (and see red/green against the tests in the editor). not sure if the eclipse plugin does the same? as for being a part of existing test suites... i guess a parameterized junit test that calls out to clj namespaces to run tests could work. or...why not just use lein for everything instead! we started pure java and getting the build onto lein was the first step for us. if you have some crazy baroque ant thing going on and need to keep it there is probably some way to do that from lein, just as there is from gradle. good luck! On Wednesday, October 15, 2014 1:17:05 PM UTC+1, Sven Richter wrote: > > Hi, > > I have the opportunity to start some clojure here in our office, we are a > pure java team right now and as I am the only working on this currently I > would like to run some tests in clojure. Of course, these tests will have > to test existing java code. > So ideally, what I would like to do is to take existing projects and add > some unit tests. These existing projects are build with gradle or ant (we > are switching to gradle, however, our main libs will be built with ant for > some time). That means that theses tests will have to be run during the > gradle / ant build. > Additionally, as we are developing in eclipse, the tests also have to be > part of the existing test suites. Is that possible at all? > > Are there any examples out there that do something similar? I would like > to keep the barrier of using the tests as low as possible (I am not talking > about the development of the tests). > > Thanks for every comment, hint, whatever, > Sven > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Testing existing java code with clojure tests from ant / gradle
Hi, I have the opportunity to start some clojure here in our office, we are a pure java team right now and as I am the only working on this currently I would like to run some tests in clojure. Of course, these tests will have to test existing java code. So ideally, what I would like to do is to take existing projects and add some unit tests. These existing projects are build with gradle or ant (we are switching to gradle, however, our main libs will be built with ant for some time). That means that theses tests will have to be run during the gradle / ant build. Additionally, as we are developing in eclipse, the tests also have to be part of the existing test suites. Is that possible at all? Are there any examples out there that do something similar? I would like to keep the barrier of using the tests as low as possible (I am not talking about the development of the tests). Thanks for every comment, hint, whatever, Sven -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.