forge插件

技术提示#34解释了如何创建可测试的Java EE 7应用程序。 如果要启动新的应用程序,这将很有用。 但是,如果您已经有一个应用程序并启用Arquillian怎么办?

这就是Forge和Forge-Arquillian附加组件派上用场的地方。 这就是我在javaee7-simple-sample中添加对Arquillian的支持的方式。

让我们看看已经完成了!

  1. 下载并安装Forge。 您可以在自己喜欢的位置下载ZIP并解压缩,也可以使用下面的命令为您完成:

    Downloads> curl http://forge.jboss.org/sh | sh% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
    100  2725    0  2725    0     0   4641      0 --:--:-- --:--:-- --:--:--  4642
    /usr/bin/java
    Downloading Forge
    ######################################################################## 100.0%
    Archive:  /Users/arungupta/.forge/forge_installer.zipcreating: /Users/arungupta/forge/forge-distribution-2.12.2.Final/creating: /Users/arungupta/forge/forge-distribution-2.12.2.Final/img/. . .If you have not yet seen the Forge built-in commands, you may either press TAB to see a list of the currently available commands, or get a more descriptive list by typing:$ command-listThen to get started - see the docs at
    http://forge.jboss.org/documentation
    Consider installing Git and Maven 3.1+ (both optional)Restart Terminal to use forge.
  2. 克隆simple-javaee7-sample仓库 :
    git clone https://github.com/javaee-samples/javaee7-simple-sample.git
  3. 将目录更改为javaee7-simple-sample并启动Forge:
    javaee7-simple-sample> ~/tools/forge-distribution-2.12.2.Final/bin/forge
    Using Forge at /Users/arungupta/tools/forge-distribution-2.12.2.Final_____                    |  ___|__  _ __ __ _  ___ | |_ / _ \| `__/ _` |/ _ \  \\|  _| (_) | | | (_| |  __/  //|_|  \___/|_|  \__, |\___| |__/      JBoss Forge, version [ 2.12.2.Final ] - JBoss, by Red Hat, Inc. [ http://forge.jboss.org ]
  4. 安装Forge-Arquillian附加组件:
    [javaee7-simple-sample]$ addon-install-from-git --url https://github.com/forge/addon-arquillian.git
    ***INFO*** Installing Addon from Git    [0/4] ...
    ***INFO*** Installing Addon from Git:Cloning repository in /var/folders/3v/syxsk5zx3yqd_8g9m206py_h0000gn/T/1416131293813-0     [0/4] ...
    ***INFO*** Installing Addon from Git:Installing project into local repository   [1/4] ...
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Arquillian Forge Addon 1.0.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] . . .Downloading: http://repo1.maven.org/maven2/org/jboss/forge/addon/maven-impl-projects/2.12.2.Final/maven-impl-projects-2.12.2.Final.pom
    Downloaded: http://repo1.maven.org/maven2/org/jboss/forge/addon/maven-impl-projects/2.12.2.Final/maven-impl-projects-2.12.2.Final.pom (4 KB at 16.9 KB/sec)
    ***SUCCESS*** Addon org.arquillian.forge:arquillian-addon,1.0.0-SNAPSHOT was installed successfully.
  5. 配置Arquillian加载项并安装WildFly适配器:
    [javaee7-simple-sample]$ arquillian-setup --testFramework junit --containerAdapter wildfly-remote
    Downloading: http://repo1.maven.org/maven2/org/wildfly/wildfly-arquillian-container-remote/maven-metadata.xml
    Downloaded: http://repo1.maven.org/maven2/org/wildfly/wildfly-arquillian-container-remote/maven-metadata.xml (702 B at 4.2 KB/sec)
    ***SUCCESS*** Arquillian setup complete
    ***SUCCESS*** Installed Arquillian 1.1.5.Final
    ***SUCCESS*** Installed junit
    ***SUCCESS*** Installed Arquillian Container WildFly Remote 8.x
    ***SUCCESS*** Installed Arquillian Container WildFly Remote 8.x dependencies

    适配器列表如下所示:

    glassfish-embedded-3.1       jetty-embedded-6.1           tomee-remote
    glassfish-managed-3.1        jetty-embedded-7             was-embedded-8
    glassfish-remote-3.1         openejb-embedded-3.1         was-remote-7
    jbossas-embedded-6           openejb-embedded-4           was-remote-8
    jbossas-managed-4.2          openshift-express            weld-ee-embedded-1.1
    jbossas-managed-5.1          openwebbeans-embedded-1      weld-se-embedded-1
    jbossas-managed-6            tomcat-embedded-6            weld-se-embedded-1.1
    jbossas-managed-7            tomcat-embedded-7            wildfly-managed
    jbossas-remote-4.2           tomcat-managed-5.5           wildfly-remote
    jbossas-remote-5             tomcat-managed-6             wls-remote-10.3
    jbossas-remote-5.1           tomcat-managed-7
    jbossas-remote-6             tomcat-remote-6

    这使您可以配置所选的容器。 这会将以下配置文件添加到您的“ pom.xml”中:

    arquillian-wildfly-remotemaven-surefire-plugin2.14.1arquillian-wildfly-remoteorg.wildflywildfly-arquillian-container-remote8.1.0.Finaltest

    该配置文件包括“ wildfly-arquillian-container-remote”依赖性,该依赖性使Arquillian可以与在远程“模式”下运行的WildFly连接。 默认主机为“ localhost”,端口为“ 8080”。 “ maven-surefire-plugin”将传递一个值为“ arquillian-wildfly-remote”的“ arquillian.launch”配置属性。 这与生成的“ arquillian.xml”中的“容器”限定符匹配。“ arquillian.xml”用于定义配置设置以定位容器或与容器通信。 在我们的情况下,WildFly在默认主机和端口上运行,因此不需要更新此文件。 需要注意的重要部分是“容器”限定符与“ arquillian.launch”限定符值匹配。

    
    

    这个文件。 有关此配置文件的更多详细信息, 请参见此处 。

  6. 在修复FORGE-2148之前,您还需要添加JAX-RS实现以及相应的JAXB提供程序。 该测试使用的是RESTEasy,因此需要添加以下内容:
    org.jboss.resteasyresteasy-client3.0.5.Finaltestorg.jboss.resteasyresteasy-jaxb-provider3.0.5.Finaltest

    可以将其添加到概要文件或项目范围的依赖项中。

