Package org.quickconnectfamily.json

Examples of org.quickconnectfamily.json.JSONOutputStream.writeObject()


    aMap.put("aNumber",blah);
    aMap.put(20,"some other stuff" );
    aMap.put("aTester",new Tester());
   
    try {
      testOut.writeObject(aMap);
      closeTheWriterIn(testOut);
      File testFile = new File("test.json");
      assertTrue(testFile.exists());
     
    } catch (JSONException e) {
View Full Code Here


    /*
     * Testing null
     */
    testOut = setupTestFile();
    try {
      testOut.writeObject(null);
      closeTheWriterIn(testOut);
      readResult = readTestFile();
      assertNull(readResult);
       
    }
View Full Code Here

   
    testOut = setupTestFile();
   
    Object[] anArray = {new Integer(4), "Hello", new JButton()};
    try {
      testOut.writeObject(anArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

    testOut = setupTestFile();
    Tester aTesterObject = new Tester();
    Object[] anArrayOfObjects = new Object[5];
    Arrays.fill(anArrayOfObjects, aTesterObject);
    try {
      testOut.writeObject(anArrayOfObjects);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

   
    testOut = setupTestFile();
   
    int[] anIntArray = {1,2,417,3,60, 50};
    try {
      testOut.writeObject(anIntArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

     * Testing an array of shorts
     */
    testOut = setupTestFile();
    short[] aShortArray = {1,2,417,3,60, 50};
    try {
      testOut.writeObject(aShortArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

     * Testing an array of longs
     */
    testOut = setupTestFile();
    long[] aLongArray = {1,2,417,3,60, 50};
    try {
      testOut.writeObject(aLongArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

     */
   
    testOut = setupTestFile();
    double[] aDoubleArray = {1.1,3.14,2.124,3.0,.00078, 1.0/3.0};
    try {
      testOut.writeObject(aDoubleArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

     */

    testOut = setupTestFile();
    double[] aFloatArray = {1.1,3.14,2.124,3.0,.00078, 1.0/3};
    try {
      testOut.writeObject(aFloatArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

     */

    testOut = setupTestFile();
    char[] aCharArray = new String("Hello there!").toCharArray();
    try {
      testOut.writeObject(aCharArray);
    } catch (JSONException e) {
      e.printStackTrace();
      fail("exception thrown");
    }
    readResult = readTestFile();
View Full Code Here

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.