Skip to content

Commit

Permalink
[Spotless] Applying Google Code Format for integ-tests #8 (opensearch…
Browse files Browse the repository at this point in the history
…-project#1962)

* spotless apply for 81 integ-test files (#327)

add ignore failures for build.gradle.

Reverting ignore for checkstyle in integ-test

Addressed PR comments.

Addressed PR comments to expand jav doc.

fixed string formatting

Fixed string formatting.

Fixed string formatting in MatchPhrasePrefixIT

Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>

* Apply suggestions from code review

Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.gale@improving.com>

* address PR comments

Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>

---------

Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.gale@improving.com>
Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
  • Loading branch information
MitchellGale and Yury-Fridlyand committed Aug 22, 2023
1 parent 36135e3 commit e030bfd
Show file tree
Hide file tree
Showing 15 changed files with 1,723 additions and 1,299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public void select_all_no_cursor() {
var query = String.format("SELECT * FROM %s", table);
ResultSet rs = stmt.executeQuery(query);
int rows = 0;
while (rs.next()) rows++;
while(rs.next())
rows++;

var restResponse = executeRestQuery(query, null);
assertEquals(rows, restResponse.getInt("total"));
Expand Down
1,276 changes: 547 additions & 729 deletions integ-test/src/test/java/org/opensearch/sql/legacy/AggregationIT.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ protected void init() throws Exception {
}

/**
* All the following tests use UTC as their date_format timezone as this is the same timezone of
* the data being queried. This is to prevent discrepancies in the OpenSearch query and the actual
* field data that is being checked for the integration tests.
* All the following tests use UTC as their date_format timezone as this is the same timezone
* of the data being queried. This is to prevent discrepancies in the OpenSearch query and the
* actual field data that is being checked for the integration tests.
*
* <p>Large LIMIT values were given for some of these queries since the default result size of the
* query is 200 and this ends up excluding some of the expected values causing the assertion to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import org.opensearch.sql.legacy.utils.StringUtils;

/**
*
*
* <pre>
* The following are tests for SHOW/DESCRIBE query support under Pretty Format Response protocol using JDBC format.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ protected void init() throws Exception {
}

/**
*
*
* <pre>
* query
* "query" : {
Expand All @@ -37,7 +35,6 @@ protected void init() throws Exception {
* }
* }
* </pre>
*
* @throws IOException
*/
@Test
Expand All @@ -53,8 +50,6 @@ public void queryTest() throws IOException {
}

/**
*
*
* <pre>
* matchQuery
* "query" : {
Expand All @@ -66,7 +61,6 @@ public void queryTest() throws IOException {
* }
* }
* </pre>
*
* @throws IOException
*/
@Test
Expand All @@ -83,8 +77,6 @@ public void matchQueryTest() throws IOException {
}

/**
*
*
* <pre>
* matchQuery
* {
Expand Down Expand Up @@ -126,7 +118,6 @@ public void matchQueryTest() throws IOException {
* }
* }
* </pre>
*
* @throws IOException
*/
@Test
Expand Down Expand Up @@ -183,8 +174,6 @@ public void negativeRegexpQueryTest() throws IOException {
}

/**
*
*
* <pre>
* wildcardQuery
* l*e means leae ltae ...
Expand All @@ -194,7 +183,6 @@ public void negativeRegexpQueryTest() throws IOException {
* }
* }
* </pre>
*
* @throws IOException
*/
@Test
Expand All @@ -210,16 +198,13 @@ public void wildcardQueryTest() throws IOException {
}

/**
*
*
* <pre>
* matchPhraseQuery
* "address" : {
* "query" : "671 Bristol Street",
* "type" : "phrase"
* }
* </pre>
*
* @throws IOException
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

package org.opensearch.sql.ppl;

import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATE;
import static org.opensearch.sql.util.MatcherUtils.rows;
import static org.opensearch.sql.util.MatcherUtils.schema;
import static org.opensearch.sql.util.MatcherUtils.verifySchema;
import static org.opensearch.sql.util.MatcherUtils.verifySome;
import org.json.JSONObject;
import org.junit.Test;

import java.io.IOException;
import org.json.JSONObject;
import org.junit.Test;
import java.io.IOException;

public class ConvertTZFunctionIT extends PPLIntegTestCase {
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_DATE;
import static org.opensearch.sql.util.MatcherUtils.rows;
import static org.opensearch.sql.util.MatcherUtils.schema;
import static org.opensearch.sql.util.MatcherUtils.verifySchema;
import static org.opensearch.sql.util.MatcherUtils.verifySome;

@Override
public void init() throws IOException {
loadIndex(Index.DATE);
}
public class ConvertTZFunctionIT extends PPLIntegTestCase {


@Override
public void init() throws IOException {
loadIndex(Index.DATE);
}

@Test
public void inRangeZeroToPositive() throws IOException {
Expand Down
Loading

0 comments on commit e030bfd

Please sign in to comment.