Hi all,
I have been testing all tests, but eclipse and sbt have been detecting some error in 3 test files: MemoryAndTimeTest, PastComparisonTest, TimeEvaluationTest
-Description Resource Path Location Type
method serialize overrides nothing. Note: the super classes of trait MockTestSerializer contain the following, non final members named serialize: def serialize(name: String,value: Long,unit: String): Unit MemoryAndTimeTest.scala /ex02/src/test/scala/ex02 line 11 Scala Problem
-Description Resource Path Location Type
overriding method deserialize in trait Serializer of type (name: String)List[(java.util.Date, Long, String)]; method deserialize has incompatible type MemoryAndTimeTest.scala /ex02/src/test/scala/ex02 line 15 Scala Problem
etc.
Can anyone help me?
Thank you in advance
Tud
SerializationMock
-
- Mausschubser
- Beiträge: 72
- Registriert: 7. Okt 2014 11:38
Re: SerializationMock
On a first look, I would say, that you changed the signatures of serialize and deserialize in the Serializer trait, which you should avoid.
-
- Erstie
- Beiträge: 12
- Registriert: 26. Mär 2013 17:48
Re: SerializationMock
Hi ManuelWeiel,
i think that i don't change anything of the signatures of serialize and deserialize in the Serializer trait. For all traits in PerfSpec.scala i can override and implement these two methods.
i think that i don't change anything of the signatures of serialize and deserialize in the Serializer trait. For all traits in PerfSpec.scala i can override and implement these two methods.
-
- Mausschubser
- Beiträge: 72
- Registriert: 7. Okt 2014 11:38
Re: SerializationMock
Please DM me your implementation of your trait Serializer.
-
- Mausschubser
- Beiträge: 72
- Registriert: 7. Okt 2014 11:38
Re: SerializationMock
Looking at your current implementation, the issue is really the type signature of the serialize and deserialize methods.
In your case the problem is more subtle though. You import. Without importing this, will default to the Scala version of a long. By using your import, you force to use the Java version of long.
As the tests use the Scala version in the signatures and your PerSpec.scala uses the Java version, the type signatures do not match.
I'd advise to stick with the Scala version of Long.
Hint: to Parse a long from and String you can use the method toLong.
In your case the problem is more subtle though. You import
Code: Alles auswählen
import java.lang.Long
Code: Alles auswählen
Long
As the tests use the Scala version in the signatures and your PerSpec.scala uses the Java version, the type signatures do not match.
I'd advise to stick with the Scala version of Long.
Hint: to Parse a long from and String you can use the method toLong.
-
- Erstie
- Beiträge: 12
- Registriert: 26. Mär 2013 17:48
Re: SerializationMock
Oh, this is my mistake.I should remember this point. Many thanks for your help 
