Trimming trailing spaces, removing tabs by a script
- using tab width of 4 spaces
- trailing space in property files is converted to unicode, so it is
visible in sources
- bat files use CRLF
- all other text files use just LF
diff --git a/appserver/tests/paas/appscoped-db-with-resources-xml/pom.xml b/appserver/tests/paas/appscoped-db-with-resources-xml/pom.xml
index b30495b..ce14296 100644
--- a/appserver/tests/paas/appscoped-db-with-resources-xml/pom.xml
+++ b/appserver/tests/paas/appscoped-db-with-resources-xml/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml
index b26f17a..70488dc 100644
--- a/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/appscoped-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>CoffeeServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-bookstore-dns/pom.xml b/appserver/tests/paas/basic-bookstore-dns/pom.xml
index 165f29b..037ccfa 100644
--- a/appserver/tests/paas/basic-bookstore-dns/pom.xml
+++ b/appserver/tests/paas/basic-bookstore-dns/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
@@ -70,7 +70,7 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.glassfish.tests.paas.basetest</groupId>
<artifactId>base-test</artifactId>
<version>${project.version}</version>
diff --git a/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/sun-web.xml
index e9eed44..e45e147 100644
--- a/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/web.xml
index f5ce35c..f06abb7 100644
--- a/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic-bookstore-dns/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BasicPaaSServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-bookstore-dns/src/test/java/org/glassfish/tests/paas/dns/BasicbookstoreDnsPaasTest.java b/appserver/tests/paas/basic-bookstore-dns/src/test/java/org/glassfish/tests/paas/dns/BasicbookstoreDnsPaasTest.java
index ce96ea8..5ce3692 100644
--- a/appserver/tests/paas/basic-bookstore-dns/src/test/java/org/glassfish/tests/paas/dns/BasicbookstoreDnsPaasTest.java
+++ b/appserver/tests/paas/basic-bookstore-dns/src/test/java/org/glassfish/tests/paas/dns/BasicbookstoreDnsPaasTest.java
@@ -46,165 +46,165 @@
public class BasicbookstoreDnsPaasTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // Bootstrap GlassFish DAS in embedded mode.
- GlassFish glassfish = bootstrap();
+ // Bootstrap GlassFish DAS in embedded mode.
+ GlassFish glassfish = bootstrap();
- // Deploy the Basic and bookstore app and verify it.
- runTests(glassfish);
+ // Deploy the Basic and bookstore app and verify it.
+ runTests(glassfish);
-
- // 5. Stop the GlassFish DAS
- glassfish.dispose();
- }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ // 5. Stop the GlassFish DAS
+ glassfish.dispose();
+ }
- private void runTests(GlassFish glassfish) throws Exception {
- // 2. Deploy the PaaS application.
- File basicArchive = new File(System.getProperty("basedir")
- + "/basic_paas_sample.war"); // TODO :: use mvn apis to
-
- File bookArchive = new File(System.getProperty("basedir")
- + "/bookstore.war");
-
- Assert.assertTrue(basicArchive.exists());
- Assert.assertTrue(bookArchive.exists());
- Deployer deployer = null;
- String firstappName = null;
- String secondappName = null;
- BaseTest firstBaseTest = new BaseTest(glassfish);
- BaseTest secondBaseTest = new BaseTest(glassfish);
- try {
- CreateDNSExternalService();
- CreateLbSharedService(glassfish);
- firstappName = firstBaseTest.deploy(basicArchive,"basic_paas_sample",null);
-
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- System.err.println("Deployed [" + firstappName + "]");
- Assert.assertNotNull(firstappName);
+ private void runTests(GlassFish glassfish) throws Exception {
+ // 2. Deploy the PaaS application.
+ File basicArchive = new File(System.getProperty("basedir")
+ + "/basic_paas_sample.war"); // TODO :: use mvn apis to
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ File bookArchive = new File(System.getProperty("basedir")
+ + "/bookstore.war");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- firstappName = firstappName.replaceAll("_","-");
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
-
- get("http://" + firstappName +".hudson.com:" + HTTP_PORT
- + "/BasicPaaSServlet",
- "Request headers from the request:");
-
-
- secondappName = secondBaseTest.deploy(bookArchive,"bookstore",null);
- System.err.println("Deployed [" + secondappName + "]");
- Assert.assertNotNull(secondappName);
- secondappName = secondappName.replaceAll("_","-");
- get("http://" + secondappName +".hudson.com:" + HTTP_PORT
- + "/BookStoreServlet",
- "Please wait while accessing the bookstore database.....");
+ Assert.assertTrue(basicArchive.exists());
+ Assert.assertTrue(bookArchive.exists());
+ Deployer deployer = null;
+ String firstappName = null;
+ String secondappName = null;
+ BaseTest firstBaseTest = new BaseTest(glassfish);
+ BaseTest secondBaseTest = new BaseTest(glassfish);
+ try {
+ CreateDNSExternalService();
+ CreateLbSharedService(glassfish);
+ firstappName = firstBaseTest.deploy(basicArchive,"basic_paas_sample",null);
- get("http://"
- + secondappName +".hudson.com:"
- + HTTP_PORT
- + "/BookStoreServlet?title=Advanced+guide+for+developing+PaaS+components&authors=Shalini+M&price=100%24",
- "Here are the list of books available in our store:");
- get("http://" + secondappName+".hudson.com:" + HTTP_PORT
- + "/BookStoreServlet",
- "Advanced guide for developing PaaS components");
- get("http://" + firstappName +".hudson.com:" + HTTP_PORT
- + "/BasicPaaSServlet",
- "Request headers from the request:");
- if (secondappName != null) {
- secondBaseTest.undeploy();
- System.err.println("Undeployed [" + secondappName + "]");
- }
+ System.err.println("Deployed [" + firstappName + "]");
+ Assert.assertNotNull(firstappName);
- get("http://" + firstappName +".hudson.com:" + HTTP_PORT
- + "/BasicPaaSServlet",
- "Request headers from the request:");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 4. Undeploy the PaaS application . TODO :: use cloud-undeploy??
- } finally {
- if (firstappName != null) {
- firstappName = firstappName.replaceAll("-","_");
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ firstappName = firstappName.replaceAll("_","-");
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- firstBaseTest.undeploy();
- System.err.println("Undeployed [" + firstappName + "]");
- deleteSharedLbandDNSexternalSerivce();
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
+ get("http://" + firstappName +".hudson.com:" + HTTP_PORT
+ + "/BasicPaaSServlet",
+ "Request headers from the request:");
- }
-
-
- }
- }
+ secondappName = secondBaseTest.deploy(bookArchive,"bookstore",null);
+ System.err.println("Deployed [" + secondappName + "]");
+ Assert.assertNotNull(secondappName);
+ secondappName = secondappName.replaceAll("_","-");
+ get("http://" + secondappName +".hudson.com:" + HTTP_PORT
+ + "/BookStoreServlet",
+ "Please wait while accessing the bookstore database.....");
- private GlassFish bootstrap() throws Exception {
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
- return glassfish;
- }
+ get("http://"
+ + secondappName +".hudson.com:"
+ + HTTP_PORT
+ + "/BookStoreServlet?title=Advanced+guide+for+developing+PaaS+components&authors=Shalini+M&price=100%24",
+ "Here are the list of books available in our store:");
+
+ get("http://" + secondappName+".hudson.com:" + HTTP_PORT
+ + "/BookStoreServlet",
+ "Advanced guide for developing PaaS components");
+ get("http://" + firstappName +".hudson.com:" + HTTP_PORT
+ + "/BasicPaaSServlet",
+ "Request headers from the request:");
+ if (secondappName != null) {
+ secondBaseTest.undeploy();
+ System.err.println("Undeployed [" + secondappName + "]");
+ }
+
+ get("http://" + firstappName +".hudson.com:" + HTTP_PORT
+ + "/BasicPaaSServlet",
+ "Request headers from the request:");
+
+ // 4. Undeploy the PaaS application . TODO :: use cloud-undeploy??
+ } finally {
+ if (firstappName != null) {
+ firstappName = firstappName.replaceAll("-","_");
+
+ firstBaseTest.undeploy();
+ System.err.println("Undeployed [" + firstappName + "]");
+ deleteSharedLbandDNSexternalSerivce();
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
+
+ }
+
+
+ }
+
+ }
+
+ private GlassFish bootstrap() throws Exception {
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
+ return glassfish;
+ }
/* Creates LB as a shared service */
public void CreateLbSharedService(GlassFish glassfish) throws Exception {
- ServiceLocator habitat = Globals.getDefaultHabitat();
- org.glassfish.api.admin.CommandRunner commandRunner = habitat
- .getService(org.glassfish.api.admin.CommandRunner.class);
- ActionReport report = habitat.getService(ActionReport.class);
- String template = checkMode(glassfish);
- if(template.equalsIgnoreCase("Native")){
- template = "LBNative";
- }else if(template.equalsIgnoreCase("kvm")){
- template = "apachemodjk";
- }else{
- template = "otd-new";
- }
- org.glassfish.api.admin.CommandRunner.CommandInvocation invocation = commandRunner
- .getCommandInvocation("create-shared-service", report);
- ParameterMap parameterMap = new ParameterMap();
+ ServiceLocator habitat = Globals.getDefaultHabitat();
+ org.glassfish.api.admin.CommandRunner commandRunner = habitat
+ .getService(org.glassfish.api.admin.CommandRunner.class);
+ ActionReport report = habitat.getService(ActionReport.class);
+ String template = checkMode(glassfish);
+ if(template.equalsIgnoreCase("Native")){
+ template = "LBNative";
+ }else if(template.equalsIgnoreCase("kvm")){
+ template = "apachemodjk";
+ }else{
+ template = "otd-new";
+ }
+ org.glassfish.api.admin.CommandRunner.CommandInvocation invocation = commandRunner
+ .getCommandInvocation("create-shared-service", report);
+ ParameterMap parameterMap = new ParameterMap();
parameterMap.add("template", template);
parameterMap.add("configuration", "http-port=50080:https-port=50081:ssl-enabled=true:health-check-interval=60:health-check-timeout=10");
parameterMap.add("servicetype", "LB");
@@ -215,54 +215,54 @@
Assert.assertFalse(report.hasFailures());
}
-
+
/*Create DNS external shared service*/
-
+
public void CreateDNSExternalService(){
-
- ServiceLocator habitat = Globals.getDefaultHabitat();
- org.glassfish.api.admin.CommandRunner commandRunner = habitat
- .getService(org.glassfish.api.admin.CommandRunner.class);
- ActionReport report = habitat.getService(ActionReport.class);
- org.glassfish.api.admin.CommandRunner.CommandInvocation invocation = commandRunner
- .getCommandInvocation("create-external-service", report);
- ParameterMap parameterMap = new ParameterMap();
- parameterMap.add("servicetype", "DNS");
- parameterMap.add("configuration", "domain-name=hudson.com:dns-ip=10.178.214.173:dns-private-key-file-loc="+System.getenv("PAAS_TESTS_HOME")+"/basic-bookstore-dns/Kkey-glassfish.+157+05094.private");
- parameterMap.add("DEFAULT","hudson-dns-external-services");
- invocation.parameters(parameterMap).execute();
+
+ ServiceLocator habitat = Globals.getDefaultHabitat();
+ org.glassfish.api.admin.CommandRunner commandRunner = habitat
+ .getService(org.glassfish.api.admin.CommandRunner.class);
+ ActionReport report = habitat.getService(ActionReport.class);
+ org.glassfish.api.admin.CommandRunner.CommandInvocation invocation = commandRunner
+ .getCommandInvocation("create-external-service", report);
+ ParameterMap parameterMap = new ParameterMap();
+ parameterMap.add("servicetype", "DNS");
+ parameterMap.add("configuration", "domain-name=hudson.com:dns-ip=10.178.214.173:dns-private-key-file-loc="+System.getenv("PAAS_TESTS_HOME")+"/basic-bookstore-dns/Kkey-glassfish.+157+05094.private");
+ parameterMap.add("DEFAULT","hudson-dns-external-services");
+ invocation.parameters(parameterMap).execute();
System.out.println("Created external service 'hudson-dns-external-services' :" + !report.hasFailures());
Assert.assertFalse(report.hasFailures());
-
- }
-
- /* Check the mode of test execution */
- public String checkMode(GlassFish glassfish) throws Exception {
- ArrayList params = new ArrayList();
- CommandResult result = null;
- CommandRunner commandRunner = glassfish.getCommandRunner();
- params.clear();
- params.add("--virtualization");
- params.add("Native");
- result = commandRunner.run("list-templates",
- (String[]) params.toArray(new String[params.size()]));
- if (result.getOutput().contains("Native")) {
- return "Native";
- }
- params.clear();
- params.add("--virtualization");
- params.add("kvm");
- result = commandRunner.run("list-templates",
- (String[]) params.toArray(new String[params.size()]));
- if (result.getOutput().contains("apachemodjk")) {
- return "kvm";
- } else {
- return "ovm";
- }
}
-
+
+ /* Check the mode of test execution */
+ public String checkMode(GlassFish glassfish) throws Exception {
+ ArrayList params = new ArrayList();
+ CommandResult result = null;
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ params.clear();
+ params.add("--virtualization");
+ params.add("Native");
+ result = commandRunner.run("list-templates",
+ (String[]) params.toArray(new String[params.size()]));
+ if (result.getOutput().contains("Native")) {
+ return "Native";
+ }
+ params.clear();
+ params.add("--virtualization");
+ params.add("kvm");
+ result = commandRunner.run("list-templates",
+ (String[]) params.toArray(new String[params.size()]));
+ if (result.getOutput().contains("apachemodjk")) {
+ return "kvm";
+ } else {
+ return "ovm";
+ }
+
+ }
+
/*Delete shared LB service*/
private void deleteSharedLbandDNSexternalSerivce() {
ServiceLocator habitat = Globals.getDefaultHabitat();
@@ -276,7 +276,7 @@
invocation.parameters(parameterMap).execute();
Assert.assertFalse(report.hasFailures());
-
+
invocation = commandRunner.getCommandInvocation("delete-external-service", report);
parameterMap = new ParameterMap();
parameterMap.add("DEFAULT", "hudson-dns-external-services");
@@ -285,7 +285,7 @@
Assert.assertFalse(report.hasFailures());
}
-
-
+
+
}
diff --git a/appserver/tests/paas/basic-db-initsql/pom.xml b/appserver/tests/paas/basic-db-initsql/pom.xml
index 942f8e5..575bae1 100644
--- a/appserver/tests/paas/basic-db-initsql/pom.xml
+++ b/appserver/tests/paas/basic-db-initsql/pom.xml
@@ -50,12 +50,12 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
diff --git a/appserver/tests/paas/basic-db-initsql/src/main/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlServlet.java b/appserver/tests/paas/basic-db-initsql/src/main/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlServlet.java
index bb35f73..767c465 100644
--- a/appserver/tests/paas/basic-db-initsql/src/main/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlServlet.java
+++ b/appserver/tests/paas/basic-db-initsql/src/main/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlServlet.java
@@ -90,9 +90,9 @@
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Data retrieved from table \"customer\"" + "</th>");
writer.println("</tr>");
- writer.println("<tr>");
- writer.println("<td>" + "Customer ID" + "</td>");
- writer.println("<td>" + "Customer Name" + "</td>");
+ writer.println("<tr>");
+ writer.println("<td>" + "Customer ID" + "</td>");
+ writer.println("<td>" + "Customer Name" + "</td>");
writer.println("</tr>");
while (rs.next()) {
writer.println("<tr>");
diff --git a/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/sun-web.xml
index fa0a7e2..d8f8ec1 100644
--- a/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/web.xml
index e0dd716..2701cb7 100644
--- a/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic-db-initsql/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BasicDBInitSqlServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-db-initsql/src/test/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlTest.java b/appserver/tests/paas/basic-db-initsql/src/test/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlTest.java
index d5b7008..99033b9 100644
--- a/appserver/tests/paas/basic-db-initsql/src/test/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlTest.java
+++ b/appserver/tests/paas/basic-db-initsql/src/test/java/org/glassfish/tests/paas/basicdbinitsql/BasicDBInitSqlTest.java
@@ -40,137 +40,137 @@
public class BasicDBInitSqlTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
+ // 1. Bootstrap GlassFish DAS in embedded mode.
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/basic_db_initsql_paas_sample.war"); // TODO :: use
- // mvn apis to
- // get the
- // archive
- // location.
- Assert.assertTrue(archive.exists());
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/basic_db_initsql_paas_sample.war"); // TODO :: use
+ // mvn apis to
+ // get the
+ // archive
+ // location.
+ Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ Deployer deployer = null;
+ String appName = null;
+ try {
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
- String instanceIP = getLBIPAddress(glassfish);
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
+ String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/basic_db_initsql_paas_sample/BasicDBInitSqlServlet",
- "Customer ID");
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/basic_db_initsql_paas_sample/BasicDBInitSqlServlet",
+ "Customer ID");
testListServices();
- // 4. Undeploy the PaaS application .
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.out.println("Destroying the resources created");
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
- }
- }
+ // 4. Undeploy the PaaS application .
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.out.println("Destroying the resources created");
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
+ }
+ }
- }
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
private void testListServices() {
ServiceLocator habitat = Globals.getDefaultHabitat();
diff --git a/appserver/tests/paas/basic-db-teardown-sql/pom.xml b/appserver/tests/paas/basic-db-teardown-sql/pom.xml
index fa27e7c..4f85bf1 100644
--- a/appserver/tests/paas/basic-db-teardown-sql/pom.xml
+++ b/appserver/tests/paas/basic-db-teardown-sql/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/basic-db-teardown-sql/src/main/java/org/glassfish/tests/paas/basicdbteardownsql/DbConnectionDetailsServlet.java b/appserver/tests/paas/basic-db-teardown-sql/src/main/java/org/glassfish/tests/paas/basicdbteardownsql/DbConnectionDetailsServlet.java
index fe64e65..4d09069 100644
--- a/appserver/tests/paas/basic-db-teardown-sql/src/main/java/org/glassfish/tests/paas/basicdbteardownsql/DbConnectionDetailsServlet.java
+++ b/appserver/tests/paas/basic-db-teardown-sql/src/main/java/org/glassfish/tests/paas/basicdbteardownsql/DbConnectionDetailsServlet.java
@@ -63,9 +63,9 @@
try {
stmt = ds.getConnection().createStatement();
- DatabaseMetaData dbMetadata = stmt.getConnection().getMetaData();
+ DatabaseMetaData dbMetadata = stmt.getConnection().getMetaData();
- writer.println(dbMetadata.getURL());
+ writer.println(dbMetadata.getURL());
writer.println(dbMetadata.getUserName());
writer.println(userCredentials.get(dbMetadata.getUserName()));
} catch (Exception ex) {
diff --git a/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/glassfish-resources.xml b/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/glassfish-resources.xml
index 8931a2b..b960334 100644
--- a/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/glassfish-resources.xml
+++ b/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/glassfish-resources.xml
@@ -20,7 +20,7 @@
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
- <jdbc-connection-pool res-type="javax.sql.DataSource" name="java:app/jdbc/teardown_sql_test_pool">
+ <jdbc-connection-pool res-type="javax.sql.DataSource" name="java:app/jdbc/teardown_sql_test_pool">
<property name="service-name" value="coffee-service"/>
</jdbc-connection-pool>
diff --git a/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/web.xml
index 6153ad6..7d6c0e8 100644
--- a/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic-db-teardown-sql/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>CoffeeServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-db-teardown-sql/src/test/java/org/glassfish/tests/paas/basicdbteardownsql/CoffeeTest.java b/appserver/tests/paas/basic-db-teardown-sql/src/test/java/org/glassfish/tests/paas/basicdbteardownsql/CoffeeTest.java
index 609d5c6..3d70be6 100644
--- a/appserver/tests/paas/basic-db-teardown-sql/src/test/java/org/glassfish/tests/paas/basicdbteardownsql/CoffeeTest.java
+++ b/appserver/tests/paas/basic-db-teardown-sql/src/test/java/org/glassfish/tests/paas/basicdbteardownsql/CoffeeTest.java
@@ -111,7 +111,7 @@
if (appName != null) {
deployer.undeploy(appName);
System.err.println("Undeployed [" + appName + "]");
- testTearDownSql(dbConnectionDetails);
+ testTearDownSql(dbConnectionDetails);
System.out.println("Destroying the resources created");
//4.1. Delete Shared DB Service.
CommandResult deleteResult = commandRunner.run(
diff --git a/appserver/tests/paas/basic-db-with-resources-xml/pom.xml b/appserver/tests/paas/basic-db-with-resources-xml/pom.xml
index 5204dc5..e192a9d 100644
--- a/appserver/tests/paas/basic-db-with-resources-xml/pom.xml
+++ b/appserver/tests/paas/basic-db-with-resources-xml/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml
index e9b824b..7bf2a1c 100644
--- a/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic-db-with-resources-xml/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>CoffeeServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-db/pom.xml b/appserver/tests/paas/basic-db/pom.xml
index 4ae4294..07d35e4 100644
--- a/appserver/tests/paas/basic-db/pom.xml
+++ b/appserver/tests/paas/basic-db/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/sun-web.xml
index 96dcc37..ab99a30 100644
--- a/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/web.xml
index 91c03a3..672c15e 100644
--- a/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic-db/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BasicDBPaaSServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-db/src/test/java/org/glassfish/tests/paas/basicdb/BasicDBPaaSTest.java b/appserver/tests/paas/basic-db/src/test/java/org/glassfish/tests/paas/basicdb/BasicDBPaaSTest.java
index cb4b5a5..c5a2233 100644
--- a/appserver/tests/paas/basic-db/src/test/java/org/glassfish/tests/paas/basicdb/BasicDBPaaSTest.java
+++ b/appserver/tests/paas/basic-db/src/test/java/org/glassfish/tests/paas/basicdb/BasicDBPaaSTest.java
@@ -48,136 +48,136 @@
public class BasicDBPaaSTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
+ // 1. Bootstrap GlassFish DAS in embedded mode.
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/basic_db_paas_sample.war"); // TODO :: use mvn apis
- // to get the archive
- // location.
- Assert.assertTrue(archive.exists());
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/basic_db_paas_sample.war"); // TODO :: use mvn apis
+ // to get the archive
+ // location.
+ Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
+ Deployer deployer = null;
+ String appName = null;
+ try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- /**
- * Look for a table entry by name SYSFILES in the output to ensure
- * DB is provisioned
- *
- */
- String instanceIP = getLBIPAddress(glassfish);
+ /**
+ * Look for a table entry by name SYSFILES in the output to ensure
+ * DB is provisioned
+ *
+ */
+ String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/basic_db_paas_sample/BasicDBPaaSServlet", "SYSFILES");
- // 4. Undeploy the PaaS-DB application using undeploy.
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
- }
- }
- }
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/basic_db_paas_sample/BasicDBPaaSServlet", "SYSFILES");
+ // 4. Undeploy the PaaS-DB application using undeploy.
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
+ }
+ }
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/basic-jpa/pom.xml b/appserver/tests/paas/basic-jpa/pom.xml
index 9392d7d..dce0c22 100644
--- a/appserver/tests/paas/basic-jpa/pom.xml
+++ b/appserver/tests/paas/basic-jpa/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
@@ -64,7 +64,7 @@
<version>3.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
@@ -84,8 +84,8 @@
</systemPath>
</dependency>
<dependency>
- <groupId>jakarta.transaction</groupId>
- <artifactId>jta</artifactId>
+ <groupId>jakarta.transaction</groupId>
+ <artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
diff --git a/appserver/tests/paas/basic-jpa/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java b/appserver/tests/paas/basic-jpa/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java
index 81430f5..d974277 100644
--- a/appserver/tests/paas/basic-jpa/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java
+++ b/appserver/tests/paas/basic-jpa/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java
@@ -24,25 +24,25 @@
import jakarta.persistence.IdClass;
import jakarta.persistence.Table;
-
+
/**
*
* @author ishan.vishnoi@java.net
*/
-@Entity
+@Entity
@Table(name = "ZOO_DIRECTORY")
public class Animal implements Serializable {
-
+
@Id
private int ID;
-
+
private String name;
-
+
private String species;
-
+
private String cageNumber;
-
+
private String yearOfBirth;
public int getID() {
@@ -51,7 +51,7 @@
public void setID(int ID) {
this.ID = ID;
- }
+ }
public String getCageNumber() {
return cageNumber;
@@ -84,7 +84,7 @@
public void setYearOfBirth(String yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
-
+
@Override
public String toString() {
return "entity.NewEntity[id=" + ID + "]";
diff --git a/appserver/tests/paas/basic-jpa/src/test/java/org/glassfish/tests/paas/basicjpa/BasicJPAPaaSTest.java b/appserver/tests/paas/basic-jpa/src/test/java/org/glassfish/tests/paas/basicjpa/BasicJPAPaaSTest.java
index 7b6389a..9dc9cdc 100644
--- a/appserver/tests/paas/basic-jpa/src/test/java/org/glassfish/tests/paas/basicjpa/BasicJPAPaaSTest.java
+++ b/appserver/tests/paas/basic-jpa/src/test/java/org/glassfish/tests/paas/basicjpa/BasicJPAPaaSTest.java
@@ -48,133 +48,133 @@
public class BasicJPAPaaSTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
+ // 1. Bootstrap GlassFish DAS in embedded mode.
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
- // 2. Deploy the PaaS-bookstore application.
- File archive = new File(System.getProperty("basedir")
- + "/target/basic-jpa.war"); // TODO :: use mvn apis to get the
- // archive location.
- Assert.assertTrue(archive.exists());
+ // 2. Deploy the PaaS-bookstore application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/basic-jpa.war"); // TODO :: use mvn apis to get the
+ // archive location.
+ Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ Deployer deployer = null;
+ String appName = null;
+ try {
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS-basic-jpa app is correctly
- // provisioned.
+ // 3. Access the app to make sure PaaS-basic-jpa app is correctly
+ // provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- String instanceIP = getLBIPAddress(glassfish);
+ String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/basic-jpa/list","Here is a list of animals in the zoo.");
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/basic-jpa/list","Here is a list of animals in the zoo.");
- // 4. Undeploy the Zoo catalogue application .
+ // 4. Undeploy the Zoo catalogue application .
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
- }
- }
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
+ }
+ }
- }
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
-
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ }
+
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/basic-service-discovery/pom.xml b/appserver/tests/paas/basic-service-discovery/pom.xml
index 65ea685..6225f3f 100644
--- a/appserver/tests/paas/basic-service-discovery/pom.xml
+++ b/appserver/tests/paas/basic-service-discovery/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/sun-web.xml
index 05e78ac..b60e32f 100644
--- a/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/web.xml
index 774a6d0..38c4a13 100644
--- a/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic-service-discovery/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BasicSDPaaSServlet</servlet-name>
diff --git a/appserver/tests/paas/basic-shared-service-test/pom.xml b/appserver/tests/paas/basic-shared-service-test/pom.xml
index 1ba360b..d29b799 100644
--- a/appserver/tests/paas/basic-shared-service-test/pom.xml
+++ b/appserver/tests/paas/basic-shared-service-test/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
@@ -64,7 +64,7 @@
<version>3.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
@@ -84,8 +84,8 @@
</systemPath>
</dependency>
<dependency>
- <groupId>jakarta.transaction</groupId>
- <artifactId>jta</artifactId>
+ <groupId>jakarta.transaction</groupId>
+ <artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
diff --git a/appserver/tests/paas/basic-shared-service-test/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java b/appserver/tests/paas/basic-shared-service-test/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java
index 1a06f4f..4d53705 100644
--- a/appserver/tests/paas/basic-shared-service-test/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java
+++ b/appserver/tests/paas/basic-shared-service-test/src/main/java/org/glassfish/tests/paas/basicjpa/Animal.java
@@ -26,19 +26,19 @@
*
* @author ishan.vishnoi@java.net
*/
-@Entity
+@Entity
@Table(name = "ZOO_DIRECTORY")
public class Animal implements Serializable {
-
+
@Id
private int ID;
-
+
private String name;
-
+
private String species;
-
+
private String cageNumber;
-
+
private String yearOfBirth;
public int getID() {
@@ -47,7 +47,7 @@
public void setID(int ID) {
this.ID = ID;
- }
+ }
public String getCageNumber() {
return cageNumber;
@@ -80,7 +80,7 @@
public void setYearOfBirth(String yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
-
+
@Override
public String toString() {
return "entity.NewEntity[id=" + ID + "]";
diff --git a/appserver/tests/paas/basic/native_setup.sh b/appserver/tests/paas/basic/native_setup.sh
index 3bdbc69..9c82b78 100755
--- a/appserver/tests/paas/basic/native_setup.sh
+++ b/appserver/tests/paas/basic/native_setup.sh
@@ -19,6 +19,6 @@
$GF_HOME/bin/asadmin start-domain --debug
$GF_HOME/bin/asadmin create-ims-config-native
#$GF_HOME/bin/asadmin create-server-pool --virtualization Native --subnet 192.168.1.102/250 --portName "br0" Native
-$GF_HOME/bin/asadmin stop-domain
+$GF_HOME/bin/asadmin stop-domain
#$GF_HOME/bin/asadmin create-template --indexes ServiceType=JavaEE,VirtualizationType=Native Native
#$GF_HOME/bin/asadmin create-template --indexes ServiceType=Database,VirtualizationType=Native DBNative
diff --git a/appserver/tests/paas/basic/pom.xml b/appserver/tests/paas/basic/pom.xml
index 57e9523..e46fff1 100644
--- a/appserver/tests/paas/basic/pom.xml
+++ b/appserver/tests/paas/basic/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/basic/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/basic/src/main/webapp/WEB-INF/sun-web.xml
index e9eed44..e45e147 100644
--- a/appserver/tests/paas/basic/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/basic/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/basic/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/basic/src/main/webapp/WEB-INF/web.xml
index f5ce35c..f06abb7 100644
--- a/appserver/tests/paas/basic/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/basic/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BasicPaaSServlet</servlet-name>
diff --git a/appserver/tests/paas/basic/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSTest.java b/appserver/tests/paas/basic/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSTest.java
index f2c632c..0e0c1de 100644
--- a/appserver/tests/paas/basic/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSTest.java
+++ b/appserver/tests/paas/basic/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSTest.java
@@ -39,151 +39,151 @@
public class BasicPaaSTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // Bootstrap GlassFish DAS in embedded mode.
- GlassFish glassfish = bootstrap();
+ // Bootstrap GlassFish DAS in embedded mode.
+ GlassFish glassfish = bootstrap();
- // Deploy the PaaS app and verify it.
- runTests(glassfish);
+ // Deploy the PaaS app and verify it.
+ runTests(glassfish);
- // Re-deploy the PaaS app and verify it.
- String testScenarios = System.getProperty("test.scenarios");
- if (testScenarios == null
- || "all".contains(testScenarios.toLowerCase())) {
- runTests(glassfish);
- }
+ // Re-deploy the PaaS app and verify it.
+ String testScenarios = System.getProperty("test.scenarios");
+ if (testScenarios == null
+ || "all".contains(testScenarios.toLowerCase())) {
+ runTests(glassfish);
+ }
- // 5. Stop the GlassFish DAS
- glassfish.dispose();
- }
+ // 5. Stop the GlassFish DAS
+ glassfish.dispose();
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private void runTests(GlassFish glassfish) throws Exception {
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/basic_paas_sample.war"); // TODO :: use mvn apis to
- // get the archive location.
- Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ private void runTests(GlassFish glassfish) throws Exception {
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/basic_paas_sample.war"); // TODO :: use mvn apis to
+ // get the archive location.
+ Assert.assertTrue(archive.exists());
+ Deployer deployer = null;
+ String appName = null;
+ try {
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- String instanceIP = getLBIPAddress(glassfish);
+ String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/basic_paas_sample/BasicPaaSServlet",
- "Request headers from the request:");
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/basic_paas_sample/BasicPaaSServlet",
+ "Request headers from the request:");
- // 4. Undeploy the PaaS application . TODO :: use cloud-undeploy??
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
+ // 4. Undeploy the PaaS application . TODO :: use cloud-undeploy??
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
- }
- }
+ }
+ }
- }
+ }
- private GlassFish bootstrap() throws Exception {
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
- return glassfish;
- }
+ private GlassFish bootstrap() throws Exception {
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
+ return glassfish;
+ }
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/bookstore/pom.xml b/appserver/tests/paas/bookstore/pom.xml
index 75bb20e..dfafaf6 100644
--- a/appserver/tests/paas/bookstore/pom.xml
+++ b/appserver/tests/paas/bookstore/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/BookStoreServlet.java b/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/BookStoreServlet.java
index f81f000..8f60d5f 100644
--- a/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/BookStoreServlet.java
+++ b/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/BookStoreServlet.java
@@ -88,7 +88,7 @@
request.getParameter("authors"), request.getParameter("price"));
operations.printBooksTable(ds, writer);
generateNewBookForm(writer);
-
+
}
writer.println("<p/><a href=\'BookStoreServlet\'>My Home</a>");
diff --git a/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/DatabaseOperations.java b/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/DatabaseOperations.java
index 11d293c..a9c5383 100644
--- a/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/DatabaseOperations.java
+++ b/appserver/tests/paas/bookstore/src/main/java/org/glassfish/tests/paas/basic/DatabaseOperations.java
@@ -222,7 +222,7 @@
stmt = con.createStatement();
String query = "SELECT * from BOOKS_TABLE";
ResultSet rs = stmt.executeQuery(query);
-
+
boolean printHeaders = true;
while(rs.next()) {
@@ -239,7 +239,7 @@
}
out.println("</tr>");
}
-
+
if(!printHeaders) { // atleast one row was there.
out.println("</table>");
} else {
@@ -262,7 +262,7 @@
}
}
}
-
+
private boolean execute(DataSource ds1, String sql) {
Connection con = null;
Statement stmt = null;
diff --git a/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/sun-web.xml
index 2ca5008..0caa236 100644
--- a/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/web.xml
index 6d09f42..5934ed3 100644
--- a/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/bookstore/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BookStoreServlet</servlet-name>
diff --git a/appserver/tests/paas/deployment-rollback/pom.xml b/appserver/tests/paas/deployment-rollback/pom.xml
index 1eae7b7..1e84b97 100644
--- a/appserver/tests/paas/deployment-rollback/pom.xml
+++ b/appserver/tests/paas/deployment-rollback/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/sun-web.xml
index f20cff7..c69fb1f 100644
--- a/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/web.xml
index edca10c..624ca99 100644
--- a/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/deployment-rollback/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>RollbackTestServlet</servlet-name>
diff --git a/appserver/tests/paas/enable-disable-test/pom.xml b/appserver/tests/paas/enable-disable-test/pom.xml
index 8087176..5585fd0 100644
--- a/appserver/tests/paas/enable-disable-test/pom.xml
+++ b/appserver/tests/paas/enable-disable-test/pom.xml
@@ -50,12 +50,12 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
diff --git a/appserver/tests/paas/enable-disable-test/src/main/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableServlet.java b/appserver/tests/paas/enable-disable-test/src/main/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableServlet.java
index 8e913da..5671f7c 100644
--- a/appserver/tests/paas/enable-disable-test/src/main/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableServlet.java
+++ b/appserver/tests/paas/enable-disable-test/src/main/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableServlet.java
@@ -90,9 +90,9 @@
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Data retrieved from table \"customer\"" + "</th>");
writer.println("</tr>");
- writer.println("<tr>");
- writer.println("<td>" + "Customer ID" + "</td>");
- writer.println("<td>" + "Customer Name" + "</td>");
+ writer.println("<tr>");
+ writer.println("<td>" + "Customer ID" + "</td>");
+ writer.println("<td>" + "Customer Name" + "</td>");
writer.println("</tr>");
while (rs.next()) {
writer.println("<tr>");
diff --git a/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/sun-web.xml
index 8813339..9a26ff9 100644
--- a/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/web.xml
index 93cd12f..2ac8231 100644
--- a/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/enable-disable-test/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>EnableDisableServlet</servlet-name>
diff --git a/appserver/tests/paas/enable-disable-test/src/test/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableTest.java b/appserver/tests/paas/enable-disable-test/src/test/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableTest.java
index 4c603a7..7eaf31a 100644
--- a/appserver/tests/paas/enable-disable-test/src/test/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableTest.java
+++ b/appserver/tests/paas/enable-disable-test/src/test/java/org/glassfish/tests/paas/enable_disable_test/EnableDisableTest.java
@@ -37,53 +37,53 @@
public class EnableDisableTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
+ // 1. Bootstrap GlassFish DAS in embedded mode.
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/enable-disable-sample.war"); // TODO :: use
- // mvn apis to
- // get the
- // archive
- // location.
- Assert.assertTrue(archive.exists());
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/enable-disable-sample.war"); // TODO :: use
+ // mvn apis to
+ // get the
+ // archive
+ // location.
+ Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ Deployer deployer = null;
+ String appName = null;
+ try {
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandResult result = null;
- CommandRunner commandRunner = glassfish.getCommandRunner();
- {
- result = commandRunner.run("list-services", "appname="
- + appName, "output=STATE");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandResult result = null;
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ {
+ result = commandRunner.run("list-services", "appname="
+ + appName, "output=STATE");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- boolean notRunning = result.getOutput().toLowerCase()
- .contains("notrunning");
- Assert.assertTrue(!notRunning);
- boolean stopped = result.getOutput().toLowerCase()
- .contains("stopped");
- Assert.assertTrue(!stopped);
- }
+ boolean notRunning = result.getOutput().toLowerCase()
+ .contains("notrunning");
+ Assert.assertTrue(!notRunning);
+ boolean stopped = result.getOutput().toLowerCase()
+ .contains("stopped");
+ Assert.assertTrue(!stopped);
+ }
//2.a.Check if all services of the application are in ONLY running state.
@@ -113,15 +113,15 @@
Assert.assertTrue(servicesRunning);
System.out.println("All services in RUNNING state");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- String instanceIP = getLBIPAddress(glassfish);
+ String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/enable-disable-sample/EnableDisableServlet",
- "Customer ID");
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/enable-disable-sample/EnableDisableServlet",
+ "Customer ID");
//4.Disable application
@@ -161,92 +161,92 @@
Assert.assertFalse(report.hasFailures());
System.out.println("Enabled application ' "+appName+" ' ");
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/enable-disable-sample/EnableDisableServlet",
- "Customer ID");
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/enable-disable-sample/EnableDisableServlet",
+ "Customer ID");
- // 8.. Undeploy the PaaS application .
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.out.println("Destroying the resources created");
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
- }
- glassfish.dispose();
- }
+ // 8.. Undeploy the PaaS application .
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.out.println("Destroying the resources created");
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
+ }
+ glassfish.dispose();
+ }
- }
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.contains(result)) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.contains(result)) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/ext-shared-service-enable-disable-test/pom.xml b/appserver/tests/paas/ext-shared-service-enable-disable-test/pom.xml
index 346acad..92de7f3 100644
--- a/appserver/tests/paas/ext-shared-service-enable-disable-test/pom.xml
+++ b/appserver/tests/paas/ext-shared-service-enable-disable-test/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
@@ -64,7 +64,7 @@
<version>3.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
@@ -84,8 +84,8 @@
</systemPath>
</dependency>
<dependency>
- <groupId>jakarta.transaction</groupId>
- <artifactId>jta</artifactId>
+ <groupId>jakarta.transaction</groupId>
+ <artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
diff --git a/appserver/tests/paas/ext-shared-service-enable-disable-test/src/main/java/org/glassfish/tests/paas/enabledisable/Animal.java b/appserver/tests/paas/ext-shared-service-enable-disable-test/src/main/java/org/glassfish/tests/paas/enabledisable/Animal.java
index bc6233b..38757fe 100644
--- a/appserver/tests/paas/ext-shared-service-enable-disable-test/src/main/java/org/glassfish/tests/paas/enabledisable/Animal.java
+++ b/appserver/tests/paas/ext-shared-service-enable-disable-test/src/main/java/org/glassfish/tests/paas/enabledisable/Animal.java
@@ -26,19 +26,19 @@
*
* @author ishan.vishnoi@java.net
*/
-@Entity
+@Entity
@Table(name = "ZOO_DIRECTORY")
public class Animal implements Serializable {
-
+
@Id
private int ID;
-
+
private String name;
-
+
private String species;
-
+
private String cageNumber;
-
+
private String yearOfBirth;
public int getID() {
@@ -47,7 +47,7 @@
public void setID(int ID) {
this.ID = ID;
- }
+ }
public String getCageNumber() {
return cageNumber;
@@ -80,7 +80,7 @@
public void setYearOfBirth(String yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
-
+
@Override
public String toString() {
return "entity.NewEntity[id=" + ID + "]";
diff --git a/appserver/tests/paas/external-and-shared-service/pom.xml b/appserver/tests/paas/external-and-shared-service/pom.xml
index 89f696f..71f421e 100644
--- a/appserver/tests/paas/external-and-shared-service/pom.xml
+++ b/appserver/tests/paas/external-and-shared-service/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
@@ -64,7 +64,7 @@
<version>3.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
@@ -84,8 +84,8 @@
</systemPath>
</dependency>
<dependency>
- <groupId>jakarta.transaction</groupId>
- <artifactId>jta</artifactId>
+ <groupId>jakarta.transaction</groupId>
+ <artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
diff --git a/appserver/tests/paas/external-and-shared-service/src/main/java/org/glassfish/tests/paas/external_and_shared_service/Animal.java b/appserver/tests/paas/external-and-shared-service/src/main/java/org/glassfish/tests/paas/external_and_shared_service/Animal.java
index 6f3bc2c..cd809cd 100644
--- a/appserver/tests/paas/external-and-shared-service/src/main/java/org/glassfish/tests/paas/external_and_shared_service/Animal.java
+++ b/appserver/tests/paas/external-and-shared-service/src/main/java/org/glassfish/tests/paas/external_and_shared_service/Animal.java
@@ -26,19 +26,19 @@
*
* @author ishan.vishnoi@java.net
*/
-@Entity
+@Entity
@Table(name = "ZOO_DIRECTORY")
public class Animal implements Serializable {
-
+
@Id
private int ID;
-
+
private String name;
-
+
private String species;
-
+
private String cageNumber;
-
+
private String yearOfBirth;
public int getID() {
@@ -47,7 +47,7 @@
public void setID(int ID) {
this.ID = ID;
- }
+ }
public String getCageNumber() {
return cageNumber;
@@ -80,7 +80,7 @@
public void setYearOfBirth(String yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
-
+
@Override
public String toString() {
return "entity.NewEntity[id=" + ID + "]";
diff --git a/appserver/tests/paas/external-db-service/generatederbyvm/pom.xml b/appserver/tests/paas/external-db-service/generatederbyvm/pom.xml
index 20591f1..e3a8f04 100644
--- a/appserver/tests/paas/external-db-service/generatederbyvm/pom.xml
+++ b/appserver/tests/paas/external-db-service/generatederbyvm/pom.xml
@@ -26,7 +26,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>generatederbyvm</artifactId>
-
+
<name>GenerateDerbyVM</name>
<build>
<plugins>
diff --git a/appserver/tests/paas/external-db-service/test/pom.xml b/appserver/tests/paas/external-db-service/test/pom.xml
index 2db273a..b1314d2 100644
--- a/appserver/tests/paas/external-db-service/test/pom.xml
+++ b/appserver/tests/paas/external-db-service/test/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/web.xml
index 9096acf..3cb642a 100644
--- a/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/external-db-service/test/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>CoffeeServlet</servlet-name>
diff --git a/appserver/tests/paas/external-db-service/test/src/test/java/org/glassfish/tests/paas/externaldbservicetest/CoffeeTest.java b/appserver/tests/paas/external-db-service/test/src/test/java/org/glassfish/tests/paas/externaldbservicetest/CoffeeTest.java
index 54e6c69..426efc3 100644
--- a/appserver/tests/paas/external-db-service/test/src/test/java/org/glassfish/tests/paas/externaldbservicetest/CoffeeTest.java
+++ b/appserver/tests/paas/external-db-service/test/src/test/java/org/glassfish/tests/paas/externaldbservicetest/CoffeeTest.java
@@ -80,14 +80,14 @@
System.out.println("\ncreate-derby-vm command output [ " +
createDerbyVMResult.getOutput() + "]");
- String derbyIP = (createDerbyVMResult.getOutput().split("\n"))[1];
+ String derbyIP = (createDerbyVMResult.getOutput().split("\n"))[1];
System.out.println("Derby IP = " + derbyIP);
//2.2. Create the shared DB service
CommandResult createExternalServiceResult = commandRunner.run(
"create-external-service", "--configuration", "ip-address=" + derbyIP + ":databasename=foo:connectionAttributes=;'create=true':port=1527:user=APP:password=APP:host=" + derbyIP + ":classname=org.apache.derby.jdbc.ClientXADataSource:resourcetype=javax.sql.XADataSource",
- "--servicetype",
+ "--servicetype",
"Database", "coffee-service");
System.out.println("\ncreate-external-service command output [ " +
createExternalServiceResult.getOutput() + "]");
diff --git a/appserver/tests/paas/helloworld/pom.xml b/appserver/tests/paas/helloworld/pom.xml
index 44543c9..ef772b9 100644
--- a/appserver/tests/paas/helloworld/pom.xml
+++ b/appserver/tests/paas/helloworld/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/web.xml
index 4e8da75..c7b6d94 100644
--- a/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/helloworld/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Hello World</display-name>
</web-app>
diff --git a/appserver/tests/paas/helloworld/src/test/java/org/glassfish/tests/paas/helloworld/HelloWorldTest.java b/appserver/tests/paas/helloworld/src/test/java/org/glassfish/tests/paas/helloworld/HelloWorldTest.java
index 780c0ec..d7fbbe9 100644
--- a/appserver/tests/paas/helloworld/src/test/java/org/glassfish/tests/paas/helloworld/HelloWorldTest.java
+++ b/appserver/tests/paas/helloworld/src/test/java/org/glassfish/tests/paas/helloworld/HelloWorldTest.java
@@ -41,70 +41,70 @@
public class HelloWorldTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // Bootstrap GlassFish DAS in embedded mode.
- GlassFish glassfish = bootstrap();
+ // Bootstrap GlassFish DAS in embedded mode.
+ GlassFish glassfish = bootstrap();
- // Deploy the PaaS app and verify it.
- runTests(glassfish);
+ // Deploy the PaaS app and verify it.
+ runTests(glassfish);
- // Re-deploy the PaaS app and verify it.
- String testScenarios = System.getProperty("test.scenarios");
- if (testScenarios == null
- || "all".contains(testScenarios.toLowerCase())) {
- runTests(glassfish);
- }
+ // Re-deploy the PaaS app and verify it.
+ String testScenarios = System.getProperty("test.scenarios");
+ if (testScenarios == null
+ || "all".contains(testScenarios.toLowerCase())) {
+ runTests(glassfish);
+ }
- // 5. Stop the GlassFish DAS
- glassfish.dispose();
- }
+ // 5. Stop the GlassFish DAS
+ glassfish.dispose();
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private void runTests(GlassFish glassfish) throws Exception {
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/helloworld.war");
+ private void runTests(GlassFish glassfish) throws Exception {
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/helloworld.war");
- Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ Assert.assertTrue(archive.exists());
+ Deployer deployer = null;
+ String appName = null;
+ try {
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- List<String> ips = getLBIPAddress(glassfish);
+ List<String> ips = getLBIPAddress(glassfish);
//wait for instances to come up
//Thread.sleep(60000);
@@ -112,84 +112,84 @@
for (String ip:ips) {
get("http://" + ip + ":" + HTTP_PORT
+ "/helloworld/hi.jsp",
- "PaaS says Hello World!");
+ "PaaS says Hello World!");
}
- // 4. Undeploy the PaaS application.
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err.println("Couldn't verify whether undeploy succeeded");
- }
+ // 4. Undeploy the PaaS application.
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err.println("Couldn't verify whether undeploy succeeded");
+ }
- }
- }
+ }
+ }
- }
+ }
- private GlassFish bootstrap() throws Exception {
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
- return glassfish;
- }
+ private GlassFish bootstrap() throws Exception {
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
+ return glassfish;
+ }
- private List<String> getLBIPAddress(GlassFish glassfish) {
+ private List<String> getLBIPAddress(GlassFish glassfish) {
List<String> lbIPs = new ArrayList<String>();
- String IPAddressPattern = "(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LOAD_BALANCER",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ String IPAddressPattern = "(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LOAD_BALANCER",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
System.out.println("#####" + result);
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
while (m.find()) {
lbIPs.add(m.group(1));
}
System.out.println("LB IPs = " + lbIPs.toString());
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
while (m.find()) {
lbIPs.add(m.group(1));
}
System.out.println("LB IPs = " + lbIPs.toString());
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- lbIPs.add("localhost");
- }
- return lbIPs;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ lbIPs.add("localhost");
+ }
+ return lbIPs;
+ }
}
diff --git a/appserver/tests/paas/javaee_shared_service/pom.xml b/appserver/tests/paas/javaee_shared_service/pom.xml
index 7f88a7a..a08edc8 100644
--- a/appserver/tests/paas/javaee_shared_service/pom.xml
+++ b/appserver/tests/paas/javaee_shared_service/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/BookStoreServlet.java b/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/BookStoreServlet.java
index 4995966..06be1c3 100644
--- a/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/BookStoreServlet.java
+++ b/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/BookStoreServlet.java
@@ -87,7 +87,7 @@
request.getParameter("authors"), request.getParameter("price"));
operations.printBooksTable(ds, writer);
generateNewBookForm(writer);
-
+
}
writer.println("<p/><a href=\'BookStoreServlet\'>My Home</a>");
diff --git a/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/DatabaseOperations.java b/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/DatabaseOperations.java
index 85f9828..db81dc1 100644
--- a/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/DatabaseOperations.java
+++ b/appserver/tests/paas/javaee_shared_service/src/main/java/org/glassfish/tests/paas/javaee_shared_service/DatabaseOperations.java
@@ -222,7 +222,7 @@
stmt = con.createStatement();
String query = "SELECT * from BOOKS_TABLE";
ResultSet rs = stmt.executeQuery(query);
-
+
boolean printHeaders = true;
while(rs.next()) {
@@ -239,7 +239,7 @@
}
out.println("</tr>");
}
-
+
if(!printHeaders) { // atleast one row was there.
out.println("</table>");
} else {
@@ -262,7 +262,7 @@
}
}
}
-
+
private boolean execute(DataSource ds1, String sql) {
Connection con = null;
Statement stmt = null;
diff --git a/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/sun-web.xml
index 21536ab..8bfbd60 100644
--- a/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/web.xml
index b9417fa..06536d0 100644
--- a/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/javaee_shared_service/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BookStoreServlet</servlet-name>
diff --git a/appserver/tests/paas/lazy-shared-service-test/pom.xml b/appserver/tests/paas/lazy-shared-service-test/pom.xml
index 2e191c8..00c174e 100644
--- a/appserver/tests/paas/lazy-shared-service-test/pom.xml
+++ b/appserver/tests/paas/lazy-shared-service-test/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
@@ -64,7 +64,7 @@
<version>3.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
@@ -84,8 +84,8 @@
</systemPath>
</dependency>
<dependency>
- <groupId>jakarta.transaction</groupId>
- <artifactId>jta</artifactId>
+ <groupId>jakarta.transaction</groupId>
+ <artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
diff --git a/appserver/tests/paas/lazy-shared-service-test/src/main/webapp/WEB-INF/glassfish-resources.xml b/appserver/tests/paas/lazy-shared-service-test/src/main/webapp/WEB-INF/glassfish-resources.xml
index 1773a72..b77502b 100644
--- a/appserver/tests/paas/lazy-shared-service-test/src/main/webapp/WEB-INF/glassfish-resources.xml
+++ b/appserver/tests/paas/lazy-shared-service-test/src/main/webapp/WEB-INF/glassfish-resources.xml
@@ -20,7 +20,7 @@
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
- <jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.ClientXADataSource" res-type="javax.sql.DataSource" name="java:app/jdbc/lazy_init_shared_service">
+ <jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.ClientXADataSource" res-type="javax.sql.DataSource" name="java:app/jdbc/lazy_init_shared_service">
<property name="service-name" value="my-shared-db-service"/>
</jdbc-connection-pool>
diff --git a/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/pom.xml b/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/pom.xml
index bf051b9..daa0c77 100644
--- a/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/pom.xml
+++ b/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/pom.xml
@@ -25,19 +25,19 @@
<version>1.0</version>
<name>EJB</name>
<packaging>ejb</packaging>
- <build>
- <finalName>ejb30-hello-mdb-ejb</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
+ <build>
+ <finalName>ejb30-hello-mdb-ejb</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
@@ -45,18 +45,18 @@
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>jakarta.jms</groupId>
- <artifactId>jakarta.jms-api</artifactId>
- <version>3.0.0-RC1</version>
- </dependency>
- <dependency>
- <groupId>jakarta.ejb</groupId>
- <artifactId>jakarta.ejb-api</artifactId>
- <version>3.2.5</version>
- </dependency>
- </dependencies>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.jms</groupId>
+ <artifactId>jakarta.jms-api</artifactId>
+ <version>3.0.0-RC1</version>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ejb</groupId>
+ <artifactId>jakarta.ejb-api</artifactId>
+ <version>3.2.5</version>
+ </dependency>
+ </dependencies>
</project>
diff --git a/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/MessageBean.java b/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/MessageBean.java
index 7e61308..2a981dc 100644
--- a/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/MessageBean.java
+++ b/appserver/tests/paas/mq-shared-service-test/mq-app/ejb/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/MessageBean.java
@@ -24,9 +24,9 @@
@MessageDriven(mappedName="jms/ejb_ejb30_hello_mdb_InQueue")
public class MessageBean implements MessageListener {
- @Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
+ @Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
QueueConnectionFactory qcFactory;
-
+
//Destination Queue
@Resource(mappedName="jms/ejb_ejb30_hello_mdb_OutQueue")
Queue replyQueue;
@@ -35,14 +35,14 @@
System.out.println("MessageBean:: onMessage :: Got message!!!" + message);
QueueConnection connection = null;
- QueueSession session = null;
+ QueueSession session = null;
try {
connection = qcFactory.createQueueConnection();
session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(replyQueue);
TextMessage tmessage = session.createTextMessage();
- String msgText = "Reply for " + ((TextMessage) message).getText();
+ String msgText = "Reply for " + ((TextMessage) message).getText();
tmessage.setText(msgText);
System.out.println("Sending " + msgText);
sender.send(tmessage);
@@ -50,9 +50,9 @@
e.printStackTrace();
} finally {
try {
- if (session != null) {
- session.close();
- }
+ if (session != null) {
+ session.close();
+ }
if(connection != null) {
connection.close();
}
diff --git a/appserver/tests/paas/mq-shared-service-test/mq-app/pom.xml b/appserver/tests/paas/mq-shared-service-test/mq-app/pom.xml
index e3bd847..7e280bf 100644
--- a/appserver/tests/paas/mq-shared-service-test/mq-app/pom.xml
+++ b/appserver/tests/paas/mq-shared-service-test/mq-app/pom.xml
@@ -26,8 +26,8 @@
<name>MQ</name>
<packaging>pom</packaging>
<modules>
- <module>ejb</module>
- <module>web</module>
- <module>ear</module>
- </modules>
+ <module>ejb</module>
+ <module>web</module>
+ <module>ear</module>
+ </modules>
</project>
diff --git a/appserver/tests/paas/mq-shared-service-test/mq-app/web/pom.xml b/appserver/tests/paas/mq-shared-service-test/mq-app/web/pom.xml
index 6f20460..faae0aa 100644
--- a/appserver/tests/paas/mq-shared-service-test/mq-app/web/pom.xml
+++ b/appserver/tests/paas/mq-shared-service-test/mq-app/web/pom.xml
@@ -26,7 +26,7 @@
<name>WebServlet</name>
<packaging>war</packaging>
<build>
- <finalName>ejb30-hello-mdb-web</finalName>
+ <finalName>ejb30-hello-mdb-web</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -45,10 +45,10 @@
<artifactId>jakarta.jms-api</artifactId>
<version>3.0.0-RC1</version>
</dependency>
- <dependency>
- <groupId>jakarta.servlet</groupId>
- <artifactId>jakarta.servlet-api</artifactId>
- <version>4.0.0</version>
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <version>4.0.0</version>
</dependency>
- </dependencies>
+ </dependencies>
</project>
diff --git a/appserver/tests/paas/mq-shared-service-test/mq-app/web/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/web/TestServlet.java b/appserver/tests/paas/mq-shared-service-test/mq-app/web/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/web/TestServlet.java
index 4fb189d..237451e 100644
--- a/appserver/tests/paas/mq-shared-service-test/mq-app/web/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/web/TestServlet.java
+++ b/appserver/tests/paas/mq-shared-service-test/mq-app/web/src/main/java/com/sun/s1asdev/ejb/ejb30/hello/mdb/web/TestServlet.java
@@ -40,7 +40,7 @@
@Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
private QueueConnectionFactory queueConFactory;
-
+
//Target Queue
@Resource(mappedName="jms/ejb_ejb30_hello_mdb_InQueue")
private jakarta.jms.Queue msgBeanQueue;
@@ -68,7 +68,7 @@
String name = (String)en.nextElement();
String value = getInitParameter(name);
msg += name + "=" + value + ", ";
- }
+ }
writer.write(", initParams: " + msg + "\n");
doTest(writer);
}
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/pom.xml b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/pom.xml
index 396620c..025c306 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/pom.xml
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java
index f121631..1644434 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java
@@ -87,7 +87,7 @@
writer.println("</table>");
if (hrDs != null && salDs != null) {
Statement stmt1 = null;
- PreparedStatement stmt2 = null;
+ PreparedStatement stmt2 = null;
try {
stmt1 = hrDs.getConnection().createStatement();
@@ -100,34 +100,34 @@
ResultSet rs1 = stmt1.executeQuery("SELECT emp_id, emp_name from HR");
- String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
- stmt2 = salDs.getConnection().prepareStatement(salQuery);
-
- DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
+ String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
+ stmt2 = salDs.getConnection().prepareStatement(salQuery);
+
+ DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
String dbUrl2 = dbMetadata2.getURL();
writer.println("DB URL : " + dbUrl2 + "\n");
if (dbUrl2.indexOf("salary_database") == -1) {
throw new Exception("Custom Database [salary_database] is not created while provisioning.");
}
-
- writer.println("<table border=\"1\" width=\"100%\">");
+
+ writer.println("<table border=\"1\" width=\"100%\">");
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Employee Information retrieved" + "</th>");
writer.println("</tr>");
writer.println("<tr>");
writer.println("<td>" + "Employee ID" + "</td>");
writer.println("<td>" + "Employee Name" + "</td>");
- writer.println("<td>" + "Employee Salary" + "</td>");
+ writer.println("<td>" + "Employee Salary" + "</td>");
writer.println("</tr>");
while (rs1.next()) {
writer.println("<tr>");
writer.println(" <td>" + rs1.getObject(1) + "</td>");
writer.println(" <td>" + rs1.getObject(2) + "</td>");
- stmt2.setInt(1, (Integer) rs1.getObject(1));
- ResultSet rs2 = stmt2.executeQuery();
- while(rs2.next()) {
- writer.println(" <td>" + rs2.getObject(1) + "</td>");
- }
+ stmt2.setInt(1, (Integer) rs1.getObject(1));
+ ResultSet rs2 = stmt2.executeQuery();
+ while(rs2.next()) {
+ writer.println(" <td>" + rs2.getObject(1) + "</td>");
+ }
writer.println("</tr>");
}
writer.println("</table>");
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql
index 9c7a42c..7e3e5ea 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql
@@ -15,8 +15,8 @@
*/
CREATE TABLE SALARY (
- emp_id integer not null,
- emp_sal float(7, 2)
+ emp_id integer not null,
+ emp_sal float(7, 2)
);
INSERT INTO SALARY VALUES(101, 11111.12);
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/web.xml
index 33009c7..e28af27 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>EmployeeServlet</servlet-name>
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java
index e64d321..3c38814 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/advanced/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java
@@ -52,7 +52,7 @@
public void test() throws Exception {
// 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ "/domains/domain1");
glassFishProperties.setConfigFileReadOnly(false);
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/basic/init.salary-service.sql b/appserver/tests/paas/multiple-db-app-scoped-services/basic/init.salary-service.sql
index 9c7a42c..7e3e5ea 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/basic/init.salary-service.sql
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/basic/init.salary-service.sql
@@ -15,8 +15,8 @@
*/
CREATE TABLE SALARY (
- emp_id integer not null,
- emp_sal float(7, 2)
+ emp_id integer not null,
+ emp_sal float(7, 2)
);
INSERT INTO SALARY VALUES(101, 11111.12);
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/basic/pom.xml b/appserver/tests/paas/multiple-db-app-scoped-services/basic/pom.xml
index 24897b5..fa57359 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/basic/pom.xml
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/basic/pom.xml
@@ -50,12 +50,12 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java
index 05f14bf..faded1c 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeServlet.java
@@ -87,7 +87,7 @@
writer.println("</table>");
if (hrDs != null && salDs != null) {
Statement stmt1 = null;
- PreparedStatement stmt2 = null;
+ PreparedStatement stmt2 = null;
try {
stmt1 = hrDs.getConnection().createStatement();
@@ -100,35 +100,35 @@
ResultSet rs1 = stmt1.executeQuery("SELECT emp_id, emp_name from HR");
- String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
- stmt2 = salDs.getConnection().prepareStatement(salQuery);
-
- DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
+ String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
+ stmt2 = salDs.getConnection().prepareStatement(salQuery);
+
+ DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
String dbUrl2 = dbMetadata2.getURL();
writer.println("DB URL : " + dbUrl2 + "\n");
if (dbUrl2.indexOf("salary_database") == -1) {
throw new Exception("Custom Database [salary_database] is not created while provisioning.");
}
-
- writer.println("<table border=\"1\" width=\"100%\">");
+
+ writer.println("<table border=\"1\" width=\"100%\">");
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Employee Information retrieved" + "</th>");
writer.println("</tr>");
writer.println("<tr>");
writer.println("<td>" + "Employee ID" + "</td>");
writer.println("<td>" + "Employee Name" + "</td>");
- writer.println("<td>" + "Employee Salary" + "</td>");
+ writer.println("<td>" + "Employee Salary" + "</td>");
writer.println("</tr>");
while (rs1.next()) {
writer.println("<tr>");
writer.println(" <td>" + rs1.getObject(1) + "</td>");
writer.println(" <td>" + rs1.getObject(2) + "</td>");
- stmt2.setInt(1, (Integer) rs1.getObject(1));
- ResultSet rs2 = stmt2.executeQuery();
- while(rs2.next()) {
- writer.println(" <td>" + rs2.getObject(1) + "</td>");
+ stmt2.setInt(1, (Integer) rs1.getObject(1));
+ ResultSet rs2 = stmt2.executeQuery();
+ while(rs2.next()) {
+ writer.println(" <td>" + rs2.getObject(1) + "</td>");
writer.println("</tr>");
- }
+ }
}
writer.println("</table>");
} catch (Exception ex) {
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/web.xml
index 33009c7..e28af27 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>EmployeeServlet</servlet-name>
diff --git a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java
index e64d321..3c38814 100644
--- a/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java
+++ b/appserver/tests/paas/multiple-db-app-scoped-services/basic/src/test/java/org/glassfish/tests/paas/multipleappscopedservicetest/EmployeeTest.java
@@ -52,7 +52,7 @@
public void test() throws Exception {
// 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ "/domains/domain1");
glassFishProperties.setConfigFileReadOnly(false);
diff --git a/appserver/tests/paas/multiple-db-shared-services/advanced/pom.xml b/appserver/tests/paas/multiple-db-shared-services/advanced/pom.xml
index 3e0a046..1f46172 100644
--- a/appserver/tests/paas/multiple-db-shared-services/advanced/pom.xml
+++ b/appserver/tests/paas/multiple-db-shared-services/advanced/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java
index 4a3b193..73b75dc 100644
--- a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java
+++ b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java
@@ -87,7 +87,7 @@
writer.println("</table>");
if (hrDs != null && salDs != null) {
Statement stmt1 = null;
- PreparedStatement stmt2 = null;
+ PreparedStatement stmt2 = null;
try {
stmt1 = hrDs.getConnection().createStatement();
@@ -100,34 +100,34 @@
ResultSet rs1 = stmt1.executeQuery("SELECT emp_id, emp_name from HR");
- String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
- stmt2 = salDs.getConnection().prepareStatement(salQuery);
-
- DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
+ String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
+ stmt2 = salDs.getConnection().prepareStatement(salQuery);
+
+ DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
String dbUrl2 = dbMetadata2.getURL();
writer.println("DB URL : " + dbUrl2 + "\n");
if (dbUrl2.indexOf("salary_database") == -1) {
throw new Exception("Custom Database [salary_database] is not created while provisioning.");
}
-
- writer.println("<table border=\"1\" width=\"100%\">");
+
+ writer.println("<table border=\"1\" width=\"100%\">");
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Employee Information retrieved" + "</th>");
writer.println("</tr>");
writer.println("<tr>");
writer.println("<td>" + "Employee ID" + "</td>");
writer.println("<td>" + "Employee Name" + "</td>");
- writer.println("<td>" + "Employee Salary" + "</td>");
+ writer.println("<td>" + "Employee Salary" + "</td>");
writer.println("</tr>");
while (rs1.next()) {
writer.println("<tr>");
writer.println(" <td>" + rs1.getObject(1) + "</td>");
writer.println(" <td>" + rs1.getObject(2) + "</td>");
- stmt2.setInt(1, (Integer) rs1.getObject(1));
- ResultSet rs2 = stmt2.executeQuery();
- while(rs2.next()) {
- writer.println(" <td>" + rs2.getObject(1) + "</td>");
- }
+ stmt2.setInt(1, (Integer) rs1.getObject(1));
+ ResultSet rs2 = stmt2.executeQuery();
+ while(rs2.next()) {
+ writer.println(" <td>" + rs2.getObject(1) + "</td>");
+ }
writer.println("</tr>");
}
writer.println("</table>");
diff --git a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql
index 69ec9fb..9606eaf 100644
--- a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql
+++ b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/init.salary-service.sql
@@ -15,8 +15,8 @@
*/
CREATE TABLE SALARY (
- emp_id integer not null,
- emp_sal float(7, 2)
+ emp_id integer not null,
+ emp_sal float(7, 2)
);
INSERT INTO SALARY VALUES(101, 11111.12);
diff --git a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/web.xml
index 68ebd14..260c2c2 100644
--- a/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/multiple-db-shared-services/advanced/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>EmployeeServlet</servlet-name>
diff --git a/appserver/tests/paas/multiple-db-shared-services/advanced/src/test/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeTest.java b/appserver/tests/paas/multiple-db-shared-services/advanced/src/test/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeTest.java
index fefe809..7046e60 100644
--- a/appserver/tests/paas/multiple-db-shared-services/advanced/src/test/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeTest.java
+++ b/appserver/tests/paas/multiple-db-shared-services/advanced/src/test/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeTest.java
@@ -133,7 +133,7 @@
"delete-shared-service", "salary-service");
System.out.println("\ndelete-shared-service salary-service command output [" +
deleteResult.getOutput() + "]");
- }
+ }
}
}
diff --git a/appserver/tests/paas/multiple-db-shared-services/basic/init.salary-service.sql b/appserver/tests/paas/multiple-db-shared-services/basic/init.salary-service.sql
index 9c7a42c..7e3e5ea 100644
--- a/appserver/tests/paas/multiple-db-shared-services/basic/init.salary-service.sql
+++ b/appserver/tests/paas/multiple-db-shared-services/basic/init.salary-service.sql
@@ -15,8 +15,8 @@
*/
CREATE TABLE SALARY (
- emp_id integer not null,
- emp_sal float(7, 2)
+ emp_id integer not null,
+ emp_sal float(7, 2)
);
INSERT INTO SALARY VALUES(101, 11111.12);
diff --git a/appserver/tests/paas/multiple-db-shared-services/basic/pom.xml b/appserver/tests/paas/multiple-db-shared-services/basic/pom.xml
index e269bb9..fdf8f01 100644
--- a/appserver/tests/paas/multiple-db-shared-services/basic/pom.xml
+++ b/appserver/tests/paas/multiple-db-shared-services/basic/pom.xml
@@ -50,12 +50,12 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
diff --git a/appserver/tests/paas/multiple-db-shared-services/basic/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java b/appserver/tests/paas/multiple-db-shared-services/basic/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java
index 4a3b193..73b75dc 100644
--- a/appserver/tests/paas/multiple-db-shared-services/basic/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java
+++ b/appserver/tests/paas/multiple-db-shared-services/basic/src/main/java/org/glassfish/tests/paas/multipleshareddbservicetest/EmployeeServlet.java
@@ -87,7 +87,7 @@
writer.println("</table>");
if (hrDs != null && salDs != null) {
Statement stmt1 = null;
- PreparedStatement stmt2 = null;
+ PreparedStatement stmt2 = null;
try {
stmt1 = hrDs.getConnection().createStatement();
@@ -100,34 +100,34 @@
ResultSet rs1 = stmt1.executeQuery("SELECT emp_id, emp_name from HR");
- String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
- stmt2 = salDs.getConnection().prepareStatement(salQuery);
-
- DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
+ String salQuery = "SELECT emp_sal from SALARY WHERE emp_id = ? ";
+ stmt2 = salDs.getConnection().prepareStatement(salQuery);
+
+ DatabaseMetaData dbMetadata2 = stmt2.getConnection().getMetaData();
String dbUrl2 = dbMetadata2.getURL();
writer.println("DB URL : " + dbUrl2 + "\n");
if (dbUrl2.indexOf("salary_database") == -1) {
throw new Exception("Custom Database [salary_database] is not created while provisioning.");
}
-
- writer.println("<table border=\"1\" width=\"100%\">");
+
+ writer.println("<table border=\"1\" width=\"100%\">");
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Employee Information retrieved" + "</th>");
writer.println("</tr>");
writer.println("<tr>");
writer.println("<td>" + "Employee ID" + "</td>");
writer.println("<td>" + "Employee Name" + "</td>");
- writer.println("<td>" + "Employee Salary" + "</td>");
+ writer.println("<td>" + "Employee Salary" + "</td>");
writer.println("</tr>");
while (rs1.next()) {
writer.println("<tr>");
writer.println(" <td>" + rs1.getObject(1) + "</td>");
writer.println(" <td>" + rs1.getObject(2) + "</td>");
- stmt2.setInt(1, (Integer) rs1.getObject(1));
- ResultSet rs2 = stmt2.executeQuery();
- while(rs2.next()) {
- writer.println(" <td>" + rs2.getObject(1) + "</td>");
- }
+ stmt2.setInt(1, (Integer) rs1.getObject(1));
+ ResultSet rs2 = stmt2.executeQuery();
+ while(rs2.next()) {
+ writer.println(" <td>" + rs2.getObject(1) + "</td>");
+ }
writer.println("</tr>");
}
writer.println("</table>");
diff --git a/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/sun-web.xml
index fcaa427..9a36082 100644
--- a/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/web.xml
index 68ebd14..260c2c2 100644
--- a/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/multiple-db-shared-services/basic/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>EmployeeServlet</servlet-name>
diff --git a/appserver/tests/paas/multiple-spe-test/mydb-plugin/pom.xml b/appserver/tests/paas/multiple-spe-test/mydb-plugin/pom.xml
index e25a07c..87f6093 100644
--- a/appserver/tests/paas/multiple-spe-test/mydb-plugin/pom.xml
+++ b/appserver/tests/paas/multiple-spe-test/mydb-plugin/pom.xml
@@ -27,7 +27,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish</groupId>
<artifactId>paas.mydbplugin</artifactId>
-
+
<version>6.1.1-SNAPSHOT</version>
<name>MyDB Plugin</name>
<build>
diff --git a/appserver/tests/paas/multiple-spe-test/spetest/src/main/java/org/glassfish/tests/paas/spetest/Animal.java b/appserver/tests/paas/multiple-spe-test/spetest/src/main/java/org/glassfish/tests/paas/spetest/Animal.java
index 866db65..ea58706 100644
--- a/appserver/tests/paas/multiple-spe-test/spetest/src/main/java/org/glassfish/tests/paas/spetest/Animal.java
+++ b/appserver/tests/paas/multiple-spe-test/spetest/src/main/java/org/glassfish/tests/paas/spetest/Animal.java
@@ -26,19 +26,19 @@
*
* @author ishan.vishnoi@java.net
*/
-@Entity
+@Entity
@Table(name = "ZOO_DIRECTORY")
public class Animal implements Serializable {
-
+
@Id
private int ID;
-
+
private String name;
-
+
private String species;
-
+
private String cageNumber;
-
+
private String yearOfBirth;
public int getID() {
@@ -47,7 +47,7 @@
public void setID(int ID) {
this.ID = ID;
- }
+ }
public String getCageNumber() {
return cageNumber;
@@ -80,7 +80,7 @@
public void setYearOfBirth(String yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
-
+
@Override
public String toString() {
return "entity.NewEntity[id=" + ID + "]";
diff --git a/appserver/tests/paas/native_lb_setup.sh b/appserver/tests/paas/native_lb_setup.sh
index 0ddce2f..3eac085 100755
--- a/appserver/tests/paas/native_lb_setup.sh
+++ b/appserver/tests/paas/native_lb_setup.sh
@@ -21,4 +21,4 @@
$GF_HOME/bin/asadmin create-template --indexes ServiceType=LB,VirtualizationType=Native LBNative
$GF_HOME/bin/asadmin create-template --indexes ServiceType=MQ,VirtualizationType=Native MQNative
$GF_HOME/bin/asadmin stop-domain
-
+
diff --git a/appserver/tests/paas/native_setup.sh b/appserver/tests/paas/native_setup.sh
index ffd5c26..dbc5cf2 100755
--- a/appserver/tests/paas/native_setup.sh
+++ b/appserver/tests/paas/native_setup.sh
@@ -18,4 +18,4 @@
echo "Your GlassFish is at $GF_HOME"
$GF_HOME/bin/asadmin start-domain --debug
$GF_HOME/bin/asadmin create-ims-config-native
-$GF_HOME/bin/asadmin stop-domain
+$GF_HOME/bin/asadmin stop-domain
diff --git a/appserver/tests/paas/pom.xml b/appserver/tests/paas/pom.xml
index 21326d5..cfe017f 100644
--- a/appserver/tests/paas/pom.xml
+++ b/appserver/tests/paas/pom.xml
@@ -25,175 +25,175 @@
<version>6.1.1-SNAPSHOT</version>
<name>PaaS samples</name>
<packaging>pom</packaging>
-
+
<profiles>
<profile>
<id>native</id>
- <activation>
- <activeByDefault>true</activeByDefault>
+ <activation>
+ <activeByDefault>true</activeByDefault>
</activation>
- <modules>
- <module>basic</module>
- <module>service_metadata</module>
- <module>basic-db</module>
- <module>bookstore</module>
- <module>basic-db-initsql</module>
- <module>scale_service</module>
- <module>deployment-rollback</module>
- <module>enable-disable-test</module>
- <module>basic-jpa</module>
- <module>basic-shared-service-test</module>
- <module>external-and-shared-service</module>
- <module>ext-shared-service-enable-disable-test</module>
- <module>multiple-spe-test</module>
- <module>basic-db-with-resources-xml</module>
- <module>basic-db-teardown-sql</module>
- <module>basic-service-discovery</module>
- <module>javaee_shared_service</module>
- <module>lazy-shared-service-test</module>
- <module>external-db-service</module>
- <module>appscoped-db-with-resources-xml</module>
- <module>basic-bookstore-dns</module>
- <!-- <module>mq-shared-service-test</module>-->
+ <modules>
+ <module>basic</module>
+ <module>service_metadata</module>
+ <module>basic-db</module>
+ <module>bookstore</module>
+ <module>basic-db-initsql</module>
+ <module>scale_service</module>
+ <module>deployment-rollback</module>
+ <module>enable-disable-test</module>
+ <module>basic-jpa</module>
+ <module>basic-shared-service-test</module>
+ <module>external-and-shared-service</module>
+ <module>ext-shared-service-enable-disable-test</module>
+ <module>multiple-spe-test</module>
+ <module>basic-db-with-resources-xml</module>
+ <module>basic-db-teardown-sql</module>
+ <module>basic-service-discovery</module>
+ <module>javaee_shared_service</module>
+ <module>lazy-shared-service-test</module>
+ <module>external-db-service</module>
+ <module>appscoped-db-with-resources-xml</module>
+ <module>basic-bookstore-dns</module>
+ <!-- <module>mq-shared-service-test</module>-->
- </modules>
-
- </profile>
- <profile>
- <id>kvm-derby</id>
-
- <modules>
- <module>basic</module>
- <module>service_metadata/custom_db_name</module>
- <module>basic-db</module>
- <module>bookstore</module>
- <module>basic-db-initsql</module>
- <module>basic-jpa</module>
- <module>basic-db-with-resources-xml</module>
- <module>basic-db-teardown-sql</module>
- <module>multiple-db-app-scoped-services/basic</module>
- <module>external-db-service</module>
- <module>appscoped-db-with-resources-xml</module>
- <module>javaee_shared_service</module>
- <module>scale_service</module>
- </modules>
-
- </profile>
- <profile>
- <id>kvm-mysql</id>
- <modules>
- <module>basic</module>
- <module>service_metadata/custom_db_name</module>
- <module>bookstore</module>
- <module>basic-db-initsql</module>
- <module>basic-jpa</module>
- <module>basic-db-with-resources-xml</module>
- <module>basic-db-teardown-sql</module>
- <module>multiple-db-app-scoped-services/basic</module>
- <module>external-db-service</module>
- <module>appscoped-db-with-resources-xml</module>
- <module>javaee_shared_service</module>
- <module>scale_service</module>
- </modules>
-
- </profile>
- <profile>
- <id>ovm-derby</id>
+ </modules>
- <modules>
- <module>basic</module>
- <module>service_metadata/custom_db_name</module>
- <module>basic-db</module>
- <module>bookstore</module>
- <module>basic-db-initsql</module>
- <module>basic-jpa</module>
- <module>basic-db-with-resources-xml</module>
- <module>basic-db-teardown-sql</module>
- <module>appscoped-db-with-resources-xml</module>
- <module>external-db-service</module>
- <module>javaee_shared_service</module>
- <module>scale_service</module>
- </modules>
-
- </profile>
- <profile>
- <id>ovm-odb</id>
+ </profile>
+ <profile>
+ <id>kvm-derby</id>
- <modules>
- <module>basic</module>
- <module>service_metadata/custom_db_name</module>
- <module>bookstore</module>
- <module>basic-db-initsql</module>
- <module>basic-jpa</module>
- <module>basic-db-with-resources-xml</module>
- <module>basic-db-teardown-sql</module>
- <module>appscoped-db-with-resources-xml</module>
- <module>external-db-service</module>
- <module>javaee_shared_service</module>
- <module>scale_service</module>
- </modules>
-
- </profile>
+ <modules>
+ <module>basic</module>
+ <module>service_metadata/custom_db_name</module>
+ <module>basic-db</module>
+ <module>bookstore</module>
+ <module>basic-db-initsql</module>
+ <module>basic-jpa</module>
+ <module>basic-db-with-resources-xml</module>
+ <module>basic-db-teardown-sql</module>
+ <module>multiple-db-app-scoped-services/basic</module>
+ <module>external-db-service</module>
+ <module>appscoped-db-with-resources-xml</module>
+ <module>javaee_shared_service</module>
+ <module>scale_service</module>
+ </modules>
+
+ </profile>
+ <profile>
+ <id>kvm-mysql</id>
+ <modules>
+ <module>basic</module>
+ <module>service_metadata/custom_db_name</module>
+ <module>bookstore</module>
+ <module>basic-db-initsql</module>
+ <module>basic-jpa</module>
+ <module>basic-db-with-resources-xml</module>
+ <module>basic-db-teardown-sql</module>
+ <module>multiple-db-app-scoped-services/basic</module>
+ <module>external-db-service</module>
+ <module>appscoped-db-with-resources-xml</module>
+ <module>javaee_shared_service</module>
+ <module>scale_service</module>
+ </modules>
+
+ </profile>
+ <profile>
+ <id>ovm-derby</id>
+
+ <modules>
+ <module>basic</module>
+ <module>service_metadata/custom_db_name</module>
+ <module>basic-db</module>
+ <module>bookstore</module>
+ <module>basic-db-initsql</module>
+ <module>basic-jpa</module>
+ <module>basic-db-with-resources-xml</module>
+ <module>basic-db-teardown-sql</module>
+ <module>appscoped-db-with-resources-xml</module>
+ <module>external-db-service</module>
+ <module>javaee_shared_service</module>
+ <module>scale_service</module>
+ </modules>
+
+ </profile>
+ <profile>
+ <id>ovm-odb</id>
+
+ <modules>
+ <module>basic</module>
+ <module>service_metadata/custom_db_name</module>
+ <module>bookstore</module>
+ <module>basic-db-initsql</module>
+ <module>basic-jpa</module>
+ <module>basic-db-with-resources-xml</module>
+ <module>basic-db-teardown-sql</module>
+ <module>appscoped-db-with-resources-xml</module>
+ <module>external-db-service</module>
+ <module>javaee_shared_service</module>
+ <module>scale_service</module>
+ </modules>
+
+ </profile>
</profiles>
- <reporting>
- <plugins>
+ <reporting>
+ <plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.9</version>
- <configuration>
- <outputDirectory>${env.PAAS_TESTS_HOME}/reports</outputDirectory>
- <outputName>PaasTestReport</outputName>
- <reportsDirectories>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic/target/surefire-reports</reportsDirectory>
- <reportsDirectory>
- ${env.PAAS_TESTS_HOME}/service_metadata/provision_using_specified_template/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/service_metadata/custom_db_name/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db/target/surefire-reports</reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/bookstore/target/surefire-reports</reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db-initsql/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/scale_service/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/deployment-rollback/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/enable-disable-test/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-jpa/target/surefire-reports</reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-shared-service-test/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/external-and-shared-service/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>
- ${env.PAAS_TESTS_HOME}/ext-shared-service-enable-disable-test/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/multiple-spe-test/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db-with-resources-xml/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db-teardown-sql/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-service-discovery/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/javaee_shared_service/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/lazy-shared-service-test/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/appscoped-db-with-resources-xml/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/external-db-service/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/mq-shared-service-test/target/surefire-reports
- </reportsDirectory>
- <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-bookstore-dns/target/surefire-reports
- </reportsDirectory>
- </reportsDirectories>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.9</version>
+ <configuration>
+ <outputDirectory>${env.PAAS_TESTS_HOME}/reports</outputDirectory>
+ <outputName>PaasTestReport</outputName>
+ <reportsDirectories>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic/target/surefire-reports</reportsDirectory>
+ <reportsDirectory>
+ ${env.PAAS_TESTS_HOME}/service_metadata/provision_using_specified_template/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/service_metadata/custom_db_name/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db/target/surefire-reports</reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/bookstore/target/surefire-reports</reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db-initsql/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/scale_service/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/deployment-rollback/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/enable-disable-test/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-jpa/target/surefire-reports</reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-shared-service-test/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/external-and-shared-service/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>
+ ${env.PAAS_TESTS_HOME}/ext-shared-service-enable-disable-test/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/multiple-spe-test/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db-with-resources-xml/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-db-teardown-sql/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-service-discovery/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/javaee_shared_service/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/lazy-shared-service-test/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/appscoped-db-with-resources-xml/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/external-db-service/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/mq-shared-service-test/target/surefire-reports
+ </reportsDirectory>
+ <reportsDirectory>${env.PAAS_TESTS_HOME}/basic-bookstore-dns/target/surefire-reports
+ </reportsDirectory>
+ </reportsDirectories>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
</project>
diff --git a/appserver/tests/paas/scale_service/src/test/java/org/glassfish/tests/paas/scale_service/ScaleServicePaaSTest.java b/appserver/tests/paas/scale_service/src/test/java/org/glassfish/tests/paas/scale_service/ScaleServicePaaSTest.java
index 54ea4a6..7e1ef0c 100644
--- a/appserver/tests/paas/scale_service/src/test/java/org/glassfish/tests/paas/scale_service/ScaleServicePaaSTest.java
+++ b/appserver/tests/paas/scale_service/src/test/java/org/glassfish/tests/paas/scale_service/ScaleServicePaaSTest.java
@@ -105,7 +105,7 @@
String instanceIP = getLBIPAddress(glassfish);
-
+
get("http://" + instanceIP +":" + HTTP_PORT
+ "/scale_service/ScaleServicePaaSServlet",
"Request headers from the request:");
@@ -136,17 +136,17 @@
deployer.undeploy(appName);
System.err.println("Undeployed [" + appName + "]");
try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner()
- .run("list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err
- .println("Couldn't varify whether undeploy succeeded");
- }
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner()
+ .run("list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err
+ .println("Couldn't varify whether undeploy succeeded");
+ }
}
}
@@ -164,46 +164,46 @@
System.setOut(sysout);
return glassfish;
}
-
+
private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/service_metadata/custom_db_name/pom.xml b/appserver/tests/paas/service_metadata/custom_db_name/pom.xml
index 39dd3fa..ad6983c 100644
--- a/appserver/tests/paas/service_metadata/custom_db_name/pom.xml
+++ b/appserver/tests/paas/service_metadata/custom_db_name/pom.xml
@@ -50,12 +50,12 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
diff --git a/appserver/tests/paas/service_metadata/custom_db_name/src/main/java/org/glassfish/tests/paas/customdbname/CustomDBNameServlet.java b/appserver/tests/paas/service_metadata/custom_db_name/src/main/java/org/glassfish/tests/paas/customdbname/CustomDBNameServlet.java
index e5deb18..196203a 100644
--- a/appserver/tests/paas/service_metadata/custom_db_name/src/main/java/org/glassfish/tests/paas/customdbname/CustomDBNameServlet.java
+++ b/appserver/tests/paas/service_metadata/custom_db_name/src/main/java/org/glassfish/tests/paas/customdbname/CustomDBNameServlet.java
@@ -87,22 +87,22 @@
try {
stmt = ds.getConnection().createStatement();
- DatabaseMetaData dbMetadata = stmt.getConnection().getMetaData();
- String dbUrl = dbMetadata.getURL();
- writer.println("DB URL : " + dbUrl + "\n");
- if(dbUrl.indexOf("foobar") == -1) {
- throw new Exception("Custom Database [foobar] is not created while provisioning.");
- }
-
+ DatabaseMetaData dbMetadata = stmt.getConnection().getMetaData();
+ String dbUrl = dbMetadata.getURL();
+ writer.println("DB URL : " + dbUrl + "\n");
+ if(dbUrl.indexOf("foobar") == -1) {
+ throw new Exception("Custom Database [foobar] is not created while provisioning.");
+ }
+
ResultSet rs = stmt.executeQuery("SELECT c_id, c_name from customer");
writer.println("<table border=\"1\" width=\"100%\">");
writer.println("<tr>");
writer.println(" <th align=\"left\" colspan=\"2\">" + "Data retrieved from table \"customer\"" + "</th>");
writer.println("</tr>");
- writer.println("<tr>");
- writer.println("<td>" + "Customer ID" + "</td>");
- writer.println("<td>" + "Customer Name" + "</td>");
+ writer.println("<tr>");
+ writer.println("<td>" + "Customer ID" + "</td>");
+ writer.println("<td>" + "Customer Name" + "</td>");
writer.println("</tr>");
while (rs.next()) {
writer.println("<tr>");
diff --git a/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/sun-web.xml
index ef7e44b..bcb7774 100644
--- a/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<resource-ref>
diff --git a/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/web.xml
index f4f79c1..378794e 100644
--- a/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/service_metadata/custom_db_name/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>CustomDBNameServlet</servlet-name>
diff --git a/appserver/tests/paas/service_metadata/custom_db_name/src/test/java/org/glassfish/tests/paas/customdbname/CustomDBNameTest.java b/appserver/tests/paas/service_metadata/custom_db_name/src/test/java/org/glassfish/tests/paas/customdbname/CustomDBNameTest.java
index 417cc02..7ded77e 100644
--- a/appserver/tests/paas/service_metadata/custom_db_name/src/test/java/org/glassfish/tests/paas/customdbname/CustomDBNameTest.java
+++ b/appserver/tests/paas/service_metadata/custom_db_name/src/test/java/org/glassfish/tests/paas/customdbname/CustomDBNameTest.java
@@ -48,120 +48,120 @@
public class CustomDBNameTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // 1. Bootstrap GlassFish DAS in embedded mode.
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
+ // 1. Bootstrap GlassFish DAS in embedded mode.
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/custom_db_name_paas_sample.war"); // TODO :: use mvn
- // apis to get
- // the archive
- // location.
- Assert.assertTrue(archive.exists());
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/custom_db_name_paas_sample.war"); // TODO :: use mvn
+ // apis to get
+ // the archive
+ // location.
+ Assert.assertTrue(archive.exists());
- Deployer deployer = null;
- String appName = null;
- try {
- deployer = glassfish.getDeployer();
- appName = deployer.deploy(archive);
+ Deployer deployer = null;
+ String appName = null;
+ try {
+ deployer = glassfish.getDeployer();
+ appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/custom_db_name_paas_sample/CustomDBNameServlet",
- "Customer ID");
+ String instanceIP = getLBIPAddress(glassfish);
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/custom_db_name_paas_sample/CustomDBNameServlet",
+ "Customer ID");
- // 4. Undeploy the PaaS application .
- } finally {
- if (appName != null) {
- deployer.undeploy(appName);
- System.out.println("Destroying the resources created");
- System.err.println("Undeployed [" + appName + "]");
- }
- }
+ // 4. Undeploy the PaaS application .
+ } finally {
+ if (appName != null) {
+ deployer.undeploy(appName);
+ System.out.println("Destroying the resources created");
+ System.err.println("Undeployed [" + appName + "]");
+ }
+ }
- }
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/service_metadata/provision_using_specified_template/pom.xml b/appserver/tests/paas/service_metadata/provision_using_specified_template/pom.xml
index 311a599..e6b15e3 100644
--- a/appserver/tests/paas/service_metadata/provision_using_specified_template/pom.xml
+++ b/appserver/tests/paas/service_metadata/provision_using_specified_template/pom.xml
@@ -50,7 +50,7 @@
</goals>
<configuration>
<skip>false</skip>
- <enableAssertions>false</enableAssertions>
+ <enableAssertions>false</enableAssertions>
</configuration>
</execution>
</executions>
diff --git a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/glassfish-services.xml b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/glassfish-services.xml
index 634dc12..64ad814 100644
--- a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/glassfish-services.xml
+++ b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/glassfish-services.xml
@@ -19,7 +19,7 @@
<glassfish-services>
<service-description name="basic" init-type="lazy">
- <template id="Native"/>
+ <template id="Native"/>
<configurations>
<configuration name="min.clustersize" value="2"/>
<configuration name="max.clustersize" value="4"/>
diff --git a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/sun-web.xml b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/sun-web.xml
index e9eed44..e45e147 100644
--- a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/sun-web.xml
+++ b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/sun-web.xml
@@ -17,7 +17,7 @@
-->
-<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
</sun-web-app>
diff --git a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/web.xml b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/web.xml
index f5ce35c..f06abb7 100644
--- a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/web.xml
+++ b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/main/webapp/WEB-INF/web.xml
@@ -17,9 +17,9 @@
-->
-<web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>BasicPaaSServlet</servlet-name>
diff --git a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSServiceMetadataTest.java b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSServiceMetadataTest.java
index 01fcac6..2edacbb 100644
--- a/appserver/tests/paas/service_metadata/provision_using_specified_template/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSServiceMetadataTest.java
+++ b/appserver/tests/paas/service_metadata/provision_using_specified_template/src/test/java/org/glassfish/tests/paas/basic/BasicPaaSServiceMetadataTest.java
@@ -40,141 +40,141 @@
public class BasicPaaSServiceMetadataTest {
- @Test
- public void test() throws Exception {
+ @Test
+ public void test() throws Exception {
- // Bootstrap GlassFish DAS in embedded mode.
- GlassFish glassfish = bootstrap();
+ // Bootstrap GlassFish DAS in embedded mode.
+ GlassFish glassfish = bootstrap();
- // Deploy the PaaS app and verify it.
- runTests(glassfish);
+ // Deploy the PaaS app and verify it.
+ runTests(glassfish);
- // Re-deploy the PaaS app and verify it.
- String testScenarios = System.getProperty("test.scenarios");
- if (testScenarios == null
- || "all".contains(testScenarios.toLowerCase())) {
- runTests(glassfish);
- }
+ // Re-deploy the PaaS app and verify it.
+ String testScenarios = System.getProperty("test.scenarios");
+ if (testScenarios == null
+ || "all".contains(testScenarios.toLowerCase())) {
+ runTests(glassfish);
+ }
- // 5. Stop the GlassFish DAS
- glassfish.dispose();
- }
+ // 5. Stop the GlassFish DAS
+ glassfish.dispose();
+ }
- private void get(String urlStr, String result) throws Exception {
- URL url = new URL(urlStr);
- URLConnection yc = url.openConnection();
- System.out.println("\nURLConnection [" + yc + "] : ");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- yc.getInputStream()));
- String line = null;
- boolean found = false;
- while ((line = in.readLine()) != null) {
- System.out.println(line);
- if (line.indexOf(result) != -1) {
- found = true;
- }
- }
- Assert.assertTrue(found);
- System.out.println("\n***** SUCCESS **** Found [" + result
- + "] in the response.*****\n");
- }
+ private void get(String urlStr, String result) throws Exception {
+ URL url = new URL(urlStr);
+ URLConnection yc = url.openConnection();
+ System.out.println("\nURLConnection [" + yc + "] : ");
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ yc.getInputStream()));
+ String line = null;
+ boolean found = false;
+ while ((line = in.readLine()) != null) {
+ System.out.println(line);
+ if (line.indexOf(result) != -1) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+ System.out.println("\n***** SUCCESS **** Found [" + result
+ + "] in the response.*****\n");
+ }
- private void runTests(GlassFish glassfish) throws Exception {
- // 2. Deploy the PaaS application.
- File archive = new File(System.getProperty("basedir")
- + "/target/basic_paas_sample2.war"); // TODO :: use mvn apis to
- // get the archive
- // location.
- Assert.assertTrue(archive.exists());
+ private void runTests(GlassFish glassfish) throws Exception {
+ // 2. Deploy the PaaS application.
+ File archive = new File(System.getProperty("basedir")
+ + "/target/basic_paas_sample2.war"); // TODO :: use mvn apis to
+ // get the archive
+ // location.
+ Assert.assertTrue(archive.exists());
- Deployer deployer = glassfish.getDeployer();
- String appName = deployer.deploy(archive);
+ Deployer deployer = glassfish.getDeployer();
+ String appName = deployer.deploy(archive);
- System.err.println("Deployed [" + appName + "]");
- Assert.assertNotNull(appName);
+ System.err.println("Deployed [" + appName + "]");
+ Assert.assertNotNull(appName);
- CommandRunner commandRunner = glassfish.getCommandRunner();
- CommandResult result = commandRunner.run("list-services");
- System.out.println("\nlist-services command output [ "
- + result.getOutput() + "]");
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ CommandResult result = commandRunner.run("list-services");
+ System.out.println("\nlist-services command output [ "
+ + result.getOutput() + "]");
- // 3. Access the app to make sure PaaS app is correctly provisioned.
- String HTTP_PORT = (System.getProperty("http.port") != null) ? System
- .getProperty("http.port") : "28080";
+ // 3. Access the app to make sure PaaS app is correctly provisioned.
+ String HTTP_PORT = (System.getProperty("http.port") != null) ? System
+ .getProperty("http.port") : "28080";
- String instanceIP = getLBIPAddress(glassfish);
- get("http://" + instanceIP + ":" + HTTP_PORT
- + "/basic_paas_sample2/BasicPaaSServlet",
- "Request headers from the request:");
+ String instanceIP = getLBIPAddress(glassfish);
+ get("http://" + instanceIP + ":" + HTTP_PORT
+ + "/basic_paas_sample2/BasicPaaSServlet",
+ "Request headers from the request:");
- // 4. Undeploy the PaaS application . TODO :: use cloud-undeploy??
- deployer.undeploy(appName);
- System.err.println("Undeployed [" + appName + "]");
- try {
- boolean undeployClean = false;
- CommandResult commandResult = glassfish.getCommandRunner().run(
- "list-services");
- if (commandResult.getOutput().contains("Nothing to list.")) {
- undeployClean = true;
- }
- Assert.assertTrue(undeployClean);
- } catch (Exception e) {
- System.err.println("Couldn't varify whether undeploy succeeded");
- }
- }
+ // 4. Undeploy the PaaS application . TODO :: use cloud-undeploy??
+ deployer.undeploy(appName);
+ System.err.println("Undeployed [" + appName + "]");
+ try {
+ boolean undeployClean = false;
+ CommandResult commandResult = glassfish.getCommandRunner().run(
+ "list-services");
+ if (commandResult.getOutput().contains("Nothing to list.")) {
+ undeployClean = true;
+ }
+ Assert.assertTrue(undeployClean);
+ } catch (Exception e) {
+ System.err.println("Couldn't varify whether undeploy succeeded");
+ }
+ }
- private GlassFish bootstrap() throws Exception {
- GlassFishProperties glassFishProperties = new GlassFishProperties();
- glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
- + "/domains/domain1");
- glassFishProperties.setConfigFileReadOnly(false);
- GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
- glassFishProperties);
- PrintStream sysout = System.out;
- glassfish.start();
- System.setOut(sysout);
- return glassfish;
- }
+ private GlassFish bootstrap() throws Exception {
+ GlassFishProperties glassFishProperties = new GlassFishProperties();
+ glassFishProperties.setInstanceRoot(System.getenv("S1AS_HOME")
+ + "/domains/domain1");
+ glassFishProperties.setConfigFileReadOnly(false);
+ GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(
+ glassFishProperties);
+ PrintStream sysout = System.out;
+ glassfish.start();
+ System.setOut(sysout);
+ return glassfish;
+ }
- private String getLBIPAddress(GlassFish glassfish) {
- String lbIP = null;
- String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
- + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
- try {
- CommandRunner commandRunner = glassfish.getCommandRunner();
- String result = commandRunner
- .run("list-services", "--type", "LB",
- "--output", "IP-ADDRESS").getOutput().toString();
- if (result.contains("Nothing to list.")) {
- result = commandRunner
- .run("list-services", "--type", "JavaEE", "--output",
- "IP-ADDRESS").getOutput().toString();
+ private String getLBIPAddress(GlassFish glassfish) {
+ String lbIP = null;
+ String IPAddressPattern = "IP-ADDRESS\\s*\n*(.*)\\s*\n(([01]?\\d*|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\."
+ + "([0-9]?\\d\\d?|2[0-4]\\d|25[0-5]))";
+ try {
+ CommandRunner commandRunner = glassfish.getCommandRunner();
+ String result = commandRunner
+ .run("list-services", "--type", "LB",
+ "--output", "IP-ADDRESS").getOutput().toString();
+ if (result.contains("Nothing to list.")) {
+ result = commandRunner
+ .run("list-services", "--type", "JavaEE", "--output",
+ "IP-ADDRESS").getOutput().toString();
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
- } else {
- Pattern p = Pattern.compile(IPAddressPattern);
- Matcher m = p.matcher(result);
- if (m.find()) {
- lbIP = m.group(2);
- } else {
- lbIP = "localhost";
- }
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
+ } else {
+ Pattern p = Pattern.compile(IPAddressPattern);
+ Matcher m = p.matcher(result);
+ if (m.find()) {
+ lbIP = m.group(2);
+ } else {
+ lbIP = "localhost";
+ }
- }
+ }
- } catch (Exception e) {
- System.out.println("Regex has thrown an exception "
- + e.getMessage());
- return "localhost";
- }
- return lbIP;
- }
+ } catch (Exception e) {
+ System.out.println("Regex has thrown an exception "
+ + e.getMessage());
+ return "localhost";
+ }
+ return lbIP;
+ }
}
diff --git a/appserver/tests/paas/setup.sh b/appserver/tests/paas/setup.sh
index 01db754..8d6c4a6 100755
--- a/appserver/tests/paas/setup.sh
+++ b/appserver/tests/paas/setup.sh
@@ -121,7 +121,7 @@
;;
*) err "Ignoring unknown service $s"
;;
- esac
+ esac
done
IFS=$IFS_TMP
@@ -142,7 +142,7 @@
[ -z "$SUBNET" ] && echo "Please specify subnet using -n <subnet> option." && exit 1;
# Parse the old style connection string into variables we can use with the
- # new commands. At some point we should probably allow these to be
+ # new commands. At some point we should probably allow these to be
# specified via CLI options, but for now this keeps us compatible with
# current uses of this script.