Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » my EMF model generated tests...
my EMF model generated tests... [message #892340] Wed, 27 June 2012 19:37 Go to next message
Sharon Snyder is currently offline Sharon SnyderFriend
Messages: 56
Registered: September 2010
Member

Hi,

I am trying to finally get some Junit tests running on my EMF model. The EMF model was created and code was generated for an RCP application. The model plugin itself "should" be standalone - right?

Well, my question is this: I generated the test code from the .genmodel. It created a project with appropriately stubbed out code. I try to run one of the resulting XXXTest.java files as Run As->Junit test .... and it fails to be able to load the class.

Is there a tutorial or information out there on doing this? I am just trying to test the model only - just create an object, or series of objects in my model, and verify that it is then providing the data I expect. This way we can create some automated tests that don't rely on the GUI display, and can test other aspects of the product.

I hope someone out there can help!

-Sharon
Re: my EMF model generated tests... [message #892397 is a reply to message #892340] Thu, 28 June 2012 06:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Sharon,

Comments below.

On 27/06/2012 9:37 PM, Sharon Snyder wrote:
> Hi,
>
> I am trying to finally get some Junit tests running on my EMF model.
> The EMF model was created and code was generated for an RCP
> application. The model plugin itself "should" be standalone - right?
This only affects the generated editor; the model and edit bundles as
well as the EMF runtime and EMF Edit always function stand alone.
>
> Well, my question is this: I generated the test code from the
> .genmodel. It created a project with appropriately stubbed out code.
> I try to run one of the resulting XXXTest.java files as Run As->Junit
> test .... and it fails to be able to load the class.
I tried it locally just now, and that worked for me. By "the class"
which class do you mean?
> Is there a tutorial or information out there on doing this? I am just
> trying to test the model only - just create an object, or series of
> objects in my model, and verify that it is then providing the data I
> expect.
Can you run the XyzExample as a Java application or does that have class
loading problems too?
> This way we can create some automated tests that don't rely on the GUI
> display, and can test other aspects of the product.
Did you modify the classpath of your model or tests?
>
> I hope someone out there can help!
>
> -Sharon


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: my EMF model generated tests... [message #892505 is a reply to message #892397] Thu, 28 June 2012 13:34 Go to previous message
Sharon Snyder is currently offline Sharon SnyderFriend
Messages: 56
Registered: September 2010
Member

Hi Ed,

I'm not sure what I changed....but with your hint I got it working. I basically removed the whole project, had the genmodel recreate it and voila! It worked!

I think it had something to do with the pom file associated with it at the time. It was probably changed early on when we were creating our product build (tycho/maven) and we never looked at the .tests projects until now!

Thanks!!

Sharon
Previous Topic:[CDO] Installing on E4.2
Next Topic:Collecting XMI files backing an entire EMF Model
Goto Forum:
  


Current Time: Tue Apr 23 12:16:23 GMT 2024

Powered by FUDForum. Page generated in 0.03520 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top