From e1a67a5e5b1648d69b35d9b8a5d462a67da30828 Mon Sep 17 00:00:00 2001 From: Carolin Brandt Date: Thu, 16 Jun 2022 16:29:13 +0200 Subject: [PATCH 1/2] Add test for Sort.getOrder and Sort.create --- core/src/test/java/tech/tablesaw/SortTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/src/test/java/tech/tablesaw/SortTest.java b/core/src/test/java/tech/tablesaw/SortTest.java index 33ff23a2a..071e2cb5b 100644 --- a/core/src/test/java/tech/tablesaw/SortTest.java +++ b/core/src/test/java/tech/tablesaw/SortTest.java @@ -21,7 +21,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import tech.tablesaw.analytic.AnalyticQuery; import tech.tablesaw.api.DoubleColumn; +import tech.tablesaw.api.IntColumn; import tech.tablesaw.api.Table; import tech.tablesaw.sorting.Sort; @@ -149,4 +151,19 @@ public void createSortInvalidPrefixColumnDoesNotExist() { assertEquals("Unrecognized Column: '>col2'", thrown.getMessage()); } + + @Test + public void testGetOrderAndCreate0() throws Exception { + assertThrows(IllegalStateException.class, () -> { + Table table = Table.create("table1", IntColumn.create(" ales")); + AnalyticQuery query = AnalyticQuery.query().from(table) + .partitionBy("product", "region") + .orderBy("sales") + .rowsBetween() + .unboundedPreceding() + .andUnBoundedFollowing() + .sum("sales").as("sumSales") + .build(); + }); + } } From b21f9a8561ad885e3fb12bd99b583e9ea01db2b4 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Wed, 19 Apr 2023 10:49:23 -0700 Subject: [PATCH 2/2] Update core/src/test/java/tech/tablesaw/SortTest.java --- core/src/test/java/tech/tablesaw/SortTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/test/java/tech/tablesaw/SortTest.java b/core/src/test/java/tech/tablesaw/SortTest.java index 071e2cb5b..2c02e2b70 100644 --- a/core/src/test/java/tech/tablesaw/SortTest.java +++ b/core/src/test/java/tech/tablesaw/SortTest.java @@ -156,14 +156,15 @@ public void createSortInvalidPrefixColumnDoesNotExist() { public void testGetOrderAndCreate0() throws Exception { assertThrows(IllegalStateException.class, () -> { Table table = Table.create("table1", IntColumn.create(" ales")); - AnalyticQuery query = AnalyticQuery.query().from(table) - .partitionBy("product", "region") - .orderBy("sales") - .rowsBetween() - .unboundedPreceding() - .andUnBoundedFollowing() - .sum("sales").as("sumSales") - .build(); + AnalyticQuery.query() + .from(table) + .partitionBy("product", "region") + .orderBy("sales") + .rowsBetween() + .unboundedPreceding() + .andUnBoundedFollowing() + .sum("sales").as("sumSales") + .build(); }); } }