Package org.jboss.serial.regression.jbser82

Source Code of org.jboss.serial.regression.jbser82.TestTwoJVM

package org.jboss.serial.regression.jbser82;

import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.jboss.serial.io.JBossObjectInputStream;
import org.jboss.serial.io.JBossObjectOutputStream;

import junit.framework.TestCase;

public class TestTwoJVM extends TestCase
{
  protected Object read(String fileName) throws Exception
  {
       System.out.println("De-serializing...");      
       FileInputStream fis = new FileInputStream(fileName);
       JBossObjectInputStream ois = new JBossObjectInputStream(fis);
      
       Object data = ois.readObject();   
      
       ois.close();
       fis.close();
      
       return data;

       // no exception... unit test passes
  }
 
  protected void writeContainer(String fileName, Object container) throws Exception
  {
       System.out.println("Serializing...");

       FileOutputStream fos = new FileOutputStream(fileName);
       JBossObjectOutputStream oos = new JBossObjectOutputStream(fos);
      
       oos.writeObject(container);
      
       oos.close();
       fos.close();

       // no exception... unit test passes
  }

}
TOP

Related Classes of org.jboss.serial.regression.jbser82.TestTwoJVM

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.