Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/src/main/java/org/apache/hop/core/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,9 @@
* @see #HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT
* @see #HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING
*/
@Variable(description = "A variable to configure the maximum file size of a single zip entry")
@Variable(
value = "4294967295",
description = "A variable to configure the maximum file size of a single zip entry")
public static final String HOP_ZIP_MAX_ENTRY_SIZE = "HOP_ZIP_MAX_ENTRY_SIZE";

/**
Expand All @@ -1018,7 +1020,6 @@
* @see #HOP_ZIP_MAX_ENTRY_SIZE
* @see #HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT
*/
@Variable(description = "")
public static final String HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING =
String.valueOf(HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT);

Expand Down Expand Up @@ -1219,7 +1220,7 @@
* @return The rounded floating point value
*/
@Deprecated(since = "2.10")
@SuppressWarnings("java:S1874") // Ignore BigDecimal RoundingModes as code will be removed

Check warning on line 1223 in core/src/main/java/org/apache/hop/core/Const.java

View workflow job for this annotation

GitHub Actions / build

Unsupported @SuppressWarnings("java:S1874")

Check warning on line 1223 in core/src/main/java/org/apache/hop/core/Const.java

View workflow job for this annotation

GitHub Actions / ui-tests

Unsupported @SuppressWarnings("java:S1874")
public static BigDecimal round(BigDecimal f, int places, int roundingMode) {
if (roundingMode == ROUND_HALF_CEILING) {
if (f.signum() >= 0) {
Expand Down Expand Up @@ -2022,7 +2023,7 @@
BufferedReader br;
try {
// Safe: resolving "hostname" through the PATH of the operator who started Hop is intended
@SuppressWarnings("java:S4036")

Check warning on line 2026 in core/src/main/java/org/apache/hop/core/Const.java

View workflow job for this annotation

GitHub Actions / build

Unsupported @SuppressWarnings("java:S4036")

Check warning on line 2026 in core/src/main/java/org/apache/hop/core/Const.java

View workflow job for this annotation

GitHub Actions / ui-tests

Unsupported @SuppressWarnings("java:S4036")
Process pr = Runtime.getRuntime().exec("hostname");
br = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line;
Expand Down Expand Up @@ -2088,7 +2089,7 @@
String mac = "none";
String os = getSystemOs();
String s = "";
boolean errorOccured = false;

Check warning on line 2092 in core/src/main/java/org/apache/hop/core/Const.java

View workflow job for this annotation

GitHub Actions / build

The value of the local variable errorOccured is not used

Check warning on line 2092 in core/src/main/java/org/apache/hop/core/Const.java

View workflow job for this annotation

GitHub Actions / ui-tests

The value of the local variable errorOccured is not used
if (os.equalsIgnoreCase("Windows NT")
|| os.equalsIgnoreCase("Windows 2000")
|| os.equalsIgnoreCase("Windows XP")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

package org.apache.hop.core.variables;

import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import org.apache.hop.core.Const;
import org.apache.hop.core.HopClientEnvironment;
Expand Down Expand Up @@ -50,4 +52,22 @@ void testInit() throws Exception {
"Specifies the password encoder plugin to use by ID (Hop is the default).",
describedVariable.getDescription());
}

@Test
void testZipMaxEntrySizeMetadata() throws Exception {
HopClientEnvironment.init();
TestUtil.registerTestPluginTypes();

VariableRegistry.init();
VariableRegistry registry = VariableRegistry.getInstance();
DescribedVariable describedVariable =
registry.findDescribedVariable(Const.HOP_ZIP_MAX_ENTRY_SIZE);

assertNotNull(describedVariable);
assertAll(
() ->
assertEquals(Const.HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING, describedVariable.getValue()),
() -> assertFalse(describedVariable.getDescription().isBlank()),
() -> assertNull(registry.findDescribedVariable("HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING")));
}
}
Loading