apache-flex 在linux上设置flex单元

8cdiaqws  于 2022-11-01  发布在  Apache
关注(0)|答案(1)|浏览(193)

我正在做一个使用Flex的项目,到目前为止,我们使用Windows来运行需要Flex环境的模块/工件的Flex单元测试。由于给定的依赖关系,很难自动化任何东西,因为我必须在Linux/Windows之间切换运行那些Maven测试。
我已经努力尝试在linux上运行flex单元测试,但是还没有成功。下面是一个flex项目上maven clean test -X的堆栈跟踪的一小部分。

[INFO] Flexmojos 3.8
[INFO]   Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests /root/trunk/flex-project/flex-surface/flex-surface-common/flex-surface-common-flex/target/test-classes/TestRunner.swf
[DEBUG] [org.sonatype.flexmojos.test.monitor.AsVmPing] opened server socket on port 13540
[DEBUG] [org.sonatype.flexmojos.test.monitor.ResultHandler] opened server socket on port 13539
[DEBUG] [LAUNCHER] ASVmLauncher starting
[DEBUG] [LAUNCHER] exec: /usr/bin/flashplayer - /root/trunk/flex-project/flex-project-arbeidsflate/flex-surface-common/flex-surface-common-flex/target/test-classes/TestRunner.swf
[DEBUG] [LAUNCHER] Creating process
[WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
[DEBUG] [LAUNCHER] Process created java.lang.UNIXProcess@1a6c088
[DEBUG] [MOJO] launcher RUNNING
[DEBUG] [MOJO] pinger STARTED
[DEBUG] [MOJO] resultHandler STARTED
[DEBUG] [LAUNCHER] Output pumpers ON
[DEBUG] [LAUNCHER] Waiting for flashplayer termination
[DEBUG] [LAUNCHER] Flashplayer closed
[DEBUG] [LAUNCHER] Unexpected return code 1
[DEBUG] [SYSERR]: mktemp: cannot create temp file /tmp/Xauthority: File exists
[DEBUG] [MOJO] launcher ERROR
[DEBUG] [MOJO] pinger STARTED
[DEBUG] [MOJO] resultHandler STARTED
[INFO] ------------------------------------------------------------------------
[INFO] Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:

我需要帮助找出问题所在。如果你们中的任何人知道任何其他在Linux上运行Flex单元测试的方法,而不是通过JENKINS/哈德逊,我将非常感激。

xesrikrc

xesrikrc1#

首先,只需按照以下网站上的linux部分说明操作即可:Running unit tests - FlexMojos。下载flashplayer并将其解压缩到某个适当的位置,然后将绝对目录路径放在PATH变量中。
下载xvfb-run脚本并更改以下'fi'


# If the user did not specify an X authorization file to use, set up a temporary

# directory to house one.

if [ -z "$AUTHFILE" ]; then
  XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$"
  if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
    error "temporary directory $XVFB_RUN_TMPDIR already exists"
    exit 4
  fi
  AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority)
fi


# If the user did not specify an X authorization file to use, set up a temporary

# directory to house one.

if [ -z "$AUTHFILE" ]; then
   XVFB_RUN_TMPDIR=$(mktemp -d)
   if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
     error "temporary directory $XVFB_RUN_TMPDIR already exists"
     exit 4
   fi
   AUTHFILE=$(mktemp "$XVFB_RUN_TMPDIR/Xauthority")
 fi

我解决了我的问题,希望你也能。祝你好运。

相关问题