Skip to content

Commit

Permalink
Merge pull request #5416 from kalinchan/FISH-5697
Browse files Browse the repository at this point in the history
FISH-5697 Upgrade H2DB to 1.4.200
  • Loading branch information
kalinchan authored Oct 7, 2021
2 parents 8e05ed9 + 2ad32bc commit d744009
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2017-2018 Payara Foundation and/or its affiliates. All rights reserved.
* Copyright (c) 2017-2021 Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -90,14 +90,14 @@ public H2Control(final String dbCommand, final String dbHost, final String dbPor
private void invokeServer() {
try {
Class serverClass = Class.forName("org.h2.tools.Server");
String dbPassword = getDbPassword() == null ? "" : getDbPassword();
String dbPassword = getDbPassword() == null ? "changeit" : getDbPassword();
String url = "tcp://localhost:" + getDbPort();
if (null != getDbCommand())
switch (getDbCommand()) {
case "start": {
Method createTcpServer = serverClass.getDeclaredMethod("createTcpServer",
new Class[]{String[].class});
Object[] paramObj = new Object[]{new String[]{"-tcpPort", getDbPort(), "-tcpPassword", dbPassword, "-tcpAllowOthers"}};
Object[] paramObj = new Object[]{new String[]{"-tcpPort", getDbPort(), "-tcpPassword", dbPassword, "-ifNotExists"}};
Object server = createTcpServer.invoke(serverClass, paramObj);
serverClass.getDeclaredMethod("start").invoke(server);
System.out.println(serverClass.getDeclaredMethod("getStatus").invoke(server));
Expand Down
9 changes: 5 additions & 4 deletions appserver/tests/quicklook/admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@
holder.
-->
<!-- Portions Copyright [2014-2019] [Payara Foundation and/or its affiliates] -->
<!-- Portions Copyright [2014-2021] [Payara Foundation and/or its affiliates] -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish.quicklook</groupId>
<artifactId>admin</artifactId>
<name>Admin Quicklook Tests</name>
<parent>
<groupId>quicklook</groupId>
<artifactId>org.glassfish.quicklook</artifactId>
<version>4.1-SNAPSHOT</version>
<artifactId>quicklook</artifactId>
<groupId>org.glassfish.quicklook</groupId>
<version>5.2021.8-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<description>Runs the tests on admin/asadmin code</description>
<build>
Expand Down
8 changes: 4 additions & 4 deletions appserver/tests/quicklook/ejb/cmp/sql/RosterApp_h2.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DROP TABLE TeamPlayer ;
DROP TABLE Player ;
DROP TABLE Team ;
DROP TABLE League ;
DROP TABLE IF EXISTS TeamPlayer ;
DROP TABLE IF EXISTS Player ;
DROP TABLE IF EXISTS Team ;
DROP TABLE IF EXISTS League ;

CREATE TABLE Player
(
Expand Down
73 changes: 36 additions & 37 deletions appserver/tests/quicklook/ejb/cmp/src/test/CmpRosterTestNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2021] Payara Foundation and/or affiliates

package test;
import org.testng.annotations.*;
import org.testng.Assert;

import java.io.*;
import java.net.*;
import java.util.*;

/**
* Simple TestNG client for basic WAR containing one JSP,one Servlet and one static
Expand All @@ -55,7 +55,7 @@ public class CmpRosterTestNG {

private static final String TEST_NAME = "Roster";

private String strContextRoot="roster";
private final String strContextRoot="roster";

static String result = "";
String host=System.getProperty("http.host");
Expand All @@ -68,42 +68,41 @@ public class CmpRosterTestNG {
*/


@Test(groups ={ "pulse"} ) // test method
public void test() throws Exception{
try{

String testurl = "http://" + host + ":" + port + "/"+
strContextRoot + "/" + TEST_NAME;

URL url = new URL(testurl);
//echo("Connecting to: " + url.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect();
int responseCode = conn.getResponseCode();

InputStream is = conn.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));

String line = null;
boolean result=false;
String testLine = null;
String EXPECTED_RESPONSE ="ROSTER-FINISHED-OK";
while ((line = input.readLine()) != null) {
// echo(line);
if(line.indexOf(EXPECTED_RESPONSE)!=-1){
testLine = line;
//echo(testLine);
result=true;
break;
@Test(groups = {"pulse"}) // test method
public void test() throws Exception {

try {

String testurl = "http://" + host + ":" + port + "/" + strContextRoot + "/" + TEST_NAME;

URL url = new URL(testurl);
//echo("Connecting to: " + url.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect();
int responseCode = conn.getResponseCode();

InputStream is = conn.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));

String line = null;
boolean result = false;
String testLine = null;
String EXPECTED_RESPONSE = "ROSTER-FINISHED-OK";
while ((line = input.readLine()) != null) {
// echo(line);
if (line.contains(EXPECTED_RESPONSE)) {
testLine = line;
//echo(testLine);
result = true;
break;
}
}
}

Assert.assertEquals(result, true,"Unexpected Results");

}catch(Exception e){
e.printStackTrace();
throw new Exception(e);

Assert.assertEquals(result, true, "Unexpected Results");

} catch (Exception e) {
e.printStackTrace();
throw new Exception(e);
}

}
Expand Down
3 changes: 2 additions & 1 deletion appserver/tests/quicklook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
-->

<!--"Portions Copyright [2018-2019] [Payara Foundation and/or its affiliates]" -->
<!--"Portions Copyright [2018-2021] [Payara Foundation and/or its affiliates]" -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion>

Expand All @@ -54,6 +54,7 @@
<groupId>org.glassfish.quicklook</groupId>
<artifactId>quicklook</artifactId>
<name>Glassfish Quicklook Bundle</name>
<packaging>pom</packaging>
<description>This pom describes how to run QuickLook tests on the Glassfish Bundle</description>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<payara-arquillian-container.version>2.4.1</payara-arquillian-container.version>
<payara.security-connectors.version>2.1.0</payara.security-connectors.version>
<opentracing.version>0.33.0</opentracing.version>
<h2db.version>1.4.196</h2db.version>
<h2db.version>1.4.200</h2db.version>
<websocket-api.version>1.1.2</websocket-api.version>
<concurrent-api.version>1.1.2</concurrent-api.version>
<concurrent.version>1.0.payara-p2</concurrent.version>
Expand Down

0 comments on commit d744009

Please sign in to comment.