diff --git a/pom-maven-central.xml b/pom-maven-central.xml
index 6320419b..46178a74 100644
--- a/pom-maven-central.xml
+++ b/pom-maven-central.xml
@@ -279,6 +279,17 @@
Europe/Madrid
+
+ enrique.gonzalo
+ Enrique Gonzalo Legarra
+ enrique.gonzalo@sngular.com
+ Sngular
+ https://sngular.github.io/
+
+ Senior FullStack Developer
+
+ Europe/Madrid
+
diff --git a/pom.xml b/pom.xml
index 5ad1f706..dad50d5c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
kloadgen
- 5.7.0
+ 5.6.5
KLoadGen
Load Generation Jmeter plugin for Kafka Cluster. Supporting AVRO, JSON Schema and Protobuf schema types. Generate Artificial
@@ -268,6 +268,17 @@
Europe/Madrid
+
+ enrique.gonzalo
+ Enrique Gonzalo Legarra
+ enrique.gonzalo@sngular.com
+ Sngular
+ https://sngular.github.io/
+
+ Senior FullStack Developer
+
+ Europe/Madrid
+
@@ -313,7 +324,7 @@
4.5.0
2.0.0-alpha1
1.3.1
- 2.35.0
+ 2.35.1
@@ -399,6 +410,12 @@
io.apicurio
apicurio-registry-client
${apicurio-registry.version}
+
+
+ org.jboss.slf4j
+ slf4j-jboss-logmanager
+
+
io.apicurio
@@ -440,6 +457,7 @@
org.slf4j
slf4j-api
${slf4j-api.version}
+ provided
org.apache.commons
diff --git a/src/main/java/com/sngular/kloadgen/config/schemaregistry/SchemaRegistryConfigElement.java b/src/main/java/com/sngular/kloadgen/config/schemaregistry/SchemaRegistryConfigElement.java
index ab7f0e7d..cdcc7490 100644
--- a/src/main/java/com/sngular/kloadgen/config/schemaregistry/SchemaRegistryConfigElement.java
+++ b/src/main/java/com/sngular/kloadgen/config/schemaregistry/SchemaRegistryConfigElement.java
@@ -63,7 +63,7 @@ private void serializeProperties() {
JMeterContextService.getContext().getProperties().setProperty(SchemaRegistryKeyHelper.SCHEMA_REGISTRY_NAME, getRegistryName());
jMeterVariables.put(SchemaRegistryKeyHelper.SCHEMA_REGISTRY_NAME, JMeterHelper.checkPropertyOrVariable(getRegistryName()));
-
+ jMeterVariables.put(SchemaRegistryKeyHelper.SCHEMA_REGISTRY_URL, JMeterHelper.checkPropertyOrVariable(getSchemaRegistryUrl()));
jMeterVariables.put(schemaRegistryManager.getSchemaRegistryUrlKey(), JMeterHelper.checkPropertyOrVariable(getRegistryUrl()));
if (ProducerKeysHelper.FLAG_YES.equalsIgnoreCase(schemaProperties.get(SchemaRegistryKeyHelper.SCHEMA_REGISTRY_AUTH_FLAG))) {
jMeterVariables.put(SchemaRegistryKeyHelper.SCHEMA_REGISTRY_AUTH_FLAG, ProducerKeysHelper.FLAG_YES);
diff --git a/src/main/java/com/sngular/kloadgen/extractor/extractors/avro/AbstractAvroFileExtractor.java b/src/main/java/com/sngular/kloadgen/extractor/extractors/avro/AbstractAvroFileExtractor.java
index fbe9de28..882c068e 100644
--- a/src/main/java/com/sngular/kloadgen/extractor/extractors/avro/AbstractAvroFileExtractor.java
+++ b/src/main/java/com/sngular/kloadgen/extractor/extractors/avro/AbstractAvroFileExtractor.java
@@ -358,7 +358,6 @@ private Set extractSchemaNames(Schema schema) {
Set schemaNames = new HashSet<>();
if (checkIfRecord(schema)) {
schemaNames.add(schema.getName());
- schema.getFields().forEach(field -> schemaNames.addAll(extractSchemaNames(field.schema())));
} else if (checkIfArray(schema)) {
schemaNames.addAll(extractSchemaNames(schema.getElementType()));
} else if (checkIfUnion(schema)) {
diff --git a/src/main/java/com/sngular/kloadgen/model/FieldValueMapping.java b/src/main/java/com/sngular/kloadgen/model/FieldValueMapping.java
index 48da718f..6950ff1b 100644
--- a/src/main/java/com/sngular/kloadgen/model/FieldValueMapping.java
+++ b/src/main/java/com/sngular/kloadgen/model/FieldValueMapping.java
@@ -7,12 +7,13 @@
package com.sngular.kloadgen.model;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.EnumMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -108,28 +109,42 @@ public final List getFieldValuesList() {
if (StringUtils.isNotBlank(inputFieldValueList) && !"[]".equalsIgnoreCase(inputFieldValueList)) {
try {
inputFieldValueAux = inputFieldValueList;
- if (inputFieldValueAux.charAt(0) != "[".charAt(0)) {
+
+ if (inputFieldValueAux.charAt(0) != '[') {
inputFieldValueAux = "[" + inputFieldValueAux;
}
- if (inputFieldValueAux.charAt(inputFieldValueAux.length() - 1) != "]".charAt(0)) {
+ if (inputFieldValueAux.charAt(inputFieldValueAux.length() - 1) != ']') {
inputFieldValueAux += "]";
}
final JsonNode nodes = OBJECT_MAPPER.readTree(inputFieldValueAux);
final Iterator nodeElements = nodes.elements();
while (nodeElements.hasNext()) {
result.add(nodeElements.next().toString());
+
}
} catch (final JsonProcessingException ex) {
- inputFieldValueAux = inputFieldValueList;
- if (inputFieldValueAux.charAt(0) == "[".charAt(0)) {
- inputFieldValueAux = inputFieldValueAux.substring(1);
+ // Warning: even though IntelliJ say that can be simplified, it can't be simplified!! (test fails)
+
+ if (inputFieldValueList.startsWith("[") && inputFieldValueList.endsWith("]")) {
+ final String pattern = "(?<=\\[?)((([À-ÿ\\p{Alnum}\\p{Punct}&&[^,\\[\\]]]+:([À-ÿ\\p{Alnum}\\p{Punct}&&[^,\\[\\]]]+|\\[([À-ÿ\\p{Alnum}\\p{Punct}&&[^,\\[\\]]]+,"
+ + "[À-ÿ\\p{Alnum}\\p{Punct}&&[^,\\[\\]]]+|)*]))|[À-ÿ\\p{Alnum}\\p{Punct}&&[^,\\[\\]]]+)(?=[]|,]))";
+ final Pattern r = Pattern.compile(pattern);
+ final Matcher matcher = r.matcher(inputFieldValueList.trim());
+ while (matcher.find()) {
+ result.add(matcher.group(0));
+ }
+ } else {
+ final String pattern = "([À-ÿ\\p{Alnum}\\p{Punct}&&[^,\\[\\]]][À-ÿ\\s\\p{Alnum}\\p{Punct}&&[^,\\[\\]]]+)[^,\\s]?+";
+ final Pattern r = Pattern.compile(pattern);
+ final Matcher matcher = r.matcher(inputFieldValueList.trim());
+ while (matcher.find()) {
+ result.add(matcher.group(0));
+ }
}
- if (inputFieldValueAux.charAt(inputFieldValueAux.length() - 1) == "]".charAt(0)) {
- inputFieldValueAux = inputFieldValueAux.substring(0, inputFieldValueAux.length() - 1);
- }
- result.addAll(Arrays.asList(inputFieldValueAux.trim().split("\\s*,\\s*", -1)));
+
}
}
+
return result;
}
diff --git a/src/main/java/com/sngular/kloadgen/property/editor/FileSubjectPropertyEditor.java b/src/main/java/com/sngular/kloadgen/property/editor/FileSubjectPropertyEditor.java
index d4883119..6db26c5b 100644
--- a/src/main/java/com/sngular/kloadgen/property/editor/FileSubjectPropertyEditor.java
+++ b/src/main/java/com/sngular/kloadgen/property/editor/FileSubjectPropertyEditor.java
@@ -38,7 +38,6 @@
import javax.swing.filechooser.FileSystemView;
import lombok.extern.slf4j.Slf4j;
import org.apache.avro.AvroRuntimeException;
-import org.apache.commons.compress.utils.Lists;
import org.apache.jmeter.gui.ClearGui;
import org.apache.jmeter.gui.GuiPackage;
import org.apache.jmeter.testbeans.gui.GenericTestBeanCustomizer;
@@ -135,10 +134,10 @@ public final List getAttributeList(final ParsedSchema selecte
public final void actionPerformed(final ActionEvent event) {
if (subjectNameComboBox.getItemCount() != 0) {
- final String schemaType = schemaTypeComboBox.getSelectedItem().toString();
+ final String schemaType = (String) schemaTypeComboBox.getSelectedItem();
final String selectedItem = (String) subjectNameComboBox.getSelectedItem();
final String selectedSchema = getSelectedSchema(selectedItem);
- final List attributeList = Lists.newArrayList();
+ final List attributeList = SchemaExtractor.flatPropertiesList(selectedSchema).getValue();
if (!attributeList.isEmpty()) {
try {
diff --git a/src/main/java/com/sngular/kloadgen/randomtool/generator/AvroGeneratorTool.java b/src/main/java/com/sngular/kloadgen/randomtool/generator/AvroGeneratorTool.java
index 0c45cfee..3f3aa8f6 100644
--- a/src/main/java/com/sngular/kloadgen/randomtool/generator/AvroGeneratorTool.java
+++ b/src/main/java/com/sngular/kloadgen/randomtool/generator/AvroGeneratorTool.java
@@ -248,7 +248,7 @@ public final Object generateMap(
}
}
} else {
- value = (HashMap