Package com.mchange.v2.io

Examples of com.mchange.v2.io.IndentedWriter


      case 0x0001:
    this.value = in.readInt();
    this.notify_all = in.readBoolean();
    break;
      default:
    throw new UnsupportedVersionException(this, version);
      }
    }
View Full Code Here


      case 0x0001:
    this.username = (String) in.readObject();
    this.password = (String) in.readObject();
    break;
      default:
    throw new UnsupportedVersionException(this, version);
      }
    }
View Full Code Here

      case 0x0001:
    this.username = (String) in.readObject();
    this.password = (String) in.readObject();
    break;
      default:
    throw new UnsupportedVersionException(this, version);
      }
    }
View Full Code Here

      case 0x0001:
    this.value = in.readInt();
    this.notify_all = in.readBoolean();
    break;
      default:
    throw new UnsupportedVersionException(this, version);
      }
    }
View Full Code Here

      case 0x0001:
    this.username = (String) in.readObject();
    this.password = (String) in.readObject();
    break;
      default:
    throw new UnsupportedVersionException(this, version);
      }
    }
View Full Code Here

      {
      case 0x0001:
    this.value = in.readInt();
    break;
      default:
    throw new UnsupportedVersionException(this, version);
      }
    }
View Full Code Here

public class DoubleWeakHashMapJUnitTestCase extends TestCase
{
    public void testGetNeverAdded()
    {
        Map m = new DoubleWeakHashMap();
        assertNull( m.get("foo") );
    }
View Full Code Here

       
        String poop = new String("poop");
        String scoop = new String("scoop");
        String doop = new String("dcoop");
       
        Map m = new DoubleWeakHashMap();
        m.put(a, poop);
        m.put(b, scoop);
        m.put(c, doop);
        assertEquals("Size should be three, viewed via Map directly.", m.size(), 3);
        assertEquals("Size should be three, viewed via keySet .", m.keySet().size(), 3);
        assertEquals("Size should be three, viewed via values Collection.", m.values().size(), 3);
       
        int count = 0;
        for (Iterator ii = m.keySet().iterator(); ii.hasNext();)
        {
            count += ((Integer) ii.next()).intValue();
        }
        assertEquals("Count should be six, viewed via values Collection.", count, 6);
       
        Integer d = new Integer(4);
        m.put(d, poop);
        m.values().remove(poop);
        assertEquals("After removing a doubled value, size should be 2", m.size(), 2);
    }
View Full Code Here

        Integer b = new Integer(2);
        Integer c = new Integer(3);
       
        String poop = new String("poop");

        Map m = new DoubleWeakHashMap();
        m.put(a, poop);
        m.put(b, new Object());
        m.put(c, new Object());
       
        //race condition... b & c might already have been removed... but i doubt it
        assertEquals("1) Weak values should not yet have been removed (but not guaranteed! sometimes fails without a defect!)", m.size(), 3);
       
        // we are relying that a full, synchronous GC occurs,
        // which is not guaranteed in all VMs
        System.gc();
       
        // let's see if we can force a deeper gc via a big array creation
        byte[] bArray = new byte[1024 * 1024];
       
        assertEquals("2) Weak values should have been automatically removed (but not guaranteed! sometimes fails without a defect!)", m.size(), 1);
       
        m.put( new Object(), b);
       
        //race condition... b & c might already have been removed... but i doubt it
        assertEquals("3) Weak key should not yet have been removed (but not guaranteed! sometimes fails without a defect!)", m.size(), 2);

        System.gc();
        // let's see if we can force a deeper gc via a big array creation
        bArray = new byte[1024 * 1024];

        assertEquals("4) Weak key should have been automatically removed (but not guaranteed! sometimes fails without a defect!)", m.size(), 1);
    }
View Full Code Here

public class DoubleWeakHashMapJUnitTestCase extends TestCase
{
    public void testGetNeverAdded()
    {
        Map m = new DoubleWeakHashMap();
        assertNull( m.get("foo") );
    }
View Full Code Here

TOP

Related Classes of com.mchange.v2.io.IndentedWriter

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.