Examples of MarshalledObject


Examples of java.rmi.MarshalledObject

     */
    public void testGet() throws Exception {
        Hashtable ht = new Hashtable();
        String str = new String("TEST");

        assertNull(new MarshalledObject(null).get());
        assertEquals(str, new MarshalledObject(str).get());
        ht.put(new Integer(1), str);
        ht.put(new Integer(2), "TEST1");
        MarshalledObject mo = new MarshalledObject(ht);
        assertEquals(ht, mo.get());
        ht.put(new Integer(2), "TEST2");
        assertTrue(! ht.equals(mo.get()));
    }
View Full Code Here

Examples of java.rmi.MarshalledObject

     */
    public void testNullLoader() throws Exception {
        ClassLoader old_cl = Thread.currentThread().getContextClassLoader();

        try {
            MarshalledObject mo = new MarshalledObject(new TestClass());
            Object obj = null;

            // 1-st get: thread context classloader is equal to system classloader
            try {
                obj = mo.get();

                if (obj.getClass().getClassLoader() != old_cl) {
                    fail("1-st get failed: loaded through: "
                            + obj.getClass().getClassLoader() + ", expected: " + old_cl);
            } else {
                System.out.println("1-st get passed.");
            }
            } catch (Exception ex) {
                fail("1-st get failed: " + ex);
            }

            // 2-nd get: thread context classloader is equal to null
            Thread.currentThread().setContextClassLoader(null);

            try {
                obj = mo.get();

                if (obj.getClass().getClassLoader() != old_cl) {
                    fail("2-nd get failed: loaded through: "
                            + obj.getClass().getClassLoader() + ", expected: " + old_cl);
                } else {
View Full Code Here

Examples of java.rmi.MarshalledObject

        assertEquals(1, set.size());
    }

    public void testSerialization() throws Exception {
        GBeanName name = new GBeanName("testDomain:prop1=value1,prop2=value2");
        MarshalledObject o = new MarshalledObject(name);
        GBeanName name2 = (GBeanName) o.get();
        assertEquals(name, name2);
    }
View Full Code Here

Examples of java.rmi.MarshalledObject

    sTmpl[i][j] = new ServiceTemplate(null,sClassType,
              tmplAttrs[j]);
    proxy.notify(tmpl[i][j],
           transitionMask,
           listener,
           new MarshalledObject
         (new QATestUtils.SrvcAttrTuple
             (srvcItems[nSrvcsPerClass*i].service,
              tmplAttrs[j][0])),
           Long.MAX_VALUE);
      }
View Full Code Here

Examples of java.rmi.MarshalledObject

            for (j=0;j<nSrvcsPerClass;j++) {
                int n = k%(attrEntries.length);
          tmpl[k] = new ServiceTemplate(null,null,tmplAttrs[n]);
    setStateAttrInfo(k,n,tmplAttrs,state);
    proxy.notify(tmpl[k],transitionMask,listener,
           new MarshalledObject
         (new QATestUtils.SrvcAttrTuple
             (srvcItems[k].service,
              tmplAttrs[n][0])),
           Long.MAX_VALUE);
                k++;
View Full Code Here

Examples of java.rmi.MarshalledObject

    sTmpl[i][j] = new ServiceTemplate(null,sClassType,
              modAttrs[j]);
    proxy.notify(tmpl[i][j],
           transitionMask,
           listener,
           new MarshalledObject
         (new QATestUtils.SrvcAttrTuple
             (srvcItems[nSrvcsPerClass*i].service,
              modAttrs[j][0])),
           Long.MAX_VALUE);
      }
View Full Code Here

Examples of java.rmi.MarshalledObject

                "Invocation Constraint before serialization:: " + ic_init);
        logger.log(Level.FINE, "serialization ...");
        logger.log(Level.FINE, "deserialization ...");

        try {
            MarshalledObject mObj = new MarshalledObject(ic_init);
            ic_after = (InvocationConstraint) mObj.get();
        } catch (Exception e) {
            logger.log(Level.FINE, e + "has been thrown while serialization or"
                    + "subsequent deserialization of " + ic_init);
            return false;
        }
View Full Code Here

Examples of java.rmi.MarshalledObject

    sTmpl[i][j] = new ServiceTemplate(null,sClassType,
              addAttrs[j]);
    proxy.notify(tmpl[i][j],
           transitionMask,
           listener,
           new MarshalledObject
         (new QATestUtils.SrvcAttrTuple
             (srvcItems[nSrvcsPerClass*i].service,
              addAttrs[j][0])),
           Long.MAX_VALUE);
      }
View Full Code Here

Examples of java.rmi.MarshalledObject

    sTmpl[i][j] = new ServiceTemplate(null,sClassType,
              modAttrs[j]);
    proxy.notify(tmpl[i][j],
           transitionMask,
           listener,
           new MarshalledObject
         (new QATestUtils.SrvcAttrTuple
             (srvcItems[nSrvcsPerClass*i].service,
              modAttrs[j][0])),
           Long.MAX_VALUE);
      }
View Full Code Here

Examples of java.rmi.MarshalledObject

         * to its constructor. Then get() method returns a new copy
         * of the original object, as deserialized from the contained byte
         * stream.
         */
        try {
            MarshalledObject mObj = new MarshalledObject(ic);
            InvocationConstraint dic = (InvocationConstraint) mObj.get();
            logger.log(Level.FINE,
                    "Invocation Constraint after deserialization:: " + dic);
            return (dic == ic);
        } catch (Exception e) {
            logger.log(Level.FINE, e + "has been thrown while serialization or"
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.