// Matcher m = p.matcher("function void fooBar() {");
// assertTrue(m.matches());
// System.err.println(m.group());
// assertEquals("fooBar", m.group(1));
ClassicDRLImporter imp = new ClassicDRLImporter( getDrl( "sample_legacy_functions.drl" ) );
assertFalse( imp.isDSLEnabled() );
assertEquals( 7,
imp.getAssets().size() );
assertEquals( AssetFormats.FUNCTION,
imp.getAssets().get( 0 ).format );
assertEquals( AssetFormats.FUNCTION,
imp.getAssets().get( 1 ).format );
assertEquals( "goo1",
imp.getAssets().get( 0 ).name );
assertEqualsIgnoreWhitespace( "function void goo1() { //do something ! { yeah } }",
imp.getAssets().get( 0 ).content );
assertEquals( "goo2",
imp.getAssets().get( 1 ).name );
assertEqualsIgnoreWhitespace( "function String goo2(String la) { //yeah man ! return \"whee\"; }",
imp.getAssets().get( 1 ).content );
assertEquals( "goo3",
imp.getAssets().get( 2 ).name );
assertEqualsIgnoreWhitespace( "function String goo3() { return \"HELLO\"; }",
imp.getAssets().get( 2 ).content );
assertEquals( "goo4",
imp.getAssets().get( 3 ).name );
assertEqualsIgnoreWhitespace( "function String goo4() { if( true ) { return \"HELLO\"; } }",
imp.getAssets().get( 3 ).content );
assertEquals( "goo6",
imp.getAssets().get( 4 ).name );
assertEqualsIgnoreWhitespace( "function String goo6() { return \"HELLO\"; /* } */ /* } } } */ }",
imp.getAssets().get( 4 ).content );
assertEquals( AssetFormats.DRL,
imp.getAssets().get( 5 ).format );
assertEquals( AssetFormats.DRL,
imp.getAssets().get( 6 ).format );
assertNotNull( imp.getAssets().get( 6 ).content );
}