Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Problem with JUnitLogger: unexpected AST node
Problem with JUnitLogger: unexpected AST node [message #1713713] Fri, 06 November 2015 07:32 Go to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Hey,

i want to use jenkins for automatic execution and therefor i need to use the Junit Logger to get test results in the right format. I modified my runtime configuration file like this:

[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.

[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).

LogSourceInfo := Yes
SourceInfoFormat := Single
LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
*.JUnitLogger.filename_stem := "MyJunitLogFile"
*.JUnitLogger.testsuite_name := "myJUnitTest"
...


If i run my testsuite with Single Mode Launcher, this error will occur :
unexpected AST node: JUnitLogger[L/AST][startOffset: 355, endOffset: 366, line: 10]

Any ideas what can be the problem ?

[Updated on: Fri, 06 November 2015 07:34]

Report message to a moderator

Re: Problem with JUnitLogger: unexpected AST node [message #1713718 is a reply to message #1713713] Fri, 06 November 2015 07:55 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
If I try to execute the testsuit by commandline:
Fatal error during logging: Static runtime cannot load plugins Exiting.

Its seldom, because i have another project, just next folder to this and there it is working..
Re: Problem with JUnitLogger: unexpected AST node [message #1713722 is a reply to message #1713718] Fri, 06 November 2015 08:37 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Johannes,

the logger plug-ins are loaded dynamically , so please make sure you use the -l switch in Makefile.
For details , please read ch 7.2.1 LoggerPlugins of the reference guide.

I hope this helps

BR Elemer






Re: Problem with JUnitLogger: unexpected AST node [message #1713724 is a reply to message #1713718] Fri, 06 November 2015 08:41 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Okay i found one mistake. If you want to use the Junit Logger you need to build dynamically linked. You can set this option in titan-eclipse under:
-> right click on project -> Properties ->TITAN Project Property -> tick box [ ] link dynamically
Now i can run from commandline and it works and generate junit test results. But with eclipse Titan Execution its still not working..
Re: Problem with JUnitLogger: unexpected AST node [message #1713727 is a reply to message #1713724] Fri, 06 November 2015 08:42 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Very Happy Very Happy again, we are writing at same time the answer.

Thank you Elmer
Re: Problem with JUnitLogger: unexpected AST node [message #1713728 is a reply to message #1713727] Fri, 06 November 2015 08:49 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Johannes,

if you are using the Eclipse plug-ins based on ANTLR 4 , then please be aware that the Executor part is not working properly.
We will fix this in the new release which is due this month.

Thank you for your patience

Best regards

Elemer


Re: Problem with JUnitLogger: unexpected AST node [message #1713745 is a reply to message #1713728] Fri, 06 November 2015 11:46 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Im delight me to early, it didn't execute any testcase because it can not find the modules. Also if i want to execute with ( standard logger) inside Titan Ecplipse Executor, there are no testcases...
I saw in the bin directory the modules will be created now as a shared library, is it necessary to add this path to $LD_LIBRARY path ?

If i call the executable wit parameter -l to see which testcases are included, it will show nothing...

[Updated on: Fri, 06 November 2015 11:52]

Report message to a moderator

Re: Problem with JUnitLogger: unexpected AST node [message #1713757 is a reply to message #1713745] Fri, 06 November 2015 13:00 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

Hi Johannes,

1. Dynamic linking is not possible under windows/cygwin. Are you on Linux or other UNIX OS?
2. The generated modules can be used without setting the LD_LIBRARY_PATH if the program can run.

Let's go step by step. Can you start the HelloWorld (or similar) without JUnit Logger (from cmd line) ? Do you follow the userguide.pdf or the referenceguide.pdf ?
Re: Problem with JUnitLogger: unexpected AST node [message #1713767 is a reply to message #1713713] Fri, 06 November 2015 14:14 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Hey Jeno,

i did go like you suppose and it seems to be a problem creating makefile with titan eclipse. Attached you find once the project for titan eclipse and also just a folder to do it with command line. For last case i create the makefile with:
ttcn3_makefilegen -g -f -l MyExample.ttcn PCOType.cc PCOType.hh MyExample.cfg 

I'm working on a linux system...
Re: Problem with JUnitLogger: unexpected AST node [message #1713955 is a reply to message #1713767] Mon, 09 November 2015 07:00 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
It would be nice, if someone can try to build an run my hello-projects.
I've started analyse the two make files to find out the different.

[Updated on: Mon, 09 November 2015 07:17]

Report message to a moderator

Re: Problem with JUnitLogger: unexpected AST node [message #1713998 is a reply to message #1713955] Mon, 09 November 2015 10:48 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Okay, the problem is if you tick in eclipse the -> right click on project -> Properties ->TITAN Project Property ->Generate the makefile using the Eclipse internal Markefile generator. If you don't check this box, it is possible to run it on command line. But in both cases it is not executable with Titan eclipse executor.
The Makefile is different at some lines:
First is created by eclipse, second by ttcn3_makefilgen
# Flags for the TTCN-3 and ASN.1 compiler:
COMPILER_FLAGS = -lL
# Flags for the TTCN-3 and ASN.1 compiler:
COMPILER_FLAGS = -L  

...
$(EXECUTABLE): $(SHARED_OBJECTS)
	$(CXX) $(LDFLAGS) -o $@ $^ \
	-L$(TTCN3_DIR)/lib -L$(OPENSSL_DIR)/lib -L$(XMLDIR)/lib \
	-l$(TTCN3_LIB) -lcrypto \
	$($(PLATFORM)_LIBS) \
	|| if [ -f $(TTCN3_DIR)/bin/titanver ]; then $(TTCN3_DIR)/bin/titanver $^; else : ; fi

$(EXECUTABLE): $(SHARED_OBJECTS)
	if $(CXX) $(LDFLAGS) -o $@ -Wl,--no-as-needed $^ \
	-L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
	-L$(OPENSSL_DIR)/lib -lcrypto \
	-L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
	then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi

I'm not an expert on makefile and I cant say whats wrong..
Re: Problem with JUnitLogger: unexpected AST node [message #1714008 is a reply to message #1713955] Mon, 09 November 2015 11:41 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

Hi, the Makefiles generated are in single mode. It can be seen from the Makefile:

# Execution mode: (either ttcn3 or ttcn3-parallel)
TTCN3_LIB = ttcn3-dynamic

you should change this for
# Execution mode: (either ttcn3 or ttcn3-parallel)
TTCN3_LIB = ttcn3-parallel-dynamic

This can be done with makefilegen or with manulally editing the Makefile or
from Eclipse by changing the Project properties>TITAN Project Property>Makefile creation attributes>>generate Makefile for single mode(off).

Don't forget to "make clean" before the new make.

There are other problems. To be continued...
Re: Problem with JUnitLogger: unexpected AST node [message #1714009 is a reply to message #1714008] Mon, 09 November 2015 11:45 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

You can always run your program from command line ! It does not depend on the Makefile generator.
Re: Problem with JUnitLogger: unexpected AST node [message #1714028 is a reply to message #1714008] Mon, 09 November 2015 13:20 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Jeno Balasko wrote on Mon, 09 November 2015 11:41
Hi, the Makefiles generated are in single mode. It can be seen from the Makefile:

# Execution mode: (either ttcn3 or ttcn3-parallel)
TTCN3_LIB = ttcn3-dynamic

you should change this for
# Execution mode: (either ttcn3 or ttcn3-parallel)
TTCN3_LIB = ttcn3-parallel-dynamic

This can be done with makefilegen or with manulally editing the Makefile or
from Eclipse by changing the Project properties>TITAN Project Property>Makefile creation attributes>>generate Makefile for single mode(off).

Don't forget to "make clean" before the new make.

There are other problems. To be continued...


Sry i forgot to change in the example which i uploaded...

[Updated on: Mon, 09 November 2015 13:25]

Report message to a moderator

Re: Problem with JUnitLogger: unexpected AST node [message #1714029 is a reply to message #1714009] Mon, 09 November 2015 13:23 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Jeno Balasko wrote on Mon, 09 November 2015 11:45
You can always run your program from command line ! It does not depend on the Makefile generator.

It should but it doesn 't work in the case of dynamically linked... because it doing something different if you use the Eclipse Makefile Creater.

br
Re: Problem with JUnitLogger: unexpected AST node [message #1714051 is a reply to message #1714009] Mon, 09 November 2015 15:00 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

Hi Johanness,

you are right, there is a Titan Eclipse plugin bug: the Makefile generation shall be modified.
Change the Makefile this way:
$(EXECUTABLE): $(SHARED_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ -Wl,--no-as-needed $^ \

instead of
$(EXECUTABLE): $(SHARED_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ \

We fix it immediately so the end of this week it will be available officially.
Waiting your feedback.

/Jeno
Re: Problem with JUnitLogger: unexpected AST node [message #1714064 is a reply to message #1714051] Mon, 09 November 2015 16:33 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

The bugfix has been stored! /Jeno
Re: Problem with JUnitLogger: unexpected AST node [message #1714065 is a reply to message #1713713] Mon, 09 November 2015 16:36 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

Hi Johannes,

It is a bug. Hopefully it will be fixed in the next release (soon).

/Jeno
Re: Problem with JUnitLogger: unexpected AST node [message #1735967 is a reply to message #1713757] Fri, 24 June 2016 06:29 Go to previous messageGo to next message
loraine alpas is currently offline loraine alpasFriend
Messages: 1
Registered: June 2016
Junior Member
Hi Jeno,

"1. Dynamic linking is not possible under windows/cygwin..."
I'm also experiencing the same problem.
Does this mean that there is no way so that I can used JUnitLogger if I'm using Windows?
Re: Problem with JUnitLogger: unexpected AST node [message #1736167 is a reply to message #1735967] Mon, 27 June 2016 08:32 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
HI Loraine,

that is correct;

Titan will work best if used on Linux or Unix.

I would also recommend you to look into Win 10; the anniversary update due this month will bring the possibility to run a Linux subsystem within Windows;
it's not confirmed yet , but we hope to make Titan working on that.

Best regards
Elemer




Previous Topic:Advanced TTCN-3 usage: working with record of structures when performance matters
Next Topic:Is it possible to execute ttcn3 test cases via cli?
Goto Forum:
  


Current Time: Wed Sep 18 23:17:51 GMT 2024

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

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

Back to the top