Package org.apache.geronimo.gjndi.binding

Source Code of org.apache.geronimo.gjndi.binding.FormatTest

/*
* 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.geronimo.gjndi.binding;

import java.util.Map;
import java.util.HashMap;

import junit.framework.TestCase;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
import org.apache.geronimo.gbean.annotation.AnnotationGBeanInfoFactory;

/**
* @version $Rev: 901935 $ $Date: 2010-01-21 19:10:53 -0500 (Thu, 21 Jan 2010) $
*/
public class FormatTest extends TestCase {

    public void testPattern() throws Exception {
        Map<String, String> map = new HashMap<String, String>();
        map.put("foo", "white");
        map.put("bar", "black");
        assertEquals("white/black", GBeanFormatBinding.format("{foo}/{bar}", map));
        assertEquals("black/black", GBeanFormatBinding.format("{bar}/{bar}", map));
        assertEquals("java:white/test/black/test", GBeanFormatBinding.format("java:{foo}/test/{bar}/test", map));
    }

    public void testGBeanInfos() throws Exception {
        GBeanInfoFactory f = new AnnotationGBeanInfoFactory();
        GBeanInfo info = f.getGBeanInfo(ResourceBinding.class);
        info = f.getGBeanInfo(GBeanFormatBinding.class);
    }

}
TOP

Related Classes of org.apache.geronimo.gjndi.binding.FormatTest

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.