Skip to content

Commit

Permalink
sync up with latest in nexial-core
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeliucc committed May 13, 2020
1 parent cc5899f commit dc0493b
Show file tree
Hide file tree
Showing 913 changed files with 207,048 additions and 18,122 deletions.
400 changes: 117 additions & 283 deletions .gitignore

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion bin/.commons.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
set JAVA_OPT=%JAVA_OPT% -Dwebdriver.winium.verbose=false
set JAVA_OPT=%JAVA_OPT% -Dwebdriver.winium.silent=false
REM set JAVA_OPT=%JAVA_OPT% -Dwebdriver.winium.logpath=%TEMP%\winium-service.log
set JAVA_OPT=%JAVA_OPT% -Dorg.apache.poi.util.POILogger=org.apache.poi.util.NullLogger

goto :eof

Expand Down Expand Up @@ -99,7 +100,7 @@ REM # Make sure prerequisite environment variables are set
:resolveEnv
set NEXIAL_LIB=%NEXIAL_HOME%\lib
set CLASSES_PATH=%NEXIAL_HOME%\classes
set datestr=%date:~10,4%-%date:~4,2%-%date:~7,2% %time%
set datestr=%date:~6,4%-%date:~0,2%-%date:~3,2% %time%

echo ENVIRONMENT:
echo CURRENT TIME: %datestr%
Expand Down
16 changes: 15 additions & 1 deletion bin/.commons.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function resolveOSXAppPath() {

IFS=$'\n'

# todo: need alternative from `locate` since it requires local sudo rights.
for p in `locate "MacOS/${appExec}" | grep -E "${appExec}$"`; do
if [[ "$path" = "" ]]; then
# first time.. just use what we found
Expand Down Expand Up @@ -94,8 +95,18 @@ function title() {
}


export NEXIAL_OS=
function resolveEnv() {
JAVA_VERSION=`echo "$(${JAVA} -version 2>&1)" | grep "java version" | awk '{ print substr($3, 2, length($3)-2); }'`
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) export NEXIAL_OS=Linux;;
Darwin*) export NEXIAL_OS=Mac;;
CYGWIN*) export NEXIAL_OS=Cygwin;;
MINGW*) export NEXIAL_OS=MinGw;;
*) export NEXIAL_OS="UNKNOWN:${unameOut}"
esac

JAVA_VERSION=`echo "$(${JAVA} -version 2>&1)" | grep " version" | awk '{ print substr($3, 2, length($3)-2); }'`

