Skip to content

Commit 340db63

Browse files
committed
Removed redundant file, cleaned up test implementation
1 parent f30193d commit 340db63

File tree

2 files changed

+24
-30
lines changed

2 files changed

+24
-30
lines changed

websocket/binary/src/test/java/org/javaee7/websocket/binary/test/WebsocketBinaryEndpointTest.java

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import org.javaee7.websocket.binary.MyEndpointClient;
1919
import org.javaee7.websocket.binary.MyEndpointInputStream;
2020
import org.jboss.arquillian.container.test.api.Deployment;
21-
import org.jboss.arquillian.container.test.api.TargetsContainer;
2221
import org.jboss.arquillian.junit.Arquillian;
22+
import org.jboss.arquillian.test.api.ArquillianResource;
2323
import org.jboss.shrinkwrap.api.ShrinkWrap;
2424
import org.jboss.shrinkwrap.api.spec.WebArchive;
2525
import static org.junit.Assert.*;
@@ -30,28 +30,26 @@
3030
* @author Nikos Ballas
3131
* @author Arun Gupta
3232
*/
33-
//@RunWith(Arquillian.class)
33+
@RunWith(Arquillian.class)
3434
public class WebsocketBinaryEndpointTest {
3535

36-
private static final String WEBAPP_SRC = "src/main/webapp";
3736
private static final String RESPONSE = "Hello World!";
3837

38+
@ArquillianResource
39+
URI base;
40+
3941
/**
4042
* Arquillian specific method for creating a file which can be deployed
4143
* while executing the test.
42-
*
43-
* @return a war file deployable in the jboss instance configuraed in
44-
* arquillian.xml file.
4544
*/
46-
@Deployment(testable = false)
47-
// @TargetsContainer("wildfly-arquillian")
45+
@Deployment(testable=false)
4846
public static WebArchive createDeployment() {
4947
WebArchive war = ShrinkWrap.create(WebArchive.class)
50-
.addClass(MyEndpointByteBuffer.class)
51-
.addClass(MyEndpointByteArray.class)
52-
.addClass(MyEndpointInputStream.class)
53-
.addClass(MyEndpointClient.class)
54-
.addAsWebResource(new File(WEBAPP_SRC, "websocket.js"));
48+
.addClasses(MyEndpointByteBuffer.class,
49+
MyEndpointByteArray.class,
50+
MyEndpointInputStream.class,
51+
MyEndpointClient.class);
52+
System.out.println(war.toString(true));
5553
return war;
5654
}
5755

@@ -122,6 +120,18 @@ public void testEndpointInputStream() throws DeploymentException, IOException, U
122120
*/
123121
public Session connectToServer(String endpoint) throws DeploymentException, IOException, URISyntaxException {
124122
WebSocketContainer container = ContainerProvider.getWebSocketContainer();
125-
return container.connectToServer(MyEndpointClient.class, new URI("ws://localhost:8080/binary/" + endpoint));
123+
URI uri = new URI("ws://"
124+
+ base.getHost()
125+
+ ":"
126+
+ base.getPort()
127+
+ "/"
128+
+ base.getPath()
129+
+ "/"
130+
131+
// "localhost:8080/binary/""
132+
+ endpoint);
133+
System.out.println("Connecting to: " + uri);
134+
return container.connectToServer(MyEndpointClient.class, uri);
135+
126136
}
127137
}

websocket/binary/src/test/resources/arquillian.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)