[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Junit test and Terracotta  XML
Forum Index -> Terracotta Platform
Author Message
hervbarr

journeyman

Joined: 03/30/2012 04:08:38
Messages: 29
Offline

Hi,
is there some tools provided by terracotta to run some tests with junit and maven ?

I have seen that a page exist :
http://www.terracotta.org/confluence/display/tcforge/Testing+Terracotta+with+Maven
But i am not able to see it as I have the message :
You are not permitted to perform this operation.

I have also tried myself but I have some problems with the terracotta-toolkit-1.4-runtime.
The jar contains inner jars which not seem to be seen by the junit runtime.
java.lang.NoClassDefFoundError: com/tc/exception/TCRuntimeException

http://old.nabble.com/junit-runner-td28767800.html shows also that some annotation and utility tests exist but i'm not able to find exactly which depencies I need.
rmahajan

journeyman

Joined: 12/28/2011 21:53:45
Messages: 32
Offline

Hi,

The link to the terracotta maven plugin is : http://forge.terracotta.org/releases/projects/tc-maven-plugin/

Regarding your Junit test, Can you please paste a piece of your test code here.I doubt that you are not initializing the terracotta system properly, as those internal jars would automatically be picked up the internal class loader.

Ridhav
hervbarr

journeyman

Joined: 03/30/2012 04:08:38
Messages: 29
Offline

Hi,
thanks for the link.
I'll look how to start the tcServer before running test and stopping it after these.

I have different kind of tests.
I have some tests where I will use directly the full functionality of terracotta and use a tc server. (I guess the connection to the TC Server will solve the classpath problem).

For some other tests, I would mock the terracotta API (using Mockito) in order to only test my code.
By this way I can check the parameters used to call Terracotta API (Mockito) and other methods which are not using terracotta, speed up the tests by avoiding deployment and connection to a TC server).
But it is in this second case where I don't know how to define correctly the class path.

I added in my maven project dependencies to :
Code:
<dependencies>
     <dependency>
       <groupId>net.sf.ehcache</groupId>
       <artifactId>ehcache-terracotta</artifactId>
     </dependency>
     <dependency>
       <groupId>org.terracotta.toolkit</groupId>
       <artifactId>terracotta-toolkit-1.4-impl</artifactId>
     </dependency>
 </dependencies>



Thanks for answers.
 
Forum Index -> Terracotta Platform
Go to:   
Powered by JForum 2.1.7 © JForum Team