@@ -0,0 +1,2649 @@
+package org.apache.velocity.test;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport junit.framework.Test;%0Aimport junit.framework.TestSuite;%0A%0Aimport org.apache.velocity.runtime.RuntimeInstance;%0Aimport org.apache.velocity.util.introspection.Uberspect;%0A%0A/*%0A * Copyright 2006 The Apache Software Foundation.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22)%0A * you may not use this file except in compliance with the License.%0A * 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%0Apublic class UberspectorTestCase%0A        extends BaseTestCase%0A%7B%0A    private RuntimeInstance ri;%0A%0A    public UberspectorTestCase(String name)%0A    %7B%0A        super(name);%0A    %7D%0A    %0A    public static Test suite()%0A    %7B%0A        return new TestSuite(UberspectorTestCase.class);%0A    %7D%0A    %0A    public void setUp()%0A            throws Exception%0A    %7B%0A        ri = new RuntimeInstance();%0A        ri.init();%0A    %7D%0A%0A    public void testEmptyProperties()%0A            throws Exception%0A    %7B%0A        Uberspect u = ri.getUberspect();%0A        Map map = new HashMap();%0A%0A        // Don't screw up on empty propeties. That should map to get(Object) and put(Object, Object) on a Map%0A        assertNotNull(u.getPropertyGet(map, %22%22, null));%0A        assertNotNull(u.getPropertySet(map, %22%22, Object.class, null));%0A    %7D%0A    %0A    public void testNullProperties()%0A        throws Exception%0A    %7B%0A        Uberspect u = ri.getUberspect();%0A        Map map = new HashMap();%0A%0A        // Don't screw up on null propeties. That should map to get(Object) and put(Object, Object) on a Map, too?%0A        assertNotNull(u.getPropertyGet(map, null, null));%0A        assertNotNull(u.getPropertySet(map, null, Object.class, null));%0A    %7D%0A    %0A    /*%0A    %0A    public void testMapGetSet()%0A        throws Exception%0A    %7B%0A        Uberspect u = ri.getUberspect();%0A        Map map = new HashMap();%0A%0A        VelPropertyGet getter = u.getPropertyGet(map, %22%22, null);%0A        VelPropertySet setter = u.getPropertySet(map, %22%22, Object.class, null);%0A%0A        assertNotNull(%22Got a null getter%22, getter);%0A        assertNotNull(%22Got a null setter%22, setter);%0A%0A        assertEquals(%22Got wrong getter%22, %22foo%22, getter.getMethodName());%0A        assertEquals(%22Got wrong setter%22, %22bar%22, setter.getMethodName());%0A    %7D%0A    */%0A%7D    %0A        %0A%0A%0A%0A

add some explicit tests for the Uberspector to find out its behaviour in corner cases...