Project

General

Profile

Actions

Bug #5103

closed

[efsm][simulator][execution] ReferenceEfsmTestGeneratorTest -> NullPointerException

Added by Sergey Smolov over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
07/18/2014
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

Тест ReferenceEfsmTestGeneratorTest падает со следующим логом:

Running test case gml printer: efsm-model
End test.

java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:514)
at java.util.Properties.setProperty(Properties.java:161)
at java.lang.System.setProperty(System.java:787)
at ru.ispras.fortress.solver.Environment.setSolverPath(Environment.java:46)
at ru.ispras.retrascope.engine.efsm.simulator.execution.ReferenceEfsmTestGeneratorTest.createObjects(ReferenceEfsmTestGeneratorTest.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:24)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Также нужно переименовать его в ReferenceEfsmTestGeneratorTestCase в соответствии с принятой в проекте конвенцией.

Actions #1

Updated by Igor Melnichenko over 9 years ago

По поводу ошибки:
The system property fortress.solver.path must be set to a full path to a
solver executable file in order to run tests related to EFSM simulation and
generation.

По поводу названия:
где можно ознакомиться с конвенцией?

Actions #2

Updated by Sergey Smolov over 9 years ago

Хорошо бы также отразить нововведение в Wiki, в частности тут:

http://forge.ispras.ru/projects/retrascope/wiki/Used_Tools

Там до сих пор написано следующее:

For solver to be found a SMT_SOLVER_PATH system variable should be created with value "path/to/solver/directory".

Кстати, почему в качестве способа хранения пути к исполняемому файлу решателя выбраны именно system properties, а не environment variables?

"Конвенция" вкратце описана тут: http://forge.ispras.ru/projects/retrascope/wiki/Project_Structure

Actions #3

Updated by Igor Melnichenko over 9 years ago

  • Status changed from New to Closed

Wiki обновил.
По поводу замены переменной среды на системное свойство: такой вариант мне кажется более логичным (в плане области видимости) и более удобным в использовании.

Actions #4

Updated by Sergey Smolov over 9 years ago

  • Status changed from Closed to Open

Не надо закрывать тикеты, созданные не тобой. Если считаешь, что задача решена, поставь статус Resolved - это позволяет избежать трудностей при поиске "закрытого" тикета.

Мне все-таки решительно непонятен механизм, с помощью которого ты выставляешь значение системного свойства.
Системными свойствами обычно пользуются, чтобы прямо в Java-коде выставить значение (System.setProperty), разве нет?

Actions #5

Updated by Igor Melnichenko over 9 years ago

Системные свойства выставляются при запуске JVM при помощи ключа -D (например, -Dfortress.solver.path="C:\z3-4.3.0-x64\bin\z3.exe").
Этим мне они и нравятся: тот же путь к Z3 так можно сделать атрибутом конкретного экземпляра Retrascope, а не всей среды пользователя.

Actions #6

Updated by Sergey Smolov over 9 years ago

Предлагается компромиссное решение - проверяем системное свойство, если оно не установлено - системную переменную SMT_SOLVER_PATH, если и она не установлена - выводим соответствующее сообщение об ошибке.

Actions #7

Updated by Igor Melnichenko over 9 years ago

Готово.

Actions #8

Updated by Igor Melnichenko over 9 years ago

  • Status changed from Open to Resolved
Actions #9

Updated by Sergey Smolov over 9 years ago

  • Status changed from Resolved to Closed

Да, этот тест теперь проходит, спасибо.

Actions

Also available in: Atom PDF