[jbpm-commits] JBoss JBPM SVN: r6867 - in jbpm3/branches/jbpm-3.2-soa/core/src: test/java/org/jbpm and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Dec 14 01:07:51 EST 2010
Author: alex.guizar at jboss.com
Date: 2010-12-14 01:07:50 -0500 (Tue, 14 Dec 2010)
New Revision: 6867
Added:
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2984/
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2984/ConfigurationPropertyNameTest.java
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/configuration/PropertyInfo.java
Log:
JBPM-2984 restore PropertyInfo's binding property name isFoo to accessor method setFoo
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/configuration/PropertyInfo.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/configuration/PropertyInfo.java 2010-12-14 04:58:10 UTC (rev 6866)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/configuration/PropertyInfo.java 2010-12-14 06:07:50 UTC (rev 6867)
@@ -41,8 +41,14 @@
// property name
if (propertyElement.hasAttribute("name")) {
String propertyName = propertyElement.getAttribute("name");
- setterMethodName = "set" + Character.toUpperCase(propertyName.charAt(0))
- + propertyName.substring(1);
+ if (propertyName.startsWith("is") && propertyName.length() >= 3
+ && Character.isUpperCase(propertyName.charAt(2))) {
+ setterMethodName = "set" + propertyName.substring(2);
+ }
+ else {
+ setterMethodName = "set" + Character.toUpperCase(propertyName.charAt(0))
+ + propertyName.substring(1);
+ }
}
// setter method
else if (propertyElement.hasAttribute("setter")) {
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2984/ConfigurationPropertyNameTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2984/ConfigurationPropertyNameTest.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/jbpm2984/ConfigurationPropertyNameTest.java 2010-12-14 06:07:50 UTC (rev 6867)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jbpm2984;
+
+import org.jbpm.AbstractJbpmTestCase;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory;
+
+/**
+ * JtaDbPersistenceServiceFactory backward incompatibility.
+ *
+ * @see <a href="https://issues.jboss.org/browse/JBPM-2984">JBPM-2984</a>
+ * @author Alejandro Guizar
+ */
+public class ConfigurationPropertyNameTest extends AbstractJbpmTestCase {
+
+ private JbpmConfiguration jbpmConfiguration;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
+ + " <jbpm-context>"
+ + " <service name='persistence'>"
+ + " <factory>"
+ + " <bean class='"
+ + JtaDbPersistenceServiceFactory.class.getName()
+ + "'>"
+ + " <property name='isCurrentSessionEnabled'><false/></property>"
+ + " </bean>"
+ + " </factory>"
+ + " </service>"
+ + " </jbpm-context>"
+ + "</jbpm-configuration>");
+ }
+
+ protected void tearDown() throws Exception {
+ jbpmConfiguration.close();
+ super.tearDown();
+ }
+
+ public void testConfigurationPropertyName() {
+ JtaDbPersistenceServiceFactory serviceFactory =
+ (JtaDbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory("persistence");
+ assertFalse("expected current session to be disabled",
+ serviceFactory.isCurrentSessionEnabled());
+ }
+}
More information about the jbpm-commits
mailing list