You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/04/25 08:18:20 UTC

[21/46] FlexPMD Donation from Adobe Systems Inc

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/PackageNodeTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/PackageNodeTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/PackageNodeTest.java
new file mode 100644
index 0000000..de9dfd9
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/PackageNodeTest.java
@@ -0,0 +1,126 @@
+/*
+ * 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 com.adobe.ac.pmd.nodes.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.io.IOException;
+
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.files.FileSetUtils;
+import com.adobe.ac.pmd.nodes.IPackage;
+import com.adobe.ac.pmd.parser.IParserNode;
+import com.adobe.ac.pmd.parser.exceptions.TokenException;
+
+public class PackageNodeTest extends FlexPmdTestBase
+{
+   private final IPackage buttonRenderer;
+   private final IPackage FlexPMD115Package;
+   private final IPackage FlexPMD62Package;
+   private final IPackage modelLocator;
+   private final IPackage stylePackage;
+
+   public PackageNodeTest() throws PMDException
+   {
+      final IParserNode ast = FileSetUtils.buildAst( getTestFiles().get( "SkinStyles.as" ) );
+      stylePackage = NodeFactory.createPackage( ast );
+
+      final IParserNode buttonRendererAst = FileSetUtils.buildAst( getTestFiles().get( "DeleteButtonRenderer.mxml" ) );
+      buttonRenderer = NodeFactory.createPackage( buttonRendererAst );
+
+      final IParserNode modelLocatorAst = FileSetUtils.buildAst( getTestFiles().get( "cairngorm."
+            + "NonBindableModelLocator.as" ) );
+      modelLocator = NodeFactory.createPackage( modelLocatorAst );
+
+      final IParserNode bug62Ast = FileSetUtils.buildAst( getTestFiles().get( "bug."
+            + "FlexPMD62.as" ) );
+      FlexPMD62Package = NodeFactory.createPackage( bug62Ast );
+
+      final IParserNode bug115Ast = FileSetUtils.buildAst( getTestFiles().get( "bug."
+            + "FlexPMD115.as" ) );
+      FlexPMD115Package = NodeFactory.createPackage( bug115Ast );
+   }
+
+   @Test
+   public void testConstructMxmlFile() throws IOException,
+                                      TokenException,
+                                      PMDException
+   {
+      assertNotNull( buttonRenderer.getClassNode() );
+      assertEquals( "",
+                    buttonRenderer.getName() );
+      assertEquals( 0,
+                    buttonRenderer.getImports().size() );
+
+   }
+
+   @Test
+   public void testConstructNamespace() throws IOException,
+                                       TokenException,
+                                       PMDException
+   {
+      final IParserNode ast = FileSetUtils.buildAst( getTestFiles().get( "schedule_internal.as" ) );
+      final IPackage namespacePackage = NodeFactory.createPackage( ast );
+
+      assertNull( namespacePackage.getClassNode() );
+      assertEquals( "flexlib.scheduling.scheduleClasses",
+                    namespacePackage.getName() );
+      assertEquals( 0,
+                    namespacePackage.getImports().size() );
+   }
+
+   @Test
+   public void testConstructStyles()
+   {
+      assertNull( stylePackage.getClassNode() );
+      assertEquals( "",
+                    stylePackage.getName() );
+      assertEquals( 0,
+                    stylePackage.getImports().size() );
+   }
+
+   @Test
+   public void testFullyQualifiedName()
+   {
+      assertEquals( "",
+                    stylePackage.getFullyQualifiedClassName() );
+      assertEquals( "DeleteButtonRenderer",
+                    buttonRenderer.getFullyQualifiedClassName() );
+      assertEquals( "com.adobe.ac.sample.model.ModelLocator",
+                    modelLocator.getFullyQualifiedClassName() );
+   }
+
+   @Test
+   public void testGetFunctions()
+   {
+      assertEquals( 0,
+                    stylePackage.getFunctions().size() );
+   }
+
+   @Test
+   public void testGetName()
+   {
+      assertEquals( "com.test.testy.ui.components",
+                    FlexPMD62Package.getName() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/VariableNodeTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/VariableNodeTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/VariableNodeTest.java
new file mode 100644
index 0000000..370a012
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/impl/VariableNodeTest.java
@@ -0,0 +1,77 @@
+/*
+ * 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 com.adobe.ac.pmd.nodes.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.files.FileSetUtils;
+import com.adobe.ac.pmd.nodes.IAttribute;
+import com.adobe.ac.pmd.nodes.IClass;
+import com.adobe.ac.pmd.parser.IParserNode;
+
+public class VariableNodeTest extends FlexPmdTestBase
+{
+   private IAttribute first;
+
+   @Before
+   public void setup() throws PMDException
+   {
+      final IParserNode ast = FileSetUtils.buildAst( getTestFiles().get( "cairngorm.NonBindableModelLocator.as" ) );
+      final IClass nonBindableModelLocator = NodeFactory.createPackage( ast ).getClassNode();
+      first = nonBindableModelLocator.getAttributes().get( 0 );
+   }
+
+   @Test
+   public void testGetAllMetaData()
+   {
+      assertEquals( 0,
+                    first.getAllMetaData().size() );
+   }
+
+   @Test
+   public void testGetInitializationExpression()
+   {
+      assertNull( first.getInitializationExpression() );
+   }
+
+   @Test
+   public void testGetMetaDataCount()
+   {
+      assertEquals( 0,
+                    first.getMetaDataCount() );
+   }
+
+   @Test
+   public void testGetName()
+   {
+      assertEquals( "_instance",
+                    first.getName() );
+   }
+
+   @Test
+   public void testGetType()
+   {
+      assertEquals( "ModelLocator",
+                    first.getType().toString() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/AsDocUtilsTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/AsDocUtilsTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/AsDocUtilsTest.java
new file mode 100644
index 0000000..28acd8b
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/AsDocUtilsTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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 com.adobe.ac.pmd.nodes.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.nodes.asdoc.impl.ClassAsDocNode;
+import com.adobe.ac.pmd.nodes.asdoc.impl.FunctionAsDocNode;
+import com.adobe.ac.pmd.nodes.asdoc.impl.ParameterAsDocNode;
+
+public class AsDocUtilsTest
+{
+   @Test
+   public void testComputeClassDoc()
+   {
+      final ClassAsDocNode emptyDoc = AsDocUtils.computeClassDoc( "" );
+
+      assertEquals( "",
+                    emptyDoc.getDescription() );
+
+      AsDocUtils.computeClassDoc( "/** description \n        * description2\n @see mx.kjnerkjlef.btbt*/" );
+   }
+
+   @Test
+   public void testComputeFunctionDoc()
+   {
+      final FunctionAsDocNode emptyDoc = AsDocUtils.computeFunctionDoc( "" );
+
+      assertEquals( "",
+                    emptyDoc.getDescription() );
+
+      final FunctionAsDocNode functionDoc = AsDocUtils.computeFunctionDoc( "/** description \n        * description2\n @see mx.kjnerkjlef.btbt*/" );
+
+      final ParameterAsDocNode parameter = AsDocUtils.computeParameterDoc( "name",
+                                                                           "description" );
+      functionDoc.addParameter( parameter );
+
+      assertEquals( parameter,
+                    functionDoc.getParameter( 0 ) );
+
+      assertEquals( "name",
+                    parameter.getName() );
+
+      assertEquals( "description",
+                    parameter.getDescription() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/FunctionUtilsTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/FunctionUtilsTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/FunctionUtilsTest.java
new file mode 100644
index 0000000..b0ef8de
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/nodes/utils/FunctionUtilsTest.java
@@ -0,0 +1,60 @@
+/*
+ * 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 com.adobe.ac.pmd.nodes.utils;
+
+import static org.junit.Assert.assertEquals;
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.files.FileSetUtils;
+import com.adobe.ac.pmd.files.IFlexFile;
+import com.adobe.ac.pmd.nodes.IClass;
+import com.adobe.ac.pmd.nodes.impl.NodeFactory;
+import com.adobe.ac.pmd.parser.IParserNode;
+
+public class FunctionUtilsTest extends FlexPmdTestBase
+{
+   @Test
+   public void testComputeFunctionLength() throws PMDException
+   {
+      final IFlexFile file = getTestFiles().get( "RadonDataGrid.as" );
+      final IParserNode dataGridAst = FileSetUtils.buildAst( file );
+      final IClass radonDataGrid = NodeFactory.createPackage( dataGridAst ).getClassNode();
+
+      assertEquals( 6,
+                    FunctionUtils.computeFunctionLength( file,
+                                                         radonDataGrid.getFunctions().get( 0 ).getBody() ) );
+
+      assertEquals( 9,
+                    FunctionUtils.computeFunctionLength( file,
+                                                         radonDataGrid.getFunctions().get( 1 ).getBody() ) );
+
+      assertEquals( 21,
+                    FunctionUtils.computeFunctionLength( file,
+                                                         radonDataGrid.getFunctions().get( 2 ).getBody() ) );
+
+      assertEquals( 16,
+                    FunctionUtils.computeFunctionLength( file,
+                                                         radonDataGrid.getFunctions().get( 3 ).getBody() ) );
+
+      assertEquals( 10,
+                    FunctionUtils.computeFunctionLength( file,
+                                                         radonDataGrid.getFunctions().get( 4 ).getBody() ) );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRule.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRule.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRule.java
new file mode 100644
index 0000000..43df42d
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRule.java
@@ -0,0 +1,79 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.rules.core.ViolationPosition;
+import com.adobe.ac.pmd.rules.core.ViolationPriority;
+import com.adobe.ac.pmd.rules.core.thresholded.AbstractMaximizedFlexRule;
+
+public class EmptyRule extends AbstractMaximizedFlexRule
+{
+   public int getActualValueForTheCurrentViolation()
+   {
+      return 0;
+   }
+
+   public int getDefaultThreshold()
+   {
+      return 10;
+   }
+
+   @Override
+   public String getDescription()
+   {
+      return "description";
+   }
+
+   @Override
+   public String getMessage()
+   {
+      return "emptyMessage";
+   }
+
+   @Override
+   public int getThreshold()
+   {
+      return getDefaultThreshold();
+   }
+
+   @Override
+   public final boolean isConcernedByTheCurrentFile()
+   {
+      return true;
+   }
+
+   @Override
+   protected List< IFlexViolation > findViolationsInCurrentFile()
+   {
+      final ArrayList< IFlexViolation > violations = new ArrayList< IFlexViolation >();
+
+      addViolation( violations,
+                    new ViolationPosition( 0 ) );
+
+      return violations;
+   }
+
+   @Override
+   protected ViolationPriority getDefaultPriority()
+   {
+      return ViolationPriority.LOW;
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRuleTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRuleTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRuleTest.java
new file mode 100644
index 0000000..18c5c8c
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/EmptyRuleTest.java
@@ -0,0 +1,134 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.rules.core.AbstractFlexRuleTest.AssertPosition;
+
+public class EmptyRuleTest extends FlexPmdTestBase
+{
+   @Test
+   public void addViolationEmptyRule()
+   {
+      final List< IFlexViolation > violatons = new EmptyRule().processFile( null,
+                                                                            null,
+                                                                            null );
+
+      assertEquals( 1,
+                    violatons.size() );
+
+      final IFlexViolation firstViolation = violatons.get( 0 );
+
+      assertEquals( 0,
+                    firstViolation.getBeginLine() );
+      assertEquals( 0,
+                    firstViolation.getEndLine() );
+      assertEquals( "emptyMessage. description",
+                    firstViolation.getRuleMessage() );
+   }
+
+   @Test
+   public void addViolationWarningRule()
+   {
+      final List< IFlexViolation > violatons = new WarningRule().processFile( null,
+                                                                              null,
+                                                                              null );
+
+      assertEquals( 1,
+                    violatons.size() );
+
+      final IFlexViolation firstViolation = violatons.get( 0 );
+
+      assertEquals( 0,
+                    firstViolation.getBeginLine() );
+      assertEquals( 0,
+                    firstViolation.getEndLine() );
+      assertEquals( "warning message",
+                    firstViolation.getRuleMessage() );
+   }
+
+   @Test
+   public void testBuildFailuresMessage()
+   {
+      final ArrayList< AssertPosition > position = new ArrayList< AssertPosition >();
+
+      position.add( AssertPosition.create( "message",
+                                           1,
+                                           2 ) );
+
+      assertEquals( "message: expected <1> but actually <2>\n",
+                    AbstractFlexRuleTest.buildFailuresMessage( position ).toString() );
+   }
+
+   @Test
+   public void testBuildFailureViolations()
+   {
+      final ViolationPosition[] expectedPositions = new ViolationPosition[]
+      { new ViolationPosition( 0 ) };
+      final ArrayList< IFlexViolation > violations = new ArrayList< IFlexViolation >();
+
+      violations.add( new Violation( new ViolationPosition( 1 ), new EmptyRule(), null ) );
+
+      final List< AssertPosition > positions = AbstractFlexRuleTest.buildFailureViolations( "",
+                                                                                            expectedPositions,
+                                                                                            violations );
+
+      assertEquals( 2,
+                    positions.size() );
+      assertEquals( "Begining line is not correct at 0th violation on ",
+                    positions.get( 0 ).message );
+      assertEquals( "Ending line is not correct at 0th violation on ",
+                    positions.get( 1 ).message );
+   }
+
+   @Test
+   public void testBuildMessageName()
+   {
+      final Map< String, List< IFlexViolation >> violatedFiles = new LinkedHashMap< String, List< IFlexViolation > >();
+      final ArrayList< IFlexViolation > emptyList = new ArrayList< IFlexViolation >();
+
+      violatedFiles.put( "file1",
+                         emptyList );
+
+      violatedFiles.put( "file2",
+                         emptyList );
+
+      assertEquals( "file1 should not contain any violations  (0 found)\n"
+                          + "file2 should not contain any violations  (0 found)\n",
+                    AbstractFlexRuleTest.buildMessageName( violatedFiles ).toString() );
+
+      final ArrayList< IFlexViolation > oneItemList = new ArrayList< IFlexViolation >();
+
+      oneItemList.add( new Violation( new ViolationPosition( 0 ), new EmptyRule(), null ) );
+      violatedFiles.put( "file2",
+                         oneItemList );
+
+      assertEquals( "file1 should not contain any violations  (0 found)\n"
+                          + "file2 should not contain any violations  (1 found at 0:0)\n",
+                    AbstractFlexRuleTest.buildMessageName( violatedFiles ).toString() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/FlexRuleTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/FlexRuleTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/FlexRuleTest.java
new file mode 100644
index 0000000..e18b6d8
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/FlexRuleTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Assert;
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.files.FileSetUtils;
+import com.adobe.ac.pmd.files.IFlexFile;
+import com.adobe.ac.pmd.nodes.impl.NodeFactory;
+import com.adobe.ac.pmd.parser.IParserNode;
+import com.adobe.ac.pmd.parser.NodeKind;
+
+public class FlexRuleTest extends FlexPmdTestBase
+{
+   public class EmptyIfStmtRule extends AbstractAstFlexRule
+   {
+      /*
+       * (non-Javadoc)
+       * @see com.adobe.ac.pmd.rules.core.AbstractFlexRule#getDefaultPriority()
+       */
+      @Override
+      protected final ViolationPriority getDefaultPriority()
+      {
+         return ViolationPriority.NORMAL;
+      }
+
+      /*
+       * (non-Javadoc)
+       * @see
+       * com.adobe.ac.pmd.rules.core.AbstractAstFlexRule#visitIf(com.adobe.ac
+       * .pmd .parser.IParserNode)
+       */
+      @Override
+      protected final void visitIf( final IParserNode ast )
+      {
+         super.visitIf( ast );
+
+         if ( isBlockEmpty( ast.getChild( 1 ) ) )
+         {
+            addViolation( ast );
+         }
+      }
+
+      private boolean isBlockEmpty( final IParserNode block )
+      {
+         return block.is( NodeKind.BLOCK )
+               && block.numChildren() == 0 || block.is( NodeKind.STMT_EMPTY );
+      }
+   }
+
+   @Test
+   public void testExclusions() throws PMDException
+   {
+      final AbstractFlexRule rule = new EmptyIfStmtRule();
+      final IFlexFile duaneMxml = getTestFiles().get( "bug.Duane.mxml" );
+      final Set< String > excludes = new HashSet< String >();
+
+      excludes.add( "" );
+
+      final int noExclusionViolationsLength = rule.processFile( duaneMxml,
+                                                                NodeFactory.createPackage( FileSetUtils.buildAst( duaneMxml ) ),
+                                                                getTestFiles() )
+                                                  .size();
+
+      rule.setExcludes( excludes );
+      final int exclusionViolationsLength = rule.processFile( duaneMxml,
+                                                              NodeFactory.createPackage( FileSetUtils.buildAst( duaneMxml ) ),
+                                                              getTestFiles() )
+                                                .size();
+
+      Assert.assertTrue( noExclusionViolationsLength > exclusionViolationsLength );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/IgnoreRuleTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/IgnoreRuleTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/IgnoreRuleTest.java
new file mode 100644
index 0000000..49d1140
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/IgnoreRuleTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.files.IFlexFile;
+
+public class IgnoreRuleTest extends FlexPmdTestBase
+{
+   private class IgnoredRule extends AbstractFlexRule
+   {
+      private final IFlexFile currentFile;
+
+      protected IgnoredRule( final IFlexFile file )
+      {
+         super();
+         currentFile = file;
+      }
+
+      @Override
+      public String getName()
+      {
+         return "com.adobe.ac.Ignored";
+      }
+
+      @Override
+      protected List< IFlexViolation > findViolationsInCurrentFile()
+      {
+         return null;
+      }
+
+      @Override
+      protected IFlexFile getCurrentFile()
+      {
+         return currentFile;
+      }
+
+      @Override
+      protected ViolationPriority getDefaultPriority()
+      {
+         return ViolationPriority.LOW;
+      }
+
+      @Override
+      protected boolean isConcernedByTheCurrentFile()
+      {
+         return true;
+      }
+   }
+   private static final String AS3_LINE  = "var i : int;";
+   private static final String MXML_LINE = "addedToStage=\"callLater( myFunction )\"";
+
+   private final IgnoredRule   ruleWithAsFile;
+   private final IgnoredRule   ruleWithMxmlFile;
+
+   public IgnoreRuleTest()
+   {
+      ruleWithAsFile = new IgnoredRule( getTestFiles().get( "AbstractRowData.as" ) );
+      ruleWithMxmlFile = new IgnoredRule( getTestFiles().get( "Main.mxml" ) );
+   }
+
+   @Test
+   public final void testIsViolationIgnored()
+   {
+      isIgnored( " NO PMD" );
+   }
+
+   @Test
+   public final void testIsViolationIgnoredCollapsed()
+   {
+      isIgnored( " NOPMD" );
+   }
+
+   @Test
+   public final void testIsViolationIgnoredWithFullCollapsed()
+   {
+      isIgnored( "NOPMD" );
+   }
+
+   @Test
+   public final void testIsViolationIgnoredWithLowerCase()
+   {
+      isIgnored( " No PMD" );
+   }
+
+   private void isIgnored( final String noPmd )
+   {
+      assertTrue( ruleWithAsFile.isViolationIgnored( AS3_LINE
+            + " //" + noPmd ) );
+      assertFalse( ruleWithAsFile.isViolationIgnored( AS3_LINE
+            + " //" + noPmd + " AlertShow" ) );
+      assertTrue( ruleWithAsFile.isViolationIgnored( AS3_LINE
+            + " //" + noPmd + " IgnoreTest$Ignored" ) );
+      assertTrue( ruleWithAsFile.isViolationIgnored( AS3_LINE
+            + " //" + noPmd + " adobe.ac.pmd.rules.core.IgnoreTest$Ignored" ) );
+      assertFalse( ruleWithAsFile.isViolationIgnored( AS3_LINE ) );
+      assertTrue( ruleWithMxmlFile.isViolationIgnored( MXML_LINE
+            + " <!--" + noPmd ) );
+      assertFalse( ruleWithMxmlFile.isViolationIgnored( MXML_LINE
+            + " <!--" + noPmd + " AlertShow" ) );
+      assertTrue( ruleWithMxmlFile.isViolationIgnored( MXML_LINE
+            + " <!--" + noPmd + " IgnoreTest$Ignored" ) );
+      assertTrue( ruleWithMxmlFile.isViolationIgnored( MXML_LINE
+            + " <!--" + noPmd + " adobe.ac.pmd.rules.core.IgnoreTest$Ignored" ) );
+      assertFalse( ruleWithMxmlFile.isViolationIgnored( MXML_LINE ) );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/TestAbstractAstFlexRule.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/TestAbstractAstFlexRule.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/TestAbstractAstFlexRule.java
new file mode 100644
index 0000000..c2ea0b5
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/TestAbstractAstFlexRule.java
@@ -0,0 +1,146 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import net.sourceforge.pmd.PMDException;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.files.FileSetUtils;
+import com.adobe.ac.pmd.files.IFlexFile;
+import com.adobe.ac.pmd.nodes.IClass;
+import com.adobe.ac.pmd.nodes.IFunction;
+import com.adobe.ac.pmd.nodes.impl.NodeFactory;
+import com.adobe.ac.pmd.parser.IParserNode;
+
+public class TestAbstractAstFlexRule extends FlexPmdTestBase
+{
+   public class AllRule extends AbstractAstFlexRule
+   {
+      protected boolean catchVisited     = false;
+      protected boolean emptyVisited     = false;
+      protected boolean interfaceVisited = false;
+      protected boolean switchVisited    = false;
+      protected boolean whileVisited     = false;
+
+      @Override
+      protected void findViolations( final IClass classNode )
+      {
+         super.findViolations( classNode );
+
+         addViolation( classNode );
+         addViolation( classNode.getInternalNode(),
+                       "first",
+                       "second" );
+         addViolation( classNode,
+                       "first",
+                       "second" );
+      }
+
+      @Override
+      protected void findViolations( final IFunction function )
+      {
+         super.findViolations( function );
+
+         addViolation( function );
+         addViolation( function,
+                       "toto" );
+      }
+
+      @Override
+      protected ViolationPriority getDefaultPriority()
+      {
+         return ViolationPriority.NORMAL;
+      }
+
+      @Override
+      protected void visitCatch( final IParserNode catchNode )
+      {
+         super.visitCatch( catchNode );
+
+         catchVisited = true;
+      }
+
+      @Override
+      protected void visitEmptyStatetement( final IParserNode statementNode )
+      {
+         super.visitEmptyStatetement( statementNode );
+
+         emptyVisited = true;
+      }
+
+      @Override
+      protected void visitInterface( final IParserNode interfaceNode )
+      {
+         super.visitInterface( interfaceNode );
+
+         interfaceVisited = true;
+      }
+
+      @Override
+      protected void visitSwitch( final IParserNode switchNode )
+      {
+         super.visitSwitch( switchNode );
+
+         switchVisited = true;
+      }
+
+      @Override
+      protected void visitWhile( final IParserNode whileNode )
+      {
+         super.visitWhile( whileNode );
+
+         whileVisited = true;
+      }
+   }
+
+   @Test
+   public void testVisit() throws PMDException
+   {
+      final AllRule rule = new AllRule();
+
+      processFile( rule,
+                   "bug.Duane.mxml" );
+      processFile( rule,
+                   "PngEncoder.as" );
+      processFile( rule,
+                   "Color.as" );
+      processFile( rule,
+                   "AbstractRowData.as" );
+      processFile( rule,
+                   "com.adobe.ac.ncss.LongSwitch.as" );
+      processFile( rule,
+                   "com.adobe.ac.ncss.BigImporterModel.as" );
+
+      Assert.assertTrue( rule.catchVisited );
+      Assert.assertTrue( rule.emptyVisited );
+      Assert.assertTrue( rule.interfaceVisited );
+      Assert.assertTrue( rule.switchVisited );
+      Assert.assertTrue( rule.whileVisited );
+   }
+
+   private void processFile( final AllRule rule,
+                             final String fileName ) throws PMDException
+   {
+      final IFlexFile duane = getTestFiles().get( fileName );
+      rule.processFile( duane,
+                        NodeFactory.createPackage( FileSetUtils.buildAst( duane ) ),
+                        getTestFiles() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationPriorityTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationPriorityTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationPriorityTest.java
new file mode 100644
index 0000000..a3da264
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationPriorityTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class ViolationPriorityTest
+{
+   @Test
+   public void testToString()
+   {
+      assertEquals( "1",
+                    ViolationPriority.HIGH.toString() );
+      assertEquals( "3",
+                    ViolationPriority.NORMAL.toString() );
+      assertEquals( "5",
+                    ViolationPriority.LOW.toString() );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationTest.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationTest.java
new file mode 100644
index 0000000..1ab9e78
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/ViolationTest.java
@@ -0,0 +1,236 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import java.io.FileNotFoundException;
+import java.net.URISyntaxException;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.adobe.ac.pmd.FlexPmdTestBase;
+import com.adobe.ac.pmd.files.IFlexFile;
+import com.adobe.ac.pmd.rules.core.thresholded.IThresholdedRule;
+
+public class ViolationTest extends FlexPmdTestBase
+{
+   private static final int              BEGINNING_COLUMN = 0;
+   private static final int              BEGINNING_LINE   = 1;
+   private static final int              ENDING_COLUMN    = 20;
+   private static final int              ENDING_LINE      = 10;
+   private static final IThresholdedRule INFO_RULE        = new EmptyRule();
+   private static final String           RULE_SET_NAME    = "RuleSetName";
+   private static final IFlexRule        WARNING_RULE     = new WarningRule();
+   private IFlexFile                     abstractRowData;
+   private IFlexFile                     abstractRowDataWithPackage;
+   private IFlexFile                     iterationsListMxml;
+   private final ViolationPosition       position;
+
+   public ViolationTest()
+   {
+      super();
+
+      position = ViolationPosition.create( 10,
+                                           20,
+                                           30,
+                                           30 );
+   }
+
+   @Before
+   public void setUp()
+   {
+      abstractRowData = getTestFiles().get( "AbstractRowData.as" );
+      abstractRowDataWithPackage = getTestFiles().get( "com.adobe.ac.AbstractRowData.as" );
+      iterationsListMxml = getTestFiles().get( "com.adobe.ac.ncss.mxml.IterationsList.mxml" );
+   }
+
+   @Test
+   public void testCompareTo()
+   {
+      final Violation infoViolation = new Violation( position, INFO_RULE, null );
+      final Violation infoViolation2 = new Violation( ViolationPosition.create( 11,
+                                                                                20,
+                                                                                30,
+                                                                                30 ), INFO_RULE, null );
+      final Violation warningViolation = new Violation( position, WARNING_RULE, null );
+      final Violation warningViolation2 = new Violation( position, WARNING_RULE, null );
+
+      assertEquals( -1,
+                    infoViolation.compareTo( infoViolation2 ) );
+      assertEquals( -1,
+                    warningViolation.compareTo( infoViolation ) );
+      assertEquals( 0,
+                    warningViolation.compareTo( warningViolation2 ) );
+      assertEquals( 1,
+                    infoViolation2.compareTo( infoViolation ) );
+      assertEquals( 1,
+                    infoViolation.compareTo( warningViolation ) );
+   }
+
+   @Test
+   public void testGetActualValueForTheCurrentViolation()
+   {
+      final IThresholdedRule thresholdRule = ( IThresholdedRule ) new Violation( position, INFO_RULE, null ).getRule();
+
+      assertEquals( 0,
+                    thresholdRule.getActualValueForTheCurrentViolation() );
+   }
+
+   @Test
+   public void testGetClassName()
+   {
+      assertEquals( "",
+                    new Violation( position, INFO_RULE, null ).getClassName() );
+   }
+
+   @Test
+   public void testGetDefaultThreshold()
+   {
+      assertEquals( Integer.valueOf( ViolationPriority.LOW.toString() ),
+                    Integer.valueOf( new Violation( position, INFO_RULE, null ).getRule().getPriority() ) );
+   }
+
+   @Test
+   public void testGetDescription()
+   {
+      assertEquals( "emptyMessage",
+                    new Violation( position, INFO_RULE, null ).getDescription() );
+   }
+
+   @Test
+   public void testGetEndColumn()
+   {
+      assertEquals( 30,
+                    new Violation( position, INFO_RULE, null ).getEndColumn() );
+   }
+
+   @Test
+   public void testGetFileName()
+   {
+      final Violation infoViolation = new Violation( position, INFO_RULE, abstractRowData );
+
+      assertEquals( "AbstractRowData.as",
+                    infoViolation.getFilename() );
+
+      final Violation infoViolation2 = new Violation( position, INFO_RULE, abstractRowDataWithPackage );
+
+      assertEquals( "com.adobe.ac.AbstractRowData.as",
+                    infoViolation2.getFilename() );
+   }
+
+   @Test
+   public void testGetMethodName()
+   {
+      assertEquals( "",
+                    new Violation( position, INFO_RULE, abstractRowData ).getMethodName() );
+
+   }
+
+   @Test
+   public void testGetPackageName()
+   {
+      assertEquals( "",
+                    new Violation( position, INFO_RULE, abstractRowData ).getPackageName() );
+
+      assertEquals( "com.adobe.ac",
+                    new Violation( position, INFO_RULE, abstractRowDataWithPackage ).getPackageName() );
+   }
+
+   @Test
+   public void testGetRuleMessage()
+   {
+      assertEquals( "emptyMessage",
+                    new Violation( position, INFO_RULE, null ).getRuleMessage() );
+
+      assertEquals( "warning message",
+                    new Violation( position, WARNING_RULE, null ).getRuleMessage() );
+   }
+
+   @Test
+   public void testGetVariableName()
+   {
+      assertEquals( "",
+                    new Violation( position, INFO_RULE, null ).getVariableName() );
+   }
+
+   @Test
+   public void testIsSuppressed()
+   {
+      assertFalse( "",
+                   new Violation( position, INFO_RULE, abstractRowData ).isSuppressed() );
+   }
+
+   @Test
+   public void testToXmlString() throws FileNotFoundException,
+                                URISyntaxException
+   {
+      final Violation infoViolation = new Violation( ViolationPosition.create( BEGINNING_LINE,
+                                                                               ENDING_LINE,
+                                                                               BEGINNING_COLUMN,
+                                                                               ENDING_COLUMN ),
+                                                     INFO_RULE,
+                                                     null );
+
+      assertEquals( "As3 file at a root level",
+                    "      <violation beginline=\""
+                          + BEGINNING_LINE + "\" endline=\"" + ENDING_LINE + "\" begincolumn=\""
+                          + BEGINNING_COLUMN + "\" endcolumn=\"" + ENDING_COLUMN + "\" rule=\""
+                          + INFO_RULE.getRuleName() + "\" ruleset=\"" + RULE_SET_NAME + "\" package=\""
+                          + abstractRowData.getPackageName() + "\" class=\"" + abstractRowData.getClassName()
+                          + "\" externalInfoUrl=\"" + Violation.RULESET_CREATOR_URL + "EmptyRule\" "
+                          + "priority=\"" + INFO_RULE.getPriority() + "\">" + "emptyMessage" + "</violation>"
+                          + infoViolation.getNewLine(),
+                    infoViolation.toXmlString( abstractRowData,
+                                               RULE_SET_NAME ) );
+
+      final Violation warningViolation = new Violation( ViolationPosition.create( BEGINNING_LINE,
+                                                                                  ENDING_LINE,
+                                                                                  BEGINNING_COLUMN,
+                                                                                  ENDING_COLUMN ),
+                                                        WARNING_RULE,
+                                                        null );
+
+      assertEquals( "As3 File at a not-root level",
+                    "      <violation beginline=\""
+                          + BEGINNING_LINE + "\" endline=\"" + ENDING_LINE + "\" begincolumn=\""
+                          + BEGINNING_COLUMN + "\" endcolumn=\"" + ENDING_COLUMN + "\" rule=\""
+                          + WARNING_RULE.getRuleName() + "\" ruleset=\"" + RULE_SET_NAME + "\" package=\""
+                          + abstractRowDataWithPackage.getPackageName() + "\" class=\""
+                          + abstractRowData.getClassName() + "\" externalInfoUrl=\""
+                          + Violation.RULESET_CREATOR_URL + "WarningRule\" " + "priority=\""
+                          + WARNING_RULE.getPriority() + "\">" + "warning message" + "</violation>"
+                          + warningViolation.getNewLine(),
+                    warningViolation.toXmlString( abstractRowDataWithPackage,
+                                                  RULE_SET_NAME ) );
+
+      assertEquals( "Mxml File at a not-root level",
+                    "      <violation beginline=\""
+                          + BEGINNING_LINE + "\" endline=\"" + ENDING_LINE + "\" begincolumn=\""
+                          + BEGINNING_COLUMN + "\" endcolumn=\"" + ENDING_COLUMN + "\" rule=\""
+                          + WARNING_RULE.getRuleName() + "\" ruleset=\"" + RULE_SET_NAME + "\" package=\""
+                          + iterationsListMxml.getPackageName() + "\" class=\""
+                          + iterationsListMxml.getClassName() + "\" externalInfoUrl=\""
+                          + Violation.RULESET_CREATOR_URL + "WarningRule\" " + "priority=\""
+                          + WARNING_RULE.getPriority() + "\">" + "warning message" + "</violation>"
+                          + warningViolation.getNewLine(),
+                    warningViolation.toXmlString( iterationsListMxml,
+                                                  RULE_SET_NAME ) );
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/WarningRule.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/WarningRule.java b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/WarningRule.java
new file mode 100644
index 0000000..3898c7e
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-api/src/test/java/com/adobe/ac/pmd/rules/core/WarningRule.java
@@ -0,0 +1,57 @@
+/*
+ * 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 com.adobe.ac.pmd.rules.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.adobe.ac.pmd.IFlexViolation;
+import com.adobe.ac.pmd.rules.core.AbstractFlexRule;
+import com.adobe.ac.pmd.rules.core.ViolationPosition;
+import com.adobe.ac.pmd.rules.core.ViolationPriority;
+
+public class WarningRule extends AbstractFlexRule
+{
+   @Override
+   public String getMessage()
+   {
+      return "warning message.";
+   }
+
+   @Override
+   public final boolean isConcernedByTheCurrentFile()
+   {
+      return true;
+   }
+
+   @Override
+   protected ViolationPriority getDefaultPriority()
+   {
+      return ViolationPriority.NORMAL;
+   }
+
+   @Override
+   protected List< IFlexViolation > findViolationsInCurrentFile()
+   {
+      final ArrayList< IFlexViolation > violations = new ArrayList< IFlexViolation >();
+
+      addViolation( violations,
+                    new ViolationPosition( 0 ) );
+
+      return violations;
+   }
+}

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/build.properties
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/build.properties b/FlexPMD/flex-pmd-ruleset-creator/build.properties
new file mode 100644
index 0000000..7c7944d
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/build.properties
@@ -0,0 +1,41 @@
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+#
+###################################
+## detail your environment settings
+###################################
+#env.MAVEN_HOME will be used by the ant file
+MAVEN.EXE = mvn.bat 
+# for windows
+#MAVEN.EXE = mvn 
+# for Mac
+
+# Location of flex SDK
+flexcover.sdk=C:\\apps\\flex\\instrumented-sdk-adobe-3.2.0.3958
+flex.sdk.version=3.2.0.3958
+
+###################################
+## common parameters section
+###################################
+temp=${basedir}/temp
+path.maven.repo=http://fna-v2.googlecode.com/svn/trunk/fna/fna_m2_repository/
+
+
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/build.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/build.xml b/FlexPMD/flex-pmd-ruleset-creator/build.xml
new file mode 100644
index 0000000..24c6d01
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/build.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" ?>
+<!--
+
+  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.
+
+-->
+<project name="FlexPMD client build utility" default="default" xmlns:artifact="urn:maven-artifact-ant">
+
+	<property environment="env" />
+	<property file="${basedir}/build.properties" />
+
+	<!-- uncomment if you need to see what properties ant is picking up 
+	<echoproperties />
+    -->
+	
+	<path id="maven-ant-tasks.classpath" path="${basedir}/ant.lib/maven-ant-tasks-2.0.9.jar" />
+	<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
+
+
+	<target name="default">
+		<echo> This build contains at set of usefull targets </echo>
+		<echo> The compilation, unit test, flexpmd quality report and done with maven </echo>
+		<echo />
+		<echo> From here, you may  the following target: </echo>
+		<echo />
+		<echo> -------- update the third party libraries swc  ----------------- </echo>
+		<echo> libs.update          -- will clean and recopy the 3rd party swc in libs</echo>
+		<echo />
+		<echo> -------- flexcover --------------------------------------------- </echo>
+		<echo> flexcover.run          -- will run the flexcover air client and flexunit test runner</echo>
+		<echo> flexcover.report       -- will run flexcover and create a emma.xml report</echo>
+	</target>
+
+	<target name="libs.update">
+		<delete includeemptydirs="true">
+			<fileset dir="${basedir}/libs" includes="*.swc" excludes="radon_flex_remoted_objects*.swc" />
+		</delete>
+		<artifact:dependencies filesetId="dependency.fileset" useScope="test">
+			<pom file="${basedir}/pom.xml" />
+		</artifact:dependencies>
+		<copy todir="${basedir}/libs">
+			<fileset refid="dependency.fileset" />
+			<!-- This mapper strips off all leading directory information -->
+			<mapper type="flatten" />
+		</copy>
+		<delete includeemptydirs="true">
+			<fileset dir="${basedir}/libs" includes="*${flex.sdk.version}*" defaultexcludes="false" excludes="datavisualization-3.2.0.3958-en_US.rb.swc,datavisualization-3.2.0.3958.swc"/>
+			<fileset dir="${basedir}/libs" includes="*.pom" defaultexcludes="false" />
+			<fileset dir="${basedir}/libs" includes="*.zip" defaultexcludes="false" />
+            <fileset dir="${basedir}/libs" includes="*.jar" defaultexcludes="false" />
+		</delete>
+	</target>
+
+	<target name="flexcover.run" depends="libs.update">
+		<ant antfile="${basedir}/flexcover.xml" target="run" />
+	</target>
+
+	<target name="flexcover.report" depends="libs.update">
+		<ant antfile="${basedir}/flexcover.xml" target="report" />
+	</target>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/flexcover.properties
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/flexcover.properties b/FlexPMD/flex-pmd-ruleset-creator/flexcover.properties
new file mode 100644
index 0000000..929c918
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/flexcover.properties
@@ -0,0 +1,89 @@
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+#
+# Common to all platforms
+
+# Mac/unix location of adl
+#adl=${FLEX_HOME}/bin/adl
+
+# Windows location of adl
+adl=${flexcover.sdk}\\bin\\adl.exe
+
+dirSep=\\
+
+# flex related variables
+FLEX_HOME=${flexcover.sdk}
+flexConfig=${flexcover.sdk}/frameworks/air-config.xml
+FLEX_TASKS=${flexcover.sdk}/ant/lib/flexTasks.jar
+
+LOCALE=en_US
+
+versionNumber=1.0
+
+# frameworks and locations
+ant.lib=${basedir}/ant.lib
+logs=${basedir}/target/logs
+temp=${logs}/temp
+flashOutput.location=${logs}/TEST-testOutput.xml
+src=${basedir}/src/main/flex
+src_resources=${basedir}/src/main/resources
+src_test=${basedir}/src/test/flex
+src_test_resources=${basedir}/src/test/resources
+src_locale=${basedir}/src/main/locales/en_US
+testClassPath=${basedir}/libs
+resourceBundles=${basedir}/src/main/locales
+flexUnitSrc=${basedir}/src/test
+filesToPublish=${basedir}/filesToPublish
+
+# constants
+testTerminationToken=-----------------TESTRUNNEROUTPUTENDS----------------
+initialContentToken=[This value will be overwritten by Flex Builder in the output app.xml]
+majorVersion=1
+minorVersion=0
+releaseVersion=0
+
+# project variables
+build=${temp}
+
+# test Harness
+testAppXML=${testName}-app.xml
+testAppMXML=${testName}.mxml
+testSWF=${testName}.swf
+testCVM=${testName}.cvm
+testOutputDir=${temp}
+
+# main app
+mainName=Main
+mainAppXMLtemplate=${mainName}-app-template.xml
+mainAppXML=${mainName}-app.xml
+mainAppMXML=${mainName}.mxml
+mainSWF=${mainName}.swf
+
+# instumentation
+coverageMetadata=${temp}/${mainName}.cvm
+coverageReport=${basedir}/target/site/emma/coverage.xml
+coverageCVR=${logs}/${mainName}_coverage.cvr
+coverageXML=${ant.lib}/CoverageViewer-app.xml
+
+# build variables
+verbose=true
+dist=${basedir}/target/dist-test
+adtJar=${flexcover.sdk}/lib/adt.jar
+

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/flexcover.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/flexcover.xml b/FlexPMD/flex-pmd-ruleset-creator/flexcover.xml
new file mode 100644
index 0000000..98ad5e7
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/flexcover.xml
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<project name="FlexPMD Flex Cover Report ANT build report utility" basedir="." default="report">
+
+	<!-- set up the build environment -->
+	<property file="build.properties" />
+	<property file="flexcover.properties" />
+	<property environment="env" />
+
+	<property name="flexpmd.version" value="1.0-RC1" />
+
+	<!-- get the hostname of the machine we're running on -->
+	<property name="env.HOSTNAME" value="${env.COMPUTERNAME}" />
+
+	<!-- include the flex target definitions -->
+	<taskdef resource="flexTasks.tasks" classpath="${FLEX_TASKS}" />
+
+	<!-- Define the FlexUnit task. -->
+	<taskdef resource="com/adobe/ac/ant/tasks/tasks.properties" classpath="${ant.lib}/FlexUnitAntTasks.jar" />
+
+	<!-- uncomment if you need to see what properties ant is picking up -->
+	<echoproperties/>
+
+	<!-- the main build target the build machine uses, build, test, report, nag -->
+	<target name="run.prepare" 
+		depends="clean,getInstrumentationMetadata,compileAndRunTests,cleanUp" 
+		description="cleans, compiles and tests the app, builds a non-release package." />
+
+	
+	<target name="report">
+		<antcall target="run.prepare">
+            <param name="testName" value="TestRunner" />
+        </antcall>
+	</target>
+	
+	<target name="run">
+		<antcall target="run.prepare">
+            <param name="testName" value="TestViewRunner" />
+        </antcall>
+	</target>
+
+	<!-- usethis target to test locally -->
+	<target name="compileAndRunTests" depends="clean,compileTest,runTest" 
+		description="compile and run the test suite and code coverage tool" />
+
+	<target name="getInstrumentationMetadata" 
+		description="compiles the app to get metadata about classes needed for code coverage" depends="clean">
+ 		<compile />
+	</target>
+
+	<target name="cleanUp" description="removes test harness and temp folder from build directory">
+		<delete file="${build}/${testAppXML}">
+		</delete>
+		<delete file="${build}/${testSWF}">
+		</delete>
+	</target>
+
+	<property name="coverageMetadata-path" location="${coverageMetadata}" />
+	<property name="coverageReport-path" location="${coverageReport}" />
+	<property name="coverageCVR-path" location="${coverageCVR}" />
+	<property name="coverageXML-path" location="${coverageXML}" />
+
+	<target name="launchCodeCoverageApp" description="launches to code coverage listener app">
+		<echo>'${coverageMetadata-path}' -output '${coverageCVR-path}' -emma-report '${coverageReport-path}'</echo>
+		<launchApp appXML="${coverageXML-path}" additionalArgs="${coverageMetadata-path} -output ${coverageCVR-path} -emma-report ${coverageReport-path}" />
+	</target>
+
+	<macrodef name="launchApp">
+		<attribute name="appXML" />
+		<attribute name="additionalArgs" />
+		<attribute name="spawn" default="true" />
+		<sequential>
+			<pathconvert property="xmlPath" dirsep="${dirSep}">
+				<path location="@{appXML}" />
+			</pathconvert>
+			<echo>launching adl with ${xmlPath}</echo>
+			<exec executable="${adl}" spawn="@{spawn}">
+				<arg line="'${xmlPath}'" />
+				<arg line="--" />
+				<arg line="@{additionalArgs}" />
+			</exec>
+		</sequential>
+	</macrodef>
+
+	<macrodef name="compile">
+		<attribute name="srcFile" default="${src}/${mainAppMXML}" />
+		<attribute name="outputFile" default="${temp}/${mainSWF}" />
+		<sequential>
+			<mxmlc file="@{srcFile}" output="@{outputFile}" debug="${debugMode}" 
+				allow-source-path-overlap="true" show-actionscript-warnings="false" 
+				keep-generated-actionscript="false" maxmemory="1024m">
+
+				<define name="CONFIG::debugging" value="false" />
+
+				<load-config filename="${flexConfig}" />
+
+				<!-- path to our source -->
+				<source-path path-element="${src}" />
+				<source-path path-element="${src_test}" />
+				<source-path path-element="${src_locale}" />
+				<source-path path-element="${testClassPath}" />
+				<source-path path-element="${resourceBundles}" />
+				<source-path path-element="${flexUnitSrc}" />
+
+				<!-- core flex libraries -->
+				<compiler.library-path dir="${flexcover.sdk}/frameworks" append="true">
+					<include name="libs" />
+				</compiler.library-path>
+				<compiler.library-path dir="${flexcover.sdk}/frameworks/locale" append="true">
+					<include name="${LOCALE}" />
+				</compiler.library-path>
+
+				<!-- air libraries (why need to declare separate)? -->
+				<compiler.library-path dir="${flexcover.sdk}/frameworks" append="true">
+					<include name="libs/air" />
+				</compiler.library-path>
+
+				<!-- local libraries -->
+				<compiler.library-path dir="." append="true">
+					<include name="libs" />
+					<include name="${ant.lib}" />
+				</compiler.library-path>
+			</mxmlc>
+		</sequential>
+	</macrodef>
+
+
+	<!-- compile the unit tests -->
+	<target name="compileTest" description="compile the the test suite">
+		<compile srcFile="${src}/${testAppMXML}" outputFile="${build}/${testSWF}" />
+		<generateAppXML srcFile="${src}/${testAppXML}" destFile="${build}/${testAppXML}" initialContent="${testSWF}" />
+	</target>
+
+	<!-- create the application XML file -->
+	<macrodef name="generateAppXML">
+		<attribute name="srcFile" />
+		<attribute name="destFile" />
+		<attribute name="initialContent" />
+		<sequential>
+			<copy file="@{srcFile}" tofile="@{destFile}" />
+			<replace file="@{destFile}" token="${initialContentToken}" value="@{initialContent}" />
+			<echo>setting build number to: ${versionNumber}</echo>
+			<replace file="@{destFile}" token="%VERSION%" value="${versionNumber}" />
+		</sequential>
+	</macrodef>
+
+	<!-- Clears out the build directory -->
+	<target name="clean">
+		<echo message="Removing build directory contents" description="removes build related directory contents" />
+	</target>
+	
+	<target name="runTest" description="runs the test harness and coverage tool" depends="clean,compileTest">
+		<parallel timeout="120000">
+			<sequential>
+				<antcall target="launchCodeCoverageApp">
+				</antcall>
+				<sleep seconds="15" />
+				<launchApp appXML="${build}/${testAppXML}" additionalArgs="'${testOutputDir}'" spawn="no" />
+				<airflexunit reportDir="${testOutputDir}" haltonfailure="true" />
+				<echo>finished running tests </echo>
+				<waitfor>
+					<available file="${coverageCVR-path}" />
+				</waitfor>
+				<echo>found coverage CVR </echo>
+				<waitfor>
+					<available file="${coverageReport-path}" />
+				</waitfor>
+				<echo>found coverage report</echo>
+			</sequential>
+		</parallel>
+	</target>
+
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/html-template/index.template.html b/FlexPMD/flex-pmd-ruleset-creator/html-template/index.template.html
new file mode 100644
index 0000000..71abea8
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/pom.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/pom.xml b/FlexPMD/flex-pmd-ruleset-creator/pom.xml
new file mode 100644
index 0000000..0e988d5
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/pom.xml
@@ -0,0 +1,218 @@
+<!--
+
+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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.adobe.ac</groupId>
+	<artifactId>flex-pmd-ruleset-creator</artifactId>
+	<packaging>swf</packaging>
+	<name>Adobe Flex PMD Ruleset creator</name>
+	<description>Adobe Flex PMD Ruleset creator</description>
+
+	<parent>
+		<artifactId>flex-pmd-flex-parent</artifactId>
+		<groupId>com.adobe.ac</groupId>
+		<version>1.3-SNAPSHOT</version>
+		<relativePath>../flex-pmd-flex-parent/pom.xml</relativePath>
+	</parent>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>flex-pmd-ruleset</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>flexunit-theme</artifactId>
+			<version>${project.parent.version}</version>
+			<type>swc</type>
+			<scope>theme</scope>
+		</dependency>
+
+
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>flex-pmd-flex-lib</artifactId>
+			<version>${project.parent.version}</version>
+			<type>swc</type>
+		</dependency>
+
+
+		<dependency>
+			<groupId>com.adobe.cairngorm</groupId>
+			<artifactId>cairngorm</artifactId>
+			<version>${cairngorm.version}</version>
+			<type>swc</type>
+		</dependency>
+
+		<!-- flex sdk dependencies -->
+
+		<dependency>
+			<groupId>com.adobe.flex.framework</groupId>
+			<artifactId>flex-framework</artifactId>
+			<version>${flex.version}</version>
+			<type>pom</type>
+			<exclusions>
+				<exclusion>
+					<groupId>com.adobe.flex.framework</groupId>
+					<artifactId>playerglobal</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<dependency>
+			<groupId>com.adobe.flex.framework</groupId>
+			<artifactId>playerglobal</artifactId>
+			<version>${flash-player.version}-${flex.version}</version>
+			<type>swc</type>
+		</dependency>
+
+		<dependency>
+			<groupId>com.adobe.flex.framework</groupId>
+			<artifactId>datavisualization</artifactId>
+			<version>${flex.version}</version>
+			<type>swc</type>
+		</dependency>
+
+		<dependency>
+			<groupId>com.adobe.flex.framework</groupId>
+			<artifactId>datavisualization</artifactId>
+			<version>${flex.version}</version>
+			<type>rb.swc</type>
+			<classifier>en_US</classifier>
+		</dependency>
+
+		<dependency>
+			<groupId>com.adobe.cairngorm</groupId>
+			<artifactId>event-source</artifactId>
+			<version>${event-source.version}</version>
+			<type>swc</type>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>com.adobe.flexunit</groupId>
+			<artifactId>flexunit</artifactId>
+			<version>${flexunit.version}</version>
+			<type>swc</type>
+			<scope>test</scope>
+		</dependency>
+		<!-- flexmojos Unit testing support -->
+		<dependency>
+			<groupId>org.sonatype.flexmojos</groupId>
+			<artifactId>flexmojos-unittest-support</artifactId>
+			<version>${flex-mojos-plugin.version}</version>
+			<type>swc</type>
+			<scope>test</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>com.adobe.flex.framework</groupId>
+					<artifactId>playerglobal</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<sourceDirectory>src/main/flex</sourceDirectory>
+		<testSourceDirectory>src/test/flex</testSourceDirectory>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+			</resource>
+		</resources>
+		<testResources>
+			<testResource>
+				<directory>src/test/resources</directory>
+			</testResource>
+		</testResources>
+
+		<plugins>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>${maven-dependency-plugin.version}</version>
+				<executions>
+					<execution>
+						<id>unpack-binary-resources</id>
+						<phase>process-sources</phase>
+						<goals>
+							<goal>unpack-dependencies</goal>
+						</goals>
+						<configuration>
+							<includeGroupIds>${project.groupId}</includeGroupIds>
+							<includes>**/*.xml</includes>
+							<outputDirectory>target/rulesets</outputDirectory>
+							<excludeTransitive>true</excludeTransitive>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+
+			<plugin>
+				<groupId>org.sonatype.flexmojos</groupId>
+				<artifactId>flexmojos-maven-plugin</artifactId>
+				<version>${flex-mojos-plugin.version}</version>
+				<extensions>true</extensions>
+				<configuration>
+					<targetPlayer>${flash-player.version}.0.0</targetPlayer>
+					<defaultSizeWidth>1000</defaultSizeWidth>
+					<defaultSizeHeight>750</defaultSizeHeight>
+				</configuration>
+			</plugin>
+
+			<plugin>
+				<groupId>org.sonatype.flexmojos</groupId>
+				<artifactId>flexmojos-maven-plugin</artifactId>
+				<version>${flex-mojos-plugin.version}</version>
+				<extensions>true</extensions>
+				<executions>
+					<execution>
+						<goals>
+							<goal>wrapper</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+					<templateURI>folder:html-template</templateURI>
+					<htmlName>${project.artifactId}</htmlName>
+				</configuration>
+			</plugin>
+			
+		</plugins>
+	</build>
+
+	<repositories>
+		<repository>
+			<id>flexmojos-repository</id>
+			<url>http://repository.sonatype.org/content/groups/public/</url>
+		</repository>
+	</repositories>
+	<pluginRepositories>
+		<pluginRepository>
+			<id>flexmojos-repository</id>
+			<url>http://repository.sonatype.org/content/groups/public/</url>
+		</pluginRepository>
+	</pluginRepositories>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/Main.mxml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/Main.mxml b/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/Main.mxml
new file mode 100644
index 0000000..260bd5b
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/Main.mxml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<mx:Application xmlns:control="com.adobe.ac.pmd.control.*"
+   xmlns:local="*"
+   xmlns:mx="http://www.adobe.com/2006/mxml"
+   xmlns:services="com.adobe.ac.pmd.services.*"
+   xmlns:view="com.adobe.ac.pmd.view.*"
+   styleName="flexUnitApplication"
+   horizontalScrollPolicy="off"
+   layout="vertical"
+   minHeight="600"
+   minWidth="850"
+   height="100%"
+   horizontalAlign="center"
+   verticalAlign="top"
+   paddingBottom="10">
+
+   <control:Controller/>
+
+   <services:MyServiceLocator/>
+
+   <mx:Panel width="100%" 
+      styleName="mainPanel"
+       height="100%">
+
+      <mx:HBox width="100%"
+         horizontalGap="0"
+         paddingRight="10"
+         verticalAlign="bottom"
+         >
+
+         <view:Title styleName="panelTitleStyle"
+            text="FlexPMD Ruleset Creator"
+            />
+
+         <view:Title styleName="panelTitleSubStyle"
+            text="powered by Adobe Technical Services"
+            buttonMode="true"
+            click="navigateToURL( new URLRequest( 'http://www.adobe.com/consulting/' ) )"
+            mouseChildren="false"
+            useHandCursor="true"
+            />
+
+         <mx:Spacer width="100%"
+            />
+
+         <view:Title styleName="panelTitleSubStyle"
+            text="v{ Version.BUILD_NUMBER } built on { Version.BUILD_DATE } at { Version.BUILD_TIME}"
+            />
+
+      </mx:HBox>
+
+      <mx:HRule width="100%"
+         styleName="flexUnitHRule"
+         />
+
+      <mx:HBox width="100%"
+         paddingBottom="5"
+         paddingLeft="10"
+          height="100%">
+
+         <view:RuleSetNavigator id="navigator"
+            width="100%"
+            selectedRuleChange="editor.model.selectedRule = event.selectedRule"
+             height="100%"/>
+
+         <mx:VRule
+            styleName="flexUnitHRule"
+             height="100%"/>
+
+		 <mx:VBox
+			 height="100%">
+			 
+	         <view:RuleEditor id="editor"/>
+			 
+			 <mx:Label
+				 text="{ navigator.model.rootRuleset.rulesNb } rule(s) in your current ruleset"
+				 />
+
+		 </mx:VBox>
+
+      </mx:HBox>
+
+      <mx:HRule width="100%"
+         styleName="flexUnitHRule"
+         />
+
+      <mx:HBox width="100%"
+         horizontalAlign="center"
+		 verticalAlign="middle"
+         >
+
+		  <mx:Button label="Import"
+					 icon="@Embed(source='/assets/up.png')"
+					 click="navigator.model.getCustomRuleset()"
+					 height="100%"
+					 />
+		  
+		  <mx:Button label="Export"
+					 icon="@Embed(source='/assets/down.png')"
+					 click="navigator.model.exportRootRuleset()"
+					 height="100%"
+					 />
+
+		  <mx:Button label="Add a regexp based rule"
+					 icon="@Embed(source='/assets/add-48.png')"
+					 click="navigator.openRuleset( navigator.model.addNewRegExpBasedRule() )"
+					 height="100%"
+					  paddingLeft="10"/>
+		  
+      </mx:HBox>
+
+   </mx:Panel>
+
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b0fc5f17/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/TestRunner-app.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/TestRunner-app.xml b/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/TestRunner-app.xml
new file mode 100644
index 0000000..32aa44b
--- /dev/null
+++ b/FlexPMD/flex-pmd-ruleset-creator/src/main/flex/TestRunner-app.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+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.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/1.5">
+    <id>com.adobe.ac.flex-pmd-ruleset-creator</id>
+    <version>1.0</version>
+    <filename>TestRunner</filename>
+    <name>Flex Unit</name>
+    <description>
+    </description>
+    <copyright>Adobe Systems Co.</copyright>
+    <initialWindow>
+        <title>Flex Unit</title>
+        <content>
+            TestRunner.swf
+        </content>
+        <systemChrome>none</systemChrome>
+        <transparent>true</transparent>
+        <visible>true</visible>
+        <minimizable>true</minimizable>
+        <maximizable>false</maximizable>
+        <resizable>false</resizable>
+        <width>640</width>
+        <height>480</height>
+        <minSize>320 240</minSize>
+        <maxSize>1280 960</maxSize>
+    </initialWindow> 
+    
+</application>