File tree Expand file tree Collapse file tree 4 files changed +30
-9
lines changed
Expand file tree Collapse file tree 4 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 277277 </None >
278278 </ItemGroup >
279279
280+ <ItemGroup Condition =" '$(TargetFramework)' == 'net8.0'" >
281+ <PackageReference Include =" System.Runtime.Serialization.Formatters" >
282+ <Version >9.0.8</Version >
283+ </PackageReference >
284+ </ItemGroup >
285+
286+ <ItemGroup Condition =" '$(TargetFramework)' == 'net9.0'" >
287+ <PackageReference Include =" System.Runtime.Serialization.Formatters" >
288+ <Version >9.0.8</Version >
289+ </PackageReference >
290+ </ItemGroup >
291+
280292</Project >
Original file line number Diff line number Diff line change 1919 (:import ; ;; java.util.Base64
2020 (clojure.lang AtomicLong AtomicInteger))) ; ;; java.util.concurrent.atomic
2121
22+
23+ (compile-when (>= (:major dotnet-version) 9 )
24+
25+ (assembly-load-from " System.Runtime.Serialization.Formatters.dll" )
26+
27+ )
28+
29+ (import '(System.Runtime.Serialization.Formatters.Binary BinaryFormatter))
30+
2231; http://clojure.org/java_interop
2332; http://clojure.org/compilation
2433
236245 [^String s]
237246 (.GetString System.Text.Encoding/UTF8 (System.Convert/FromBase64String s))) ; ;; (.decode (Base64/getDecoder) s)
238247
239- (compile-when (>= (:major clojure-version) 9 )
240-
241- (assembly-load-from " System.Runtime.Serialization.Formatters.dll" )
242-
243- )
244-
245248(deftest test-proxy-non-serializable
246249 (testing " That proxy classes refuse serialization and deserialization"
247250 ; ; Serializable listed directly in interface list:
248251 (is (thrown? System.Runtime.Serialization.SerializationException ; ;; java.io.NotSerializableException
249- (let [formatter (System.Runtime.Serialization.Formatters.Binary. BinaryFormatter. )] ; ;; (-> (java.io.ByteArrayOutputStream.)
252+ (let [formatter (BinaryFormatter. )] ; ;; (-> (java.io.ByteArrayOutputStream.)
250253 (.Serialize formatter (System.IO.MemoryStream. ) ; ;; (java.io.ObjectOutputStream.)
251254 (proxy [Object System.Runtime.Serialization.ISerializable] []))))) ; ;; (.writeObject (proxy [Object java.io.Serializable] [])))
252255 ; ; Serializable included via inheritence:
Original file line number Diff line number Diff line change 1414 (:import (System.IO MemoryStream) ; ;;(java.io ObjectOutputStream ObjectInputStream
1515 #_(System.Runtime.Serialization.Formatters.Binary BinaryFormatter))) ; ;; ByteArrayOutputStream ByteArrayInputStream))) -- defer import until after load
1616
17- (compile-when (>= (:major clojure-version) 9 )
17+
18+ (compile-when (>= (:major dotnet-version) 9 )
1819
1920(assembly-load-from " System.Runtime.Serialization.Formatters.dll" )
2021
2122)
2223
2324(import '(System.Runtime.Serialization.Formatters.Binary BinaryFormatter))
2425
26+
2527(defn- serialize
2628 " Serializes a single object, returning a byte array."
2729 [v]
Original file line number Diff line number Diff line change 2828
2929 <Error Condition =" '$(TestTargetFramework)' != 'net462' AND '$(TestTargetFramework)' != 'net9.0' AND '$(TestTargetFramework)' != 'net8.0' AND '$(TestTargetFramework)' != 'net6.0'" />
3030
31-
31+ <!--
3232 <TestLibraryFramework Condition=" '$(TestTargetFramework)' == 'net462' ">netstandard2.0</TestLibraryFramework>
3333 <TestLibraryFramework Condition=" '$(TestTargetFramework)' != 'net462' ">netstandard2.1</TestLibraryFramework>
34+ -->
35+
36+ <!-- When I switched target frameworks for Clojure.Source and Clojure.Tests, needed to change TestLibraryFramework to match TestTargetFramework -->
37+ <TestLibraryFramework >$(TestTargetFramework)</TestLibraryFramework >
3438
3539
3640 <TestDir >$(RootDir)Test\$(Configuration)\$(TestTargetFramework)</TestDir >
You can’t perform that action at this time.
0 commit comments