testSingleItem()
{
final ObjectName name1 = createName( ":name=test,type=test" );
final Set<ObjectName> testSet = createSet( name1 );
final ObjectNameQuery q = new ObjectNameQueryImpl();
assertEquals( 1, q.matchAny( testSet,
null,
null ).size() );
assertEquals( 1, q.matchAny( testSet,
new String [] { "type" },
new String [] { "test" } ).size() );
assertEquals( 1, q.matchAny( testSet,
new String [] { "type" },
null ).size() );
assertEquals( 1, q.matchAny( testSet,
null,
new String [] { "test" } ).size() );
assertEquals( 1, q.matchAny( testSet,
new String [] { "t.*" },
new String [] { ".*e.*" } ).size() );
assertEquals( 1, q.matchAny( testSet,
null,
new String [] { ".*e.*" } ).size() );
assertEquals( 0, q.matchAny( testSet, EmptyStrings, EmptyStrings ).size() );
assertEquals( 0, q.matchAny( testSet, null, EmptyStrings ).size() );
assertEquals( 0, q.matchAny( testSet, EmptyStrings, null ).size() );
}