forked from apache/jmeter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: after disabling the Java Request sampler, it cannot be enabled a…
…gain Java sampler was inheriting "enabled" status from its config element as internally, Java Sampler UI always creates a config element and merges it to the java sampler. The solution is to move "configureTestElement(sampler);" to the very end of modifyTestElement so all the base properties are populated based on the element properties rather than "config element" properties. Ideally we should somehow limit "mergeIn", and we should refrain from merging unexpected properties. Fixes apache#6004
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/core/src/test/kotlin/org/apache/jmeter/gui/AbstractJMeterGuiComponentTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.jmeter.gui | ||
|
||
import org.apache.jmeter.testelement.TestElement | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
import javax.swing.JPopupMenu | ||
|
||
class AbstractJMeterGuiComponentTest { | ||
@Test | ||
fun isEnabled() { | ||
val element = object : AbstractJMeterGuiComponent() { | ||
override fun getLabelResource(): String = "dummy_element_for_tests" | ||
|
||
override fun createTestElement(): TestElement = TODO() | ||
|
||
override fun modifyTestElement(element: TestElement?) = TODO() | ||
|
||
override fun createPopupMenu(): JPopupMenu = TODO() | ||
|
||
override fun getMenuCategories(): MutableCollection<String> = TODO() | ||
} | ||
|
||
assertEquals(true, element.isEnabled, "element.isEnabled after creation of the element") | ||
|
||
element.clearGui() | ||
assertEquals(true, element.isEnabled, "element.isEnabled after element.clearGui()") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters