Testing active annotations

37 views
Skip to first unread message

Jesper Eskilson

unread,
Nov 21, 2015, 10:56:54 AM11/21/15
to Xtend Programming Language
I tried writing some tests for my active annotations (using  2.9.0.v201511170433), but the "compile" method described in the documentation does not seem to exist.

package com.iar.jsonrpc.tests

import com.iar.jsonrpc.cpp.JsonRpcCppInterface
import org.eclipse.xtend.core.compiler.batch.XtendCompilerTester
import org.junit.Test

class AnnotationProcessorTest {
    extension XtendCompilerTester compilerTester = XtendCompilerTester.
        newXtendCompilerTester(JsonRpcCppInterface.classLoader)

    @Test
    def void testSimple() {
        compilerTester.compile(
        '''
            @JsonRpcCppInterface
            interface HelloWorld {
                def int foo()
            }
        ''') [
            
        ]
    }
}

This results in a compilation error: "The method compile(String, (Object)=>Object) is undefined for the type XtendCompilerTester".

Am I missing something?

/Jesper

Norbert Sándor

unread,
Nov 30, 2015, 5:02:47 PM11/30/15
to Xtend Programming Language
Your code compiles without problems in my Eclipse.
I use the same Xtend plugin version (with the 2.9.0.rc2 Xtend libraries), and I modified only the classloader part to: "newXtendCompilerTester(class.classLoader)".
--
Norbi

Jesper Eskilson

unread,
Dec 1, 2015, 1:44:00 AM12/1/15
to Xtend Programming Language
Ok, thanks.


--
You received this message because you are subscribed to a topic in the Google Groups "Xtend Programming Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtend-lang/m7OPg2idEyk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xtend-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages