OID multiKey = new OID ("com.arsdigita.notification.QueueItem"); multiKey.set("requestID", new BigDecimal(3)); multiKey.set("partyTo", new BigDecimal(8));
OID multiKey = new OID(COMPOUND2); multiKey.set("one", new Integer(3)); multiKey.set("two", new Integer(8));
    public void testSerialization() throws Exception {        String serial = oid.toString();        s_log.info("OID Serial: " + serial);        OID parsed = OID.valueOf(serial);        assertEquals("Parsing failed", oid.toString(), parsed.toString());        assertEquals("Parsing or equals() failed", oid, parsed);        parseInvalidOID("comlete nonsense");        // now we test with multiple integer keys        OID multiKey = new OID            ("com.arsdigita.notification.QueueItem");        multiKey.set("requestID", new BigDecimal(3));        multiKey.set("partyTo", new BigDecimal(8));        parsed = OID.valueOf(multiKey.toString());        assertTrue("Parsing of OID with multiple big decimal keys failed",               multiKey.equals(parsed));        // now we test with multiple keys of multiple types        OID multiKeyMulti = new OID("com.arsdigita.kernel.permissions.Permission");        multiKeyMulti.set("objectId", new BigDecimal(4));        multiKeyMulti.set("partyId", new BigDecimal(4));        multiKeyMulti.set("privilege", "my privilege");        parsed = OID.valueOf(multiKeyMulti.toString());        assertTrue("Parsing of OID with multiple keys failed",               multiKeyMulti.equals(parsed));    }