Unittests for java batch constraints [message #55757] |
Mon, 02 October 2006 13:57  |
Eclipse User |
|
|
|
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 #56219 is a reply to message #55757] |
Tue, 03 October 2006 17:40  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.08340 seconds