echo "» ENVIRONMENT: "
echo " CURRENT TIME: `date \"+%Y-%m-%d %H:%M%:%S\"`"
Expand Down Expand Up @@ -141,6 +152,7 @@ function resolveAppPath() {


# utilities to be invoked by other frontend scripts
mkdir -p "$HOME/.nexial"
export PROJECT_BASE=~/projects
export NEXIAL_HOME=$(cd `dirname $0`/..; pwd -P)
export NEXIAL_LIB=${NEXIAL_HOME}/lib
Expand Down Expand Up @@ -174,7 +186,9 @@ fi
JAVA_OPT="${JAVA_OPT} -ea"
JAVA_OPT="${JAVA_OPT} -Xss24m"
JAVA_OPT="${JAVA_OPT} -Dfile.encoding=UTF-8"
# JAVA_OPT="${JAVA_OPT} -Djava.awt.headless=true"
JAVA_OPT="${JAVA_OPT} -Dnexial.home=${NEXIAL_HOME}"
JAVA_OPT="${JAVA_OPT} -Dwebdriver.winium.verbose=true"
JAVA_OPT="${JAVA_OPT} -Dwebdriver.winium.silent=false"
# JAVA_OPT="${JAVA_OPT} -Dwebdriver.winium.logpath=$TMPDIR/winium-service.log"
JAVA_OPT="${JAVA_OPT} -Dorg.apache.poi.util.POILogger=org.apache.poi.util.NullLogger"
57 changes: 57 additions & 0 deletions bin/nexial-artifact-repair.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@echo off
REM --------------------------------------------------------------------------------
REM environment variable guide
REM --------------------------------------------------------------------------------
REM JAVA_HOME - home directory of a valid JDK installation (1.6 or above)
REM PROJECT_HOME - home directory of your project.
REM NEXIAL_OUT - the output directory
REM FIREFOX_BIN - the full path of firefox.exe
REM NEXIAL_RUNMODE - determine screen capture image strategy (local or server)
REM --------------------------------------------------------------------------------

setlocal enableextensions enabledelayedexpansion

set NEXIAL_BIN=%~dp0

call :init
if NOT ERRORLEVEL 0 goto :exit

call :title "nexial artifact repair"
if NOT ERRORLEVEL 0 goto :exit

call :checkJava
if NOT ERRORLEVEL 0 goto :exit

call :resolveEnv
if NOT ERRORLEVEL 0 goto :exit

REM run nexial now
REM echo Runtime Option: %JAVA_OPT%
echo.

REM run now
%JAVA% -classpath %NEXIAL_CLASSES%;%NEXIAL_LIB%\nexial*.jar;%NEXIAL_LIB%\* %JAVA_OPT% org.nexial.core.tools.repair.RepairArtifact %*

endlocal
exit /b 0
goto :eof

:init
%NEXIAL_BIN%.commons.cmd %*

:checkJava
%NEXIAL_BIN%.commons.cmd %*

:title
%NEXIAL_BIN%.commons.cmd %*

:resolveEnv
%NEXIAL_BIN%.commons.cmd %*

:exit
endlocal
exit /b 1




13 changes: 13 additions & 0 deletions bin/nexial-artifact-repair.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

NEXIAL_HOME=$(cd `dirname $0`/..; pwd -P)
. ${NEXIAL_HOME}/bin/.commons.sh
title "nexial artifact repair"
checkJava
resolveEnv

# run now
${JAVA} -classpath "${NEXIAL_CLASSES}:${NEXIAL_LIB}/nexial*.jar:${NEXIAL_LIB}/*" ${JAVA_OPT} \
org.nexial.core.tools.repair.RepairArtifact $*

exit $?
Empty file modified bin/nexial-crypt.cmd
100644 → 100755
Empty file.
Empty file modified bin/nexial-crypt.sh
100644 → 100755
Empty file.
19 changes: 0 additions & 19 deletions bin/nexial-desktop-xpath-update.cmd
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
@echo off
REM --------------------------------------------------------------------------------
REM environment variable guide
REM --------------------------------------------------------------------------------
REM JAVA_HOME - home directory of a valid JDK installation (1.6 or above)
REM PROJECT_HOME - home directory of your project.
REM NEXIAL_OUT - the output directory
REM FIREFOX_BIN - the full path of firefox.exe
REM NEXIAL_RUNMODE - determine screen capture image strategy (local or server)
REM --------------------------------------------------------------------------------

setlocal enableextensions enabledelayedexpansion

Expand All @@ -25,8 +16,6 @@ if NOT ERRORLEVEL 0 goto :exit
call :resolveEnv
if NOT ERRORLEVEL 0 goto :exit

REM run nexial now
REM echo Runtime Option: %JAVA_OPT%
echo.

REM run now
Expand All @@ -47,14 +36,6 @@ goto :eof
:resolveEnv
%NEXIAL_BIN%.commons.cmd %*

:reportBadInputAndExit
echo.
echo ERROR: Required input not found.
echo USAGE: %0 [project name] [optional: testcase id, testcase id, ...]
echo.
echo.
goto :exit

:exit
endlocal
exit /b 1
Expand Down
8 changes: 0 additions & 8 deletions bin/nexial-log-parser.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ goto :eof
:resolveEnv
%NEXIAL_BIN%.commons.cmd %*

:reportBadInputAndExit
echo.
echo ERROR: Required input not found.
echo USAGE: %0 [project name] [optional: testcase id, testcase id, ...]
echo.
echo.
goto :exit

:exit
endlocal
exit /b 1
Expand Down
Empty file modified bin/nexial-log-parser.sh
100644 → 100755
Empty file.
40 changes: 40 additions & 0 deletions bin/nexial-macro-update.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@echo off

setlocal enableextensions

set NEXIAL_BIN=%~dp0

call :init
if NOT ERRORLEVEL 0 goto :exit

call :title "nexial macro updater"
if NOT ERRORLEVEL 0 goto :exit

call :checkJava
if NOT ERRORLEVEL 0 goto :exit

call :resolveEnv
if NOT ERRORLEVEL 0 goto :exit

echo.

%JAVA% -classpath %NEXIAL_LIB%\nexial*.jar;%NEXIAL_LIB%\* %JAVA_OPT% org.nexial.core.tools.MacroUpdater %*
endlocal
exit /b 0
goto :eof

:init
%NEXIAL_BIN%.commons.cmd %*

:checkJava
%NEXIAL_BIN%.commons.cmd %*

:title
%NEXIAL_BIN%.commons.cmd %*

:resolveEnv
%NEXIAL_BIN%.commons.cmd %*

:exit
endlocal
exit /b 1
22 changes: 22 additions & 0 deletions bin/nexial-macro-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

NEXIAL_HOME=$(cd `dirname $0`/..; pwd -P)
. ${NEXIAL_HOME}/bin/.commons.sh
title "nexial macro updater"
checkJava
resolveEnv

args=""
for var in "$@"; do args="$args \"$var\""; done

# run now
echo
echo

eval ${JAVA} -classpath "${NEXIAL_CLASSES}:${NEXIAL_LIB}/nexial*.jar:${NEXIAL_LIB}/*" ${JAVA_OPT} org.nexial.core.tools.MacroUpdater ${args}
ret=$?

echo
echo

exit ${ret}
41 changes: 41 additions & 0 deletions bin/nexial-project-inspector.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@echo off

setlocal enableextensions enabledelayedexpansion

set NEXIAL_BIN=%~dp0

call :init
if NOT ERRORLEVEL 0 goto :exit

call :title "nexial project inspector"
if NOT ERRORLEVEL 0 goto :exit

call :checkJava
if NOT ERRORLEVEL 0 goto :exit

call :resolveEnv
if NOT ERRORLEVEL 0 goto :exit

REM run now
echo.
%JAVA% -classpath %NEXIAL_CLASSES%;%NEXIAL_LIB%\nexial*.jar;%NEXIAL_LIB%\* %JAVA_OPT% org.nexial.core.tools.inspector.ProjectInspector %*

endlocal
exit /b 0
goto :eof

:init
%NEXIAL_BIN%.commons.cmd %*

:checkJava
%NEXIAL_BIN%.commons.cmd %*

:title
%NEXIAL_BIN%.commons.cmd %*

:resolveEnv
%NEXIAL_BIN%.commons.cmd %*

:exit
endlocal
exit /b 1
13 changes: 13 additions & 0 deletions bin/nexial-project-inspector.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

NEXIAL_HOME=$(cd `dirname $0`/..; pwd -P)
. ${NEXIAL_HOME}/bin/.commons.sh
title "nexial project inspector"
checkJava
resolveEnv

# run now
${JAVA} -classpath "${NEXIAL_CLASSES}:${NEXIAL_LIB}/nexial*.jar:${NEXIAL_LIB}/*" ${JAVA_OPT} \
org.nexial.core.tools.inspector.ProjectInspector $*

exit $?
40 changes: 32 additions & 8 deletions bin/nexial-project.cmd
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,46 @@ if "%1"=="" goto :reportBadInputAndExit
)
echo PROJECT_HOME: %PROJECT_HOME%

