Colin Zhang created JXPATH-202:
----------------------------------

             Summary: selector by predicate of Long value get wrong result?
                 Key: JXPATH-202
                 URL: https://issues.apache.org/jira/browse/JXPATH-202
             Project: Commons JXPath
          Issue Type: Bug
    Affects Versions: 1.3
         Environment: jre1.8

 
            Reporter: Colin Zhang


Below test failed,  am I using the wrong way or it is a bug?

import org.apache.commons.jxpath.JXPathContext;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Iterator;

public class LongValueTests {


@Test
public void testIterate() {
Bean b = new Bean(1010903488200000175L, 1010902, "Whatever");
JXPathContext context = JXPathContext.newContext(b);
Iterator iterator = context.iterate(".[longValue=1010903488200000128]");
Assertions.assertFalse(iterator.hasNext());
}

public static class Bean {

private Long longValue;

private Integer intValue;

private String stringValue;

public Bean(Long longValue, Integer intValue, String stringValue) {
this.longValue = longValue;
this.intValue = intValue;
this.stringValue = stringValue;
}

public Long getLongValue() {
return longValue;
}

public Integer getIntValue() {
return intValue;
}

public String getStringValue() {
return stringValue;
}
}
}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to