jsalvata 2004/01/28 02:08:43
Modified: src/core/org/apache/jmeter/gui GuiPackage.java
Log:
Can now obtain the GUI for a just-created test bean with no
properties (from the test bean's class instead of the
test_class or gui_class properties).
Revision Changes Path
1.25 +20 -8 jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java
Index: GuiPackage.java
===================================================================
RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- GuiPackage.java 23 Jan 2004 01:55:29 -0000 1.24
+++ GuiPackage.java 28 Jan 2004 10:08:39 -0000 1.25
@@ -194,17 +194,29 @@
*/
public JMeterGUIComponent getGui(TestElement node)
{
+ String testClassName= node.getPropertyAsString(TestElement.TEST_CLASS);
+ String guiClassName= node.getPropertyAsString(TestElement.GUI_CLASS);
try
{
- return getGui(
- node,
- Class.forName(node.getPropertyAsString(TestElement.GUI_CLASS)),
- Class.forName(node.getPropertyAsString(TestElement.TEST_CLASS)));
+ Class testClass;
+ if (testClassName.equals(""))
+ {
+ testClass= node.getClass();
+ }
+ else
+ {
+ testClass= Class.forName(testClassName);
+ }
+ Class guiClass= null;
+ if (! guiClassName.equals(""))
+ {
+ guiClass= Class.forName(guiClassName);
+ }
+ return getGui(node, guiClass, testClass);
}
catch (ClassNotFoundException e)
{
- log.error("Could not get GUI for "
- +node.getPropertyAsString(TestElement.GUI_CLASS), e);
+ log.error("Could not get GUI for " + node, e);
return null;
}
}
@@ -231,12 +243,12 @@
try
{
JMeterGUIComponent comp = (JMeterGUIComponent) nodesToGui.get(node);
- log.debug("Gui retrieved = " + comp);
if (comp == null)
{
comp = getGuiFromCache(guiClass, testClass);
nodesToGui.put(node, comp);
}
+ log.debug("Gui retrieved = " + comp);
return comp;
}
catch (Exception e)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]