From 0acc028b9661662a25058370b835fa2f9d120cb9 Mon Sep 17 00:00:00 2001
From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Date: Mon, 3 Nov 2025 22:26:22 +0800
Subject: [PATCH 1/6] Drop deprecated method
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
---
.../java/com/thoughtworks/gauge/Table.java | 31 +++++--------------
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/thoughtworks/gauge/Table.java b/src/main/java/com/thoughtworks/gauge/Table.java
index ac81b1b9..85b4ec56 100644
--- a/src/main/java/com/thoughtworks/gauge/Table.java
+++ b/src/main/java/com/thoughtworks/gauge/Table.java
@@ -5,10 +5,8 @@
*----------------------------------------------------------------*/
package com.thoughtworks.gauge;
-import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Collections;
@@ -25,14 +23,13 @@ public class Table {
private static final String DASH = "-";
private static final String PIPE = "|";
private static final char SPACE_AS_CHAR = ' ';
+
private final List headers;
- private final List> rows;
- private final List tableRows;
+ private final List> rows = new ArrayList<>();
+ private final List tableRows = new ArrayList<>();
public Table(List headers) {
this.headers = headers;
- rows = new ArrayList<>();
- tableRows = new ArrayList<>();
}
public void addRow(List row) {
@@ -57,7 +54,7 @@ public List getColumnNames() {
/**
* Gets a Column name by index.
*
- * @param columnIndex
+ * @param columnIndex 0-indexed column ordinal within the table
* @return a single column name by given column index.
*/
public String getColumnName(int columnIndex) {
@@ -74,16 +71,6 @@ public List getTableRows() {
return tableRows;
}
- /**
- * @return List of TableRows in the table. Each Row is represented by a List
- * of String values according to the order of column names
- * @deprecated Use getTableRows() method instead of this.
- */
- @Deprecated
- public List> getRows() {
- return rows;
- }
-
/**
* Get all the values of a column in Table.
*
@@ -144,14 +131,10 @@ private void addValues(int maxStringLength, List formattedHeaderAndRows)
}
private String formattedRow(List strings, int maxStringLength) {
- List formattedStrings = Lists.transform(strings, format(maxStringLength));
+ List formattedStrings = strings.stream().map(s -> Strings.padEnd(s, maxStringLength, SPACE_AS_CHAR)).toList();
return PIPE + Joiner.on(PIPE).join(formattedStrings) + PIPE;
}
- private Function format(final int maxStringLength) {
- return input -> Strings.padEnd(input, maxStringLength, SPACE_AS_CHAR);
- }
-
private Integer getMaxStringLength() {
List maxs = new ArrayList<>();
maxs.add(getMaxStringSize(headers));
@@ -177,8 +160,8 @@ public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (headers == null ? 0 : headers.hashCode());
- result = prime * result + (rows == null ? 0 : rows.hashCode());
- result = prime * result + (tableRows == null ? 0 : tableRows.hashCode());
+ result = prime * result + rows.hashCode();
+ result = prime * result + tableRows.hashCode();
return result;
}
From 94e8785b5bb361d90ecba8d77576b7019bb09244 Mon Sep 17 00:00:00 2001
From: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Date: Mon, 3 Nov 2025 22:48:19 +0800
Subject: [PATCH 2/6] Drop long-deprecated classes/types
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
---
java.json | 2 +-
pom.xml | 2 +-
.../thoughtworks/gauge/AfterClassSteps.java | 40 ---------
.../thoughtworks/gauge/BeforeClassSteps.java | 40 ---------
.../gauge/datastore/DataStore.java | 55 ------------
.../gauge/datastore/DataStoreFactory.java | 87 -------------------
.../gauge/datastore/DataStoreInitializer.java | 3 -
.../gauge/processor/ExecuteStepProcessor.java | 6 +-
.../gauge/registry/HooksRegistry.java | 29 -------
.../thoughtworks/gauge/scan/HooksScanner.java | 14 +--
.../gauge/screenshot/CustomScreenshot.java | 9 --
.../screenshot/CustomScreenshotScanner.java | 10 +--
.../screenshot/CustomScreenshotWriter.java | 2 +-
.../screenshot/ICustomScreenshotGrabber.java | 23 -----
.../gauge/screenshot/ScreenshotFactory.java | 25 ++----
.../gauge/registry/HooksRegistryTest.java | 46 ----------
16 files changed, 14 insertions(+), 379 deletions(-)
delete mode 100644 src/main/java/com/thoughtworks/gauge/AfterClassSteps.java
delete mode 100644 src/main/java/com/thoughtworks/gauge/BeforeClassSteps.java
delete mode 100644 src/main/java/com/thoughtworks/gauge/datastore/DataStore.java
delete mode 100644 src/main/java/com/thoughtworks/gauge/datastore/DataStoreFactory.java
delete mode 100644 src/main/java/com/thoughtworks/gauge/screenshot/CustomScreenshot.java
delete mode 100644 src/main/java/com/thoughtworks/gauge/screenshot/ICustomScreenshotGrabber.java
diff --git a/java.json b/java.json
index c0b14892..6c6028cd 100644
--- a/java.json
+++ b/java.json
@@ -1,6 +1,6 @@
{
"id": "java",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Java support for gauge",
"install": {
"windows": [],
diff --git a/pom.xml b/pom.xml
index 30f791cd..02e7a69d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
gauge-javacom.thoughtworks.gaugegauge-java
- 1.0.0
+ 1.0.1Java plugin for Gaugehttps://github.com/getgauge/gauge-java
diff --git a/src/main/java/com/thoughtworks/gauge/AfterClassSteps.java b/src/main/java/com/thoughtworks/gauge/AfterClassSteps.java
deleted file mode 100644
index 88bf86c4..00000000
--- a/src/main/java/com/thoughtworks/gauge/AfterClassSteps.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*----------------------------------------------------------------
- * Copyright (c) ThoughtWorks, Inc.
- * Licensed under the Apache License, Version 2.0
- * See LICENSE.txt in the project root for license information.
- *----------------------------------------------------------------*/
-package com.thoughtworks.gauge;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Methods annotated with this hook, will be executed after every step in that particular class.
- *
- * If there is more than one method annotated with @AfterClassSteps the order of execution is as follows:
- *
- *
Hooks which are not filtered by tags.
- *
Hooks filtered by tags.
- *
- * If there is more than one hook of these categories, they are executed in reverse alphabetical order based on method names.
- *
- */
-@Target(ElementType.METHOD)
-@Deprecated
-@Retention(RetentionPolicy.RUNTIME)
-public @interface AfterClassSteps {
-
- /**
- * @return Array of tags to filter which steps the hook executes after based on the tags in the current scenario and spec.
- */
- String[] tags() default {};
-
- /**
- * @return OR: if hook should execute for the current execution context (spec and scenario) containing any of the tags provided
- * AND: if hook should execute for the current execution context (spec and scenario) containing all of the tags provided
- * Default is AND
- */
- Operator tagAggregation() default Operator.AND;
-}
diff --git a/src/main/java/com/thoughtworks/gauge/BeforeClassSteps.java b/src/main/java/com/thoughtworks/gauge/BeforeClassSteps.java
deleted file mode 100644
index 5dcc7b1e..00000000
--- a/src/main/java/com/thoughtworks/gauge/BeforeClassSteps.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*----------------------------------------------------------------
- * Copyright (c) ThoughtWorks, Inc.
- * Licensed under the Apache License, Version 2.0
- * See LICENSE.txt in the project root for license information.
- *----------------------------------------------------------------*/
-package com.thoughtworks.gauge;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Methods annotated with this hook, will execute before every step in that particular class.
- *
- * If there is more than one method annotated with @BeforeClassSteps the order of execution is as follows:
- *
- *
Hooks which are not filtered by tags.
- *
Hooks filtered by tags.
- *
- * If there is more than one hook of these categories, they are alphabetically sorted based on method names.
- *
- */
-@Target(ElementType.METHOD)
-@Deprecated
-@Retention(RetentionPolicy.RUNTIME)
-public @interface BeforeClassSteps {
-
- /**
- * @return Array of tags to filter which steps the hook executes before based on the tags in the current scenario and spec.
- */
- String[] tags() default {};
-
- /**
- * @return OR: if hook should execute for the current execution context (spec and scenario) containing any of the tags provided
- * AND: if hook should execute for the current execution context (spec and scenario) containing all of the tags provided
- * Default is AND
- */
- Operator tagAggregation() default Operator.AND;
-}
diff --git a/src/main/java/com/thoughtworks/gauge/datastore/DataStore.java b/src/main/java/com/thoughtworks/gauge/datastore/DataStore.java
deleted file mode 100644
index b9c870fa..00000000
--- a/src/main/java/com/thoughtworks/gauge/datastore/DataStore.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*----------------------------------------------------------------
- * Copyright (c) ThoughtWorks, Inc.
- * Licensed under the Apache License, Version 2.0
- * See LICENSE.txt in the project root for license information.
- *----------------------------------------------------------------*/
-package com.thoughtworks.gauge.datastore;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-/**
- * @deprecated DataStore is no longer valid. The usage together with DataStoreFactory API will throw an Exception in multithreaded execution.
- *