Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Unittests for java batch constraints
Unittests for java batch constraints [message #55757] Mon, 02 October 2006 13:57 Go to next message
Eclipse UserFriend
Originally posted by: mystic77.gmx.net

Hi,

I want to write some unit tests (Junit 4 or Junit 3.8) , which test the
behaviour of my implemented java batch constraints.
I want to test the validate method of my constraint class which is
derived from AbstractModelConstraint. I want t to test everything as a
plugin.
Is this possible ?
For any information on this I would be very pleased.

so thanks in advance
david
Re: Unittests for java batch constraints [message #55784 is a reply to message #55757] Mon, 02 October 2006 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

David,

Given a GenModel, you can "Generate Test Code..." to generate much of
the scaffolding you'd need to set up a JUnit test suite. It should be
possible to extend this to also test your constraints.


david wrote:

> Hi,
> I want to write some unit tests (Junit 4 or Junit 3.8) , which test
> the behaviour of my implemented java batch constraints. I want to
> test the validate method of my constraint class which is derived from
> AbstractModelConstraint. I want t to test everything as a plugin. Is
> this possible ? For any information on this I would be very pleased.
> so thanks in advance david
Re: Unittests for java batch constraints [message #56219 is a reply to message #55757] Tue, 03 October 2006 17:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, David,

Yes, this is possible. Have a look at how the
org.eclipse.emf.validation.tests plug-in tests the EMFT Validation
framework, itself, by performing batch validations and observing the
IStatuses that result.

For example, look in the
org.eclipse.emf.validation.internal.service.tests.ModelValid ationServiceTest
class's test_validateBatchSingle() method to see how it invokes validation,
extracts the IStatus results, and uses a convenient
assertAllConstraintsPresent() method to verify the execution of one or more
constraints.

HTH,

Christian


david wrote:

> Hi,
>
> I want to write some unit tests (Junit 4 or Junit 3.8) , which test the
> behaviour of my implemented java batch constraints.
> I want to test the validate method of my constraint class which is
> derived from AbstractModelConstraint. I want t to test everything as a
> plugin.
> Is this possible ?
> For any information on this I would be very pleased.
>
> so thanks in advance
> david
Re: Unittests for java batch constraints [message #593271 is a reply to message #55757] Mon, 02 October 2006 14:03 Go to previous message
Eclipse UserFriend
David,

Given a GenModel, you can "Generate Test Code..." to generate much of
the scaffolding you'd need to set up a JUnit test suite. It should be
possible to extend this to also test your constraints.


david wrote:

> Hi,
> I want to write some unit tests (Junit 4 or Junit 3.8) , which test
> the behaviour of my implemented java batch constraints. I want to
> test the validate method of my constraint class which is derived from
> AbstractModelConstraint. I want t to test everything as a plugin. Is
> this possible ? For any information on this I would be very pleased.
> so thanks in advance david
Re: Unittests for java batch constraints [message #593495 is a reply to message #55757] Tue, 03 October 2006 17:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, David,

Yes, this is possible. Have a look at how the
org.eclipse.emf.validation.tests plug-in tests the EMFT Validation
framework, itself, by performing batch validations and observing the
IStatuses that result.

For example, look in the
org.eclipse.emf.validation.internal.service.tests.ModelValid ationServiceTest
class's test_validateBatchSingle() method to see how it invokes validation,
extracts the IStatus results, and uses a convenient
assertAllConstraintsPresent() method to verify the execution of one or more
constraints.

HTH,

Christian


david wrote:

> Hi,
>
> I want to write some unit tests (Junit 4 or Junit 3.8) , which test the
> behaviour of my implemented java batch constraints.
> I want to test the validate method of my constraint class which is
> derived from AbstractModelConstraint. I want t to test everything as a
> plugin.
> Is this possible ?
> For any information on this I would be very pleased.
>
> so thanks in advance
> david
Previous Topic:programmatically parsing OCL constraints
Next Topic:Can I add my own class path entries to JETEmitter project
Goto Forum:
  


Current Time: Thu May 08 15:06:14 EDT 2025

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

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

Back to the top