[JDATA-4] to-java not working on some setters Created: 09/Oct/13  Updated: 09/Oct/13

Status: Open
Project: java.data
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Peter Gillard-Moss Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

clojure 1.5.1
org.clojure/java.data 0.1.1


In this example the last test fails.

I have used org.codehause.mojo.rpm.Mapping[1] as the example as this is where I discovered the bug.

[1] http://mojo.codehaus.org/rpm-maven-plugin/apidocs/org/codehaus/mojo/rpm/Mapping.html


(use 'clojure.java.data
(import '[org.codehaus.mojo.rpm Mapping])

(testing "setting normally"

(let [mapping (Mapping.)]
(.setConfiguration mapping "a value")
(.setDirectory mapping "/tmp")

(is (= (.getDirectory mapping) "/tmp"))
(is (= (.getConfiguration mapping) "a value"))))

(testing "setting via java-data"
(let [mapping (to-java Mapping {:configuration "a value" :directory "/tmp"})]
(is (= (.getDirectory mapping) "/tmp"))
(is (= (.getConfiguration mapping) "a value")))))

Generated at Thu Apr 25 18:48:13 CDT 2019 using JIRA 4.4#649-r158309.