rem determine project id
rem first, use current project structure to determine project id
set PROJECT_NAME=
for %%F in (%1) do set PROJECT_NAME=%%~nF

rem if project.id file exist, read its content as project id
set PROJECT_ID=%PROJECT_HOME%\.meta\project.id
if exist %PROJECT_ID% (
for /f "delims=" %%x in (%PROJECT_ID%) do set PROJECT_NAME=%%x
)

rem lastly, user gets to choose
set user_project_name=NUL
echo.
echo ^>^> currently project id is defined as %PROJECT_NAME%.
echo ^>^> to change it, enter new project id below or press ENTER to keep it as is
set /p user_project_name=" Enter project id [%PROJECT_NAME%]: "
if not "%user_project_name%"=="NUL" (
set PROJECT_NAME=%user_project_name%
)

echo.
echo ^>^> (re)creating project home at %PROJECT_HOME%
mkdir %PROJECT_HOME%\.meta 2>NUL
mkdir %PROJECT_HOME%\artifact\bin 2>NUL
mkdir %PROJECT_HOME%\artifact\script 2>NUL
mkdir %PROJECT_HOME%\artifact\data 2>NUL
mkdir %PROJECT_HOME%\artifact\plan 2>NUL
mkdir %PROJECT_HOME%\output 2>NUL

REM create empty project.properties file if it does not exist
if exist %PROJECT_HOME%\artifact\project.properties (
echo ^>^> skip over the creation of project.properties
) else (
type NUL > %PROJECT_HOME%\artifact\project.properties
)

REM create project.id file to uniquely identify a "project" across enterprise (i.e. same SCM)
set PROJECT_ID=%PROJECT_HOME%\.meta\project.id
if not exist %PROJECT_ID% (
echo ^>^> create %PROJECT_ID%
set PROJECT_NAME=
for %%F in (%1) do set PROJECT_NAME=%%~nF
echo %PROJECT_NAME% > %PROJECT_ID%
)
echo ^>^> (re)creating %PROJECT_ID% with %PROJECT_NAME%"
echo !PROJECT_NAME!> %PROJECT_ID%

set script_name=%~n1
set SKIP_DEF_SCRIPTS=false
Expand Down Expand Up @@ -69,7 +93,7 @@ if "%1"=="" goto :reportBadInputAndExit

cd %PROJECT_HOME%
cd
dir /s /b /on
dir /s /b /on *.xlsx *.properties

echo.
echo.
Expand Down
Loading

0 comments on commit dc0493b

Please sign in to comment.