harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r561851 - /harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
Date Wed, 01 Aug 2007 16:04:30 GMT
Author: tellison
Date: Wed Aug  1 09:04:29 2007
New Revision: 561851

URL: http://svn.apache.org/viewvc?view=rev&rev=561851
Log:
Add regression test for HARMONY-1369 ([classlib][beans] compatibility: java.beans.beancontext.BeanContextServicesSupport.addService(..)
returns true on RI and false on Harmony)

Added:
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
  (with props)

Added: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java?view=auto&rev=561851
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
Wed Aug  1 09:04:29 2007
@@ -0,0 +1,72 @@
+/* 
+ * 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.beans.tests.java.beans.beancontext;
+
+import java.beans.beancontext.BeanContextServiceProvider;
+import java.beans.beancontext.BeanContextServices;
+import java.beans.beancontext.BeanContextServicesSupport;
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+/*
+ * Regression test for HARMONY-1369
+ */
+public class BeanContextServicesSupport2Test extends TestCase {
+
+    public void test() {
+        BeanContextServiceProvider bcsp = new BCSP();
+        BCSS serviceSupport = new BCSS(new BeanContextServicesSupport());
+        assertTrue("Expected first addService to return true", serviceSupport
+                .addService(Boolean.TYPE, bcsp, false));
+        assertFalse("Expected second addService to return false", serviceSupport
+                .addService(Boolean.TYPE, bcsp, false));
+    }
+
+    class BCSP implements BeanContextServiceProvider {
+        public Iterator getCurrentServiceSelectors(BeanContextServices p0,
+                Class p1) {
+            return null;
+        }
+
+        public void releaseService(BeanContextServices p0, Object p1, Object p2) {
+            return;
+        }
+
+        public Object getService(BeanContextServices p0, Object p1, Class p2,
+                Object p3) {
+            return null;
+        }
+    }
+
+    class BCSS extends BeanContextServicesSupport {
+        public BCSS() {
+            super();
+        }
+
+        public BCSS(BeanContextServicesSupport peer) {
+            super(peer);
+        }
+
+        public boolean addService(Class serviceClass,
+                BeanContextServiceProvider bcsp, boolean firevent) {
+            return super.addService(serviceClass, bcsp, firevent);
+        }
+    }
+
+}

Propchange: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message