@@ -0,0 +1,2505 @@
+/* %0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A * %0A *     http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.harmony.beans.tests.java.beans.beancontext;%0A%0Aimport java.beans.beancontext.BeanContextServiceProvider;%0Aimport java.beans.beancontext.BeanContextServices;%0Aimport java.beans.beancontext.BeanContextServicesSupport;%0Aimport java.util.Iterator;%0A%0Aimport junit.framework.TestCase;%0A%0A/*%0A * Regression test for HARMONY-1369%0A */%0Apublic class BeanContextServicesSupport2Test extends TestCase %7B%0A%0A    public void test() %7B%0A        BeanContextServiceProvider bcsp = new BCSP();%0A        BCSS serviceSupport = new BCSS(new BeanContextServicesSupport());%0A        assertTrue(%22Expected first addService to return true%22, serviceSupport%0A                .addService(Boolean.TYPE, bcsp, false));%0A        assertFalse(%22Expected second addService to return false%22, serviceSupport%0A                .addService(Boolean.TYPE, bcsp, false));%0A    %7D%0A%0A    class BCSP implements BeanContextServiceProvider %7B%0A        public Iterator getCurrentServiceSelectors(BeanContextServices p0,%0A                Class p1) %7B%0A            return null;%0A        %7D%0A%0A        public void releaseService(BeanContextServices p0, Object p1, Object p2) %7B%0A            return;%0A        %7D%0A%0A        public Object getService(BeanContextServices p0, Object p1, Class p2,%0A                Object p3) %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A    class BCSS extends BeanContextServicesSupport %7B%0A        public BCSS() %7B%0A            super();%0A        %7D%0A%0A        public BCSS(BeanContextServicesSupport peer) %7B%0A            super(peer);%0A        %7D%0A%0A        public boolean addService(Class serviceClass,%0A                BeanContextServiceProvider bcsp, boolean firevent) %7B%0A            return super.addService(serviceClass, bcsp, firevent);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add regression test for HARMONY-1369 ([classlib][beans] compatibility: java.beans.beancontext.BeanContextServicesSupport.addService(..) returns true on RI and false on Harmony)