Skip to content

Commit a4bcb64

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents bd9e098 + a4b91fd commit a4bcb64

File tree

8 files changed

+48
-29
lines changed

8 files changed

+48
-29
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ When developing and runing them from IDE, remember to activate the profile befor
7171

7272
To learn more about Arquillian please refer to the [Arquillian Guides](http://arquillian.org/guides/)
7373

74+
### Importing in Eclipse ###
75+
76+
To import the samples in an Eclipse workspace, please install the [Groovy plugins for your Eclipse version](http://groovy.codehaus.org/Eclipse+Plugin) first, then import the sample projects you want using File>Import>Existing Maven Projects.
77+
7478
## How to contribute ##
7579

7680
With your help we can improve this set of samples, learn from each other and grow the community full of passionate people who care about the technology, innovation and code quality. Every contribution matters!

jaxrs/angularjs/src/test/java/org/javaee7/jaxrs/angularjs/NoteResourceImplTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.jboss.shrinkwrap.api.Archive;
1818
import org.jboss.shrinkwrap.api.GenericArchive;
1919
import org.jboss.shrinkwrap.api.ShrinkWrap;
20+
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
2021
import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
2122
import org.jboss.shrinkwrap.api.spec.WebArchive;
2223
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
@@ -49,6 +50,8 @@ public static Archive createDeployment()
4950
return ShrinkWrap.create(WebArchive.class, NoteResourceImplTest.class.getSimpleName() + ".war")
5051
.addClasses(Note.class, NoteApp.class, NoteResource.class, NoteResourceImpl.class)
5152
.addAsResource("META-INF/persistence.xml")
53+
.addAsWebInfResource("enforce-beans.xml", "jboss-all.xml")
54+
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
5255
.addAsLibraries(seleniumApi)
5356
.merge(webResources);
5457
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jboss xmlns="urn:jboss:1.0">
3+
<weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
4+
</jboss>

jaxrs/async-client/src/test/java/org/javaee7/jaxrs/asyncclient/MyResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class MyResourceTest {
4444

4545
/**
4646
* Since +JAX-RS+ webservices are, well, web related and require a
47-
* web contex, they are required to be deployed within a +web archive+.
47+
* web context, they are required to be deployed within a +web archive+.
4848
* By default, +JAX-RS+ will perform autodiscovery of our services.
4949
* That means there is no need to add a +web.xml+ in this scenario.
5050
*
@@ -83,7 +83,7 @@ public void setUpClass() throws MalformedURLException {
8383
*
8484
* include::MyResourceTest#setUpClass[]
8585
*
86-
* Now we're free to invoke our deployed service by using the +JAX-RS+
86+
* Now we are free to invoke our deployed service by using the +JAX-RS+
8787
* client library.
8888
*
8989
* The asynchronous client library comes with multiple option on how

jms/jms-xa/src/main/java/org/javaee7/jms/xa/JMSMailman.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import javax.jms.JMSException;
77
import javax.jms.Message;
88
import javax.jms.MessageListener;
9-
import javax.jms.TextMessage;
109
import java.util.logging.Level;
1110
import java.util.logging.Logger;
1211

@@ -24,8 +23,8 @@ public class JMSMailman implements MessageListener {
2423
public void onMessage(Message message)
2524
{
2625
try {
27-
TextMessage tm = (TextMessage) message;
28-
logger.info("Message received (async): " + tm.getText());
26+
String text = message.getBody(String.class);
27+
logger.info("Message received (async): " + text);
2928
deliveryStats.messageDelivered();
3029
} catch (JMSException ex) {
3130
logger.log(Level.SEVERE, null, ex);

jms/jms-xa/src/main/java/org/javaee7/jms/xa/Mailman.java

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
import javax.annotation.Resource;
44
import javax.ejb.Singleton;
55
import javax.inject.Inject;
6-
import javax.jms.Connection;
76
import javax.jms.ConnectionFactory;
7+
import javax.jms.JMSContext;
88
import javax.jms.JMSDestinationDefinition;
9-
import javax.jms.JMSException;
10-
import javax.jms.MessageProducer;
119
import javax.jms.Queue;
12-
import javax.jms.Session;
13-
import javax.jms.TextMessage;
1410

1511
@JMSDestinationDefinition(
1612
name = Mailman.CLASSIC_QUEUE,
@@ -32,24 +28,8 @@ public class Mailman {
3228

3329
public void sendMessage(String payload)
3430
{
35-
Connection connection = null;
36-
try {
37-
connection = connectionFactory.createConnection();
38-
connection.start();
39-
Session session = connection.createSession(false, Session.SESSION_TRANSACTED);
40-
MessageProducer messageProducer = session.createProducer(demoQueue);
41-
TextMessage textMessage = session.createTextMessage(payload);
42-
messageProducer.send(textMessage);
43-
} catch (JMSException ex) {
44-
ex.printStackTrace();
45-
} finally {
46-
if (connection != null) {
47-
try {
48-
connection.close();
49-
} catch (JMSException ex) {
50-
ex.printStackTrace();
51-
}
52-
}
31+
try (JMSContext context = connectionFactory.createContext()) {
32+
context.createProducer().send(demoQueue,payload);
5333
}
5434
}
5535
}

jms/jms-xa/src/test/resources/arquillian.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@
88
<property name="deploymentExportPath">target/deployment</property>
99
</engine>
1010

11+
<container qualifier="wildfly">
12+
<configuration>
13+
<property name="serverConfig">standalone-full.xml</property>
14+
</configuration>
15+
</container>
16+
1117
</arquillian>

pom.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@
272272
</dependency>
273273
</dependencies>
274274
</plugin>
275+
<plugin>
276+
<groupId>org.codehaus.groovy</groupId>
277+
<artifactId>groovy-eclipse-compiler</artifactId>
278+
<version>2.8.0-01</version>
279+
<extensions>true</extensions>
280+
</plugin>
275281
<plugin>
276282
<groupId>org.apache.maven.plugins</groupId>
277283
<artifactId>maven-surefire-plugin</artifactId>
@@ -306,6 +312,15 @@
306312
</execution>
307313
</executions>
308314
</plugin>
315+
<plugin>
316+
<groupId>org.apache.maven.plugins</groupId>
317+
<artifactId>maven-surefire-report-plugin</artifactId>
318+
<version>2.17</version>
319+
<configuration>
320+
<aggregate>true</aggregate>
321+
<linkXRef>true</linkXRef>
322+
</configuration>
323+
</plugin>
309324
<plugin>
310325
<groupId>org.apache.maven.plugins</groupId>
311326
<artifactId>maven-war-plugin</artifactId>
@@ -354,8 +369,12 @@
354369
<plugins>
355370
<plugin>
356371
<groupId>org.apache.maven.plugins</groupId>
357-
<artifactId>maven-surefire-plugin</artifactId>
372+
<artifactId>maven-surefire-report-plugin</artifactId>
358373
<version>2.17</version>
374+
<configuration>
375+
<aggregate>true</aggregate>
376+
<linkXRef>true</linkXRef>
377+
</configuration>
359378
</plugin>
360379
</plugins>
361380
</reporting>
@@ -446,6 +465,7 @@
446465
<configuration>
447466
<systemPropertyVariables>
448467
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
468+
<arquillian.launch>wildfly</arquillian.launch>
449469
</systemPropertyVariables>
450470
<environmentVariables>
451471
<JBOSS_HOME>${project.build.directory}/wildfly-${org.wildfly}</JBOSS_HOME>
@@ -540,6 +560,9 @@
540560
<environmentVariables>
541561
<JBOSS_HOME>${project.build.directory}/wildfly-${org.wildfly}</JBOSS_HOME>
542562
</environmentVariables>
563+
<systemPropertyVariables>
564+
<arquillian.launch>wildfly</arquillian.launch>
565+
</systemPropertyVariables>
543566
</configuration>
544567
</plugin>
545568
</plugins>

0 commit comments

Comments
 (0)