Skip to content

Commit 0262d27

Browse files
BAEL-317 - Added junit and surefire, updated the authentication info so that it fits the article
1 parent 35ee1b8 commit 0262d27

5 files changed

Lines changed: 55 additions & 34 deletions

File tree

‎ejb/ejb-client/pom.xml‎

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
<?xml version="1.0"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>com.baeldung.ejb</groupId>
7-
<artifactId>ejb</artifactId>
8-
<version>1.0-SNAPSHOT</version>
9-
</parent>
10-
<artifactId>ejb-client</artifactId>
11-
<name>EJB3 Client Maven</name>
12-
<description>EJB3 Client Maven</description>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>com.baeldung.ejb</groupId>
7+
<artifactId>ejb</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<artifactId>ejb-client</artifactId>
11+
<name>EJB3 Client Maven</name>
12+
<description>EJB3 Client Maven</description>
13+
<properties>
14+
<junit.version>4.12</junit.version>
15+
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
16+
</properties>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.wildfly</groupId>
21+
<artifactId>wildfly-ejb-client-bom</artifactId>
22+
<type>pom</type>
23+
<scope>import</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>com.baeldung.ejb</groupId>
27+
<artifactId>ejb-remote</artifactId>
28+
<type>ejb</type>
29+
</dependency>
30+
31+
<dependency>
32+
<groupId>junit</groupId>
33+
<artifactId>junit</artifactId>
34+
<version>${junit.version}</version>
35+
<scope>test</scope>
36+
</dependency>
37+
</dependencies>
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-surefire-plugin</artifactId>
43+
<version>${maven-surefire-plugin.version}</version>
44+
<configuration>
45+
<excludes>
46+
<exclude>**/*EJBSetupTest.java</exclude>
47+
</excludes>
48+
</configuration>
49+
</plugin>
50+
</plugins>
51+
</build>
1352

14-
<dependencies>
15-
<dependency>
16-
<groupId>org.wildfly</groupId>
17-
<artifactId>wildfly-ejb-client-bom</artifactId>
18-
<type>pom</type>
19-
<scope>import</scope>
20-
</dependency>
21-
<dependency>
22-
<groupId>com.baeldung.ejb</groupId>
23-
<artifactId>ejb-remote</artifactId>
24-
<type>ejb</type>
25-
</dependency>
26-
</dependencies>
2753

2854
</project>

‎ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public void createInitialContext() throws NamingException {
5555
prop.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
5656
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
5757
prop.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
58-
prop.put(Context.SECURITY_PRINCIPAL, "pritamtest");
59-
prop.put(Context.SECURITY_CREDENTIALS, "iamtheki9g");
58+
prop.put(Context.SECURITY_PRINCIPAL, "testUser");
59+
prop.put(Context.SECURITY_CREDENTIALS, "admin1234!");
6060
prop.put("jboss.naming.client.ejb.context", false);
6161

6262
context = new InitialContext(prop);

‎ejb/ejb-client/src/main/resources/jboss-ejb-client.properties‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ remote.connection.default.port=8080
44
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
55
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
66
remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=${host.auth:JBOSS-LOCAL-USER}
7-
remote.connection.default.username=pritamtest
8-
remote.connection.default.password=iamtheki9g
7+
remote.connection.default.username=testUser
8+
remote.connection.default.password=admin1234!

‎ejb/ejb-remote/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
<configuration>
2929
<hostname>127.0.0.1</hostname>
3030
<port>9990</port>
31-
<username>pritamtest</username>
32-
<password>iamtheki9g</password>
31+
<username>testUser</username>
32+
<password>admin1234!</password>
3333
<filename>${build.finalName}.jar</filename>
3434
</configuration>
3535
</plugin>

‎ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
package com.baeldung.ejb.tutorial;
22

3-
import javax.annotation.Resource;
4-
import javax.ejb.SessionContext;
53
import javax.ejb.Stateless;
64

75
@Stateless(name = "HelloWorld")
86
public class HelloWorldBean implements HelloWorld {
97

10-
@Resource
11-
private SessionContext context;
12-
138
@Override
149
public String getHelloWorld() {
1510
return "Welcome to EJB Tutorial!";

0 commit comments

Comments
 (0)