update testcase for testsuite boilerpipe-javadoc
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/boilerpipe/boilerpipe-javadoc",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_boilerpipe-javadoc_function_extract",
|
||||
"desc": "Test content extraction"
|
||||
},
|
||||
{
|
||||
"name": "test_boilerpipe-javadoc_function_parse",
|
||||
"desc": "Test HTML parsing"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-11-29
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test content extraction
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试内容提取功能"
|
||||
|
||||
# 检查是否已安装boilerpipe-javadoc软件包
|
||||
LOG_INFO "检查boilerpipe-javadoc是否已安装"
|
||||
if dnf list installed boilerpipe-javadoc &>/dev/null; then
|
||||
LOG_INFO "boilerpipe-javadoc已安装,脚本结束时将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "boilerpipe-javadoc未安装,将在测试结束后卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有boilerpipe-javadoc软件包
|
||||
LOG_INFO "检查yum源中是否存在boilerpipe-javadoc软件包"
|
||||
if ! dnf list available boilerpipe-javadoc &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到boilerpipe-javadoc软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装boilerpipe-javadoc软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装boilerpipe-javadoc软件包"
|
||||
dnf install -y boilerpipe-javadoc
|
||||
CHECK_RESULT $? 0 0 "安装boilerpipe-javadoc失败"
|
||||
fi
|
||||
|
||||
# 测试内容提取功能
|
||||
LOG_INFO "测试内容提取功能"
|
||||
output=$(boilerpipe-extractor --help)
|
||||
CHECK_RESULT $? 0 0 "执行内容提取命令失败"
|
||||
|
||||
# 检查参数支持情况
|
||||
LOG_INFO "检查参数支持情况"
|
||||
if ! echo "$output" | grep -q "\-\-extract"; then
|
||||
LOG_ERROR "参数--extract不支持或不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 执行实际内容提取测试
|
||||
LOG_INFO "执行实际内容提取测试"
|
||||
boilerpipe-extractor --extract http://example.com
|
||||
CHECK_RESULT $? 0 0 "内容提取测试失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载boilerpipe-javadoc软件包"
|
||||
dnf remove -y boilerpipe-javadoc
|
||||
CHECK_RESULT $? 0 0 "卸载boilerpipe-javadoc失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试内容提取功能完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2024 ISCAS .ALL rights reserved.
|
||||
# This program is licensed under Mulan PSL v2.
|
||||
# You can use it according to the terms and conditions of the Mulan PSL v2.
|
||||
# http://license.coscl.org.cn/MulanPSL2
|
||||
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
# See the Mulan PSL v2 for more details.
|
||||
|
||||
# #############################################
|
||||
# @Author : honghua
|
||||
# @Contact : honghua@iscas.ac.cn
|
||||
# @Date : 2025-12-09
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test HTML parsing
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已经安装boilerpipe-javadoc
|
||||
LOG_INFO "检查是否已安装boilerpipe-javadoc"
|
||||
if dnf list installed boilerpipe-javadoc &>/dev/null; then
|
||||
LOG_INFO "boilerpipe-javadoc已安装"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "boilerpipe-javadoc未安装"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在boilerpipe-javadoc
|
||||
LOG_INFO "检查yum源中是否存在boilerpipe-javadoc"
|
||||
if ! dnf list available boilerpipe-javadoc &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到boilerpipe-javadoc"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装boilerpipe-javadoc
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "开始安装boilerpipe-javadoc"
|
||||
dnf install -y boilerpipe-javadoc
|
||||
CHECK_RESULT $? 0 0 "安装boilerpipe-javadoc失败"
|
||||
fi
|
||||
|
||||
# 测试HTML解析功能
|
||||
LOG_INFO "测试HTML解析功能"
|
||||
output=$(java -cp /usr/share/java/boilerpipe-javadoc.jar TestHTMLParsing)
|
||||
CHECK_RESULT $? 0 0 "HTML解析测试失败"
|
||||
LOG_INFO "HTML解析测试输出: $output"
|
||||
|
||||
# 如果脚本开始时未安装,则卸载boilerpipe-javadoc
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载boilerpipe-javadoc"
|
||||
dnf remove -y boilerpipe-javadoc
|
||||
CHECK_RESULT $? 0 0 "卸载boilerpipe-javadoc失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user