Skip to Content
0
May 21, 2020 at 01:04 PM

Serialization of IInfoObjects

67 Views

Hi All,

Is there a way to serialize and deserialize IInfoObjects without having active BOE session?

What I previously found as solution was something like this:

// getting objects from BOE
IInfoObjects objects = this.findObjects(query, boContext);
FileOutputStream fileOut = new FileOutputStream("test.txt"); 
objectOutputStream = new ObjectOutputStream(fileOut); 
// serialization
objectOutputStream.writeObject(objects);

ObjectInputStream objectInputStream =
    new ObjectInputStream(new FileInputStream("C:\\Users\\I517646\\Downloads\\tt.txt"));
//deserialization
IInfoObjects object = (IInfoObjects) objectInputStream.readObject();

But when deserializing these objects I also need BOE session.

I need this for integration tests, to be able to mock communication with BOE, so I need a solution where I don't need any communication with it after getting and serializing objects i.e. I want to serialize objects so I can reuse them in my tests.

Is there a way to do it?