File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Mocking a Blob object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mocking a Blob object?" Watch "Mocking a Blob object?" New topic

Mocking a Blob object?

bhavit pant

Joined: May 22, 2012
Posts: 21

hey guys, i need to mock a blob data in XML. which is defined as

How can i Mock it . i have to use a Mock database as Xml
i am using Junit/ (DjUnit for Coverage)
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

You could have your XML point to an actual binary file. Of you could write a Java object that reads an XML file. Or you could jump binary data into a string in your XML. Which is best depends on how you are using the XML file.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Mocking a Blob object?
It's not a secret anymore!