openshift_在OpenShift上托管的WildFly实例上进行Arquillian测试
openshift
技术提示#54解释了如何为现有Java EE项目启用Arquillian。 在该技巧中,测试是针对本地安装的WildFly服务器运行的。 如果此WildFly实例在OpenShift上运行,那么同一个适配器也可以工作吗? 没有!
因为与xlocalhost相比,PaaS的安全性约束和要求是不同的。 让我们看一下对OpenShift上托管的WildFly实例在javaee7-simple-sample中运行测试所需的条件。
让我们开始吧!
- 如技术提示52中所述 ,在OpenShift上创建WildFly应用程序,如下所示:
workspaces>rhc app-create mywildfly jboss-wildfly-8 Application Options ------------------- Domain: milestogo Cartridges: jboss-wildfly-8 Gear Size: default Scaling: noCreating application 'mywildfly' ... Artifacts deployed: ./ROOT.war doneWildFly 8 administrator added. Please make note of these credentials:Username: adminMYtMTDbPassword: tq1K-QYLFgBDrun 'rhc port-forward mywildfly' to access the web admin area on port 9990.Waiting for your DNS name to be available ... doneCloning into 'mywildfly'... Warning: Permanently added the RSA host key for IP address '54.163.64.193' to the list of known hosts.Your application 'mywildfly' is now available.URL: http://mywildfly-milestogo.rhcloud.com/SSH to: 54699516ecb8d41cb8000016@mywildfly-milestogo.rhcloud.comGit remote: ssh://54699516ecb8d41cb8000016@mywildfly-milestogo.rhcloud.com/~/git/mywildfly.git/Cloned to: /Users/arungupta/workspaces/mywildflyRun 'rhc show-app mywildfly' for more details about your app.
从日志中记下ssh用户名。 这是
@
之前与SSH to
对应的值中的部分。 - 在解决FORGEPLUGINS-177之前,我们需要手动添加Maven配置文件并在“ arquillian.xml”中提供容器配置信息。 将以下
<profile>
添加到“ pom.xml”:<profile><id>arquillian-wildfly-openshift</id><build><plugins><plugin><artifactId>maven-surefire-plugin</artifactId><version>2.14.1</version><configuration><systemPropertyVariables><arquillian.launch>arquillian-wildfly-openshift</arquillian.launch></systemPropertyVariables></configuration></plugin></plugins></build><dependencies><dependency><groupId>org.jboss.arquillian.container</groupId><artifactId>arquillian-openshift</artifactId><version>1.0.0.Final-SNAPSHOT</version><scope>test</scope></dependency></dependencies> </profile>
这是使用
arquillian-openshift
容器,并引用arquillian-wildfly-openshift
配置,该配置将与“ arquillian.xml”中的相应容器匹配。 因此,这就是更新后的“ arquillian.xml”的外观:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"><container qualifier="arquillian-wildfly-remote"/><container qualifier="arquillian-wildfly-openshift"><configuration><property name="namespace">milestogo</property><property name="application">mywildfly</property><property name="libraDomain">rhcloud.com</property><property name="sshUserName">54699516ecb8d41cb8000016</property><property name="login">arungupta@redhat.com</property><property name="deploymentTimeoutInSeconds">300</property><property name="disableStrictHostChecking">true</property> </configuration></container> </arquillian>
注意带有限定符
arquillian-wildfly-openshift
的新<container>
。 它提供有关服务器位置以及其他一些配置属性的信息。sshUserName
属性值应与之前创建的WildFly实例相同。 - 就是这样,现在您可以在OpenShift上针对WildFly实例运行测试:
javaee7-simple-sample> mvn test -Parquillian-wildfly-openshift [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building helloworld 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ helloworld --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ helloworld --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.14.1:test (default-test) @ helloworld --- [INFO] Surefire report directory: /Users/arungupta/workspaces/javaee7-simple-sample/target/surefire-reports-------------------------------------------------------T E S T S ------------------------------------------------------- Running org.javaee7.sample.PersonTest Nov 17, 2014 11:18:24 AM org.jboss.arquillian.container.openshift.OpenShiftContainer start INFO: Preparing Arquillian OpenShift container at http://mywildfly-milestogo.rhcloud.com Nov 17, 2014 11:19:19 AM org.jboss.arquillian.container.openshift.OpenShiftRepository push INFO: Pushed to the remote repository ssh://54699516ecb8d41cb8000016@mywildfly-milestogo.rhcloud.com/~/git/mywildfly.git/ Nov 17, 2014 11:20:56 AM org.jboss.arquillian.container.openshift.OpenShiftRepository push INFO: Pushed to the remote repository ssh://54699516ecb8d41cb8000016@mywildfly-milestogo.rhcloud.com/~/git/mywildfly.git/ Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 152.653 sec Nov 17, 2014 11:20:56 AM org.jboss.arquillian.container.openshift.OpenShiftContainer stop INFO: Shutting down Arquillian OpenShift container at http://mywildfly-milestogo.rhcloud.comResults :Tests run: 2, Failures: 0, Errors: 0, Skipped: 0[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 05:46 min [INFO] Finished at: 2014-11-17T11:24:09+02:00 [INFO] Final Memory: 12M/309M [INFO] ------------------------------------------------------------------------
- 完整的源代码可在github.com/javaee-samples/javaee7-simple-sample中找到 。
请享用!
翻译自: https://www.javacodegeeks.com/2014/11/arquillian-tests-on-a-wildfly-instance-hosted-on-openshift.html
openshift
openshift_在OpenShift上托管的WildFly实例上进行Arquillian测试相关推荐
- 在OpenShift上托管的WildFly实例上进行Arquillian测试
技术提示#54解释了如何为现有Java EE项目启用Arquillian. 在该技巧中,测试是针对本地安装的WildFly服务器运行的. 如果此WildFly实例在OpenShift上运行,那么同一个 ...
- openshift_在OpenShift上扩展Java EE微服务
openshift 这个小系列的前两个部分介绍了如何使用WildFly Swarm构建一个小型的JAX-RS服务并将其打包到Docker映像中 . 您学习了如何将此示例部署到OpenShift ,现在 ...
- SQL Server整合–在单个SQL Server实例上托管多个数据库
介绍 (Introduction) Consolidating SQL Server databases and instances is a practice which, under certai ...
- Node.js 体验-在Windows Azure工作者角色上托管Node.js
在我的前面的文章中我演示了如何在Windows Azure 网站(即WAWS)上开发和部署Node.js 应用程序.WAWS是Windows Azure 平台中的新功能.因为它是低成本, 同时它提供I ...
- aws mongodb_在AWS上托管React flask mongodb Web应用程序第4部分
aws mongodb This is a 4 part blog series of articles. Here, you will learn the basic concepts of AWS ...
- 什么是SSR/SSG/ISR?如何在AWS上托管它们?
概述. 在这篇文章中,我们将讨论如何在AWS上运行SSR/SSG/ISR以及App Runner的魅力. 内容 我们将首先分别解释传统和现代网络应用. 接下来,我们将介绍如何在AWS上托管SSR/SS ...
- 安装没有在R包仓库CRAN上托管的R包
安装没有在R包仓库CRAN上托管的R包 有的时候,我们有些任务需要使用新的R包.但是,一旦切换到本地环境并使用'install.packages()'命令获取包,可能会发现到无法在本地安装包.可能的原 ...
- AWS上创建的notebook实例提示没有导入pytorch模块的解决办法 直接在编辑块中执行如下命令,最后重启kernel问题解决
AWS上创建的notebook实例提示没有导入pytorch模块的解决办法 直接在编辑块中执行如下命令,最后重启kernel问题解决 conda install pytorch torchvision ...
- HttpContext.Current.Session ,出现未将对象引用设置到实例上
HttpContext.Current.Session ,出现未将对象引用设置到实例上 using System.Web.SessionState; public class xx: IHttpHa ...
最新文章
- (转)Sublime Text2 快捷键汇总
- JSONSerialization.ReadingOption详解
- delphi html table,delphi 使用webbrowser取得网页中表格(Table)内容的正确方法
- nginx lua以html显示,nginx 支持lua及lua脚本格式化日志
- Hibernate异常之关键字错误
- 【零基础学Java】—static关键字概述(十六)
- Linux 基本操作命令
- nodejs爬虫与python爬虫_不再羡慕python,nodejs爬虫撸起袖子就是干,爬取宅男女神网大姐姐的高清图片!...
- Windows系统下桌面右键菜单新建项管理
- 《测试用例评审》会议纪要模板
- 检查压缩包是否损坏_工业安全吊带的检查PPE(个人防护装备)检查程序与表格...
- 如何使WooCommerce产品属性更加突出
- 【品牌营销策划方案】2020碧桂园x江小白创意引爆策略方案【白酒】【IP】【创意营销】
- 腾讯地图 多个异步script互相依赖加载问题
- Johnson-Trotter算法求全排列
- slam中的相机相关
- 新手程序员首份工作月薪三千,网友:3000元?你是在丢码农的脸吗
- html中百分比都支持吗,響應式設計中百分比%的問題_html/css_WEB-ITnose
- python基础-input函数
- 深度学习环境配置(一)--deepin20.6 安装显卡驱动
热门文章
- jzoj1158-荒岛野人【扩欧,gcd,同余方程】
- P1516-青蛙的约会【扩欧,同余方程】
- 2021“MINIEYE杯”中国大学生算法设计超级联赛(2)I love exam(背包)
- codeforces1453 D. Checkpoints
- 洛谷P1373 小a和uim之大逃离 动态规划
- 2016陕西省ACM省赛 HE 字符串处理 删除注释
- Nacos(一)之简介
- Sentinel(二十五)之Sentinel Dashboard同步Apollo存储规则
- 干货 | 彻底弄懂 HTTP 缓存机制及原理
- 是现在的钱不值钱还是药太贵!