In the quest of getting JUnit tests to be part of how we use Ryhtm we came up with the code snippet below. All went well until we added
@Test
which obviously is a java annotation and uses the @ marker as a syntax element that is also being used by Rythm. How can the desired effect be achieved to get the @annotation? To simply escape the @@ does not work it gives a
Syntax error on token "@", delete this token
error. So How can a Java @ annotation be used ?
I have also filed this as a bug report at https://github.com/greenlaw110/Rythm/issues/285
@// This is a rythm template
@import static org.junit.Assert.*
@import org.junit.Test.*
@def static {
class TestMe {
String name;
@Test
public void testMe() {
name="test";
assertEquals("test",name);
}
}
}
@{
TestMe testme=new TestMe();
testme.name="testme";
}
The TestMe has the name @(testme.name)