From 0262d2728f4b2cfcee4b74f6ed44fa09f6f06970 Mon Sep 17 00:00:00 2001 From: slavisa-baeldung Date: Wed, 16 Nov 2016 07:21:01 +0100 Subject: [PATCH] BAEL-317 - Added junit and surefire, updated the authentication info so that it fits the article --- ejb/ejb-client/pom.xml | 72 +++++++++++++------ .../com/baeldung/ejb/client/EJBClient.java | 4 +- .../resources/jboss-ejb-client.properties | 4 +- ejb/ejb-remote/pom.xml | 4 +- .../baeldung/ejb/tutorial/HelloWorldBean.java | 5 -- 5 files changed, 55 insertions(+), 34 deletions(-) diff --git a/ejb/ejb-client/pom.xml b/ejb/ejb-client/pom.xml index d1d245ba6d..772e4056d3 100644 --- a/ejb/ejb-client/pom.xml +++ b/ejb/ejb-client/pom.xml @@ -1,28 +1,54 @@ - 4.0.0 - - com.baeldung.ejb - ejb - 1.0-SNAPSHOT - - ejb-client - EJB3 Client Maven - EJB3 Client Maven + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + + com.baeldung.ejb + ejb + 1.0-SNAPSHOT + + ejb-client + EJB3 Client Maven + EJB3 Client Maven + + 4.12 + 2.19.1 + + + + + org.wildfly + wildfly-ejb-client-bom + pom + import + + + com.baeldung.ejb + ejb-remote + ejb + + + + junit + junit + ${junit.version} + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + **/*EJBSetupTest.java + + + + + - - - org.wildfly - wildfly-ejb-client-bom - pom - import - - - com.baeldung.ejb - ejb-remote - ejb - - \ No newline at end of file diff --git a/ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java b/ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java index 5426bbdc81..08286d580e 100644 --- a/ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java +++ b/ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java @@ -55,8 +55,8 @@ public class EJBClient { prop.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); prop.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080"); - prop.put(Context.SECURITY_PRINCIPAL, "pritamtest"); - prop.put(Context.SECURITY_CREDENTIALS, "iamtheki9g"); + prop.put(Context.SECURITY_PRINCIPAL, "testUser"); + prop.put(Context.SECURITY_CREDENTIALS, "admin1234!"); prop.put("jboss.naming.client.ejb.context", false); context = new InitialContext(prop); diff --git a/ejb/ejb-client/src/main/resources/jboss-ejb-client.properties b/ejb/ejb-client/src/main/resources/jboss-ejb-client.properties index e17d8ba17e..077cd7583f 100644 --- a/ejb/ejb-client/src/main/resources/jboss-ejb-client.properties +++ b/ejb/ejb-client/src/main/resources/jboss-ejb-client.properties @@ -4,5 +4,5 @@ remote.connection.default.port=8080 remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=${host.auth:JBOSS-LOCAL-USER} -remote.connection.default.username=pritamtest -remote.connection.default.password=iamtheki9g \ No newline at end of file +remote.connection.default.username=testUser +remote.connection.default.password=admin1234! \ No newline at end of file diff --git a/ejb/ejb-remote/pom.xml b/ejb/ejb-remote/pom.xml index 3661fa5b2c..65bfc6dbec 100644 --- a/ejb/ejb-remote/pom.xml +++ b/ejb/ejb-remote/pom.xml @@ -28,8 +28,8 @@ 127.0.0.1 9990 - pritamtest - iamtheki9g + testUser + admin1234! ${build.finalName}.jar diff --git a/ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java b/ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java index 6c5ee34afe..4b88747e6a 100644 --- a/ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java +++ b/ejb/ejb-remote/src/main/java/com/baeldung/ejb/tutorial/HelloWorldBean.java @@ -1,15 +1,10 @@ package com.baeldung.ejb.tutorial; -import javax.annotation.Resource; -import javax.ejb.SessionContext; import javax.ejb.Stateless; @Stateless(name = "HelloWorld") public class HelloWorldBean implements HelloWorld { - @Resource - private SessionContext context; - @Override public String getHelloWorld() { return "Welcome to EJB Tutorial!";