Save instance of object during runtime and use it later for testing java

I was wondering if it possible to save instance of an object during runtime and use that instance latter on for testing. My case is that my application makes request to server, parses json response to objects and latter on I want to use some of these instances for junit testing. I don't want to serialize them. For example I have Set containing strings "1","2","3". At given point i want to save an instance of it. Program goes, expects all the fields of the object, makes new instance, initialize it with current values and stores it as MySet or something like this and it contains the given strings. I hope I was clear enough.
"I don't want to serialize them" -- do you just mean you don't want to implement Serializable? Because persisting object states for later use is pretty much the definition of serialization.

以上就是Save instance of object during runtime and use it later for testing java的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