现在,您可以进行测试了!

下载WildFly 8.1并解压缩。 以以下方式启动服务器:

./bin/standalone.sh

运行测试:

javaee7-simple-sample> mvn test
[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 16, 2014 1:53:57 PM org.xnio.Xnio
INFO: XNIO version 3.2.0.Beta4
Nov 16, 2014 1:53:57 PM org.xnio.nio.NioXnio
INFO: XNIO NIO Implementation Version 3.2.0.Beta4
Nov 16, 2014 1:53:57 PM org.jboss.remoting3.EndpointImpl
INFO: JBoss Remoting version (unknown)
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.963 secResults :Tests run: 2, Failures: 0, Errors: 0, Skipped: 0[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.403 s
[INFO] Finished at: 2014-11-16T13:53:59+02:00
[INFO] Final Memory: 17M/309M
[INFO] ------------------------------------------------------------------------

现在,您已经使用Arquillian启用了现有项目!

在此处提交任何问题 。

请享用!

翻译自: https://www.javacodegeeks.com/2014/11/enable-arquillian-on-an-existing-java-ee-project-using-forge-addon.html

forge插件

forge插件_使用Forge插件在现有Java EE项目上启用Arquillian相关推荐

  1. 使用Forge插件在现有Java EE项目上启用Arquillian

    技术提示#34解释了如何创建可测试的Java EE 7应用程序. 如果要启动新的应用程序,这将很有用. 但是,如果您已经有一个应用程序并启用Arquillian怎么办? 这就是Forge和Forge- ...

  2. forge开发_使用Forge,WildFly Swarm和Arquillian开发微服务

    forge开发 在这篇文章中,我们将看到如何使用WildFly Swarm和Forge开发微服务,以及如何使用Arquillian和Rest Assured对其进行测试. WildFly Swarm提 ...

  3. java代码自动生成的插件_如何使用插件生成自定义Java 8代码

    java代码自动生成的插件 大多数程序员讨厌的一件事就是编写样板代码. 无休止的时间花费在设置实体类和配置数据库连接上. 为了避免这种情况,您可以让Speedment Open Source之类的程序 ...

  4. lede 插件_【PS插件】神器在手不怕图片模糊

    点击蓝字 关注我们 PS插件是什么??? 插件是一种遵循一定规范的应用程序接口编写出来的程序.很多软件都有插件,ps软件插件有无数种,它可以通过不同的方式改变象素数据,以达到对图象进行抽象.艺术化的特 ...

  5. java自定义maven插件_自定义Maven插件

    第一.自定义Maven插件概述 Mojo:Maven plain Old Java Object.每一个 Mojo 就是 Maven 中的一个执行目标(executable goal),而插件则是对单 ...

  6. 查看文章影响因子的插件_这个浏览器插件可以智能查询SCI论文被引情况

    在查询一篇SCI文章时,我们有时候需要知道他的被引情况,看看有哪些文章引用了它,有时也需要知道施引文献在其文章中是如何描述被引文献的. 查询SCI论文被引情况可以在Web of Science中实现, ...

  7. Eclipse 安装插件(aptana、svn 、git、Java EE、JSHint)

    转发9 1.安装 aptana 插件: * 依次点击:Help -> Install New Software... -> Add * 输入:http://download.aptana. ...

  8. excel python插件_利用 Python 插件 xlwings 读写 Excel

    Python 通过 xlwings 读取 Excel 数据 去年底公司让我做设备管理,多次委婉拒绝,最终还是做了.其实我比较喜欢技术.做管理后发现现场没有停机率统计,而原始数据有,每次要自己在Exce ...

  9. figma 安装插件_彩色滤光片Figma插件,用于色盲

    figma 安装插件 So as a UX Designer, it is important to design with disabilities in mind. One of these is ...

最新文章

  1. NLP为RPA带来了什么价值?
  2. 添加css的方式:link与@import区别
  3. python和java一样吗-Python与Java的区别与优劣?
  4. App设计灵感之十二组精美的插画引导页设计案例
  5. kafka压力测试说明
  6. vs2015-OpenGL绘制三角形
  7. 生成汉字拼音首字母函数!
  8. 东方韵味春节牛年PSD分层海报,过大年不愁没海报发了!
  9. sap gui java_不喜欢SAP GUI?那试试用Eclipse进行ABAP开发吧
  10. Solr 4.10.3 后台管理页面查询详解
  11. 在C#中使用DevExpress中的ChartControl实现极坐标图
  12. 泛微协同商务系统_泛微ecology OA Beanshell组件远程代码执行漏洞复现
  13. xp系统扫描仪服务器,xp系统扫描仪添加步骤全程的图文教程
  14. ruoyi 项目启动步骤
  15. 电脑关闭所有应用的快捷键
  16. markdown的搬砖汇总
  17. 【Spark ML】第 1 章:机器学习简介
  18. 什么专业python工程师_西安专业的Python工程师哪家专业
  19. 巧做卡拉OK遮罩字幕
  20. 新征程,筑生态 - 华为中国ICT生态之行2017走进武汉

热门文章

  1. bzoj2111,P2606-[ZJOI2010]排列计数【Lucas,组合计数,dp】
  2. P5431-[模板]乘法逆元2【递推】
  3. P3701 -「伪模板」主席树【网络流,最大流】
  4. codeforces1440 E. Greedy Shopping
  5. 【莫队】区间不同数(金牌导航 莫队-1)
  6. MYSQL 入门全套
  7. Vue.js2.0开发环境搭建(二)
  8. spring boot添加swagger步骤
  9. 注意!在subList生成子列表之后,一定不要随便更改原列表
  10. 优秀学生专栏——孙振涛