Skip to content

Commit 9482bd8

Browse files
author
Reza Rahman
committed
Cleanup
1 parent 8a6cde7 commit 9482bd8

13 files changed

Lines changed: 216 additions & 72 deletions

File tree

actionbazaar/pom.xml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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/xsd/maven-4.0.0.xsd">
2+
<project
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
46
<name>actionbazaar</name>
57
<modelVersion>4.0.0</modelVersion>
68
<groupId>com.actionbazaar</groupId>
@@ -35,7 +37,7 @@
3537
<version>1.3.1.Final</version>
3638
<type>pom</type>
3739
<scope>import</scope>
38-
</dependency>
40+
</dependency>
3941
</dependencies>
4042
</dependencyManagement>
4143
<dependencies>
@@ -75,18 +77,18 @@
7577
<type>pom</type>
7678
<scope>test</scope>
7779
</dependency>
80+
<dependency>
81+
<groupId>org.jboss.arquillian.extension</groupId>
82+
<artifactId>arquillian-drone-webdriver-depchain</artifactId>
83+
<type>pom</type>
84+
<scope>test</scope>
85+
</dependency>
7886
<dependency>
7987
<groupId>org.jboss.arquillian.container</groupId>
8088
<artifactId>arquillian-wls-remote-12.1</artifactId>
8189
<version>1.0.0.Alpha2</version>
8290
<scope>test</scope>
8391
</dependency>
84-
<dependency>
85-
<groupId>org.jboss.arquillian.extension</groupId>
86-
<artifactId>arquillian-drone-webdriver-depchain</artifactId>
87-
<type>pom</type>
88-
<scope>test</scope>
89-
</dependency>
9092
<dependency>
9193
<groupId>org.glassfish.tyrus</groupId>
9294
<artifactId>tyrus-server</artifactId>
@@ -125,7 +127,6 @@
125127
<version>2.1.1</version>
126128
<configuration>
127129
<failOnMissingWebXml>false</failOnMissingWebXml>
128-
<!-- <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors> -->
129130
<warName>actionbazaar</warName>
130131
</configuration>
131132
</plugin>

