Project

General

Profile

Revision a38340e1

IDa38340e1af1333e6f77bb3521860d5d4fefbdb23
Parent a38e2585
Child 9e4028e0

Added by Andreas Kohlbecker about 1 month ago

ref #6581 fixing means to get bean property

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/taxonGraph/TaxonGraphBeforeTransactionCompleteProcess.java
11 11
import java.lang.reflect.InvocationTargetException;
12 12
import java.util.Objects;
13 13

  
14
import org.apache.commons.beanutils.BeanUtils;
14
import org.apache.commons.beanutils.PropertyUtils;
15 15
import org.apache.commons.lang.ArrayUtils;
16 16
import org.apache.log4j.Level;
17 17
import org.apache.log4j.Logger;
......
186 186
                    if (oldState[i] == null && state[i] == null){
187 187
                        return -1;
188 188
                    }else{
189
                        //TODO make it recursive (until now only a 2 step path is allowed, but should be enough for the given use-case)
190
                        Object oldStatePathObj = (oldState[i]==null) ? null: BeanUtils.getProperty(oldState[i],path[1]);
191
                        Object newStatePathObj = (state[i]==null) ? null: BeanUtils.getProperty(state[i],path[1]);
189
                        //TODO make it recursive (until now only a 2 step path is allowed, but should be enough for the given use-case
190
                        Object oldStatePathObj = (oldState[i]==null) ? null: PropertyUtils.getProperty(oldState[i], path[1]);
191
                        Object newStatePathObj = (state[i]==null) ? null: PropertyUtils.getProperty(state[i], path[1]);
192 192
                        if (oldStatePathObj == null && newStatePathObj == null){
193 193
                            return -1;
194 194
                        }else{
195 195
                            if(!Objects.equals(oldStatePathObj, newStatePathObj)){
196
                                return 0;
196
                                return i;
197 197
                            }else{
198 198
                                return -1;
199 199
                            }
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/taxonGraph/TaxonGraphHibernateListenerTest.java
19 19
import org.junit.After;
20 20
import org.junit.Assert;
21 21
import org.junit.Before;
22
import org.junit.Ignore;
23 22
import org.junit.Test;
24 23
import org.springframework.security.authentication.AuthenticationProvider;
25 24
import org.unitils.dbunit.annotation.DataSet;
......
176 175

  
177 176
    @Test
178 177
    @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class, value="TaxonGraphTest.xml")
179
    @Ignore //FIXME preliminary   #6581
178
    // @Ignore //FIXME preliminary   #6581
180 179
    public void testChangeNomRef() throws TaxonGraphException{
181 180
        try {
182 181
            setUuidPref();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)