You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2014/08/27 00:44:11 UTC
[40/51] [partial] Refactored the PMD Maven build - Adjusted the
directory structure - Fixed a lot of compile problems - Fixed the maven setup
- Made PMD build with Flexmojos 7.1.0 and Apache Flex 4.13.0 - Fixed a few
UnitTests
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/FlexPmdTestBase.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/FlexPmdTestBase.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/FlexPmdTestBase.java
deleted file mode 100644
index c3e3b5d..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/FlexPmdTestBase.java
+++ /dev/null
@@ -1,71 +0,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.
- */
-package com.adobe.ac.pmd;
-
-import java.io.File;
-import java.util.Map;
-
-import com.adobe.ac.pmd.files.IFlexFile;
-
-/**
- * This is a base class for any FlexPMD rule test case.
- *
- * @author xagnetti
- */
-public class FlexPmdTestBase // NO_UCD
-{
- protected static final String BEGIN_LINE_NOT_CORRECT = "Begining line is not correct"; // NO_UCD
- protected static final String END_LINE_NOT_CORRECT = "Ending line is not correct"; // NO_UCD
- protected static final String VIOLATIONS_NUMBER_NOT_CORRECT = "Violations number is not correct"; // NO_UCD
-
- /**
- * Test files placeholder. The key is the qualified file name
- */
- private Map< String, IFlexFile > testFiles = ResourcesManagerTest.getInstance()
- .getTestFiles();
-
- /**
- *
- */
- protected FlexPmdTestBase()
- {
- }
-
- /**
- * @return
- */
- protected File getTestDirectory() // NO_UCD
- {
- return ResourcesManagerTest.getInstance().getTestRootDirectory();
- }
-
- /**
- * @return
- */
- protected final Map< String, IFlexFile > getTestFiles() // NO_UCD
- {
- return testFiles;
- }
-
- /**
- * @param testFilesToBeSet
- */
- protected final void setTestFiles( final Map< String, IFlexFile > testFilesToBeSet )
- {
- testFiles = testFilesToBeSet;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/ResourcesManagerTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/ResourcesManagerTest.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/ResourcesManagerTest.java
deleted file mode 100644
index 5986888..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/ResourcesManagerTest.java
+++ /dev/null
@@ -1,104 +0,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.
- */
-package com.adobe.ac.pmd;
-
-import java.io.File;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import net.sourceforge.pmd.PMDException;
-
-import com.adobe.ac.pmd.files.IFlexFile;
-import com.adobe.ac.pmd.files.impl.FileUtils;
-import com.adobe.ac.utils.StackTraceUtils;
-
-/**
- * Internal utility which finds out the test resources, and map them to their
- * qualified names.
- *
- * @author xagnetti
- */
-public final class ResourcesManagerTest
-{
- private static ResourcesManagerTest instance = null;
- private static final Logger LOGGER = Logger.getLogger( ResourcesManagerTest.class.getName() );
-
- /**
- * @return
- */
- public static synchronized ResourcesManagerTest getInstance() // NOPMD
- {
- if ( instance == null )
- {
- try
- {
- new LoggerUtils().loadConfiguration();
- instance = new ResourcesManagerTest( "/test" );
- }
- catch ( final URISyntaxException e )
- {
- LOGGER.warning( StackTraceUtils.print( e ) );
- }
- catch ( final PMDException e )
- {
- LOGGER.warning( StackTraceUtils.print( e ) );
- }
- }
- return instance;
- }
-
- private final Map< String, IFlexFile > testFiles;
- private final File testRootDirectory;
-
- private ResourcesManagerTest( final String directory ) throws URISyntaxException,
- PMDException
- {
- final URL resource = this.getClass().getResource( directory );
-
- if ( resource == null )
- {
- LOGGER.severe( directory
- + " folder is not found in the resource" );
- testRootDirectory = null;
- testFiles = new LinkedHashMap< String, IFlexFile >();
- }
- else
- {
- testRootDirectory = new File( resource.toURI().getPath() );
- testFiles = FileUtils.computeFilesList( testRootDirectory,
- null,
- "",
- null );
- }
- }
-
- /**
- * @return
- */
- public Map< String, IFlexFile > getTestFiles()
- {
- return testFiles;
- }
-
- protected File getTestRootDirectory()
- {
- return testRootDirectory;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IAs3File.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IAs3File.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IAs3File.java
deleted file mode 100644
index 4997eeb..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IAs3File.java
+++ /dev/null
@@ -1,24 +0,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.
- */
-package com.adobe.ac.pmd.files;
-
-/**
- * @author xagnetti
- */
-public interface IAs3File extends IFlexFile
-{
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IFlexFile.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IFlexFile.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IFlexFile.java
deleted file mode 100644
index 21adb01..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IFlexFile.java
+++ /dev/null
@@ -1,94 +0,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.
- */
-package com.adobe.ac.pmd.files;
-
-import java.util.Set;
-
-/**
- * @author xagnetti
- */
-public interface IFlexFile
-{
- /**
- * @param stringToLookup
- * @param linesToBeIgnored
- * @return
- */
- boolean contains( final String stringToLookup,
- final Set< Integer > linesToBeIgnored );
-
- /**
- * @return
- */
- String getClassName();
-
- /**
- * @return the token for comment closing
- */
- String getCommentClosingTag();
-
- /**
- * @return the token for comment opening
- */
- String getCommentOpeningTag();
-
- /**
- * @return java.io.File name
- */
- String getFilename();
-
- /**
- * @return java.io.File absolute path
- */
- String getFilePath();
-
- /**
- * @return
- */
- String getFullyQualifiedName();
-
- /**
- * @param lineIndex
- * @return
- */
- String getLineAt( int lineIndex );
-
- /**
- * @return
- */
- int getLinesNb();
-
- /**
- * @return
- */
- String getPackageName();
-
- /**
- * @return the token for one line comment
- */
- String getSingleLineComment();
-
- /**
- * @return true if the file is a main MXML file
- */
- boolean isMainApplication();
-
- /**
- * @return true if the file is a MXML file
- */
- boolean isMxml();
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IMxmlFile.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IMxmlFile.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IMxmlFile.java
deleted file mode 100644
index 1d98c98..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/IMxmlFile.java
+++ /dev/null
@@ -1,43 +0,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.
- */
-package com.adobe.ac.pmd.files;
-
-/**
- * @author xagnetti
- */
-public interface IMxmlFile extends IFlexFile
-{
- /**
- * @return
- */
- String[] getActualScriptBlock();
-
- /**
- * @return
- */
- int getBeginningScriptBlock();
-
- /**
- * @return
- */
- int getEndingScriptBlock();
-
- /**
- * @return
- */
- String[] getScriptBlock();
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/AbstractFlexFile.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/AbstractFlexFile.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/AbstractFlexFile.java
deleted file mode 100644
index 986f2a7..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/AbstractFlexFile.java
+++ /dev/null
@@ -1,259 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.apache.commons.lang.StringUtils;
-
-import com.adobe.ac.pmd.files.IFlexFile;
-import com.adobe.ac.utils.StackTraceUtils;
-
-/**
- * Abstract class representing a Flex File (either MXML or AS)
- *
- * @author xagnetti
- */
-abstract class AbstractFlexFile implements IFlexFile
-{
- private static final Logger LOGGER = Logger.getLogger( AbstractFlexFile.class.getName() );
-
- /**
- * @param filePath
- * @param rootPath
- * @param className
- * @param fileSeparator
- * @return
- */
- protected static String computePackageName( final String filePath,
- final CharSequence rootPath,
- final String className,
- final String fileSeparator )
- {
- String temporaryPackage;
-
- temporaryPackage = filePath.replace( className,
- "" ).replace( rootPath,
- "" ).replace( fileSeparator,
- "." );
- if ( temporaryPackage.endsWith( "." ) )
- {
- temporaryPackage = temporaryPackage.substring( 0,
- temporaryPackage.length() - 1 );
- }
- if ( temporaryPackage.length() > 0
- && temporaryPackage.charAt( 0 ) == '.' )
- {
- temporaryPackage = temporaryPackage.substring( 1,
- temporaryPackage.length() );
- }
- return temporaryPackage;
- }
-
- private static boolean doesCurrentLineContain( final String line,
- final String search )
- {
- return line.contains( search );
- }
-
- private final String className;
- private final File file;
- private final List< String > lines;
- private final String packageName;
-
- /**
- * @param underlyingFile
- * @param rootDirectory
- */
- protected AbstractFlexFile( final File underlyingFile,
- final File rootDirectory )
- {
- final String filePath = underlyingFile.getPath();
- final CharSequence rootPath = rootDirectory == null ? ""
- : rootDirectory.getPath();
-
- file = underlyingFile;
- className = underlyingFile.getName();
- packageName = computePackageName( filePath,
- rootPath,
- className,
- System.getProperty( "file.separator" ) );
- lines = new ArrayList< String >();
- try
- {
- String[] linesArray;
- linesArray = FileUtils.readLines( underlyingFile );
- for ( final String string : linesArray )
- {
- lines.add( string );
- }
- }
- catch ( final IOException e )
- {
- LOGGER.warning( StackTraceUtils.print( e ) );
- }
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#contains(java.lang.String, int)
- */
- public final boolean contains( final String stringToLookup,
- final Set< Integer > linesToBeIgnored )
- {
- int lineIndex = 1;
- boolean found = false;
-
- for ( final String line : lines )
- {
- if ( doesCurrentLineContain( line,
- stringToLookup )
- && !linesToBeIgnored.contains( lineIndex ) )
- {
- found = true;
- break;
- }
- lineIndex++;
- }
- return found;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public final boolean equals( final Object obj )
- {
- return obj != null
- && obj instanceof AbstractFlexFile && hashCode() == ( ( AbstractFlexFile ) obj ).hashCode();
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getClassName()
- */
- public final String getClassName()
- {
- return className;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getCommentClosingTag()
- */
- public abstract String getCommentClosingTag();
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getCommentOpeningTag()
- */
- public abstract String getCommentOpeningTag();
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getFilename()
- */
- public final String getFilename()
- {
- return file.getName();
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getFilePath()
- */
- public final String getFilePath()
- {
- return file.toURI().getPath();
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getFullyQualifiedName()
- */
- public final String getFullyQualifiedName()
- {
- return ( StringUtils.isEmpty( packageName ) ? ""
- : packageName
- + "." )
- + className;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getLineAt(int)
- */
- public String getLineAt( final int lineIndex )
- {
- return lines.get( lineIndex - 1 );
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getLines()
- */
- public final List< String > getLines()
- {
- return lines;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getLinesNb()
- */
- public int getLinesNb()
- {
- return lines.size();
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getPackageName()
- */
- public final String getPackageName()
- {
- return packageName;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- return getFilePath().hashCode();
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#isMainApplication()
- */
- public abstract boolean isMainApplication();
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#isMxml()
- */
- public abstract boolean isMxml();
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/As3File.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/As3File.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/As3File.java
deleted file mode 100644
index d4a3c93..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/As3File.java
+++ /dev/null
@@ -1,86 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import java.io.File;
-
-import com.adobe.ac.pmd.files.IAs3File;
-
-/**
- * @author xagnetti
- */
-class As3File extends AbstractFlexFile implements IAs3File
-{
- /**
- * @param file
- * @param rootDirectory
- */
- protected As3File( final File file,
- final File rootDirectory )
- {
- super( file, rootDirectory );
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#getCommentClosingTag()
- */
- @Override
- public final String getCommentClosingTag()
- {
- return "*/";
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#getCommentOpeningTag()
- */
- @Override
- public final String getCommentOpeningTag()
- {
- return "/*";
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getSingleLineComment()
- */
- public String getSingleLineComment()
- {
- return "//";
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#isMainApplication()
- */
- @Override
- public final boolean isMainApplication()
- {
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#isMxml()
- */
- @Override
- public final boolean isMxml()
- {
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/FileUtils.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/FileUtils.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/FileUtils.java
deleted file mode 100644
index 12450f8..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/FileUtils.java
+++ /dev/null
@@ -1,163 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sourceforge.pmd.PMDException;
-
-import com.adobe.ac.ncss.filters.FlexFilter;
-import com.adobe.ac.pmd.files.IFlexFile;
-
-/**
- * @author xagnetti
- */
-public final class FileUtils
-{
- /**
- * @param source
- * @param sourceList
- * @param packageToExclude
- * @param excludePatterns
- * @return
- * @throws PMDException
- */
- public static Map< String, IFlexFile > computeFilesList( final File source,
- final List< File > sourceList,
- final String packageToExclude,
- final List< String > excludePatterns ) throws PMDException
- {
- final Map< String, IFlexFile > files = new LinkedHashMap< String, IFlexFile >();
- final FlexFilter flexFilter = new FlexFilter();
- final Collection< File > foundFiles = getFlexFiles( source,
- sourceList,
- flexFilter );
-
- for ( final File sourceFile : foundFiles )
- {
- final AbstractFlexFile file = create( sourceFile,
- source );
-
- if ( ( "".equals( packageToExclude ) || !file.getFullyQualifiedName().startsWith( packageToExclude ) )
- && !currentPackageIncludedInExcludePatterns( file.getFullyQualifiedName(),
- excludePatterns ) )
- {
- files.put( file.getFullyQualifiedName(),
- file );
- }
- }
-
- return files;
- }
-
- /**
- * @param sourceFile
- * @param sourceDirectory
- * @return
- */
- public static AbstractFlexFile create( final File sourceFile,
- final File sourceDirectory )
- {
- AbstractFlexFile file;
-
- if ( sourceFile.getName().endsWith( ".as" ) )
- {
- file = new As3File( sourceFile, sourceDirectory );
- }
- else
- {
- file = new MxmlFile( sourceFile, sourceDirectory );
- }
-
- return file;
- }
-
- /**
- * @param file
- * @return
- * @throws IOException
- */
- public static String[] readLines( final File file ) throws IOException
- {
- final List< String > lines = com.adobe.ac.ncss.utils.FileUtils.readFile( file );
-
- return lines.toArray( new String[ lines.size() ] );
- }
-
- private static boolean currentPackageIncludedInExcludePatterns( final String fullyQualifiedName,
- final List< String > excludePatterns )
- {
- if ( excludePatterns != null )
- {
- for ( final String excludePattern : excludePatterns )
- {
- if ( fullyQualifiedName.startsWith( excludePattern ) )
- {
- return true;
- }
- }
- }
- return false;
- }
-
- private static Collection< File > getFlexFiles( final File source,
- final List< File > sourceList,
- final FlexFilter flexFilter ) throws PMDException
- {
- if ( source == null
- && sourceList == null )
- {
- throw new PMDException( "sourceDirectory is not specified", null );
- }
- Collection< File > foundFiles;
- if ( source == null )
- {
- foundFiles = com.adobe.ac.ncss.utils.FileUtils.listFiles( sourceList,
- flexFilter,
- true );
- }
- else
- {
- if ( source.isDirectory() )
- {
- foundFiles = com.adobe.ac.ncss.utils.FileUtils.listFiles( source,
- flexFilter,
- true );
- }
- else
- {
- foundFiles = new ArrayList< File >();
- foundFiles.add( source );
- }
- }
- if ( foundFiles.isEmpty() )
- {
- return new ArrayList< File >();
- }
- return foundFiles;
- }
-
- private FileUtils()
- {
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/MxmlFile.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/MxmlFile.java b/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/MxmlFile.java
deleted file mode 100644
index 7438c53..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/com/adobe/ac/pmd/files/impl/MxmlFile.java
+++ /dev/null
@@ -1,334 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.adobe.ac.pmd.files.IMxmlFile;
-
-/**
- * @author xagnetti
- */
-class MxmlFile extends AbstractFlexFile implements IMxmlFile
-{
- private static final String METADATA_TAG = "Metadata";
- private String[] actualScriptBlock;
- private int endLine;
- private boolean mainApplication = false;
- private String[] scriptBlock;
- private int startLine;
-
- /**
- * @param file
- * @param rootDirectory
- */
- protected MxmlFile( final File file,
- final File rootDirectory )
- {
- super( file, rootDirectory );
-
- computeIfIsMainApplication();
- if ( getLinesNb() > 0 )
- {
- extractScriptBlock();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IMxmlFile#getActualScriptBlock()
- */
- public final String[] getActualScriptBlock()
- {
- return actualScriptBlock; // NOPMD
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IMxmlFile#getBeginningScriptBlock()
- */
- public int getBeginningScriptBlock()
- {
- return startLine;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#getCommentClosingTag()
- */
- @Override
- public final String getCommentClosingTag()
- {
- return "-->";
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#getCommentOpeningTag()
- */
- @Override
- public final String getCommentOpeningTag()
- {
- return "<!--";
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IMxmlFile#getEndingScriptBlock()
- */
- public int getEndingScriptBlock()
- {
- return endLine;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IMxmlFile#getScriptBlock()
- */
- public final String[] getScriptBlock()
- {
- return scriptBlock; // NOPMD by xagnetti on 7/7/09 3:15 PM
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.IFlexFile#getSingleLineComment()
- */
- public String getSingleLineComment()
- {
- return getCommentOpeningTag();
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#isMainApplication()
- */
- @Override
- public final boolean isMainApplication()
- {
- return mainApplication;
- }
-
- /*
- * (non-Javadoc)
- * @see com.adobe.ac.pmd.files.impl.AbstractFlexFile#isMxml()
- */
- @Override
- public final boolean isMxml()
- {
- return true;
- }
-
- private void computeIfIsMainApplication()
- {
- for ( final String line : getLines() )
- {
- if ( line.contains( "Application " )
- && line.charAt( 0 ) == '<' )
- {
- mainApplication = true;
- break;
- }
- }
- }
-
- private int computeScriptOffSet( final int startingLineIndex )
- {
- int currentLineIndex = startingLineIndex + 1;
- while ( getLines().get( currentLineIndex ).contains( "CDATA[" )
- || getLines().get( currentLineIndex ).contains( "//" ) || containsCloseComment( currentLineIndex )
- || getLines().get( currentLineIndex ).trim().equals( "" ) )
- {
- currentLineIndex++;
- }
- return currentLineIndex
- - startingLineIndex;
- }
-
- private boolean containsCloseComment( final int currentLineIndex )
- {
- final boolean closedAsComment = getLines().get( currentLineIndex ).contains( "/*" )
- && getLines().get( currentLineIndex ).contains( "*/" );
- final boolean closeMxmlComment = getLines().get( currentLineIndex ).contains( "<!--" )
- && getLines().get( currentLineIndex ).contains( "-->" );
- return closedAsComment
- || closeMxmlComment;
- }
-
- private void copyScriptLinesKeepingOriginalLineIndices()
- {
- final List< String > scriptLines = extractScriptLines();
- final List< String > metaDataLines = extractMetaDataLines();
- final String packageLine = "package "
- + getPackageName() + "{";
- final String classLine = "class "
- + getClassName().split( "\\." )[ 0 ] + "{";
-
- scriptLines.set( 0,
- packageLine );
-
- if ( metaDataLines.isEmpty()
- || metaDataLines.get( 0 ).compareTo( "HostComponent" ) == 0 )
- {
- if ( scriptLines.size() > 1 )
- {
- scriptLines.set( 1,
- classLine );
- }
- }
- else
- {
- final int firstMetaDataLine = getFirstMetaDataLine( getLines() );
-
- for ( int i = firstMetaDataLine; i < firstMetaDataLine
- + metaDataLines.size(); i++ )
- {
- scriptLines.set( i,
- metaDataLines.get( i
- - firstMetaDataLine ) );
- }
- scriptLines.set( firstMetaDataLine
- + metaDataLines.size(),
- classLine );
- }
-
- scriptLines.set( scriptLines.size() - 1,
- "}}" );
- scriptBlock = scriptLines.toArray( new String[ scriptLines.size() ] );
- }
-
- private List< String > extractMetaDataLines()
- {
- final ArrayList< String > metaDataLines = new ArrayList< String >();
- int currentLineIndex = 0;
- int start = 0;
- int end = 0;
-
- for ( final String line : getLines() )
- {
- if ( line.contains( METADATA_TAG ) )
- {
- if ( line.contains( "</" ) )
- {
- end = currentLineIndex
- - ( getLines().get( currentLineIndex - 1 ).contains( "]]>" ) ? 1
- : 0 );
- if ( line.contains( "<fx" )
- || line.contains( "<mx" ) )
- {
- start = end;
- }
- break;
- }
- if ( line.contains( "<" ) )
- {
- start = currentLineIndex
- + ( getLines().get( currentLineIndex + 1 ).contains( "CDATA[" ) ? 2
- : 1 );
- }
- }
- currentLineIndex++;
- }
- metaDataLines.addAll( getLines().subList( start,
- end ) );
- return metaDataLines;
- }
-
- private void extractScriptBlock()
- {
- int currentLineIndex = 0;
- startLine = 0;
- endLine = 0;
-
- for ( final String line : getLines() )
- {
- if ( line.contains( "Script" ) )
- {
- if ( line.contains( "</" ) )
- {
- endLine = currentLineIndex
- - ( getLines().get( currentLineIndex - 1 ).contains( "]]>" ) ? 1
- : 0 );
- break;
- }
- else if ( line.contains( "<" ) )
- {
- startLine = currentLineIndex
- + computeScriptOffSet( currentLineIndex );
- }
- }
- currentLineIndex++;
- }
-
- copyScriptLinesKeepingOriginalLineIndices();
- }
-
- private List< String > extractScriptLines()
- {
- final List< String > scriptLines = new ArrayList< String >();
-
- for ( int j = 0; j < startLine; j++ )
- {
- scriptLines.add( "" );
- }
- if ( startLine < endLine )
- {
- actualScriptBlock = getLines().subList( startLine,
- endLine ).toArray( new String[ endLine
- - startLine ] );
- scriptLines.addAll( new ArrayList< String >( getLines().subList( startLine,
- endLine ) ) );
- }
- for ( int j = endLine; j < getLines().size(); j++ )
- {
- scriptLines.add( "" );
- }
- return scriptLines;
- }
-
- private int getFirstMetaDataLine( final List< String > lines )
- {
- for ( int i = 0; i < lines.size(); i++ )
- {
- final String line = lines.get( i );
-
- if ( line.contains( METADATA_TAG )
- && line.contains( "<" ) )
- {
- return i;
- }
- }
- return 0;
- }
-
- // private String printMetaData( final List< String > metaDataLines )
- // {
- // final StringBuffer buffer = new StringBuffer();
- // if ( metaDataLines == null
- // || metaDataLines.isEmpty() )
- // {
- // return "";
- // }
- // for ( final String line : metaDataLines )
- // {
- // buffer.append( line );
- // }
- // return buffer + " ";
- // }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/main/java/net/sourceforge/pmd/PMDException.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/main/java/net/sourceforge/pmd/PMDException.java b/FlexPMD/flex-pmd-files/src/main/java/net/sourceforge/pmd/PMDException.java
deleted file mode 100644
index ce150c9..0000000
--- a/FlexPMD/flex-pmd-files/src/main/java/net/sourceforge/pmd/PMDException.java
+++ /dev/null
@@ -1,80 +0,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.
- */
-package net.sourceforge.pmd;
-
-/**
- * A convenience exception wrapper. Contains the original exception, if any.
- * Also, contains a severity number (int). Zero implies no severity. The higher
- * the number the greater the severity.
- *
- * @author Donald A. Leckie
- * @version $Revision: 5681 $, $Date: 2007-11-30 14:00:56 -0800 (Fri, 30 Nov
- * 2007) $
- * @since August 30, 2002
- */
-public class PMDException extends Exception
-{
- private static final long serialVersionUID = 6938647389367956874L;
-
- private int severity;
-
- /**
- * @param message
- */
- public PMDException( final String message )
- {
- super( message );
- }
-
- /**
- * @param message
- * @param reason
- */
- public PMDException( final String message,
- final Exception reason )
- {
- super( message, reason );
- }
-
- /**
- * Returns the cause of this exception or <code>null</code>
- *
- * @return the cause of this exception or <code>null</code>
- * @deprecated use {@link #getCause()} instead
- */
- @Deprecated
- public Exception getReason()
- {
- return ( Exception ) getCause();
- }
-
- /**
- * @return
- */
- public int getSeverity()
- {
- return severity;
- }
-
- /**
- * @param severityToBeSet
- */
- public void setSeverity( final int severityToBeSet )
- {
- severity = severityToBeSet;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/FlexPmdTestBaseTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/FlexPmdTestBaseTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/FlexPmdTestBaseTest.java
deleted file mode 100644
index 3fede84..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/FlexPmdTestBaseTest.java
+++ /dev/null
@@ -1,40 +0,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.
- */
-package com.adobe.ac.pmd;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-import com.adobe.ac.pmd.files.IFlexFile;
-
-public class FlexPmdTestBaseTest
-{
- @Test
- public void testSetTestFiles()
- {
- final FlexPmdTestBase testBase = new FlexPmdTestBase();
- final Map< String, IFlexFile > testFilesToBeSet = new LinkedHashMap< String, IFlexFile >();
-
- testBase.setTestFiles( testFilesToBeSet );
- Assert.assertEquals( testFilesToBeSet,
- testBase.getTestFiles() );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/ResourcesManagerTestTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/ResourcesManagerTestTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/ResourcesManagerTestTest.java
deleted file mode 100644
index fe4848a..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/ResourcesManagerTestTest.java
+++ /dev/null
@@ -1,32 +0,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.
- */
-package com.adobe.ac.pmd;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-public class ResourcesManagerTestTest
-{
- @Test
- public void testGetInstance()
- {
- final ResourcesManagerTest manager = ResourcesManagerTest.getInstance();
-
- Assert.assertNotNull( manager.getTestFiles() );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/MxmlFileTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/MxmlFileTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/MxmlFileTest.java
deleted file mode 100644
index 2193e78..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/MxmlFileTest.java
+++ /dev/null
@@ -1,150 +0,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.
- */
-package com.adobe.ac.pmd.files;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.adobe.ac.pmd.FlexPmdTestBase;
-
-public class MxmlFileTest extends FlexPmdTestBase
-{
- private IMxmlFile bug141;
- private IMxmlFile bug233a;
- private IMxmlFile bug233b;
- private IMxmlFile deleteRenderer;
- private IMxmlFile iterationsList;
- private IMxmlFile nestedComponent;
-
- @Before
- public void setUp()
- {
- bug141 = ( IMxmlFile ) getTestFiles().get( "bug.FlexPMD141a.mxml" );
- bug233a = ( IMxmlFile ) getTestFiles().get( "bug.FlexPMD233a.mxml" );
- bug233b = ( IMxmlFile ) getTestFiles().get( "bug.FlexPMD233b.mxml" );
- iterationsList = ( IMxmlFile ) getTestFiles().get( "com.adobe.ac.ncss.mxml.IterationsList.mxml" );
- nestedComponent = ( IMxmlFile ) getTestFiles().get( "com.adobe.ac.ncss.mxml.NestedComponent.mxml" );
- deleteRenderer = ( IMxmlFile ) getTestFiles().get( "DeleteButtonRenderer.mxml" );
- }
-
- @Test
- public void testCommentTags()
- {
- assertEquals( "<!--",
- iterationsList.getCommentOpeningTag() );
- assertEquals( "-->",
- iterationsList.getCommentClosingTag() );
- }
-
- @Test
- public void testFlexPMD141()
- {
- final String[] lines = bug141.getScriptBlock();
-
- assertEquals( "package bug{",
- lines[ 0 ] );
- assertEquals( "class FlexPMD141a{",
- lines[ 1 ] );
- assertEquals( Integer.valueOf( 46 ),
- Integer.valueOf( lines.length ) );
- assertEquals( "",
- lines[ 36 ] );
- assertEquals( "",
- lines[ 37 ] );
- assertEquals( "",
- lines[ 38 ] );
- assertEquals( "private var object:List = new List();",
- lines[ 39 ].trim() );
- assertEquals( "}}",
- lines[ lines.length - 1 ] );
- }
-
- @Test
- public void testFlexPMD233()
- {
- final String[] lines = bug233a.getScriptBlock();
-
- Assert.assertEquals( "",
- lines[ 47 ] );
-
- Assert.assertEquals( 80,
- bug233b.getActualScriptBlock().length );
- }
-
- @Test
- public void testGetActionScriptScriptBlock()
- {
- final String[] deleteRendererLines = deleteRenderer.getScriptBlock();
-
- assertEquals( "package {",
- deleteRendererLines[ 0 ] );
- assertEquals( " [Event(name=\"ruleRemoved\", type=\"flash.events.Event\")]",
- deleteRendererLines[ 43 ] );
- assertEquals( "class DeleteButtonRenderer{",
- deleteRendererLines[ 44 ] );
- assertEquals( Integer.valueOf( 115 ),
- Integer.valueOf( deleteRendererLines.length ) );
- assertEquals( " import com.adobe.ac.pmd.model.Rule;",
- deleteRendererLines[ 49 ] );
- assertEquals( "}}",
- deleteRendererLines[ deleteRendererLines.length - 1 ] );
- }
-
- @Test
- public void testGetMxmlScriptBlock()
- {
- final String[] iterationsListLines = iterationsList.getScriptBlock();
-
- assertEquals( "package com.adobe.ac.ncss.mxml{",
- iterationsListLines[ 0 ] );
- assertEquals( "class IterationsList{",
- iterationsListLines[ 1 ] );
- assertEquals( " import com.adobe.ac.anthology.model.object.IterationModelLocator;",
- iterationsListLines[ 40 ] );
- assertEquals( "}}",
- iterationsListLines[ iterationsListLines.length - 1 ] );
- assertEquals( Integer.valueOf( 104 ),
- Integer.valueOf( iterationsListLines.length ) );
- }
-
- @Test
- public void testGetMxmlScriptBlock2()
- {
- final String[] nestedLines = nestedComponent.getScriptBlock();
-
- assertEquals( "package com.adobe.ac.ncss.mxml{",
- nestedLines[ 0 ] );
- assertEquals( "class NestedComponent{",
- nestedLines[ 1 ] );
- assertEquals( Integer.valueOf( 57 ),
- Integer.valueOf( nestedLines.length ) );
- assertEquals( "}}",
- nestedLines[ nestedLines.length - 1 ] );
- }
-
- @Test
- public void testScriptBlockLines()
- {
- assertEquals( Integer.valueOf( 40 ),
- Integer.valueOf( iterationsList.getBeginningScriptBlock() ) );
- assertEquals( Integer.valueOf( 94 ),
- Integer.valueOf( iterationsList.getEndingScriptBlock() ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/AbstractFlexFileTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/AbstractFlexFileTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/AbstractFlexFileTest.java
deleted file mode 100644
index 7987d77..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/AbstractFlexFileTest.java
+++ /dev/null
@@ -1,157 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.FileNotFoundException;
-import java.net.URISyntaxException;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.Assert;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.adobe.ac.pmd.FlexPmdTestBase;
-import com.adobe.ac.pmd.files.IAs3File;
-import com.adobe.ac.pmd.files.IMxmlFile;
-
-public class AbstractFlexFileTest extends FlexPmdTestBase
-{
- private IAs3File as3;
- private IMxmlFile mainMxml;
- private IMxmlFile mxml;
-
- @Before
- public void init() throws FileNotFoundException,
- URISyntaxException
- {
- as3 = ( IAs3File ) getTestFiles().get( "AbstractRowData.as" );
- mainMxml = ( IMxmlFile ) getTestFiles().get( "Main.mxml" );
- mxml = ( IMxmlFile ) getTestFiles().get( "com.adobe.ac.ncss.mxml.IterationsList.mxml" );
- }
-
- @Test
- public void testContains()
- {
- assertTrue( as3.contains( "logger",
- buildSetContaining( 0 ) ) );
- assertFalse( as3.contains( "loggerr",
- buildSetContaining( 0 ) ) );
- assertFalse( as3.contains( "addEventListener",
- buildSetContaining( 109,
- 114 ) ) );
- }
-
- @Test
- public void testEquals()
- {
- Assert.assertTrue( as3.equals( as3 ) );
- Assert.assertFalse( mxml.equals( as3 ) );
- Assert.assertFalse( as3.equals( mxml ) );
- }
-
- @Test
- public void testFlexPMD152()
- {
- Assert.assertEquals( "com.something",
- AbstractFlexFile.computePackageName( "C:/somePath/ProjectName/com/something/Test.mxml",
- "C:/somePath/ProjectName",
- "Test.mxml",
- "/" ) );
-
- Assert.assertEquals( "com.something",
- AbstractFlexFile.computePackageName( "C:/somePath/ProjectName/com/something/Test.mxml",
- "C:/somePath/ProjectName/",
- "Test.mxml",
- "/" ) );
- }
-
- @Test
- public void testGetClassName()
- {
- assertEquals( "AbstractRowData.as",
- as3.getClassName() );
- assertEquals( "IterationsList.mxml",
- mxml.getClassName() );
- }
-
- @Test
- public void testGetFileName()
- {
- Assert.assertEquals( "AbstractRowData.as",
- as3.getFilename() );
- }
-
- @Test
- public void testGetFilePath()
- {
- assertNotNull( as3.getFilePath() );
- assertNotNull( mxml.getFilePath() );
- assertNotNull( mainMxml.getFilePath() );
- }
-
- @Test
- public void testGetPackageName()
- {
- assertEquals( "",
- as3.getPackageName() );
- assertEquals( "com.adobe.ac.ncss.mxml",
- mxml.getPackageName() );
- }
-
- @Test
- public void testGetPath()
- {
- assertEquals( "AbstractRowData.as",
- as3.getFullyQualifiedName() );
- assertEquals( "com.adobe.ac.ncss.mxml.IterationsList.mxml",
- mxml.getFullyQualifiedName() );
- }
-
- @Test
- public void testIsMainApplication()
- {
- assertFalse( as3.isMainApplication() );
- assertFalse( mxml.isMainApplication() );
- assertTrue( mainMxml.isMainApplication() );
- }
-
- @Test
- public void testIsMxml()
- {
- assertFalse( as3.isMxml() );
- assertTrue( mxml.isMxml() );
- }
-
- private Set< Integer > buildSetContaining( final int... lines )
- {
-
- final HashSet< Integer > hashSet = new HashSet< Integer >();
-
- for ( final int line : lines )
- {
- hashSet.add( line );
- }
- return hashSet;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/As3FileTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/As3FileTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/As3FileTest.java
deleted file mode 100644
index b15e413..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/As3FileTest.java
+++ /dev/null
@@ -1,64 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.adobe.ac.pmd.FlexPmdTestBase;
-import com.adobe.ac.pmd.files.IAs3File;
-
-public class As3FileTest extends FlexPmdTestBase
-{
- private IAs3File data;
-
- @Before
- public void setUp()
- {
- data = ( IAs3File ) getTestFiles().get( "AbstractRowData.as" );
- }
-
- @Test
- public void testGetCommentClosingTag()
- {
- assertEquals( "*/",
- data.getCommentClosingTag() );
- }
-
- @Test
- public void testGetCommentOpeningTag()
- {
- assertEquals( "/*",
- data.getCommentOpeningTag() );
- }
-
- @Test
- public void testGetLineAt()
- {
- assertEquals( " public const logger : ILogger;",
- data.getLineAt( 45 ) );
- }
-
- @Test
- public void testGetSingleLineComment()
- {
- assertEquals( "//",
- data.getSingleLineComment() );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FileUtilsTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FileUtilsTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FileUtilsTest.java
deleted file mode 100644
index b507a86..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FileUtilsTest.java
+++ /dev/null
@@ -1,115 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-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.IFlexFile;
-
-public class FileUtilsTest extends FlexPmdTestBase
-{
- @Test
- public void testComputeFilesList() throws PMDException
- {
- Map< String, IFlexFile > files;
- files = FileUtils.computeFilesList( getTestDirectory(),
- null,
- "",
- null );
-
- Assert.assertEquals( 105,
- files.size() );
-
- final List< String > excludePatterns = new ArrayList< String >();
- excludePatterns.add( "bug" );
- files = FileUtils.computeFilesList( getTestDirectory(),
- null,
- "",
- excludePatterns );
-
- Assert.assertEquals( 88,
- files.size() );
- }
-
- @Test
- public void testComputeFilesListWithEmptySourceFolder() throws PMDException
- {
- final Map< String, IFlexFile > files = FileUtils.computeFilesList( new File( getTestDirectory().getAbsolutePath()
- + "/" + "empty/emptyFolder" ),
- null,
- "",
- null );
-
- Assert.assertEquals( 1,
- files.size() );
- }
-
- @Test
- public void testComputeFilesListWithoutSource()
- {
- try
- {
- FileUtils.computeFilesList( null,
- null,
- "",
- null );
- Assert.fail();
- }
- catch ( final PMDException e )
- {
- Assert.assertEquals( "sourceDirectory is not specified",
- e.getMessage() );
- }
- }
-
- @Test
- public void testComputeFilesListWithSourceFile() throws PMDException
- {
- final Map< String, IFlexFile > files = FileUtils.computeFilesList( new File( getTestFiles().get( "AbstractRowData.as" )
- .getFilePath() ),
- null,
- "",
- null );
-
- Assert.assertEquals( 1,
- files.size() );
- }
-
- @Test
- public void testComputeFilesListWithSourceList() throws PMDException
- {
- final List< File > sourceList = new ArrayList< File >();
-
- sourceList.add( getTestDirectory() );
- final Map< String, IFlexFile > files = FileUtils.computeFilesList( null,
- sourceList,
- "",
- null );
-
- Assert.assertEquals( 105,
- files.size() );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FlexFileFactoryTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FlexFileFactoryTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FlexFileFactoryTest.java
deleted file mode 100644
index 842f3e6..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/FlexFileFactoryTest.java
+++ /dev/null
@@ -1,63 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-
-import org.junit.Test;
-
-import com.adobe.ac.pmd.FlexPmdTestBase;
-import com.adobe.ac.pmd.files.IAs3File;
-import com.adobe.ac.pmd.files.IFlexFile;
-import com.adobe.ac.pmd.files.IMxmlFile;
-
-public class FlexFileFactoryTest extends FlexPmdTestBase
-{
- @Test
- public void testCreate()
- {
- assertTrue( "",
- create( new File( getTestFiles().get( "AbstractRowData.as" ).getFilePath() ),
- new File( "" ) ) instanceof IAs3File );
- assertTrue( "",
- create( new File( getTestFiles().get( "Main.mxml" ).getFilePath() ),
- new File( "" ) ) instanceof IMxmlFile );
- assertTrue( "",
- create( new File( getTestFiles().get( "com.adobe.ac.ncss.mxml.IterationsList.mxml" )
- .getFilePath() ),
- new File( "" ) ) instanceof IMxmlFile );
- }
-
- private IFlexFile create( final File sourceFile,
- final File sourceDirectory )
- {
- IFlexFile file;
-
- if ( sourceFile.getName().endsWith( ".as" ) )
- {
- file = new As3File( sourceFile, sourceDirectory );
- }
- else
- {
- file = new MxmlFile( sourceFile, sourceDirectory );
- }
-
- return file;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/MxmlFileTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/MxmlFileTest.java b/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/MxmlFileTest.java
deleted file mode 100644
index e51bc29..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/com/adobe/ac/pmd/files/impl/MxmlFileTest.java
+++ /dev/null
@@ -1,50 +0,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.
- */
-package com.adobe.ac.pmd.files.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.adobe.ac.pmd.FlexPmdTestBase;
-import com.adobe.ac.pmd.files.IMxmlFile;
-
-public class MxmlFileTest extends FlexPmdTestBase
-{
- private IMxmlFile data;
-
- @Before
- public void setUp()
- {
- data = ( IMxmlFile ) getTestFiles().get( "Main.mxml" );
- }
-
- @Test
- public void testGetActualScriptBlock()
- {
- assertEquals( Integer.valueOf( 4 ),
- Integer.valueOf( data.getActualScriptBlock().length ) );
- }
-
- @Test
- public void testGetSingleLineComment()
- {
- assertEquals( "<!--",
- data.getSingleLineComment() );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-files/src/test/java/net/sourceforge/pmd/PMDExceptionTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-files/src/test/java/net/sourceforge/pmd/PMDExceptionTest.java b/FlexPMD/flex-pmd-files/src/test/java/net/sourceforge/pmd/PMDExceptionTest.java
deleted file mode 100644
index 550d982..0000000
--- a/FlexPMD/flex-pmd-files/src/test/java/net/sourceforge/pmd/PMDExceptionTest.java
+++ /dev/null
@@ -1,61 +0,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.
- */
-package net.sourceforge.pmd;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class PMDExceptionTest
-{
- @SuppressWarnings("deprecation")
- @Test
- public void testGetReason()
- {
- final Exception reason = new Exception();
- final PMDException exception = new PMDException( "message", reason );
-
- assertEquals( reason,
- exception.getReason() );
- }
-
- @Test
- public void testPMDExceptionString()
- {
- assertEquals( "message",
- new PMDException( "message" ).getMessage() );
- }
-
- @Test
- public void testPMDExceptionStringException()
- {
- final PMDException exception = new PMDException( "message", new Exception() );
-
- assertEquals( "message",
- exception.getMessage() );
- }
-
- @Test
- public void testSetSeverity()
- {
- final PMDException exception = new PMDException( "message" );
-
- exception.setSeverity( 1 );
- assertEquals( Integer.valueOf( 1 ),
- Integer.valueOf( exception.getSeverity() ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/.checkstyle
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-flex-lib/.checkstyle b/FlexPMD/flex-pmd-flex-lib/.checkstyle
deleted file mode 100644
index a34f4bb..0000000
--- a/FlexPMD/flex-pmd-flex-lib/.checkstyle
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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.
-
--->
-<fileset-config file-format-version="1.2.0" simple-config="true">
- <fileset name="all" enabled="true" check-config-name="Ac" local="false">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
-</fileset-config>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch b/FlexPMD/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch
deleted file mode 100644
index 850ec2f..0000000
--- a/FlexPMD/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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.
-
--->
-<launchConfiguration type="org.maven.ide.eclipse.Maven2BuilderConfigurationType">
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.maven.ide.eclipse.maven2Builder"/>
-<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
-</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/pom.xml
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-flex-lib/pom.xml b/FlexPMD/flex-pmd-flex-lib/pom.xml
deleted file mode 100644
index 618220b..0000000
--- a/FlexPMD/flex-pmd-flex-lib/pom.xml
+++ /dev/null
@@ -1,207 +0,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 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-flex-lib</artifactId>
- <packaging>swc</packaging>
- <name>Adobe Flex PMD Flex lib</name>
- <description>Adobe Flex PMD Flex library containing shared classes</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.version}</version>
- </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.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>
-
- <!-- 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>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${ant-run-plugin.version}</version>
- <executions>
- <execution>
- <id>copy-version-as</id>
- <phase>process-resources</phase>
- <configuration>
- <tasks>
- <tstamp>
- <format property="last.updated.date" pattern="yyyy-MM-dd" />
- <format property="last.updated.time" pattern="HH:mm:ss" />
- </tstamp>
- <echo message="Generating Version.as..." />
- <echo file="${basedir}/src/main/flex/Version.as" append="false" message="package" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message="{" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public class Version" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" {" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public static const BUILD_NUMBER : String = '${project.version}';" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public static const BUILD_TIME : String = '${last.updated.time}';" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public static const BUILD_DATE : String = '${last.updated.date}';" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" }" />
- <echo file="${basedir}/src/main/flex/Version.as" append="true" message="}" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </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>
- </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>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>surefire-reports</reportsDirectory>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>${project.groupId}</groupId>
- <artifactId>flex-pmd-maven-plugin</artifactId>
- <version>${project.parent.version}</version>
- <configuration>
- <failOnError>true</failOnError>
- </configuration>
- </plugin>
-
- </plugins>
- </reporting>
-
-</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as
deleted file mode 100644
index beb6097..0000000
--- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as
+++ /dev/null
@@ -1,26 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package com.adobe.ac.model
-{
-
- public interface IDomainModel
- {
- // Marker interface for Domain Model
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as
deleted file mode 100644
index f0ee7c2..0000000
--- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as
+++ /dev/null
@@ -1,26 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package com.adobe.ac.model
-{
-
- public interface IPresentationModel
- {
- // Marker interface for Presentation Model
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as
deleted file mode 100644
index 1e2d5d1..0000000
--- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as
+++ /dev/null
@@ -1,28 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package com.adobe.ac.pmd.api
-{
- import com.adobe.ac.pmd.model.Ruleset;
-
- public interface IGetRulesetContent
- {
- function getRulesetContent( ref : String ) : void;
- function onReceiveRulesetContent( ruleset : Ruleset ) : void;
- }
-}
\ No newline at end of file