Where do I put the .js file when I create js interface with Graphene 2
- by Thang Pham
I follow this tutorial https://docs.jboss.org/author/display/ARQGRA2/JavaScript+Interface
Where do I put my helloworld.js file? I put it under webapp/resources/js/helloworld.js and I do
import org.jboss.arquillian.graphene.javascript.Dependency;
import org.jboss.arquillian.graphene.javascript.JavaScript;
@JavaScript("helloworld")
@Dependency(sources = "js/helloworld.js")
public interface HelloWorld {
String hello();
}
and I got NPE when I inject
@JavaScript
private HelloWorld helloWorld;
Please help. Here is my POM, I use glassfish3.1
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.org.jboss.arquillian>1.0.4.Final</version.org.jboss.arquillian>
<version.org.jboss.arquillian.drone>1.2.0.Alpha2</version.org.jboss.arquillian.drone>
<version.org.jboss.arquillian.graphene>1.0.0.Final</version.org.jboss.arquillian.graphene>
<version.org.jboss.arquillian.graphene2>2.0.0.Alpha4</version.org.jboss.arquillian.graphene2>
</properties>
<dependencyManagement>
<dependencies>
<!-- Arquillian Drone dependencies and Selenium dependencies -->
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>${version.org.jboss.arquillian.drone}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Arquillian Core dependencies -->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.org.jboss.arquillian}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</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.extension</groupId>
<artifactId>arquillian-drone-webdriver-depchain</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>${version.org.jboss.arquillian.graphene2}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver-impl</artifactId>
<version>${version.org.jboss.arquillian.graphene2}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-remote-3.1</artifactId>
<version>1.0.0.CR4</version>
<scope>test</scope>
</dependency>
</dependencies>