
package org.apache.felix.framework;

import java.util.Dictionary;
import java.util.Hashtable;
import junit.framework.TestCase;
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkUtil;

public class FilterTest extends TestCase
{
    public void testMissingAttribute()
    {
        Dictionary dict = new Hashtable();
        dict.put("one", "one-value");
        dict.put("two", "two-value");
        dict.put("three", "three-value");
        Filter filter = null;
        try
        {
            filter = FrameworkUtil.createFilter("(missing=value)");
        }
        catch (Exception ex)
        {
            assertTrue("Filter should parse: " + ex, false);
        }
        assertFalse("Filter should not match: " + filter, filter.match(dict));
    }
}