actionbazaar/src/main/java/com/actionbazaar/interfaces/rest/RestConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* JAX-RS configuration.
4747
*/
4848
@ApplicationPath("rest")
49+
// TODO Move this to XML.
4950
public class RestConfiguration extends ResourceConfig {
5051

5152
public RestConfiguration() {
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<persistence version="2.1"
3-
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
5-
<persistence-unit name="action-bazaar-unit">
6-
<jta-data-source>jdbc/ActionBazaarDB</jta-data-source>
7-
<properties>
8-
<property name="javax.persistence.schema-generation.database.action"
9-
value="drop-and-create" />
10-
<property name="eclipselink.logging.level" value="FINEST" />
11-
</properties>
12-
</persistence-unit>
2+
<persistence
3+
version="2.1"
4+
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
7+
<persistence-unit name="action-bazaar-unit">
8+
<jta-data-source>jdbc/ActionBazaarDB</jta-data-source>
9+
<properties>
10+
<property name="javax.persistence.schema-generation.database.action"
11+
value="drop-and-create" />
12+
<property name="eclipselink.logging.level" value="INFO" />
13+
</properties>
14+
</persistence-unit>
1315
</persistence>

actionbazaar/src/main/webapp/WEB-INF/web.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<web-app version="3.0"
3-
xmlns="http://java.sun.com/xml/ns/javaee"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
2+
<web-app
3+
version="3.0"
4+
xmlns="http://java.sun.com/xml/ns/javaee"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
67
<context-param>
78
<param-name>javax.faces.PROJECT_STAGE</param-name>
8-
<param-value>UnitTest</param-value>
9+
<param-value>Development</param-value>
910
</context-param>
1011
<servlet>
1112
<servlet-name>Faces Servlet</servlet-name>
@@ -16,6 +17,9 @@
1617
<servlet-name>Faces Servlet</servlet-name>
1718
<url-pattern>*.jsf</url-pattern>
1819
</servlet-mapping>
20+
<session-config>
21+
<session-timeout>30</session-timeout>
22+
</session-config>
1923
<welcome-file-list>
2024
<welcome-file>add_bid.jsf</welcome-file>
2125
</welcome-file-list>

actionbazaar/src/test/java/com/actionbazaar/interfaces/rest/BidRestServiceTest.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
140
package com.actionbazaar.interfaces.rest;
241

342
import com.actionbazaar.application.BidService;
@@ -20,6 +59,7 @@
2059
import org.junit.runner.RunWith;
2160

2261
@RunWith(Arquillian.class)
62+
// TODO Move this to client side.
2363
public class BidRestServiceTest {
2464

2565
private static Long bidId;

actionbazaar/src/test/java/com/actionbazaar/interfaces/socket/ChatServerTest.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,48 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
140
package com.actionbazaar.interfaces.socket;
241

342
import java.io.IOException;
443
import java.net.URI;
544
import java.net.URISyntaxException;
45+
import java.net.URL;
646
import java.util.Arrays;
747
import java.util.logging.Level;
848
import java.util.logging.Logger;
@@ -19,6 +59,7 @@
1959
import javax.websocket.WebSocketContainer;
2060
import org.jboss.arquillian.container.test.api.Deployment;
2161
import org.jboss.arquillian.junit.Arquillian;
62+
import org.jboss.arquillian.test.api.ArquillianResource;
2263
import org.jboss.shrinkwrap.api.ShrinkWrap;
2364
import org.jboss.shrinkwrap.api.spec.WebArchive;
2465
import static org.junit.Assert.assertEquals;

actionbazaar/src/test/java/com/actionbazaar/interfaces/web/AddBidTest.java

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
140
package com.actionbazaar.interfaces.web;
241

342
import com.actionbazaar.application.BidService;
@@ -39,8 +78,6 @@ public static Archive<?> createDeployment() {
3978
.addAsWebInfResource("test-web.xml", "web.xml")
4079
.addAsWebResource("add_bid.xhtml", "add_bid.xhtml")
4180
.addAsWebResource("confirm_add_bid.xhtml", "confirm_add_bid.xhtml")
42-
.addAsWebInfResource("test-faces-config.xml",
43-
"faces-config.xml")
4481
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
4582
.addAsResource("test-persistence.xml",
4683
"META-INF/persistence.xml");
@@ -53,27 +90,11 @@ public void testAddBid() {
5390
browser.findElement(By.id("bidForm:itemTextField")).sendKeys("Test item");
5491
browser.findElement(By.id("bidForm:bidderTextField")).sendKeys("rrahman");
5592
browser.findElement(By.id("bidForm:amountTextField")).sendKeys("50.25");
93+
5694
browser.findElement(By.id("bidForm:addBidButton")).click();
5795

5896
assertEquals("Test item", browser.findElement(By.id("itemField")).getText());
5997
assertEquals("rrahman", browser.findElement(By.id("bidderField")).getText());
6098
assertEquals("50.25", browser.findElement(By.id("amountField")).getText());
61-
//
62-
// JSFServerSession server = session.getJSFServerSession();
63-
//
64-
// assertEquals(null, server.getManagedBeanValue("#{bid.item}"));
65-
// assertEquals(null, server.getManagedBeanValue("#{bid.bidder}"));
66-
// assertEquals(null, server.getManagedBeanValue("#{bid.amount}"));
67-
//
68-
// JSFClientSession client = session.getJSFClientSession();
69-
//
70-
// client.setValue("item", "Test Item");
71-
// client.setValue("bidder", "Test Bidder");
72-
// client.setValue("amount", "101.50");
73-
// client.click("add");
74-
//
75-
// assertEquals("/confirm_bid.xhtml", server.getCurrentViewID());
76-
//
77-
7899
}
79100
}

actionbazaar/src/test/java/com/actionbazaar/interfaces/web/AlertServletTest.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
140
package com.actionbazaar.interfaces.web;
241

342
import static org.junit.Assert.assertEquals;
@@ -17,6 +56,7 @@
1756
import org.junit.runner.RunWith;
1857

1958
@RunWith(Arquillian.class)
59+
// TODO Move to client side.
2060
public class AlertServletTest {
2161

2262
@Deployment
@@ -27,8 +67,7 @@ public static WebArchive createDeployment() {
2767
.addAsWebInfResource("test-weblogic.xml", "weblogic.xml");
2868
File[] files = Maven
2969
.resolver()
30-
.resolve(
31-
"org.glassfish.jersey.media:jersey-media-json-processing:2.5.1")
70+
.resolve("org.glassfish.jersey.media:jersey-media-json-processing:2.5.1")
3271
.withTransitivity().asFile();
3372
archive.addAsLibraries(files);
3473

@@ -44,6 +83,7 @@ public void testGetAlerts() {
4483
.target("http://localhost:7001/actionbazaar-test/alerts")
4584
.queryParam("user_id", "1111").request("application/json")
4685
.get(JsonObject.class);
86+
// TODO Assert more of the content.
4787
assertEquals(5, response.getJsonArray("alerts").size());
4888
}
4989
}

actionbazaar/src/test/resources/arquillian.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0"?>
2-
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xmlns="http://jboss.org/schema/arquillian"
4-
xsi:schemaLocation="http://jboss.org/schema/arquillian
2+
<arquillian
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns="http://jboss.org/schema/arquillian"
5+
xsi:schemaLocation="http://jboss.org/schema/arquillian
56
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
67
<engine>
78
<property name="deploymentExportPath">target/</property>

actionbazaar/src/test/resources/test-faces-config.xml

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

0 commit comments

Comments
 (0)