java.data

to-java not working on some setters

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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")))))

Activity

No changes have yet been made on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: