1

I am trying to run a eclipse plugin test that uses OCL, more specifically:

Diagnostic diagnostic = Diagnostician.INSTANCE.validate(modelRoot);

Which works fine if i run it as rightclick -> run as ... -> Eclipse Plugin Test

But if i try to run it via maven (maven install) it fails with the following errormessage:

java.lang.AssertionError: Unable to find delegate to evaluate the 'constraint' on ...

I tried adding

                 <dependency>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>org.eclipse.tycho.surefire.junit4</artifactId>
                    <version>0.14.0</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.ocl</groupId>
                    <artifactId>ecore</artifactId>
                    <version>3.3.0-v20130520-1222</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.emf</groupId>
                    <artifactId>ocl</artifactId>
                    <version>1.1.0-v200706201508</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.emf.query</groupId>
                    <artifactId>ocl</artifactId>
                    <version>1.1.0-v200706071712</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse</groupId>
                    <artifactId>ocl</artifactId>
                    <version>3.4.0-v20140524-1358</version>
                </dependency>

to the tycho dependenncies (in the pom), but without any sucess. I would greatly appreciate any ideas on how to fix this

Simon Eismann
  • 273
  • 1
  • 5
  • 17

1 Answers1

1

to run tycho test you have to configure the target platform for the test first, Please refer to this

hope this helps

Community
  • 1
  • 1
Hisham Khalil
  • 1,054
  • 8
  • 9
  • Hey, sorry it took me so long to answer. I now updated my targetplatform until running install -X lists all elements of my original targetplatform as : [DEBUG] Installation OSGI bundles: [DEBUG] reference:file: any ideas what else might be causing this? – Simon Eismann May 17 '16 at 09:06
  • Deugger revealed that it only fails for some files, not for all if that is relevant – Simon Eismann May 17 '16 at 09:55
  • The problem was that the targetplatform used a new version of Pivot, which requires a different standalone initialisation than the old one. – Simon Eismann May 18 '16 at 23:56