Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] How to write true unit tests in Tycho build

On 06/28/2016 01:35 PM, Alexandre Waris wrote:
David, any succes/update on the subject ?

I also need to run plain old unit test in my Tycho build.

My "solution" seems to work, but I'm sure it's completely wrong-headed and misguided.  Hard to tell.  I couldn't find anyone who both fully understood the mix of technologies and also cared enough to give me a straight answer.

Note that I'm a very long-time Java dev, but I inherited this particular codebase, and this is my first Eclipse plugin project, so I'm not quite used to some of the conventions in use here.

Most of the modules in my build have all of their source in "src".  From my Maven background, I found that odd, but considering that there weren't any existing unit tests in the project, I supposed it was somewhat understandable.  I saw one person indicate that this is a common convention in Tycho builds.

For the one module I have unit tests for, I moved the source folder to "src/main/java" and created "src/test/java", and specified those dirs in the POM.

In the POM in question, I added specific config for "tycho-compiler-plugin" to exclude "**/*Test.java", and I added a config for "maven-surefire-plugin".

With these ingredients, the unit test build and run and the Tycho build are essentially integrated, but separate.  Surefire runs the tests, but Tycho isn't involved.  The Tycho build runs, and it ignores the unit tests.

Thanks

2016-04-07 19:10 GMT+02:00 Jeff MAURY <jeffmaury@xxxxxxxxx>:

I would recommend not to use Maven dependencies but rather osgi ones

Jeff

Le 5 avr. 2016 00:45, "David M. Karr" <davidmichaelkarr@xxxxxxxxx> a écrit :
So I'm now at the point in the Eclipse codebase that I've inherited where I want to write some unit tests (not integration tests), using JUnit and Mockito.  I've used both considerably in the past, but never in a Tycho project.  Normally, I would just add the junit and mockito dependency specs to the pom.  Can I do that, or do I have to have these in p2 repo and add them to my target platform?

When I tried just adding the maven dependencies to the pom, Eclipse was able to see the JUnit dependency, but the mockito dependency seemed to be ignored.

What's the proper procedure here?
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top