<< Back to previous view

[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
Environment:

clojure 1.5.1
org.clojure/java.data 0.1.1



 Description   

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

Tests:

(do
(use 'clojure.java.data
'clojure.test)
(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 Sat Aug 30 17:32:03 CDT 2014 using JIRA 4.4#649-r158309.