Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
daneshk authored Feb 6, 2024
2 parents 7699881 + aea22ae commit 354ea07
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.4"
version = "2.10.5"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down
36 changes: 18 additions & 18 deletions ballerina/tests/execute-params-query-test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -614,25 +614,25 @@ function insertIntoArrayTable3() returns error? {
groups: ["execute", "execute-params"]
}
function insertIntoArrayTable4() returns error? {
SmallIntArrayValue paraSmallint = new ([]);
IntegerArrayValue paraInt = new ([]);
BigIntArrayValue paraLong = new ([]);
FloatArrayValue paraFloat = new (<int?[]>[]);
RealArrayValue paraReal = new (<int?[]>[]);
DecimalArrayValue paraDecimal = new (<int?[]>[]);
NumericArrayValue paraNumeric = new (<int?[]>[]);
DoubleArrayValue paraDouble = new (<int?[]>[]);
CharArrayValue paraChar = new ([]);
VarcharArrayValue paraVarchar = new ([]);
NVarcharArrayValue paraNVarchar = new ([]);
SmallIntArrayValue paraSmallint = new ();
IntegerArrayValue paraInt = new ();
BigIntArrayValue paraLong = new ();
FloatArrayValue paraFloat = new ();
RealArrayValue paraReal = new ();
DecimalArrayValue paraDecimal = new ();
NumericArrayValue paraNumeric = new ();
DoubleArrayValue paraDouble = new ();
CharArrayValue paraChar = new ();
VarcharArrayValue paraVarchar = new ();
NVarcharArrayValue paraNVarchar = new ();
string?[] paraString = [];
BooleanArrayValue paraBool = new ([]);
DateArrayValue paraDate = new (<string?[]>[]);
TimeArrayValue paraTime = new (<string?[]>[]);
DateTimeArrayValue paraDatetime = new (<string?[]>[]);
TimestampArrayValue paraTimestamp = new (<string?[]>[]);
BinaryArrayValue paraBinary = new (<byte[]?[]>[]);
VarBinaryArrayValue paraVarBinary = new (<byte[]?[]>[]);
BooleanArrayValue paraBool = new ();
DateArrayValue paraDate = new ();
TimeArrayValue paraTime = new ();
DateTimeArrayValue paraDatetime = new ();
TimestampArrayValue paraTimestamp = new ();
BinaryArrayValue paraBinary = new ();
VarBinaryArrayValue paraVarBinary = new ();
byte[]?[] paraBlob = [];
int rowId = 8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ private Package loadPackage(String path) {
return project.currentPackage();
}

@Test
public void testCompilerErrors() {
Package currentPackage = loadPackage("sample3");
PackageCompilation compilation = currentPackage.getCompilation();
DiagnosticResult diagnosticResult = compilation.diagnosticResult();
List<Diagnostic> diagnosticErrorStream = diagnosticResult.diagnostics().stream()
.filter(r -> r.diagnosticInfo().severity().equals(DiagnosticSeverity.ERROR))
.collect(Collectors.toList());
long availableErrors = diagnosticErrorStream.size();

Assert.assertEquals(availableErrors, 1);
}

@Test
public void testInvalidConnectionParamConfig() {
Package currentPackage = loadPackage("sample1");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
org = "sql_test"
name = "sample1"
version = "0.1.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
//
// WSO2 Inc. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/sql;

type ConnectionPool record {
int connection?;
}

int|sql:ConnectionPool pool2 = {
maxOpenConnections: 10,
maxConnectionLifeTime: 10,
minIdleConnections: 2
};

public function main() {

}

0 comments on commit 354ea07

Please sign in to comment.