harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r487602 - in /harmony/enhanced/classlib/trunk/modules/rmi/src: main/java/java/rmi/activation/ActivationGroup.java test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java
Date Fri, 15 Dec 2006 17:18:01 GMT
Author: ayza
Date: Fri Dec 15 09:18:00 2006
New Revision: 487602

URL: http://svn.apache.org/viewvc?view=rev&rev=487602
Log:
Patches from HARMONY-1970 ([classlib][rmi] Could not get proxy ActivationSystem via ActivationGroup.getSystem()
method) were applied.

Added:
    harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java
  (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/activation/ActivationGroup.java

Modified: harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/activation/ActivationGroup.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/activation/ActivationGroup.java?view=diff&rev=487602&r1=487601&r2=487602
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/activation/ActivationGroup.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/rmi/src/main/java/java/rmi/activation/ActivationGroup.java
Fri Dec 15 09:18:00 2006
@@ -136,9 +136,12 @@
         }
         // rmi.log.1C=current_AS = {0}
         rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.1C", current_AS)); //$NON-NLS-1$
+
         // rmi.log.23=current_AS.ref = {0}
-        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.23", //$NON-NLS-1$
-                ((RemoteObject) current_AS).getRef()));
+        if (current_AS instanceof RemoteObject) { 
+            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.23", //$NON-NLS-1$
+                    ((RemoteObject) current_AS).getRef()));
+        }
         // rmi.log.24=---------- END -> ActivationGroup.getSystem() ----------
         rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.24")); //$NON-NLS-1$
         return current_AS;

Added: harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java?view=auto&rev=487602
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java
Fri Dec 15 09:18:00 2006
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.rmi.tests.java.rmi.activation;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.rmi.activation.ActivationGroup;
+import java.rmi.activation.ActivationSystem;
+
+import junit.framework.TestCase;
+
+public class ActivationGroupTest extends TestCase {
+    /**
+     * Tests if getSystem() method successfully returns if this system was previously
+     * set to a proxy value (which is possible in real application when dynamic remote
+     * stub is created for it) - regression test for HARMONY-1970.
+     */
+    public void testGetSystemProxyObj() throws Exception {
+        ActivationSystem system = (ActivationSystem) Proxy.newProxyInstance(null,
+                new Class[] { ActivationSystem.class }, new TestInvocationHandler());
+        ActivationGroup.setSystem(system);
+        ActivationGroup.getSystem();
+    }
+
+    static class TestInvocationHandler implements InvocationHandler {
+        public Object invoke(Object proxy, Method method, Object[] args) {
+            return null;
+        }
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/java/rmi/activation/ActivationGroupTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message