除了设置模块
JBOSS_HOME/modules/com/p6spy/main
Run Code Online (Sandbox Code Playgroud)
加入p6spy.jar
并module.xml
说:
<module xmlns="urn:jboss:module:1.0" name="com.p6spy">
<resources>
<resource-root path="p6spy.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
Run Code Online (Sandbox Code Playgroud)
编辑standalone-full.xml
并添加条目datasources/drivers
:
<driver name="p6spy" module="com.p6spy">
<xa-datasource-class>com.p6spy.engine.spy.P6SpyDriver</xa-datasource-class>
</driver>
Run Code Online (Sandbox Code Playgroud)
添加模块依赖jboss-deployment-structure.xml
:
<module name="com.p6spy"/>
Run Code Online (Sandbox Code Playgroud)
p6spy
我仍然收到此错误:替换数据源定义中的原始驱动程序:
Caused by: java.lang.Exception:
{"JBAS014771: Services with missing/unavailable dependencies" =>
["jboss.data-source.jboss/datasources/MyDsjboss.jdbc-driver.p6spyMissing
[jboss.data-source.jboss/datasources/MyDsjboss.jdbc-driver.p6spy]"
]}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Arquillian来对抗weblogic 12C.
我将以下配置放在我的pom.xml中
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.0.0.CR7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<version>1.0.0.CR7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>1.0.0-beta-5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-wls-remote-12.1</artifactId>
<version>1.0.0.Alpha2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>weblogic</groupId>
<artifactId>wlfullclient</artifactId>
<version>12.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.0.Final</version>
<scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
然后,我将arquillian.xml文件配置如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org.schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="weblogic" default="true">
<configuration>
<protocol type="Servlet 3.0">
<property name="executionType">REMOTE</property>
</protocol>
<property name="adminUrl">t3://localhost:7001</property>
<property name="adminUserName">weblogic</property>
<property name="adminPassword">weblogic1</property>
<property name="target">AdminServer</property>
<property name="wlsHome">c:\java\servers\wls12c\wlserver</property>
</configuration>
</container>
</arquillian>
Run Code Online (Sandbox Code Playgroud)
最后,我试图用Arquillian"创建"一个档案:
JavaArchive ejbArchive = ShrinkWrap.create(JavaArchive.class,"jee6app-ejb.jar").addAsResource("META-INF/persistence.xml","META-INF/persistence.xml").addPackages(false,Adr.class.getPackage(),Service.class.getPackage());
EnterpriseArchive earArchive = …
Run Code Online (Sandbox Code Playgroud) 我正试图用Arquillian Drone/Graphene在一个简单的独立"hello world"测试中注入URL.也许我错过了一些明显的东西,但我找不到任何关于此的文档.
我想可能有一些system.properties(或arquillian.xml),我可以像这样设置:
<systemPropertyVariables>
<arq.extension.graphene.xxx>http://www.google.com</arq.extension.graphene.xxx>
</systemPropertyVariables>
Run Code Online (Sandbox Code Playgroud)
这是我的简单测试:
@RunWith(Arquillian.class)
public class DummyTest
{
@Drone
GrapheneSelenium browser;
@ArquillianResource
URL url;
// URL url = URLUtils.buildUrl("http://www.google.com/");
@Test
public void openBrowser()
{
browser.open(url);
}
}
Run Code Online (Sandbox Code Playgroud)
这是pom:
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.arquillian.example</groupId>
<artifactId>arquillian-tutorial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<version.junit>4.11</version.junit>
<version.arquillian_core>1.0.4.Final</version.arquillian_core>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.arquillian_core}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>arquillian-graphene</artifactId>
<version>2.0.0.Alpha4</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency> …
Run Code Online (Sandbox Code Playgroud) 我正在使用arquillian网站上的Greeter示例运行基本的arquillian单元测试.唯一的区别是我在Greeter.java中的greet(PrintStream to,String name)函数中执行了log.debug.我使用slf4j进行日志记录.
Greeter.java
package org.arquillian.example;
import java.io.PrintStream;
import javax.inject.Inject;
import org.slf4j.Logger;
public class Greeter {
@Inject
private Logger log;
public void greet(PrintStream to, String name) {
log.debug("Greeter Testing");
to.println(createGreeting(name));
}
public String createGreeting(String name) {
return "Hello, " + name + "!";
}
}
Run Code Online (Sandbox Code Playgroud)
GreeterTest.java
package org.arquillian.example;
import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
public class GreeterTest {
@Inject
Greeter greeter;
@Deployment
public static JavaArchive createDeployment() { …
Run Code Online (Sandbox Code Playgroud) 如何在项目和团队成员之间共享Arquillian配置文件Arquillian.xml?
<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="jbossas-managed-wildfly-8" default="true">
<configuration>
<property name="jbossHome">C:\test\wildfly-8.1.0.Final</property>
<property name="javaVmArguments">-Djboss.socket.binding.port-offset=2 -Xmx512m -XX:MaxPermSize=128m</property>
<property name="managementPort">9992</property>
</configuration>
</container>
Run Code Online (Sandbox Code Playgroud)
问题是这指向磁盘上的特定位置,不同的团队成员在不同位置使用Wildfly.
此外,我们必须为使用它的每个项目复制Arquillian.xml.
我们使用Arquillian进行Maven测试(可以注入值)和Eclipse中的JUnit测试(不能注入它们).
任何想法如何做到这一点?
我之前使用过JBoss 7和JBoss Forge 1.xa,对设置非常满意.现在我想在JBoss 8.1中使用最新的2.8版本,甚至无法设置Arquillian.
运行:
forge install-plugin arquillian
Run Code Online (Sandbox Code Playgroud)
给
forge: unrecognized option: 'install-plugin'
Run Code Online (Sandbox Code Playgroud)
接下来各种各样如何帮助,因为大多数它们似乎是为旧的Arquillian和JBoss版本制作的.
forge --install arquillian
Run Code Online (Sandbox Code Playgroud)
给
downloading: http://repo1.maven.org/maven2/org/jboss/forge/addon/arquillian/maven- metadata.xml
java.lang.IllegalArgumentException: No Artifact version found for org.jboss.forge.addon:arquillian
Run Code Online (Sandbox Code Playgroud)
是否有关于如何使用伪造设置arquillian的最新描述?
我试图用arquillian框架测试我的应用程序.所以我配置了pom和arquillian.xml来在wildfly远程容器中运行我的测试用例.即使我在arquillian.xml中给出了远程地址,测试用例在本地wildfly服务器上运行.我已经配置了服务器配置文件并使用remote-wildfly服务器配置文件运行测试.
考试班
@RunWith(Arquillian.class)
public class BasicTest {
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class).addClass(Greeter.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
@Inject
private Greeter greeter;
@Test
public void shouldBeAbleTo() {
assertEquals("Hello, aliens!", greeter.createGreeting("aliens"));
}
Run Code Online (Sandbox Code Playgroud)
}
的pom.xml
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.aerogear</groupId>
<artifactId>arquillian-wildfly-example</artifactId>
<packaging>jar</packaging>
<version>0.0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.org.jboss.arquillian>1.1.5.Final</version.org.jboss.arquillian>
<version.org.wildfly>8.1.0.Final</version.org.wildfly>
<version.junit>4.11</version.junit>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no …
Run Code Online (Sandbox Code Playgroud) 我有一个多模块项目,用maven组织和构建.它由一个war-module,一个ejb-module和一个ear-module组成.他们拥有相同的父项目(用于依赖管理).结构如下:
| - parent(包装pom)
| - ejb-module
| - war-module
| - ear-module
Built order is first ejb-module then war-module than ear-module. The project depends on arquillian for testing. Both ejb-module and war-module contain a test. When I run "mvn clean test -Parq-wildfly-managed" (profile is to activate testing) the test of ejb-module is executed, but the test of war-module is not executed and there is no surefire-report in the target folder. There is no additional information on the output. I …
我正在使用 intelliJ 运行 junit arquillian 测试。
问题是我的测试适用于 maven 命令,但不适用于 arquillian
mvn package -P=arq-wildlfy-managed
Run Code Online (Sandbox Code Playgroud)
这是我的 pom :
<dependencyManagement>
<dependencies>
<!-- Arquillian BOM (Bill Of Materials). -->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.org.jboss.arquillian}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<!-- JUnit regression testing framework. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<!-- Arquillian WildFly managed profile -->
<profile>
<id>arq-wildfly-managed</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.org.wildfly}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<goals> …
Run Code Online (Sandbox Code Playgroud) 我正在按照本教程,但我有一些问题来设置jdbc连接.
在我的arquillian.xml中,我写道:
...
<container qualifier="payara-remote" default="true">
<configuration>
<property name="resourcesXml">
src/test/resources-payara-remote/glassfish-resources.xml
</property>
</configuration>
</container>
...
Run Code Online (Sandbox Code Playgroud)
当我运行我的测试时,我收到此警告:
AVVERTENZA: Configuration contain properties not supported by the backing object org.jboss.arquillian.container.glassfish.remote_3_1.GlassFishRestConfiguration
Unused property entries: {resourcesXml=
src/test/resources-payara-remote/glassfish-resources.xml
}
Supported property names: [adminHttps, remoteServerHttpPort, libraries, type, remoteServerAddress, target, remoteServerAdminPort, remoteServerAdminHttps, adminUser, authorisation, adminPort, properties, adminHost, adminPassword]
Run Code Online (Sandbox Code Playgroud)
所以我认为"resourceXml"不受支持......我如何告诉arquillian使用该文件?
而且,在该文件中我声明了一个jdbc/test.我必须在persistence.xml中编写什么才能使用该数据库连接?
先感谢您
UPDATE
我希望在"src/test/resources-payara-remote/glassfish-resources.xml"中使用我的test-db声明jdbc连接(不在远程服务器中创建jdbc连接),但我不知道如何设置arquillian以使用.xml文件中声明的jdbc连接.