Fixed, revision 1536586.
Adrian Crum
Sandglass Software
www.sandglass-software.com
On 10/28/2013 7:04 PM, Hans Bakker wrote:
Adrian,
We already solved the first problem,
however can you tell me how to create a new TestSuiteInfo like the
following:
x = new TestSuiteInfo(componentConfig, testSuiteElement);
which is now private which was public before, how should i create it now?
Regards,
Hans
On 10/28/2013 06:34 PM, Adrian Crum wrote:
Yes, of course it was necessary to change the classes - as your
compiler errors point out.
The general design principle for modelling XML files is to create an
immutable (read-only) representation of the XML file. Not only is this
an accurate representation of a (supposedly) immutable XML file, it is
also thread-safe.
You are trying to change a model state or you are trying to access
private members (I can't be sure because I can't see your modifications).
If the error message is caused by modifying the model state, then you
need to refactor your code to treat the model as read-only. If you are
trying to access private members, then create accessors for them.
Adrian Crum
Sandglass Software
www.sandglass-software.com
On 10/27/2013 11:31 PM, Hans Bakker wrote:
Hi Adrian,
we have an additional component here which integrate selenium with junit
in OFBiz.
Because of the change below, our code does not compile anymore and i was
wondering if you can give us suggestions how to modify our code:
1. ModelTestSuite modelTestSuite = new
ModelTestSuite(testSuiteInfo.componentConfig.getComponentName(),
documentElement, testCase);
gives the error:
componentConfig has private access in
org.ofbiz.base.component.ComponentConfig.ResourceInfo
2. TestSuiteInfo testSuiteInfo = new TestSuiteInfo(componentConfig,
testSuiteElement);
gives the error:
TestSuiteInfo(org.ofbiz.base.component.ComponentConfig,org.w3c.dom.Element)
has private access in
org.ofbiz.base.component.ComponentConfig.TestSuiteInfo
was it really required to change these signatures? If yes, please
suggest how to solve this.....
Regards,
Hans
On 10/22/2013 02:22 AM, [email protected] wrote:
Author: adrianc
Date: Mon Oct 21 19:22:21 2013
New Revision: 1534331
URL: http://svn.apache.org/r1534331
Log:
ComponentConfig.java refactor - improved thread-safety for the
WebappInfo inner class.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java?rev=1534331&r1=1534330&r2=1534331&view=diff
==============================================================================
---
ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
(original)
+++
ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
Mon Oct 21 19:22:21 2013
@@ -206,7 +206,7 @@ public final class ComponentConfig {
for (ComponentConfig cc : getAllComponents()) {
for (WebappInfo wInfo : cc.getWebappInfos()) {
String key =
UtilValidate.isNotEmpty(wInfo.position) ? wInfo.position : wInfo.title;
- if (serverName.equals(wInfo.server) &&
wInfo.appBarDisplay) {
+ if (serverName.equals(wInfo.server) &&
wInfo.getAppBarDisplay()) {
if (UtilValidate.isNotEmpty(menuName)) {
if (menuName.equals(wInfo.menuName)) {
tm.put(key, wInfo);
@@ -781,10 +781,10 @@ public final class ComponentConfig {
public final String location;
public final String[] basePermission;
public final String position;
- // FIXME: CatalinaContainer modifies this field.
- public boolean appBarDisplay;
public final boolean sessionCookieAccepted;
public final boolean privileged;
+ // CatalinaContainer modifies this field.
+ private volatile boolean appBarDisplay;
private WebappInfo(ComponentConfig componentConfig, Element
element) {
this.componentConfig = componentConfig;
@@ -873,6 +873,10 @@ public final class ComponentConfig {
}
}
+ public synchronized boolean getAppBarDisplay() {
+ return this.appBarDisplay;
+ }
+
public String[] getBasePermission() {
return this.basePermission;
}
@@ -908,5 +912,9 @@ public final class ComponentConfig {
public boolean isSessionCookieAccepted() {
return sessionCookieAccepted;
}
+
+ public synchronized void setAppBarDisplay(boolean
appBarDisplay) {
+ this.appBarDisplay = appBarDisplay;
+ }
}
}
Modified:
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1534331&r1=1534330&r2=1534331&view=diff
==============================================================================
---
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
(original)
+++
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
Mon Oct 21 19:22:21 2013
@@ -779,7 +779,7 @@ public class CatalinaContainer implement
List<String> virtualHosts =
appInfo.getVirtualHosts();
String mount = appInfo.getContextRoot();
List<String> keys = FastList.newInstance();
- if (UtilValidate.isEmpty(virtualHosts)) {
+ if (virtualHosts.isEmpty()) {
keys.add(engineName + ":DEFAULT:" + mount);
} else {
for (String virtualHost: virtualHosts) {
@@ -790,12 +790,12 @@ public class CatalinaContainer implement
// nothing was removed from the new list of
keys; this
// means there are no existing loaded entries
that overlap
// with the new set
- if (appInfo.location != null) {
+ if (!appInfo.location.isEmpty()) {
futures.add(executor.submit(createContext(appInfo)));
}
loadedMounts.addAll(keys);
} else {
- appInfo.appBarDisplay = false; // disable app bar
display on overrided apps
+ appInfo.setAppBarDisplay(false); // disable app
bar display on overrided apps
Debug.logInfo("Duplicate webapp mount; not
loading : " + appInfo.getName() + " / " + appInfo.getLocation(),
module);
}
}