Package com.enragedginger.stephenerialization.sandwich

Examples of com.enragedginger.stephenerialization.sandwich.SubSandwich


  /**
   * Run setup prior to each test.
   */
  @Before
  public void setup() {
    subSandwich = new SubSandwich();
    subSandwich.setMolecules(8675309L);
    subSandwich.setName("Turkey Club");
    subSandwich.setPrice(5.99);
    subSandwich.setSesameSeeds((byte) 30);
    subSandwich.setSize('M');
View Full Code Here


    String version = String.valueOf(annotation.version());
    ObjectOutputStream output = TestStreamBuilder.createOutputStream(className, version);
    output.writeObject(subSandwich);
    output.close();
    ObjectInputStream input = TestStreamBuilder.createInputStream(className, version);
    SubSandwich actualSandwich = (SubSandwich) input.readObject();
    input.close();
    assertEquals(subSandwich.getSlicesOfBread(), actualSandwich.getSlicesOfBread());
    assertEquals(subSandwich.getSesameSeeds(), actualSandwich.getSesameSeeds());
    assertEquals(subSandwich.getSlicesOfMeat(), actualSandwich.getSlicesOfMeat());
    assertEquals(subSandwich.getMolecules(), actualSandwich.getMolecules());
    assertEquals(subSandwich.getPrice(), actualSandwich.getPrice(), 0.0);
    assertEquals(subSandwich.getSize(), actualSandwich.getSize());
    assertEquals(subSandwich.getName(), actualSandwich.getName());
    assertEquals(subSandwich.getLength(), actualSandwich.getLength(), 0.0f);
    assertEquals(subSandwich.isActuallyFresh(), actualSandwich.isActuallyFresh());
  }
View Full Code Here

 
  @Test
  public void readVersion20120926() throws Exception {
    String version = "20120926";
    ObjectInputStream input = TestStreamBuilder.createInputStream(className, version);
    SubSandwich actualSandwich = (SubSandwich) input.readObject();
    input.close();
    assertEquals(subSandwich.getSlicesOfBread(), actualSandwich.getSlicesOfBread());
    assertEquals(subSandwich.getSesameSeeds(), actualSandwich.getSesameSeeds());
    assertEquals(0, actualSandwich.getSlicesOfMeat());
    assertEquals(0, actualSandwich.getMolecules());
    assertEquals(0, actualSandwich.getPrice(), 0.0);
    assertEquals(0, actualSandwich.getSize());
    assertEquals(null, actualSandwich.getName());
    assertEquals(subSandwich.getLength(), actualSandwich.getLength(), 0.0f);
    assertEquals(false, actualSandwich.isActuallyFresh());
  }
View Full Code Here

 
  @Test
  public void readVersion20120927() throws Exception {
    String version = "20120927";
    ObjectInputStream input = TestStreamBuilder.createInputStream(className, version);
    SubSandwich actualSandwich = (SubSandwich) input.readObject();
    input.close();
    assertEquals(subSandwich.getSlicesOfBread(), actualSandwich.getSlicesOfBread());
    assertEquals(subSandwich.getSesameSeeds(), actualSandwich.getSesameSeeds());
    assertEquals(subSandwich.getSlicesOfMeat(), actualSandwich.getSlicesOfMeat());
    assertEquals(subSandwich.getMolecules(), actualSandwich.getMolecules());
    assertEquals(0, actualSandwich.getPrice(), 0.0);
    assertEquals(0, actualSandwich.getSize());
    assertEquals(null, actualSandwich.getName());
    assertEquals(subSandwich.getLength(), actualSandwich.getLength(), 0.0f);
    assertEquals(subSandwich.isActuallyFresh(), actualSandwich.isActuallyFresh());
  }
View Full Code Here

 
  @Test
  public void readVersion20120928() throws Exception {
    String version = "20120928";
    ObjectInputStream input = TestStreamBuilder.createInputStream(className, version);
    SubSandwich actualSandwich = (SubSandwich) input.readObject();
    input.close();
    assertEquals(subSandwich.getSlicesOfBread(), actualSandwich.getSlicesOfBread());
    assertEquals(subSandwich.getSesameSeeds(), actualSandwich.getSesameSeeds());
    assertEquals(subSandwich.getSlicesOfMeat(), actualSandwich.getSlicesOfMeat());
    assertEquals(subSandwich.getMolecules(), actualSandwich.getMolecules());
    assertEquals(subSandwich.getPrice(), actualSandwich.getPrice(), 0.0);
    assertEquals(subSandwich.getSize(), actualSandwich.getSize());
    assertEquals(null, actualSandwich.getName());
    assertEquals(subSandwich.getLength(), actualSandwich.getLength(), 0.0f);
    assertEquals(subSandwich.isActuallyFresh(), actualSandwich.isActuallyFresh());
  }
View Full Code Here

 
  @Test
  public void readVersion20121001() throws Exception {
    String version = "20121001";
    ObjectInputStream input = TestStreamBuilder.createInputStream(className, version);
    SubSandwich actualSandwich = (SubSandwich) input.readObject();
    input.close();
    assertEquals(subSandwich.getSlicesOfBread(), actualSandwich.getSlicesOfBread());
    assertEquals(subSandwich.getSesameSeeds(), actualSandwich.getSesameSeeds());
    assertEquals(subSandwich.getSlicesOfMeat(), actualSandwich.getSlicesOfMeat());
    assertEquals(subSandwich.getMolecules(), actualSandwich.getMolecules());
    assertEquals(subSandwich.getPrice(), actualSandwich.getPrice(), 0.0);
    assertEquals(subSandwich.getSize(), actualSandwich.getSize());
    assertEquals(subSandwich.getName(), actualSandwich.getName());
    assertEquals(subSandwich.getLength(), actualSandwich.getLength(), 0.0f);
    assertEquals(subSandwich.isActuallyFresh(), actualSandwich.isActuallyFresh());
  }
View Full Code Here

TOP

Related Classes of com.enragedginger.stephenerialization.sandwich.SubSandwich

Copyright © 2018 www.massapicom. 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.