IDEMPIERE-1044 Load testing. Use more reliable fixed uuid generation method for jmeter load testing. Disable recycling of uuid for jmeter load testing. Added npe check for close window.
This commit is contained in:
parent
a8794b6c64
commit
6e6d59d04f
|
@ -48,6 +48,45 @@ public class AdempiereIdGenerator implements IdGenerator {
|
||||||
public String nextComponentUuid(Desktop desktop, Component comp, ComponentInfo compInfo) {
|
public String nextComponentUuid(Desktop desktop, Component comp, ComponentInfo compInfo) {
|
||||||
buildLocatorAttribute(comp);
|
buildLocatorAttribute(comp);
|
||||||
|
|
||||||
|
String uuid = comp.getId();
|
||||||
|
boolean useIdSpace = true;
|
||||||
|
if (Util.isEmpty(uuid)) {
|
||||||
|
useIdSpace = false;
|
||||||
|
String attribute = comp.getWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME);
|
||||||
|
if (!Util.isEmpty(attribute)) {
|
||||||
|
String widgetName = getWidgetName(comp.getWidgetClass());
|
||||||
|
uuid = widgetName+"0"+attribute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Util.isEmpty(uuid)) {
|
||||||
|
uuid = getWidgetName(comp.getWidgetClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder builder = new StringBuilder(uuid);
|
||||||
|
if (useIdSpace) {
|
||||||
|
Component parent = comp.getParent();
|
||||||
|
while (parent != null) {
|
||||||
|
if (parent instanceof IdSpace) {
|
||||||
|
builder.insert(0, "_");
|
||||||
|
builder.insert(0, parent.getUuid());
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
parent = parent.getParent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (comp.getParent() != null) {
|
||||||
|
builder.insert(0, "_");
|
||||||
|
builder.insert(0, comp.getParent().getUuid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uuid = escapeId(builder.toString());
|
||||||
|
if (desktop.getComponentByUuidIfAny(uuid) == null) { // look to avoid dups
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
String number;
|
String number;
|
||||||
if ((number = (String)desktop.getAttribute("Id_Num")) == null) {
|
if ((number = (String)desktop.getAttribute("Id_Num")) == null) {
|
||||||
number = "0";
|
number = "0";
|
||||||
|
@ -56,7 +95,8 @@ public class AdempiereIdGenerator implements IdGenerator {
|
||||||
int i = Integer.parseInt(number);
|
int i = Integer.parseInt(number);
|
||||||
i++;// Start from 1
|
i++;// Start from 1
|
||||||
desktop.setAttribute("Id_Num", String.valueOf(i));
|
desktop.setAttribute("Id_Num", String.valueOf(i));
|
||||||
return "t_" + i;
|
|
||||||
|
return uuid + "_" + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getWidgetName(String widgetClass) {
|
private static String getWidgetName(String widgetClass) {
|
||||||
|
|
|
@ -345,7 +345,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
{
|
{
|
||||||
Tabpanel panel = (Tabpanel) child;
|
Tabpanel panel = (Tabpanel) child;
|
||||||
Component component = panel.getFirstChild();
|
Component component = panel.getFirstChild();
|
||||||
Object att = component.getAttribute(WINDOWNO_ATTRIBUTE);
|
Object att = component != null ? component.getAttribute(WINDOWNO_ATTRIBUTE) : null;
|
||||||
if (att != null && (att instanceof Integer))
|
if (att != null && (att instanceof Integer))
|
||||||
{
|
{
|
||||||
if (windowNo == (Integer)att)
|
if (windowNo == (Integer)att)
|
||||||
|
|
|
@ -17,4 +17,9 @@
|
||||||
<listener>
|
<listener>
|
||||||
<listener-class>org.adempiere.webui.UiLifeCycleListener</listener-class>
|
<listener-class>org.adempiere.webui.UiLifeCycleListener</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
|
||||||
|
<library-property>
|
||||||
|
<name>org.zkoss.zk.ui.uuidRecycle.disabled</name>
|
||||||
|
<value>true</value>
|
||||||
|
</library-property>
|
||||||
</zk>
|
</zk>
|
||||||
|
|
Loading…
Reference in New Issue