From fc532226ba5e4bc42400282c667d8e988f7eb828 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 2 Oct 2023 03:50:51 -0300 Subject: [PATCH] Release 2.2 (#51) --- pom.xml | 13 +- .../correlation/CorrelationProxyControl.java | 51 +- .../CorrelationProxyControlGui.java | 2 +- .../CorrelationTemplateVersions.java | 21 +- .../CorrelationTemplatesRegistry.java | 10 - ...ionTemplatesRepositoriesConfiguration.java | 129 +- ...relationTemplatesRepositoriesRegistry.java | 12 +- .../CorrelationTemplatesRepository.java | 28 +- .../core/templates/LocalConfiguration.java | 491 +++++++- .../LocalCorrelationTemplatesRegistry.java | 108 -- ...relationTemplatesRepositoriesRegistry.java | 197 +-- ...relationTemplatesRepositoriesRegistry.java | 29 +- .../templates/RepositoryGeneralConst.java | 10 +- .../correlation/core/templates/Template.java | 4 + .../repository/RepositoryRegistry.java | 10 + .../pluggable/CentralRepository.java | 21 + .../repository/pluggable/LocalRepository.java | 47 +- .../pluggable/RemoteFolderRepository.java | 30 +- .../pluggable/RemoteUrlRepository.java | 25 +- .../correlation/gui/RulesContainer.java | 18 +- .../gui/TestPlanTemplatesRepository.java | 10 + .../CorrelationTemplatesSelectionPanel.java | 5 +- .../gui/automatic/CorrelationWizard.java | 12 + .../gui/templates/PlaceHolderComboBox.java | 139 ++ .../templates/TemplateDependenciesTable.java | 307 +++++ .../gui/templates/TemplateManagerDisplay.java | 10 + .../gui/templates/TemplateSaveFrame.java | 1121 ++++++++++------- .../gui/templates/TemplatesManagerFrame.java | 18 +- .../correlation/gui/templates/Validation.java | 22 - .../gui/templates/VersionUtils.java | 56 + .../templates/validations/BaseValidation.java | 128 ++ .../validations/ComponentValidation.java | 20 + .../gui/templates/validations/Condition.java | 10 + .../validations/ValidationManager.java | 131 ++ .../validations/type/NoNumbersCondition.java | 24 + .../validations/type/NotEmptyCondition.java | 23 + .../type/UniqueVersionCondition.java | 35 + .../TemplateSaveFrame.html | 56 + .../CorrelationProxyControlBuilder.java | 5 +- .../CorrelationProxyControlTest.java | 11 +- .../core/automatic/CorrelationWizardIT.java | 19 +- .../templates/LocalConfigurationTest.java | 68 +- ...tionTemplatesRepositoriesRegistryTest.java | 45 +- .../TemplateDependenciasTableIT.java | 104 ++ .../TemplateManagerDisplaySaveFrameIT.java | 70 +- .../gui/templates/ValidationTest.java | 29 - 46 files changed, 2558 insertions(+), 1176 deletions(-) create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/PlaceHolderComboBox.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/TemplateDependenciesTable.java delete mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/Validation.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/VersionUtils.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/BaseValidation.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/ComponentValidation.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/Condition.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/ValidationManager.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/type/NoNumbersCondition.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/type/NotEmptyCondition.java create mode 100644 src/main/java/com/blazemeter/jmeter/correlation/gui/templates/validations/type/UniqueVersionCondition.java create mode 100644 src/main/resources/correlation-descriptions/TemplateSaveFrame.html create mode 100644 src/test/java/com/blazemeter/jmeter/correlation/gui/templates/TemplateDependenciasTableIT.java delete mode 100644 src/test/java/com/blazemeter/jmeter/correlation/gui/templates/ValidationTest.java diff --git a/pom.xml b/pom.xml index 8f36ce0..7fe7189 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.blazemeter jmeter-bzm-correlation-recorder jar - 2.1 + 2.2 Correlation Recorder as JMeter plugin Correlation Recorder Plugin for JMeter https://github.com/Blazemeter/CorrelationRecorder @@ -160,6 +160,17 @@ 1.9 test + + org.apache.maven + maven-artifact + 3.8.4 + + + org.apache.commons + commons-lang3 + 3.12.0 + provided + diff --git a/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java b/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java index bb4837e..9e7c7d3 100644 --- a/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java +++ b/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java @@ -18,13 +18,11 @@ import com.blazemeter.jmeter.correlation.core.templates.ConfigurationException; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplateDependency; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplateVersions; -import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRegistry; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRegistryHandler; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRepositoriesConfiguration; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRepositoriesRegistryHandler; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRepository; import com.blazemeter.jmeter.correlation.core.templates.LocalConfiguration; -import com.blazemeter.jmeter.correlation.core.templates.LocalCorrelationTemplatesRegistry; import com.blazemeter.jmeter.correlation.core.templates.Template; import com.blazemeter.jmeter.correlation.core.templates.Template.Builder; import com.blazemeter.jmeter.correlation.core.templates.repository.RepositoryManager; @@ -115,7 +113,6 @@ public class CorrelationProxyControl extends ProxyControl implements private transient CorrelationTemplatesRepositoriesConfiguration templateRepositoryConfig; private transient LocalConfiguration localConfiguration; private transient CorrelationEngine correlationEngine; - private transient CorrelationTemplatesRegistry correlationTemplatesRegistry; private JMeterTreeNode target = null; private List samples = new ArrayList<>(); private Method putSamplesIntoModel; @@ -136,7 +133,6 @@ public CorrelationProxyControl() { correlationEngine = new CorrelationEngine(); componentsRegistry = CorrelationComponentsRegistry.getInstance(); localConfiguration = new LocalConfiguration(JMeterUtils.getJMeterBinDir()); - correlationTemplatesRegistry = new LocalCorrelationTemplatesRegistry(localConfiguration); templateRepositoryConfig = new CorrelationTemplatesRepositoriesConfiguration(localConfiguration); setName(RECORDER_NAME); @@ -147,14 +143,12 @@ public CorrelationProxyControl( CorrelationComponentsRegistry componentsRegistry, CorrelationTemplatesRepositoriesConfiguration templateRepositoryConfig, LocalConfiguration localConfiguration, - CorrelationEngine correlationEngine, - CorrelationTemplatesRegistry correlationTemplatesRegistry) { + CorrelationEngine correlationEngine) { this.componentsRegistry = componentsRegistry; this.templateRepositoryConfig = templateRepositoryConfig; this.localConfiguration = localConfiguration; this.correlationEngine = correlationEngine; - this.correlationTemplatesRegistry = correlationTemplatesRegistry; } public CorrelationTemplatesRepositoriesConfiguration getTemplateRepositoryConfig() { @@ -519,9 +513,7 @@ public void onSaveTemplate(Builder builder) throws IOException, ConfigurationExc .withResponseFilters(getResponseFilter()) .build(); - correlationTemplatesRegistry.save(template); - updateLocalRepository(template); - installTemplate(template.getRepositoryId(), template.getId(), template.getVersion()); + localConfiguration.saveTemplate(template); } public List getGroups() { @@ -578,16 +570,12 @@ public void setResponseFilter(String responseFilter) { setProperty(RESPONSE_FILTER, responseFilter); } - private void updateLocalRepository(Template template) { - templateRepositoryConfig - .updateLocalRepository(template.getId(), template.getVersion()); - } - @Override public void onLoadTemplate(String repositoryOwner, String id, String templateVersion) throws IOException { - Optional