use of aQute.bnd.osgi.resource.FilterParser in project bnd by bndtools.
the class FilterParserTest method testSpaces.
public void testSpaces() throws Exception {
FilterParser p = new FilterParser();
p.parse("(| (a=b) (b=c) )");
p.parse("(| (&(osgi.ee=JavaSE)(version=1.6)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )");
p.parse("( & ( org.osgi.framework.windowing.system = xyz ) )");
p.parse("( | ( org.osgi.framework.windowing.system=xyz))");
}
use of aQute.bnd.osgi.resource.FilterParser in project bnd by bndtools.
the class NativeCodeHeaderTest method testNative.
public void testNative() throws Exception {
ResourceBuilder rb = new ResourceBuilder();
Requirement nativeCode = //
rb.getNativeCode(//
"f1;" + //
" osname=Windows95;" + //
" processor=x86;" + //
" selection-filter='(com.acme.windowing=win32)';" + //
" language=en;" + //
" osname=Windows98;" + //
" language=se, " + //
"lib/solaris/libhttp.so;" + //
" osname=Solaris;" + //
" osname = SunOS ;" + //
" processor = sparc, " + //
"lib/linux/libhttp.so ; " + //
" osname = Linux ; " + //
" processor = mips; " + //
" selection-filter = '(com.acme.windowing=gtk)'," + "*").synthetic();
assertEquals(NativeNamespace.NATIVE_NAMESPACE, nativeCode.getNamespace());
assertEquals("optional", nativeCode.getDirectives().get("resolution"));
String filter = nativeCode.getDirectives().get("filter");
assertEquals(null, Verifier.validateFilter(filter));
FilterParser p = new FilterParser();
Expression parse = p.parse(filter);
assertEquals("(|(&(|(osgi.native.osname=Windows95)(osgi.native.osname=Windows98))(osgi.native.processor=x86)(|(osgi.native.language=en)(osgi.native.language=se))(com.acme.windowing=win32))(&(|(osgi.native.osname=Solaris)(osgi.native.osname=SunOS))(osgi.native.processor=sparc))(&(osgi.native.osname=Linux)(osgi.native.processor=mips)(com.acme.windowing=gtk)))", filter);
System.out.println(nativeCode);
}
Aggregations