diff --git a/deors.plugins.sonarqube.idemetadata-master/.gitignore b/deors.plugins.sonarqube.idemetadata-master/.gitignore new file mode 100644 index 0000000..beef00d --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/.gitignore @@ -0,0 +1,4 @@ +.classpath +.project +.settings +target diff --git a/deors.plugins.sonarqube.idemetadata-master/pom.xml b/deors.plugins.sonarqube.idemetadata-master/pom.xml new file mode 100644 index 0000000..ae603a6 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/pom.xml @@ -0,0 +1,168 @@ + + + + 4.0.0 + + deors.plugins.sonarqube.idemetadata + deors.plugins + deors.plugins.sonarqube.idemetadata + 1.0 + sonar-plugin + + + UTF-8 + + 1.8 + 5.1 + 1.0 + 1.7.5 + 1.2.16 + 1.4.3 + + 4.12 + + 0.7.5.201505241946 + ${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar + ${project.build.directory}/jacoco.exec + ${project.build.directory}/jacoco.itest + -javaagent:${jacoco.path}=destfile=${jacoco.utReport} + -javaagent:${jacoco.path}=destfile=${jacoco.itReport} + + 3.5 + + ${jacoco.itReport} + false + ${project.basedir}/findbugs-filter.xml + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + ${jacoco.utAgentConfig} + + **/it/*TestCase.java + + + + listener + org.sonar.java.jacoco.JUnitListener + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.18.1 + + ${jacoco.itAgentConfig} + + **/it/*TestCase.java + + + + + integration-test + integration-test + + integration-test + + + + + + org.codehaus.sonar + sonar-packaging-maven-plugin + 1.13 + true + + idemetadata + deors.plugins.sonarqube.idemetadata.IDEMetadataPlugin + SonarQube IDE Metadata plugin + Gathers and displays information from IDE metadata files, including project type (based on natures/facets) and dependencies. + + + + + + + + org.codehaus.sonar + sonar-plugin-api + ${sonarqube.version} + provided + + + + org.glassfish + javax.json + ${json.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + log4j + log4j + ${log4j.version} + + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + runtime + + + + + org.codehaus.sonar + sonar-testing-harness + ${sonarqube.version} + test + + + junit + junit + ${junit.version} + test + + + org.jacoco + org.jacoco.agent + ${jacoco.version} + runtime + test + + + org.sonarsource.java + sonar-jacoco-listeners + ${jacoco-listeners.version} + test + + + + diff --git a/deors.plugins.sonarqube.idemetadata-master/readme.md b/deors.plugins.sonarqube.idemetadata-master/readme.md new file mode 100644 index 0000000..031d07a --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/readme.md @@ -0,0 +1,28 @@ +deors.plugins.sonarqube.idemetadata +=================================== + +SonarQube IDE Metadata plugin gathers and displays information from IDE metadata files, +including project type (based on natures/facets) and dependencies. + +Introduction +------------ + +This is an example of a simple SonarQube plug-in that declares a few metrics at the +project level containing information extracted from IDE Metadata configuration files +(currently only Eclipse IDE is supported but other extractors can be easily created). + +To install this plug-in, follow these steps: + +A) Create the plug-in binary with this command: + + mvn clean package + +B) Copy the file to your SonarQube installation: + + copy target/deors.plugins.sonarqube.idemetadata-1.0.jar $SONARQUBE_HOME/extensions/plugins + +C) Restart SonarQube + +D) Add the widget to a dashboard + +E) Analyse a project and enjoy! diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataDashboardWidget.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataDashboardWidget.java new file mode 100644 index 0000000..c872020 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataDashboardWidget.java @@ -0,0 +1,57 @@ +package deors.plugins.sonarqube.idemetadata; + +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.Description; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.UserRole; + +/** + * IDE Metadata plugin widget definition. + * + * @author jorge.hidalgo + * @version 1.0 + */ +@UserRole(UserRole.USER) +@Description("Shows IDE metadata configuration for the project, including project type, language support and configured frameworks") +public class IDEMetadataDashboardWidget + extends AbstractRubyTemplate + implements RubyRailsWidget { + + /** + * Default constructor. + */ + public IDEMetadataDashboardWidget() { + super(); + } + + /** + * Returns the widget id. + * + * @return the widget id + */ + public String getId() { + return "idemetadata"; + } + + /** + * Returns the widget title. + * + * @return the widget title + */ + public String getTitle() { + return "IDE Metadata"; + } + + /** + * Returns the path to the widget Ruby file. + * + * @return the path to the widget Ruby file + */ + @Override + protected String getTemplatePath() { + String templatePath = "/deors/plugins/sonarqube/idemetadata/idemetadata_widget.html.erb"; + // uncomment next line to enable change reloading during development + //templatePath = "c:/projects/deors.plugins/deors.plugins.sonarqube.idemetadata/src/main/resources" + templatePath; + return templatePath; + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataMetrics.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataMetrics.java new file mode 100644 index 0000000..cdc85a0 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataMetrics.java @@ -0,0 +1,257 @@ +package deors.plugins.sonarqube.idemetadata; + +import java.util.Arrays; +import java.util.List; + +import org.sonar.api.measures.CoreMetrics; +import org.sonar.api.measures.Metric; +import org.sonar.api.measures.Metrics; + +/** + * IDE Metadata plugin metrics definition. + * + * @author jorge.hidalgo + * @version 1.0 + */ +public class IDEMetadataMetrics implements Metrics { + + /** + * The project name (as configured in the IDE). + */ + public static final Metric IDE_PRJ_NAME = + new Metric.Builder( + "ide_prj_name", + "Project name in IDE", + Metric.ValueType.STRING) + .setDescription("The project name (as configured in the IDE)") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as Java in the IDE. + */ + public static final Metric IDE_IS_JAVA = + new Metric.Builder( + "ide_is_java", + "Java project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as Java in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as EAR in the IDE. + */ + public static final Metric IDE_IS_EAR = + new Metric.Builder( + "ide_is_ear", + "Enterprise Application project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as EAR in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as EJB in the IDE. + */ + public static final Metric IDE_IS_EJB = + new Metric.Builder( + "ide_is_ejb", + "Enterprise JavaBeans project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as EJB in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as Web in the IDE. + */ + public static final Metric IDE_IS_WEB = + new Metric.Builder( + "ide_is_web", + "Web Application project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as Web in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as GWT in the IDE. + */ + public static final Metric IDE_IS_GWT = + new Metric.Builder( + "ide_is_gwt", + "Google Web Toolkit project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as GWT in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as GAE in the IDE. + */ + public static final Metric IDE_IS_GAE = + new Metric.Builder( + "ide_is_gae", + "Google App Engine project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as GAE in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as Groovy in the IDE. + */ + public static final Metric IDE_IS_GROOVY = + new Metric.Builder( + "ide_is_groovy", + "Groovy project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as Groovy in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as Grails in the IDE. + */ + public static final Metric IDE_IS_GRAILS = + new Metric.Builder( + "ide_is_grails", + "Grails project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as Grails in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as PDE in the IDE. + */ + public static final Metric IDE_IS_PDE = + new Metric.Builder( + "ide_is_pde", + "Eclipse Plugin Development project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as PDE in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Whether the project is configured as JET in the IDE. + */ + public static final Metric IDE_IS_JET = + new Metric.Builder( + "ide_is_jet", + "Java Emitter Templates project", + Metric.ValueType.BOOL) + .setDescription("Whether the project is configured as JET in the IDE") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * The list of declared dependencies for the project. + */ + public static final Metric IDE_DEPENDENCIES = + new Metric.Builder( + "ide_dependencies", + "List of declared dependencies", + Metric.ValueType.STRING) + .setDescription("The list of declared dependencies for the project") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * The list of configured classpath entries for the project. + */ + public static final Metric IDE_CLASSPATH = + new Metric.Builder( + "ide_classpath", + "List of configured classpath entries", + Metric.ValueType.STRING) + .setDescription("The list of configured classpath entries for the project") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /*add code for our project*/ + + public static final Metric IDE_FILE_NUMBER = + new Metric.Builder( + "ide_classpath", + "Number of project files", + Metric.ValueType.STRING) + .setDescription("Number of project files") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + public static final Metric IDE_CLASS_NUMBER = + new Metric.Builder( + "ide_classpath", + "Number of classes that is created in the project", + Metric.ValueType.STRING) + .setDescription("Number of classes that is created in the project") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + public static final Metric WA_IS_NAMEPBM = + new Metric.Builder( + "ide_classpath", + "List of problem that named badly", + Metric.ValueType.STRING) + .setDescription("List of problem that named badly for the showed information") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + public static final Metric WA_IS_COMMENTARY = + new Metric.Builder( + "ide_classpath", + "Problem caused by less or too much commentary of code", + Metric.ValueType.STRING) + .setDescription("Problem caused by less or too much commentary of code for the showed information") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + public static final Metric WA_IS_THREAT = + new Metric.Builder( + "ide_classpath", + "Potential threat caused by Bad programming style", + Metric.ValueType.STRING) + .setDescription("Problem caused by less or too much commentary of code for the showed information") + .setQualitative(false) + .setDomain(CoreMetrics.DOMAIN_GENERAL) + .create(); + + /** + * Default constructor. + */ + public IDEMetadataMetrics() { + super(); + } + + /** + * Defines the plugin metrics. + * + * @return the list of this plugin metrics + */ + public List getMetrics() { + return Arrays.asList( + IDE_PRJ_NAME, IDE_IS_JAVA, IDE_IS_EAR, IDE_IS_EJB, IDE_IS_WEB, + IDE_IS_GWT, IDE_IS_GAE, IDE_IS_GROOVY, IDE_IS_GRAILS, + IDE_IS_PDE, IDE_IS_JET, IDE_DEPENDENCIES, IDE_CLASSPATH); + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataPlugin.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataPlugin.java new file mode 100644 index 0000000..278d81a --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataPlugin.java @@ -0,0 +1,35 @@ +package deors.plugins.sonarqube.idemetadata; + +import java.util.Arrays; +import java.util.List; + +import org.sonar.api.Extension; +import org.sonar.api.SonarPlugin; + +/** + * IDE Metadata plugin definition. + * + * @author jorge.hidalgo + * @version 1.0 + */ +public class IDEMetadataPlugin extends SonarPlugin { + + /** + * Default constructor. + */ + public IDEMetadataPlugin() { + super(); + } + + /** + * Defines the plugin extensions: metrics, sensor and dashboard widget. + * + * @return the list of extensions for this plugin + */ + public List> getExtensions() { + return Arrays.asList( + IDEMetadataMetrics.class, + IDEMetadataSensor.class, + IDEMetadataDashboardWidget.class); + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataSensor.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataSensor.java new file mode 100644 index 0000000..a33ffef --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/IDEMetadataSensor.java @@ -0,0 +1,176 @@ +package deors.plugins.sonarqube.idemetadata; + +import java.io.File; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.sonar.api.batch.Sensor; +import org.sonar.api.batch.SensorContext; +import org.sonar.api.batch.fs.FileSystem; +import org.sonar.api.measures.Measure; +import org.sonar.api.resources.Project; + +import deors.plugins.sonarqube.idemetadata.analyzers.AnalyzerException; +import deors.plugins.sonarqube.idemetadata.analyzers.EclipseAnalyzer; +import deors.plugins.sonarqube.idemetadata.model.ProjectInfo; + +/** + * IDE Metadata plugin sensor. It analyses project directory in search for + * IDE metadata configuration files and extracts relevant information. + * + * @author jorge.hidalgo + * @version 1.0 + */ +public class IDEMetadataSensor implements Sensor { + + /** + * The file system object for the project being analysed. + */ + private final FileSystem fileSystem; + + /** + * The logger object for the sensor. + */ + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + /** + * Constructor that sets the file system object for the + * project being analysed. + * + * @param fileSystem the project file system + */ + public IDEMetadataSensor(FileSystem fileSystem) { + this.fileSystem = fileSystem; + } + + /** + * Determines whether the sensor should run or not for the given project. + * + * @param project the project being analysed + * @return always true + */ + public boolean shouldExecuteOnProject(Project project) { + // this sensor is executed on any type of project + return true; + } + + /** + * Analyses project directory in search for IDE metadata configuration files + * and extracts relevant information. + * + * @param project the project being analysed + * @param sensorContext the sensor context + */ + public void analyse(Project project, SensorContext sensorContext) { + + File rootDir = fileSystem.baseDir(); + + log.info("Analysing project root in search for IDE Metadata files: " + rootDir.getAbsolutePath()); + + EclipseAnalyzer analyzer = new EclipseAnalyzer(rootDir); + ProjectInfo projectInfo; + + try { + projectInfo = analyzer.analyze(); + + log.info("Analysis done"); + log.debug("this is what we've found: " + projectInfo); + + saveMainInfo(sensorContext, projectInfo); + saveDependencies(sensorContext, projectInfo); + saveClasspath(sensorContext, projectInfo); + + } catch (AnalyzerException ae) { + log.error("Error while running EclipseAnalyzer", ae); + } + } + + /** + * Saves measures corresponding to main project information. + * + * @param sensorContext the sensor context + * @param projectInfo the project information bean + */ + private void saveMainInfo(SensorContext sensorContext, ProjectInfo projectInfo) { + + log.debug("saving measures for main project information"); + + Measure measure; + + measure = new Measure(IDEMetadataMetrics.IDE_PRJ_NAME, projectInfo.getProjectName()); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_JAVA, projectInfo.isJavaProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_EAR, projectInfo.isEarProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_EJB, projectInfo.isEjbProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_WEB, projectInfo.isWebProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_GWT, projectInfo.isGwtProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_GAE, projectInfo.isGaeProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_GROOVY, projectInfo.isGroovyProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_GRAILS, projectInfo.isGrailsProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_PDE, projectInfo.isPdeProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + measure = new Measure(IDEMetadataMetrics.IDE_IS_JET, projectInfo.isJetProject() ? 1d : 0d); + sensorContext.saveMeasure(measure); + + log.debug("measures saved"); + } + + /** + * Saves measures corresponding to project dependencies information. + * + * @param sensorContext the sensor context + * @param projectInfo the project information bean + */ + private void saveDependencies(SensorContext sensorContext, ProjectInfo projectInfo) { + + log.debug("saving measure for project dependencies"); + + sensorContext.saveMeasure(new Measure( + IDEMetadataMetrics.IDE_DEPENDENCIES, projectInfo.getProjectDependencies().toString())); + + log.debug("measure saved"); + } + + /** + * Saves measures corresponding to project classpath information. + * + * @param sensorContext the sensor context + * @param projectInfo the project information bean + */ + private void saveClasspath(SensorContext sensorContext, ProjectInfo projectInfo) { + + log.debug("saving measure for project classpath"); + + sensorContext.saveMeasure(new Measure( + IDEMetadataMetrics.IDE_CLASSPATH, projectInfo.getProjectClasspath().toString())); + + log.debug("measure saved"); + } + + /** + * Returns the name of the sensor as it will be used in logs during analysis. + * + * @return the name of the sensor + */ + public String toString() { + return "IDEMetadataSensor"; + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/AnalyzerException.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/AnalyzerException.java new file mode 100644 index 0000000..cccf02b --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/AnalyzerException.java @@ -0,0 +1,50 @@ +package deors.plugins.sonarqube.idemetadata.analyzers; + +/** + * Analyzer Exception type. + * + * @author jorge.hidalgo + * @version 1.0 + */ +public class AnalyzerException extends Exception { + + /** + * Serialization id. + */ + private static final long serialVersionUID = -1644223223242751568L; + + /** + * Default constructor. + */ + public AnalyzerException() { + super(); + } + + /** + * Exception constructor from a given message. + * + * @param message the exception message + */ + public AnalyzerException(String message) { + super(message); + } + + /** + * Exception constructor from a given root cause. + * + * @param rootCause the exception root cause + */ + public AnalyzerException(Throwable rootCause) { + super(rootCause); + } + + /** + * Exception constructor from a given message and root cause. + * + * @param message the exception message + * @param rootCause the exception root cause + */ + public AnalyzerException(String message, Throwable rootCause) { + super(message, rootCause); + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/EclipseAnalyzer.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/EclipseAnalyzer.java new file mode 100644 index 0000000..c9b67bf --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/EclipseAnalyzer.java @@ -0,0 +1,297 @@ +package deors.plugins.sonarqube.idemetadata.analyzers; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import deors.plugins.sonarqube.idemetadata.model.ProjectInfo; + +/** + * Eclipse IDE Metadata Analyzer. + * + * This tool searches for project and classpath metadata generated by Eclipse IDE + * and derived IDE's and extracts the project basic information and dependencies. + * The tool detects Java, Web, EJB, EAR, Google Web Toolkit, Google App Engine, + * Groovy, Grails, Eclipse PDE and Eclipse JET projects. + * + * @author jorge.hidalgo + * @version 1.0 + */ +public class EclipseAnalyzer { + + /** + * The project root directory. + */ + private final File rootDir; + + /** + * Bean with analysis results. + */ + private ProjectInfo projectInfo; + + /** + * XPath expression used to parse Eclipse project files. + */ + private static final String XPATH_PROJECT_NAME = "/projectDescription/name/text()"; //$NON-NLS-1$ + + /** + * XPath expression used to parse Eclipse project files. + */ + private static final String XPATH_PROJECT_DEPENDENCIES = "/projectDescription/projects/project/text()"; //$NON-NLS-1$ + + /** + * XPath expression used to parse Eclipse project files. + */ + private static final String XPATH_PROJECT_NATURES = "/projectDescription/natures/nature/text()"; //$NON-NLS-1$ + + /** + * XPath expression used to parse Eclipse facet config files. + */ + private static final String XPATH_FACET_FIXED = "/faceted-project/fixed/@facet"; //$NON-NLS-1$ + + /** + * XPath expression used to parse Eclipse facet config files. + */ + private static final String XPATH_FACET_INSTALLED = "/faceted-project/installed/@facet"; //$NON-NLS-1$ + + /** + * XPath expression used to parse Eclipse classpath files. + */ + private static final String XPATH_CLASSPATH_LIB = "/classpath/classpathentry[@kind='lib']/@path"; //$NON-NLS-1$ + + /** + * XPath expression used to parse Eclipse classpath files. + */ + private static final String XPATH_CLASSPATH_SRC = "/classpath/classpathentry[@kind='src']/@path"; //$NON-NLS-1$ + + /** + * The Eclipse project file name. + */ + private static final String PROJECT_FILE = ".project"; //$NON-NLS-1$ + + /** + * The Eclipse classpath file name. + */ + private static final String CLASSPATH_FILE = ".classpath"; //$NON-NLS-1$ + + /** + * The WST facet configuration file name. + */ + private static final String FACET_CONFIG_FILE = ".settings\\org.eclipse.wst.common.project.facet.core.xml"; //$NON-NLS-1$ + + /** + * The logger. + */ + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + /** + * Analyzer constructor. + * + * @param rootDir the project root directory + */ + public EclipseAnalyzer(final File rootDir) { + super(); + this.rootDir = rootDir; + } + + /** + * Analyzes the metadata files. + * + * @return the project information extracted from metadata files + * @throws AnalyzerException any error occurred while analyzing the metadata + * files, typically a parsing error in XML files + */ + public ProjectInfo analyze() + throws AnalyzerException { + + projectInfo = new ProjectInfo(); + + analyzeProjectFile(); + analyzeFacetsFile(); + analyzeClasspathFile(); + + return projectInfo; + } + + /** + * Analyzes the .project file. + * + * @throws AnalyzerException any error occurred while analyzing the metadata + * files, typically a parsing error in XML files + */ + private void analyzeProjectFile() + throws AnalyzerException { + + List projectDependencies = new ArrayList<>(); + List projectNatures = new ArrayList<>(); + + try { + // parses .project file + File projectFile = new File(rootDir, PROJECT_FILE); + if (!projectFile.exists()) { + return; + } + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + DocumentBuilder builder = factory.newDocumentBuilder(); + XPathFactory xpathFactory = XPathFactory.newInstance(); + XPath xpath = xpathFactory.newXPath(); + + Document projectDocument = builder.parse(projectFile); + + // gets project name + XPathExpression xpathProjectName = xpath.compile(XPATH_PROJECT_NAME); + NodeList projectNameNodes = (NodeList) xpathProjectName.evaluate(projectDocument, XPathConstants.NODESET); + String projectName = projectNameNodes.item(0).getNodeValue(); + + log.debug("project name = " + projectName); + + // gets project dependencies + XPathExpression xpathProjectDependencies = xpath.compile(XPATH_PROJECT_DEPENDENCIES); + NodeList projectDependenciesNodes = (NodeList) xpathProjectDependencies.evaluate(projectDocument, XPathConstants.NODESET); + for (int i = 0, n = projectDependenciesNodes.getLength(); i < n; i++) { + String supplier = projectDependenciesNodes.item(i).getNodeValue(); + projectDependencies.add(supplier); + } + + // gets project natures + XPathExpression xpathProjectNatures = xpath.compile(XPATH_PROJECT_NATURES); + NodeList projectNaturesNodes = (NodeList) xpathProjectNatures.evaluate(projectDocument, XPathConstants.NODESET); + for (int i = 0, n = projectNaturesNodes.getLength(); i < n; i++) { + projectNatures.add(projectNaturesNodes.item(i).getNodeValue()); + } + + projectInfo.setProjectName(projectName); + projectInfo.setProjectDependencies(projectDependencies); + projectInfo.setProjectNatures(projectNatures); + + } catch (ParserConfigurationException | + SAXException | + XPathExpressionException | + IOException ex) { + log.error("error parsing project file", ex); + throw new AnalyzerException("error parsing project file", ex); + } + } + + /** + * Analyzes the facet configuration file. + * + * @throws AnalyzerException any error occurred while analyzing the metadata + * files, typically a parsing error in XML files + */ + private void analyzeFacetsFile() + throws AnalyzerException { + + List projectFacets = new ArrayList<>(); + + try { + // for faceted projects, parses facet config file + File facetConfigFile = new File(rootDir, FACET_CONFIG_FILE); + if (!facetConfigFile.exists()) { + return; + } + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + DocumentBuilder builder = factory.newDocumentBuilder(); + XPathFactory xpathFactory = XPathFactory.newInstance(); + XPath xpath = xpathFactory.newXPath(); + + Document facetConfigDocument = builder.parse(facetConfigFile); + + // get fixed facets + XPathExpression xpathFixedFacetEntry = xpath.compile(XPATH_FACET_FIXED); + NodeList fixedFacetEntryNodes = (NodeList) xpathFixedFacetEntry.evaluate(facetConfigDocument, XPathConstants.NODESET); + for (int i = 0, n = fixedFacetEntryNodes.getLength(); i < n; i++) { + projectFacets.add(fixedFacetEntryNodes.item(i).getNodeValue()); + } + + // get installed facets + XPathExpression xpathInstalledFacetEntry = xpath.compile(XPATH_FACET_INSTALLED); + NodeList installedFacetEntryNodes = (NodeList) xpathInstalledFacetEntry.evaluate(facetConfigDocument, XPathConstants.NODESET); + for (int i = 0, n = installedFacetEntryNodes.getLength(); i < n; i++) { + projectFacets.add(installedFacetEntryNodes.item(i).getNodeValue()); + } + + projectInfo.setProjectFacets(projectFacets); + + } catch (ParserConfigurationException | + SAXException | + XPathExpressionException | + IOException ex) { + log.error("error parsing project file", ex); + throw new AnalyzerException("error parsing project file", ex); + } + } + + /** + * Analyze the classpath file. + * + * @throws AnalyzerException any error occurred while analyzing the metadata + * files, typically a parsing error in XML files + */ + private void analyzeClasspathFile() + throws AnalyzerException { + + List projectClasspath = new ArrayList<>(); + + try { + // parses .classpath file + File classpathFile = new File(rootDir, CLASSPATH_FILE); + if (!classpathFile.exists()) { + return; + } + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + DocumentBuilder builder = factory.newDocumentBuilder(); + XPathFactory xpathFactory = XPathFactory.newInstance(); + XPath xpath = xpathFactory.newXPath(); + + Document classpathDocument = builder.parse(classpathFile); + + // get libraries in classpath + XPathExpression xpathClasspathLibEntry = xpath.compile(XPATH_CLASSPATH_LIB); + NodeList classpathLibEntryNodes = (NodeList) xpathClasspathLibEntry.evaluate(classpathDocument, XPathConstants.NODESET); + for (int i = 0, n = classpathLibEntryNodes.getLength(); i < n; i++) { + String libName = classpathLibEntryNodes.item(i).getNodeValue(); + projectClasspath.add(libName); + } + + // get source folders in classpath + XPathExpression xpathClasspathSrcEntry = xpath.compile(XPATH_CLASSPATH_SRC); + NodeList classpathSrcEntryNodes = (NodeList) xpathClasspathSrcEntry.evaluate(classpathDocument, XPathConstants.NODESET); + for (int i = 0, n = classpathSrcEntryNodes.getLength(); i < n; i++) { + String srcName = classpathSrcEntryNodes.item(i).getNodeValue(); + projectClasspath.add(srcName); + } + + projectInfo.setProjectClasspath(projectClasspath); + + } catch (ParserConfigurationException | + SAXException | + XPathExpressionException | + IOException ex) { + log.error("error parsing project file", ex); + throw new AnalyzerException("error parsing project file", ex); + } + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/package-info.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/package-info.java new file mode 100644 index 0000000..4a4d9d1 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/analyzers/package-info.java @@ -0,0 +1,8 @@ +/** + * Sonar IDE Metadata plugin analyzers package. Contains analyzers + * for different IDE metadata (currently only Eclipse is supported). + * + * @author jorge.hidalgo + * @version 1.0 + */ +package deors.plugins.sonarqube.idemetadata.analyzers; diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/model/ProjectInfo.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/model/ProjectInfo.java new file mode 100644 index 0000000..b600dac --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/model/ProjectInfo.java @@ -0,0 +1,595 @@ +package deors.plugins.sonarqube.idemetadata.model; + +import java.util.ArrayList; +import java.util.List; + +import javax.json.Json; +import javax.json.JsonArrayBuilder; +import javax.json.JsonObjectBuilder; + +/** + * The project information bean. + * + * @author jorge.hidalgo + * @version 1.2 + */ +public class ProjectInfo { + + /** + * An EAR nature identifier. + */ + static final String IBM_ETOOLS_EAR_NATURE = "com.ibm.etools.j2ee.EAR13Nature"; //$NON-NLS-1$ + + /** + * An EJB nature identifier. + */ + static final String IBM_ETOOLS_EJB_NATURE = "com.ibm.etools.j2ee.EJB2_0Nature"; //$NON-NLS-1$ + + /** + * A Java nature identifier. + */ + static final String IBM_ETOOLS_JAVA_NATURE = "com.ibm.etools.ctc.javaprojectnature"; //$NON-NLS-1$ + + /** + * A Web nature identifier. + */ + static final String IBM_ETOOLS_WEB_NATURE = "com.ibm.etools.j2ee.WebNature"; //$NON-NLS-1$ + + /** + * An EJB nature identifier. + */ + static final String IBM_WTP_EJB_NATURE = "com.ibm.wtp.ejb.EJBNature"; //$NON-NLS-1$ + + /** + * A Web nature identifier. + */ + static final String IBM_WTP_WEB_NATURE = "com.ibm.wtp.web.WebNature"; //$NON-NLS-1$ + + /** + * A Java nature identifier. + */ + static final String JAVA_NATURE = "org.eclipse.jdt.core.javanature"; //$NON-NLS-1$ + + /** + * A Faceted project nature identifier. + */ + static final String FACET_NATURE = "org.eclipse.wst.common.project.facet.core.nature"; //$NON-NLS-1$ + + /** + * A Google Web Toolkit nature identifier. + */ + static final String GWT_NATURE = "com.google.gwt.eclipse.core.gwtNature"; //$NON-NLS-1$ + + /** + * A Google App Engine nature identifier. + */ + static final String GAE_NATURE = "com.google.appengine.eclipse.core.gaeNature"; //$NON-NLS-1$ + + /** + * A Groovy nature identifier. + */ + static final String GROOVY_NATURE = "org.eclipse.jdt.groovy.core.groovyNature"; //$NON-NLS-1$ + + /** + * A Grails nature identifier. + */ + static final String GRAILS_NATURE = "com.springsource.sts.grails.core.nature"; //$NON-NLS-1$ + + /** + * An Eclipse plug-in nature identifier. + */ + static final String PDE_NATURE = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$ + + /** + * A JET nature identifier. + */ + static final String JET_NATURE = "org.eclipse.jet.jet2Nature"; //$NON-NLS-1$ + + /** + * A Web facet identifier. + */ + static final String WEB_FACET = "jst.web"; //$NON-NLS-1$ + + /** + * An EJB facet identifier. + */ + static final String EJB_FACET = "jst.ejb"; //$NON-NLS-1$ + + /** + * An EAR facet identifier. + */ + static final String EAR_FACET = "jst.ear"; //$NON-NLS-1$ + + /** + * A Grails facet identifier. + */ + static final String GRAILS_FACET = "grails.app"; //$NON-NLS-1$ + + /** + * The project classpath list. + */ + private List projectClasspath; + + /** + * The project dependencies list. + */ + private List projectDependencies; + + /** + * The project name. + */ + private String projectName; + + /** + * The project natures list. + */ + private List projectNatures; + + /** + * The project facets list. + */ + private List projectFacets; + + /** + * Default constructor. + */ + public ProjectInfo() { + + super(); + + this.projectName = "DEFAULT"; //$NON-NLS-1$ + this.projectClasspath = new ArrayList<>(); + this.projectDependencies = new ArrayList<>(); + this.projectNatures = new ArrayList<>(); + this.projectFacets = new ArrayList<>(); + } + + /** + * Constructor that sets the project name. + * + * @param projectName the project name + */ + public ProjectInfo(String projectName) { + + this(); + + this.projectName = projectName; + } + + /** + * Adds a project classpath entry. + * + * @param classpathEntry the classpath entry + */ + public void addProjectClasspathEntry(String classpathEntry) { + + projectClasspath.add(classpathEntry); + } + + /** + * Adds a project dependency. + * + * @param dependencyName the dependency name + */ + public void addProjectDependency(String dependencyName) { + + projectDependencies.add(dependencyName); + } + + /** + * Adds a project nature. + * + * @param natureName the nature name + */ + public void addProjectNature(String natureName) { + + projectNatures.add(natureName); + } + + /** + * Adds a project facet. + * + * @param facetName the facet name + */ + public void addProjectFacet(String facetName) { + + projectFacets.add(facetName); + } + + /** + * Compares equality between this object and the given object. + * + * @param target the object to compare with + * + * @return whether this object and the given object are equal + */ + public boolean equals(Object target) { + + if (target == null) { + return false; + } + + if (!(target instanceof ProjectInfo)) { + return false; + } + + ProjectInfo casted = (ProjectInfo) target; + + return projectName.equals(casted.projectName); + } + + /** + * Return the hash code of this object. It is calculated using + * the AND logical operator over property values. + * + * @return the hash code + */ + public int hashCode() { + + return projectName.hashCode(); + } + + /** + * Returns the value of the property projectClasspath. + * + * @return the value of the property + */ + public List getProjectClasspath() { + + return projectClasspath; + } + + /** + * Returns the value of the property projectDependencies. + * + * @return the value of the property + */ + public List getProjectDependencies() { + + return projectDependencies; + } + + /** + * Returns the value of the property projectName. + * + * @return the value of the property + */ + public String getProjectName() { + + return projectName; + } + + /** + * Returns the value of the property projectNatures. + * + * @return the value of the property + */ + public List getProjectNatures() { + + return projectNatures; + } + + /** + * Returns the value of the property projectFacets. + * + * @return the value of the property + */ + public List getProjectFacets() { + + return projectFacets; + } + + /** + * Returns whether the project has a Java nature. + * + * @return the Java nature flag + */ + public boolean isJavaProject() { + + for (String nature : projectNatures) { + if (JAVA_NATURE.equals(nature) + || IBM_ETOOLS_JAVA_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Returns whether the project has an EAR nature. + * + * @return the EAR nature flag + */ + public boolean isEarProject() { + + for (String nature : projectNatures) { + if (IBM_ETOOLS_EAR_NATURE.equals(nature)) { + return true; + } + } + + if (isFacetedProject()) { + for (String facet : projectFacets) { + if (EAR_FACET.equals(facet)) { + return true; + } + } + } + + return false; + } + + /** + * Returns whether the project has an EJB nature. + * + * @return the EJB nature flag + */ + public boolean isEjbProject() { + + for (String nature : projectNatures) { + if (IBM_ETOOLS_EJB_NATURE.equals(nature) + || IBM_WTP_EJB_NATURE.equals(nature)) { + return true; + } + } + + if (isFacetedProject()) { + for (String facet : projectFacets) { + if (EJB_FACET.equals(facet)) { + return true; + } + } + } + + return false; + } + + /** + * Returns whether the project has a Web nature. + * + * @return the Web nature flag + */ + public boolean isWebProject() { + + for (String nature : projectNatures) { + if (IBM_ETOOLS_WEB_NATURE.equals(nature) + || IBM_WTP_WEB_NATURE.equals(nature) + || GWT_NATURE.equals(nature) + || GRAILS_NATURE.equals(nature)) { + return true; + } + } + + if (isFacetedProject()) { + for (String facet : projectFacets) { + if (WEB_FACET.equals(facet) + || GRAILS_FACET.equals(facet)) { + return true; + } + } + } + + return false; + } + + /** + * Returns whether the project has a Faceted project nature. + * + * @return the Faceted project nature flag + */ + public boolean isFacetedProject() { + + for (String nature : projectNatures) { + if (FACET_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Returns whether the project has a GWT nature. + * + * @return the GWT nature flag + */ + public boolean isGwtProject() { + + for (String nature : projectNatures) { + if (GWT_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Returns whether the project has a GAE nature. + * + * @return the GAE nature flag + */ + public boolean isGaeProject() { + + for (String nature : projectNatures) { + if (GAE_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Returns whether the project has a Groovy nature. + * + * @return the Groovy nature flag + */ + public boolean isGroovyProject() { + + for (String nature : projectNatures) { + if (GROOVY_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Returns whether the project has a Grails nature. + * + * @return the Grails nature flag + */ + public boolean isGrailsProject() { + + for (String nature : projectNatures) { + if (GRAILS_NATURE.equals(nature)) { + return true; + } + } + + if (isFacetedProject()) { + for (String facet : projectFacets) { + if (GRAILS_FACET.equals(facet)) { + return true; + } + } + } + + return false; + } + + /** + * Returns whether the project has an Eclipse plug-in nature. + * + * @return the Eclipse plug-in nature flag + */ + public boolean isPdeProject() { + + for (String nature : projectNatures) { + if (PDE_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Returns whether the project has a JET nature. + * + * @return the GraiJETls nature flag + */ + public boolean isJetProject() { + + for (String nature : projectNatures) { + if (JET_NATURE.equals(nature)) { + return true; + } + } + + return false; + } + + /** + * Changes the value of the property projectClasspath. + * + * @param projectClasspath the new value for the property + */ + public void setProjectClasspath(List projectClasspath) { + + this.projectClasspath = projectClasspath; + } + + /** + * Changes the value of the property projectDependencies. + * + * @param projectDependencies the new value for the property + */ + public void setProjectDependencies(List projectDependencies) { + + this.projectDependencies = projectDependencies; + } + + /** + * Changes the value of the property projectName. + * + * @param projectName the new value for the property + */ + public void setProjectName(String projectName) { + + this.projectName = projectName; + } + + /** + * Changes the value of the property projectNatures. + * + * @param projectNatures the new value for the property + */ + public void setProjectNatures(List projectNatures) { + + this.projectNatures = projectNatures; + } + + /** + * Changes the value of the property projectFacets. + * + * @param projectFacets the new value for the property + */ + public void setProjectFacets(List projectFacets) { + + this.projectFacets = projectFacets; + } + + /** + * Returns a JSON representation of this object. + * + * @return the JSON representation + */ + public String toJson() { + + JsonObjectBuilder jsb = Json.createObjectBuilder() + .add("name", getProjectName()); //$NON-NLS-1$ + + if (!projectDependencies.isEmpty()) { + JsonArrayBuilder jab = Json.createArrayBuilder(); + for (String dep : projectDependencies) { + jab.add(dep); + } + jsb.add("dependencies", jab); //$NON-NLS-1$ + } + + jsb.add("isJava", isJavaProject()); //$NON-NLS-1$ + jsb.add("isEar", isEarProject()); //$NON-NLS-1$ + jsb.add("isEjb", isEjbProject()); //$NON-NLS-1$ + jsb.add("isWeb", isWebProject()); //$NON-NLS-1$ + jsb.add("isGwt", isGwtProject()); //$NON-NLS-1$ + jsb.add("isGae", isGaeProject()); //$NON-NLS-1$ + jsb.add("isGroovy", isGroovyProject()); //$NON-NLS-1$ + jsb.add("isGrails", isGrailsProject()); //$NON-NLS-1$ + jsb.add("isPde", isPdeProject()); //$NON-NLS-1$ + jsb.add("isJet", isJetProject()); //$NON-NLS-1$ + + return jsb.build().toString(); + } + + /** + * Returns a string representation of this object. + * + * @return the string representation + */ + public String toString() { + + return projectName + + " dependencies " //$NON-NLS-1$ + + projectDependencies + + " natures " //$NON-NLS-1$ + + projectNatures + + " facets " //$NON-NLS-1$ + + projectFacets + + " classpath " //$NON-NLS-1$ + + projectClasspath; + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/model/package-info.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/model/package-info.java new file mode 100644 index 0000000..613d89b --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/model/package-info.java @@ -0,0 +1,7 @@ +/** + * Contains model beans for IDE Metadata plugin. + * + * @author jorge.hidalgo + * @version 1.0 + */ +package deors.plugins.sonarqube.idemetadata.model; diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/package-info.java b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/package-info.java new file mode 100644 index 0000000..3d39240 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/java/deors/plugins/sonarqube/idemetadata/package-info.java @@ -0,0 +1,8 @@ +/** + * Sonar IDE Metadata plugin root package. Contains plugin definition, + * metrics definition, sensor and dashboard widget. + * + * @author jorge.hidalgo + * @version 1.0 + */ +package deors.plugins.sonarqube.idemetadata; diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/resources/.gitignore b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/.gitignore new file mode 100644 index 0000000..17ae84b --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/.gitignore @@ -0,0 +1 @@ +rebel.xml diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/resources/deors/plugins/sonarqube/idemetadata/idemetadata_widget.html.erb b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/deors/plugins/sonarqube/idemetadata/idemetadata_widget.html.erb new file mode 100644 index 0000000..cae3bba --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/deors/plugins/sonarqube/idemetadata/idemetadata_widget.html.erb @@ -0,0 +1,157 @@ +<% + def check_image(metric_or_measure) + html = '' + + if metric_or_measure.is_a? ProjectMeasure + m = metric_or_measure + elsif @snapshot + m = @snapshot.measure(metric_or_measure) + end + + if m.nil? + return '' + end + + if m && m.metric + if m.value == 1 + html = image_tag(url_for_static(:plugin => 'idemetadata', :path => 'check-round-yes-small.png'), :size => '16x16', :style => 'vertical-align:middle') + elsif + html = image_tag(url_for_static(:plugin => 'idemetadata', :path => 'check-round-no-small.png'), :size => '16x16', :style => 'vertical-align:middle') + end + end + + html + end + + def remove_brackets(metric_or_measure) + out = '' + + if metric_or_measure.is_a? ProjectMeasure + m = metric_or_measure + elsif @snapshot + m = @snapshot.measure(metric_or_measure) + end + + if m.nil? + return '' + end + + if m && m.metric + out = m.data[1..-2] + end + + out + end +%> +
+

Project name (as configured in the IDE):

+

+ + <%= format_measure('ide_prj_name') %> + +

+
+
+ + + + + + + +
+

Project type and active frameworks:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%= check_image('ide_is_java') -%> + Java VM +
+ <%= check_image('ide_is_ear') -%> + Java Enterprise Application (EAR) +
+ <%= check_image('ide_is_ejb') -%> + Enterprise JavaBeans (EJB) +
+ <%= check_image('ide_is_web') -%> + Web +
+ <%= check_image('ide_is_gwt') -%> + Google Web Toolkit +
+ <%= check_image('ide_is_gae') -%> + Google App Engine +
+ <%= check_image('ide_is_groovy') -%> + Groovy +
+ <%= check_image('ide_is_grails') -%> + Grails +
+ <%= check_image('ide_is_pde') -%> + Eclipse Plug-in +
+ <%= check_image('ide_is_jet') -%> + Eclipse JET code generator +
+
+

Declared dependencies:

+ + + <% remove_brackets('ide_dependencies').split(/, /).each do |it| %> + + + + <% end %> + +
+ <%= image_tag('bullet_black.png', :style => 'vertical-align:middle') -%> + <%= it -%> +
+
+

Configured source folders:

+ + + <% remove_brackets('ide_classpath').split(/, /).each do |it| %> + + + + <% end %> + +
+ <%= image_tag('bullet_black.png', :style => 'vertical-align:middle') -%> + <%= it -%> +
+
+
diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/resources/static/check-round-no-small.png b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/static/check-round-no-small.png new file mode 100644 index 0000000..39e8c98 Binary files /dev/null and b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/static/check-round-no-small.png differ diff --git a/deors.plugins.sonarqube.idemetadata-master/src/main/resources/static/check-round-yes-small.png b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/static/check-round-yes-small.png new file mode 100644 index 0000000..c11a0c5 Binary files /dev/null and b/deors.plugins.sonarqube.idemetadata-master/src/main/resources/static/check-round-yes-small.png differ diff --git a/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/IDEMetadataMetricsTest.java b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/IDEMetadataMetricsTest.java new file mode 100644 index 0000000..22c658a --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/IDEMetadataMetricsTest.java @@ -0,0 +1,20 @@ +package deors.plugins.sonarqube.idemetadata; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class IDEMetadataMetricsTest { + + public IDEMetadataMetricsTest() { + super(); + } + + @Test + public void testMetricsDefinition() { + + IDEMetadataMetrics metrics = new IDEMetadataMetrics(); + + assertEquals("plug-in should have 13 metrics defined", 13, metrics.getMetrics().size()); + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/IDEMetadataPluginTest.java b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/IDEMetadataPluginTest.java new file mode 100644 index 0000000..004e320 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/IDEMetadataPluginTest.java @@ -0,0 +1,20 @@ +package deors.plugins.sonarqube.idemetadata; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class IDEMetadataPluginTest { + + public IDEMetadataPluginTest() { + super(); + } + + @Test + public void testPluginDefinition() { + + IDEMetadataPlugin plugin = new IDEMetadataPlugin(); + + assertEquals("plug-in should have 3 extensions defined", 3, plugin.getExtensions().size()); + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/analyzers/EclipseAnalyzerTest.java b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/analyzers/EclipseAnalyzerTest.java new file mode 100644 index 0000000..e9ee0b0 --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/analyzers/EclipseAnalyzerTest.java @@ -0,0 +1,105 @@ +package deors.plugins.sonarqube.idemetadata.analyzers; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; + +import org.junit.Test; + +import deors.plugins.sonarqube.idemetadata.model.ProjectInfo; + + +public class EclipseAnalyzerTest { + public EclipseAnalyzerTest() { + super(); + } + + @Test + public void testMissingProject() throws AnalyzerException { + + EclipseAnalyzer ea = new EclipseAnalyzer(new File("missing-dir")); + + ProjectInfo projectInfo = ea.analyze(); + + assertFalse("project should not be Java", projectInfo.isJavaProject()); + } + + @Test + public void testUnfacetedJavaProject() throws URISyntaxException, AnalyzerException { + + URL settingsUrl = this.getClass().getResource("/project1"); + File settingsDir = new File(settingsUrl.toURI()); + + EclipseAnalyzer ea = new EclipseAnalyzer(settingsDir); + + ProjectInfo projectInfo = ea.analyze(); + + assertFalse("project should not be faceted", projectInfo.isFacetedProject()); + assertTrue("project should be Java", projectInfo.isJavaProject()); + } + + @Test + public void testFacetedJavaWebProject() throws URISyntaxException, AnalyzerException { + + URL settingsUrl = this.getClass().getResource("/project2"); + File settingsDir = new File(settingsUrl.toURI()); + + EclipseAnalyzer ea = new EclipseAnalyzer(settingsDir); + + ProjectInfo projectInfo = ea.analyze(); + + assertTrue("project should be faceted", projectInfo.isFacetedProject()); + assertTrue("project should be Java", projectInfo.isJavaProject()); + assertTrue("project should be Web", projectInfo.isWebProject()); + } + + @Test + public void testProjectWithDependencies() throws URISyntaxException, AnalyzerException { + + URL settingsUrl = this.getClass().getResource("/project3"); + File settingsDir = new File(settingsUrl.toURI()); + + EclipseAnalyzer ea = new EclipseAnalyzer(settingsDir); + + ProjectInfo projectInfo = ea.analyze(); + + assertFalse("project should have dependencies", projectInfo.getProjectDependencies().isEmpty()); + assertFalse("project should depend on classpath libraries", projectInfo.getProjectClasspath().isEmpty()); + } + + @Test(expected = AnalyzerException.class) + public void testProjectWithBadFiles1() throws URISyntaxException, AnalyzerException { + + URL settingsUrl = this.getClass().getResource("/badproject1"); + File settingsDir = new File(settingsUrl.toURI()); + + EclipseAnalyzer ea = new EclipseAnalyzer(settingsDir); + + ea.analyze(); + } + + @Test(expected = AnalyzerException.class) + public void testProjectWithBadFiles2() throws URISyntaxException, AnalyzerException { + + URL settingsUrl = this.getClass().getResource("/badproject2"); + File settingsDir = new File(settingsUrl.toURI()); + + EclipseAnalyzer ea = new EclipseAnalyzer(settingsDir); + + ea.analyze(); + } + + @Test(expected = AnalyzerException.class) + public void testProjectWithBadFiles3() throws URISyntaxException, AnalyzerException { + + URL settingsUrl = this.getClass().getResource("/badproject3"); + File settingsDir = new File(settingsUrl.toURI()); + + EclipseAnalyzer ea = new EclipseAnalyzer(settingsDir); + + ea.analyze(); + } +} diff --git a/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/model/ProjectInfoTest.java b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/model/ProjectInfoTest.java new file mode 100644 index 0000000..ace62cf --- /dev/null +++ b/deors.plugins.sonarqube.idemetadata-master/src/test/java/deors/plugins/sonarqube/idemetadata/model/ProjectInfoTest.java @@ -0,0 +1,3568 @@ +package deors.plugins.sonarqube.idemetadata.model; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Vector; +import org.junit.*; +import static org.junit.Assert.*; + +/** + * The class ProjectInfoTest contains tests for the class {@link ProjectInfo}. + * + * @generatedBy CodePro at 14/06/13 23:26 + * @author jorge.hidalgo + * @version $Revision: 1.0 $ + */ +public class ProjectInfoTest { + + private ProjectInfo fixture1; + + private ProjectInfo fixture2; + + private ProjectInfo fixture3; + + private ProjectInfo fixture4; + + private ProjectInfo fixture5; + + private ProjectInfo fixture6; + + private ProjectInfo fixture7; + + private ProjectInfo fixture8; + + private ProjectInfo fixture9; + + private ProjectInfo fixture10; + + private ProjectInfo fixture11; + + private ProjectInfo fixture12; + + public ProjectInfo getFixture3() { + if (fixture3 == null) { + fixture3 = new ProjectInfo("PRJ3"); + fixture3.addProjectDependency("DEP3"); + fixture3.addProjectNature(ProjectInfo.GAE_NATURE); + fixture3.addProjectNature(ProjectInfo.JAVA_NATURE); + fixture3.addProjectNature(ProjectInfo.FACET_NATURE); + fixture3.addProjectNature(ProjectInfo.GRAILS_NATURE); + fixture3.addProjectNature(ProjectInfo.GROOVY_NATURE); + fixture3.addProjectNature(ProjectInfo.GWT_NATURE); + fixture3.addProjectNature(ProjectInfo.JET_NATURE); + fixture3.addProjectNature(ProjectInfo.PDE_NATURE); + fixture3.addProjectFacet(ProjectInfo.EAR_FACET); + fixture3.addProjectFacet(ProjectInfo.EJB_FACET); + fixture3.addProjectFacet(ProjectInfo.WEB_FACET); + } + return fixture3; + } + + public ProjectInfo getFixture4() { + if (fixture4 == null) { + fixture4 = new ProjectInfo("PRJ4"); + fixture4.addProjectDependency("DEP4"); + fixture4.addProjectNature(ProjectInfo.IBM_ETOOLS_JAVA_NATURE); + fixture4.addProjectNature(ProjectInfo.IBM_ETOOLS_EAR_NATURE); + fixture4.addProjectNature(ProjectInfo.IBM_ETOOLS_EJB_NATURE); + } + return fixture4; + } + + public ProjectInfo getFixture5() { + if (fixture5 == null) { + fixture5 = new ProjectInfo("PRJ5"); + fixture5.addProjectDependency("DEP5"); + fixture5.addProjectNature(ProjectInfo.IBM_WTP_EJB_NATURE); + } + return fixture5; + } + + public ProjectInfo getFixture6() { + if (fixture6 == null) { + fixture6 = new ProjectInfo("PRJ6"); + fixture6.addProjectDependency("DEP6"); + fixture6.addProjectNature(ProjectInfo.FACET_NATURE); + fixture6.addProjectFacet(ProjectInfo.EJB_FACET); + } + return fixture6; + } + + public ProjectInfo getFixture7() { + if (fixture7 == null) { + fixture7 = new ProjectInfo("PRJ7"); + fixture7.addProjectDependency("DEP7"); + fixture7.addProjectNature(ProjectInfo.FACET_NATURE); + fixture7.addProjectFacet(ProjectInfo.EAR_FACET); + } + return fixture7; + } + + public ProjectInfo getFixture8() { + if (fixture8 == null) { + fixture8 = new ProjectInfo("PRJ8"); + fixture8.addProjectDependency("DEP8"); + fixture8.addProjectNature(ProjectInfo.GWT_NATURE); + } + return fixture8; + } + + public ProjectInfo getFixture9() { + if (fixture9 == null) { + fixture9 = new ProjectInfo("PRJ9"); + fixture9.addProjectDependency("DEP9"); + fixture9.addProjectNature(ProjectInfo.IBM_WTP_WEB_NATURE); + } + return fixture9; + } + + public ProjectInfo getFixture10() { + if (fixture10 == null) { + fixture10 = new ProjectInfo("PRJ10"); + fixture10.addProjectDependency("DEP10"); + fixture10.addProjectNature(ProjectInfo.IBM_ETOOLS_WEB_NATURE); + } + return fixture10; + } + + public ProjectInfo getFixture11() { + if (fixture11 == null) { + fixture11 = new ProjectInfo("PRJ11"); + fixture11.addProjectDependency("DEP11"); + fixture11.addProjectNature(ProjectInfo.FACET_NATURE); + fixture11.addProjectFacet(ProjectInfo.WEB_FACET); + } + return fixture11; + } + + public ProjectInfo getFixture12() { + if (fixture12 == null) { + fixture12 = new ProjectInfo("PRJ12"); + fixture12.addProjectDependency("DEP12"); + fixture12.addProjectNature(ProjectInfo.FACET_NATURE); + fixture12.addProjectFacet(ProjectInfo.GRAILS_FACET); + } + return fixture12; + } + + @Test + public void testisGaeProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isGaeProject(); + assertEquals(true, result); + } + + @Test + public void testisGaeProject_fixture4() + throws Exception { + ProjectInfo projectInfo = getFixture4(); + boolean result = projectInfo.isGaeProject(); + assertEquals(false, result); + } + + @Test + public void testIsEarProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isEarProject(); + assertEquals(true, result); + } + + @Test + public void testIsEarProject_fixture4() + throws Exception { + ProjectInfo projectInfo = getFixture4(); + boolean result = projectInfo.isEarProject(); + assertEquals(true, result); + } + + @Test + public void testIsEarProject_fixture6() + throws Exception { + ProjectInfo projectInfo = getFixture6(); + boolean result = projectInfo.isEarProject(); + assertEquals(false, result); + } + + @Test + public void testIsEarProject_fixture7() + throws Exception { + ProjectInfo projectInfo = getFixture7(); + boolean result = projectInfo.isEarProject(); + assertEquals(true, result); + } + + @Test + public void testIsEjbProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isEjbProject(); + assertEquals(true, result); + } + + @Test + public void testIsEjbProject_fixture4() + throws Exception { + ProjectInfo projectInfo = getFixture4(); + boolean result = projectInfo.isEjbProject(); + assertEquals(true, result); + } + + @Test + public void testIsEjbProject_fixture5() + throws Exception { + ProjectInfo projectInfo = getFixture5(); + boolean result = projectInfo.isEjbProject(); + assertEquals(true, result); + } + + @Test + public void testIsEjbProject_fixture7() + throws Exception { + ProjectInfo projectInfo = getFixture7(); + boolean result = projectInfo.isEjbProject(); + assertEquals(false, result); + } + + @Test + public void testIsFacetedProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isFacetedProject(); + assertEquals(true, result); + } + + @Test + public void testIsGrailsProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isGrailsProject(); + assertEquals(true, result); + } + + @Test + public void testIsGroovyProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isGroovyProject(); + assertEquals(true, result); + } + + @Test + public void testIsGwtProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isGwtProject(); + assertEquals(true, result); + } + + @Test + public void testIsJavaProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isJavaProject(); + assertEquals(true, result); + } + + @Test + public void testIsJavaProjectfixture4() + throws Exception { + ProjectInfo projectInfo = getFixture4(); + boolean result = projectInfo.isJavaProject(); + assertEquals(true, result); + } + + @Test + public void testIsJetProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isJetProject(); + assertEquals(true, result); + } + + @Test + public void testIsPdeProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isPdeProject(); + assertEquals(true, result); + } + + @Test + public void testIsWebProject_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + boolean result = projectInfo.isWebProject(); + assertEquals(true, result); + } + + @Test + public void testIsWebProject_fixture7() + throws Exception { + ProjectInfo projectInfo = getFixture7(); + boolean result = projectInfo.isWebProject(); + assertEquals(false, result); + } + + @Test + public void testIsWebProject_fixture8() + throws Exception { + ProjectInfo projectInfo = getFixture8(); + boolean result = projectInfo.isWebProject(); + assertEquals(true, result); + } + + @Test + public void testIsWebProject_fixture9() + throws Exception { + ProjectInfo projectInfo = getFixture9(); + boolean result = projectInfo.isWebProject(); + assertEquals(true, result); + } + + @Test + public void testIsWebProject_fixture10() + throws Exception { + ProjectInfo projectInfo = getFixture10(); + boolean result = projectInfo.isWebProject(); + assertEquals(true, result); + } + + @Test + public void testIsWebProject_fixture11() + throws Exception { + ProjectInfo projectInfo = getFixture11(); + boolean result = projectInfo.isWebProject(); + assertEquals(true, result); + } + + @Test + public void testIsGrailsProject_fixture11() + throws Exception { + ProjectInfo projectInfo = getFixture11(); + boolean result = projectInfo.isGrailsProject(); + assertEquals(false, result); + } + + @Test + public void testIsWebProject_fixture12() + throws Exception { + ProjectInfo projectInfo = getFixture12(); + boolean result = projectInfo.isWebProject(); + assertEquals(true, result); + } + + @Test + public void testIsGrailsProject_fixture12() + throws Exception { + ProjectInfo projectInfo = getFixture12(); + boolean result = projectInfo.isGrailsProject(); + assertEquals(true, result); + } + + @Test + public void testToJson_fixture3() + throws Exception { + ProjectInfo projectInfo = getFixture3(); + String result = projectInfo.toJson(); + assertEquals("{\"name\":\"PRJ3\",\"dependencies\":[\"DEP3\"],\"isJava\":true,\"isEar\":true,\"isEjb\":true,\"isWeb\":true,\"isGwt\":true,\"isGae\":true,\"isGroovy\":true,\"isGrails\":true,\"isPde\":true,\"isJet\":true}", result); + } + + /** + * Return an instance of the class being tested. + * + * @return an instance of the class being tested + * + * @see ProjectInfo + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + public ProjectInfo getFixture1() + throws Exception { + if (fixture1 == null) { + fixture1 = new ProjectInfo(""); + } + return fixture1; + } + + /** + * Return an instance of the class being tested. + * + * @return an instance of the class being tested + * + * @see ProjectInfo + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + public ProjectInfo getFixture2() + throws Exception { + if (fixture2 == null) { + fixture2 = new ProjectInfo(); + } + return fixture2; + } + + /** + * Run the ProjectInfo() constructor test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testProjectInfo_1() + throws Exception { + + ProjectInfo result = new ProjectInfo(); + + // add additional test code here + assertNotNull(result); + assertEquals("DEFAULT dependencies [] natures [] facets [] classpath []", result.toString()); + assertEquals("DEFAULT", result.getProjectName()); + assertEquals(false, result.isJavaProject()); + assertEquals(false, result.isFacetedProject()); + assertEquals(false, result.isGroovyProject()); + assertEquals(false, result.isEjbProject()); + assertEquals(false, result.isGwtProject()); + assertEquals(false, result.isEarProject()); + assertEquals("{\"name\":\"DEFAULT\",\"isJava\":false,\"isEar\":false,\"isEjb\":false,\"isWeb\":false,\"isGwt\":false,\"isGae\":false,\"isGroovy\":false,\"isGrails\":false,\"isPde\":false,\"isJet\":false}", result.toJson()); + assertEquals(false, result.isJetProject()); + assertEquals(false, result.isPdeProject()); + assertEquals(false, result.isWebProject()); + assertEquals(false, result.isGrailsProject()); + assertEquals(false, result.isGaeProject()); + } + + /** + * Run the ProjectInfo(String) constructor test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testProjectInfo_2() + throws Exception { + String projectName = ""; + + ProjectInfo result = new ProjectInfo(projectName); + + // add additional test code here + assertNotNull(result); + assertEquals(" dependencies [] natures [] facets [] classpath []", result.toString()); + assertEquals("", result.getProjectName()); + assertEquals(false, result.isJavaProject()); + assertEquals(false, result.isFacetedProject()); + assertEquals(false, result.isGroovyProject()); + assertEquals(false, result.isEjbProject()); + assertEquals(false, result.isGwtProject()); + assertEquals(false, result.isEarProject()); + assertEquals("{\"name\":\"\",\"isJava\":false,\"isEar\":false,\"isEjb\":false,\"isWeb\":false,\"isGwt\":false,\"isGae\":false,\"isGroovy\":false,\"isGrails\":false,\"isPde\":false,\"isJet\":false}", result.toJson()); + assertEquals(false, result.isJetProject()); + assertEquals(false, result.isPdeProject()); + assertEquals(false, result.isWebProject()); + assertEquals(false, result.isGrailsProject()); + assertEquals(false, result.isGaeProject()); + } + + /** + * Run the ProjectInfo(String) constructor test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testProjectInfo_3() + throws Exception { + String projectName = "0123456789"; + + ProjectInfo result = new ProjectInfo(projectName); + + // add additional test code here + assertNotNull(result); + assertEquals("0123456789 dependencies [] natures [] facets [] classpath []", result.toString()); + assertEquals("0123456789", result.getProjectName()); + assertEquals(false, result.isJavaProject()); + assertEquals(false, result.isFacetedProject()); + assertEquals(false, result.isGroovyProject()); + assertEquals(false, result.isEjbProject()); + assertEquals(false, result.isGwtProject()); + assertEquals(false, result.isEarProject()); + assertEquals("{\"name\":\"0123456789\",\"isJava\":false,\"isEar\":false,\"isEjb\":false,\"isWeb\":false,\"isGwt\":false,\"isGae\":false,\"isGroovy\":false,\"isGrails\":false,\"isPde\":false,\"isJet\":false}", result.toJson()); + assertEquals(false, result.isJetProject()); + assertEquals(false, result.isPdeProject()); + assertEquals(false, result.isWebProject()); + assertEquals(false, result.isGrailsProject()); + assertEquals(false, result.isGaeProject()); + } + + /** + * Run the void addProjectClasspathEntry(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectClasspathEntry_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + String classpathEntry = ""; + + fixture.addProjectClasspathEntry(classpathEntry); + + // add additional test code here + } + + /** + * Run the void addProjectClasspathEntry(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectClasspathEntry_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + String classpathEntry = "0123456789"; + + fixture.addProjectClasspathEntry(classpathEntry); + + // add additional test code here + } + + /** + * Run the void addProjectClasspathEntry(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectClasspathEntry_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + String classpathEntry = ""; + + fixture.addProjectClasspathEntry(classpathEntry); + + // add additional test code here + } + + /** + * Run the void addProjectClasspathEntry(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectClasspathEntry_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + String classpathEntry = "0123456789"; + + fixture.addProjectClasspathEntry(classpathEntry); + + // add additional test code here + } + + /** + * Run the void addProjectDependency(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectDependency_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + String dependencyName = ""; + + fixture.addProjectDependency(dependencyName); + + // add additional test code here + } + + /** + * Run the void addProjectDependency(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectDependency_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + String dependencyName = "0123456789"; + + fixture.addProjectDependency(dependencyName); + + // add additional test code here + } + + /** + * Run the void addProjectDependency(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectDependency_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + String dependencyName = ""; + + fixture.addProjectDependency(dependencyName); + + // add additional test code here + } + + /** + * Run the void addProjectDependency(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectDependency_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + String dependencyName = "0123456789"; + + fixture.addProjectDependency(dependencyName); + + // add additional test code here + } + + /** + * Run the void addProjectFacet(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectFacet_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + String facetName = ""; + + fixture.addProjectFacet(facetName); + + // add additional test code here + } + + /** + * Run the void addProjectFacet(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectFacet_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + String facetName = "0123456789"; + + fixture.addProjectFacet(facetName); + + // add additional test code here + } + + /** + * Run the void addProjectFacet(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectFacet_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + String facetName = ""; + + fixture.addProjectFacet(facetName); + + // add additional test code here + } + + /** + * Run the void addProjectFacet(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectFacet_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + String facetName = "0123456789"; + + fixture.addProjectFacet(facetName); + + // add additional test code here + } + + /** + * Run the void addProjectNature(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectNature_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + String natureName = ""; + + fixture.addProjectNature(natureName); + + // add additional test code here + } + + /** + * Run the void addProjectNature(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectNature_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + String natureName = "0123456789"; + + fixture.addProjectNature(natureName); + + // add additional test code here + } + + /** + * Run the void addProjectNature(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectNature_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + String natureName = ""; + + fixture.addProjectNature(natureName); + + // add additional test code here + } + + /** + * Run the void addProjectNature(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testAddProjectNature_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + String natureName = "0123456789"; + + fixture.addProjectNature(natureName); + + // add additional test code here + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + Object target = "1"; + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + Object target = null; + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + Object target = new ProjectInfo(""); + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(true, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + Object target = new ProjectInfo(); + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(true, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture2_3() + throws Exception { + ProjectInfo fixture = getFixture2(); + Object target = "1"; + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture1_3() + throws Exception { + ProjectInfo fixture = getFixture1(); + Object target = null; + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture2_4() + throws Exception { + ProjectInfo fixture = getFixture2(); + Object target = new ProjectInfo(""); + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean equals(Object) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testEquals_fixture1_4() + throws Exception { + ProjectInfo fixture = getFixture1(); + Object target = new ProjectInfo(); + + boolean result = fixture.equals(target); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the List getProjectClasspath() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectClasspath_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + List result = fixture.getProjectClasspath(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the List getProjectClasspath() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectClasspath_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + List result = fixture.getProjectClasspath(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the List getProjectDependencies() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectDependencies_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + List result = fixture.getProjectDependencies(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the List getProjectDependencies() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectDependencies_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + List result = fixture.getProjectDependencies(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the List getProjectFacets() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectFacets_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + List result = fixture.getProjectFacets(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the List getProjectFacets() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectFacets_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + List result = fixture.getProjectFacets(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the String getProjectName() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectName_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + String result = fixture.getProjectName(); + + // add additional test code here + assertEquals("", result); + } + + /** + * Run the String getProjectName() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectName_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + String result = fixture.getProjectName(); + + // add additional test code here + assertEquals("DEFAULT", result); + } + + /** + * Run the List getProjectNatures() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectNatures_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + List result = fixture.getProjectNatures(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the List getProjectNatures() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testGetProjectNatures_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + List result = fixture.getProjectNatures(); + + // add additional test code here + assertNotNull(result); + assertEquals(0, result.size()); + } + + /** + * Run the int hashCode() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testHashCode_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + int result = fixture.hashCode(); + + // add additional test code here + assertEquals(0, result); + } + + /** + * Run the int hashCode() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testHashCode_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + int result = fixture.hashCode(); + + // add additional test code here + assertEquals(-2032180703, result); + } + + /** + * Run the boolean isEarProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsEarProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isEarProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isEarProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsEarProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isEarProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isEjbProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsEjbProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isEjbProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isEjbProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsEjbProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isEjbProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isFacetedProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsFacetedProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isFacetedProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isFacetedProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsFacetedProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isFacetedProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGaeProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGaeProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isGaeProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGaeProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGaeProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isGaeProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGrailsProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGrailsProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isGrailsProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGrailsProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGrailsProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isGrailsProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGroovyProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGroovyProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isGroovyProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGroovyProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGroovyProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isGroovyProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGwtProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGwtProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isGwtProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isGwtProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsGwtProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isGwtProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isJavaProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsJavaProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isJavaProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isJavaProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsJavaProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isJavaProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isJetProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsJetProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isJetProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isJetProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsJetProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isJetProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isPdeProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsPdeProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isPdeProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isPdeProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsPdeProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isPdeProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isWebProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsWebProject_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + boolean result = fixture.isWebProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the boolean isWebProject() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testIsWebProject_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + boolean result = fixture.isWebProject(); + + // add additional test code here + assertEquals(false, result); + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectClasspath = new ArrayList(); + projectClasspath.add(""); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectClasspath = new ArrayList(); + projectClasspath.add(""); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectClasspath = new ArrayList(); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectClasspath = new LinkedList(); + projectClasspath.add(""); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_3() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectClasspath = new LinkedList(); + projectClasspath.add(""); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_3() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectClasspath = new LinkedList(); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_4() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectClasspath = new Vector(); + projectClasspath.add(""); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_4() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectClasspath = new Vector(); + projectClasspath.add(""); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_5() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectClasspath = new Vector(); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_5() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectClasspath = new ArrayList(); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_6() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectClasspath = new LinkedList(); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_6() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectClasspath = new Vector(); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_7() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectClasspath = new ArrayList(); + projectClasspath.add(""); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_7() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectClasspath = new ArrayList(); + projectClasspath.add(""); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_8() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectClasspath = new ArrayList(); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_8() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectClasspath = new LinkedList(); + projectClasspath.add(""); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_9() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectClasspath = new LinkedList(); + projectClasspath.add(""); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_9() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectClasspath = new LinkedList(); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_10() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectClasspath = new Vector(); + projectClasspath.add(""); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_10() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectClasspath = new Vector(); + projectClasspath.add(""); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_11() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectClasspath = new Vector(); + projectClasspath.add("0123456789"); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_11() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectClasspath = new ArrayList(); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture2_12() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectClasspath = new LinkedList(); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectClasspath(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectClasspath_fixture1_12() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectClasspath = new Vector(); + + fixture.setProjectClasspath(projectClasspath); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectDependencies = new ArrayList(); + projectDependencies.add(""); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectDependencies = new ArrayList(); + projectDependencies.add(""); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectDependencies = new ArrayList(); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectDependencies = new LinkedList(); + projectDependencies.add(""); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_3() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectDependencies = new LinkedList(); + projectDependencies.add(""); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_3() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectDependencies = new LinkedList(); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_4() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectDependencies = new Vector(); + projectDependencies.add(""); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_4() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectDependencies = new Vector(); + projectDependencies.add(""); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_5() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectDependencies = new Vector(); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_5() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectDependencies = new ArrayList(); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_6() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectDependencies = new LinkedList(); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_6() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectDependencies = new Vector(); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_7() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectDependencies = new ArrayList(); + projectDependencies.add(""); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_7() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectDependencies = new ArrayList(); + projectDependencies.add(""); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_8() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectDependencies = new ArrayList(); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_8() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectDependencies = new LinkedList(); + projectDependencies.add(""); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_9() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectDependencies = new LinkedList(); + projectDependencies.add(""); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_9() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectDependencies = new LinkedList(); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_10() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectDependencies = new Vector(); + projectDependencies.add(""); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_10() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectDependencies = new Vector(); + projectDependencies.add(""); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_11() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectDependencies = new Vector(); + projectDependencies.add("0123456789"); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_11() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectDependencies = new ArrayList(); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture2_12() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectDependencies = new LinkedList(); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectDependencies(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectDependencies_fixture1_12() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectDependencies = new Vector(); + + fixture.setProjectDependencies(projectDependencies); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectFacets = new ArrayList(); + projectFacets.add(""); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectFacets = new ArrayList(); + projectFacets.add(""); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectFacets = new ArrayList(); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectFacets = new LinkedList(); + projectFacets.add(""); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_3() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectFacets = new LinkedList(); + projectFacets.add(""); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_3() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectFacets = new LinkedList(); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_4() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectFacets = new Vector(); + projectFacets.add(""); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_4() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectFacets = new Vector(); + projectFacets.add(""); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_5() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectFacets = new Vector(); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_5() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectFacets = new ArrayList(); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_6() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectFacets = new LinkedList(); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_6() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectFacets = new Vector(); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_7() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectFacets = new ArrayList(); + projectFacets.add(""); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_7() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectFacets = new ArrayList(); + projectFacets.add(""); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_8() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectFacets = new ArrayList(); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_8() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectFacets = new LinkedList(); + projectFacets.add(""); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_9() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectFacets = new LinkedList(); + projectFacets.add(""); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_9() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectFacets = new LinkedList(); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_10() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectFacets = new Vector(); + projectFacets.add(""); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_10() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectFacets = new Vector(); + projectFacets.add(""); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_11() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectFacets = new Vector(); + projectFacets.add("0123456789"); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_11() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectFacets = new ArrayList(); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture2_12() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectFacets = new LinkedList(); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectFacets(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectFacets_fixture1_12() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectFacets = new Vector(); + + fixture.setProjectFacets(projectFacets); + + // add additional test code here + } + + /** + * Run the void setProjectName(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectName_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + String projectName = ""; + + fixture.setProjectName(projectName); + + // add additional test code here + } + + /** + * Run the void setProjectName(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectName_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + String projectName = "0123456789"; + + fixture.setProjectName(projectName); + + // add additional test code here + } + + /** + * Run the void setProjectName(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectName_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + String projectName = ""; + + fixture.setProjectName(projectName); + + // add additional test code here + } + + /** + * Run the void setProjectName(String) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectName_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + String projectName = "0123456789"; + + fixture.setProjectName(projectName); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectNatures = new ArrayList(); + projectNatures.add(""); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectNatures = new ArrayList(); + projectNatures.add(""); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_2() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectNatures = new ArrayList(); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_2() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectNatures = new LinkedList(); + projectNatures.add(""); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_3() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectNatures = new LinkedList(); + projectNatures.add(""); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_3() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectNatures = new LinkedList(); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_4() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectNatures = new Vector(); + projectNatures.add(""); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_4() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectNatures = new Vector(); + projectNatures.add(""); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_5() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectNatures = new Vector(); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_5() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectNatures = new ArrayList(); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_6() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectNatures = new LinkedList(); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_6() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectNatures = new Vector(); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_7() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectNatures = new ArrayList(); + projectNatures.add(""); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_7() + throws Exception { + ProjectInfo fixture = getFixture1(); + ArrayList projectNatures = new ArrayList(); + projectNatures.add(""); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_8() + throws Exception { + ProjectInfo fixture = getFixture2(); + ArrayList projectNatures = new ArrayList(); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_8() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectNatures = new LinkedList(); + projectNatures.add(""); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_9() + throws Exception { + ProjectInfo fixture = getFixture2(); + LinkedList projectNatures = new LinkedList(); + projectNatures.add(""); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_9() + throws Exception { + ProjectInfo fixture = getFixture1(); + LinkedList projectNatures = new LinkedList(); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_10() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectNatures = new Vector(); + projectNatures.add(""); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_10() + throws Exception { + ProjectInfo fixture = getFixture1(); + Vector projectNatures = new Vector(); + projectNatures.add(""); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_11() + throws Exception { + ProjectInfo fixture = getFixture2(); + Vector projectNatures = new Vector(); + projectNatures.add("0123456789"); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_11() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectNatures = new ArrayList(); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture2_12() + throws Exception { + ProjectInfo fixture = getFixture2(); + List projectNatures = new LinkedList(); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the void setProjectNatures(List) method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testSetProjectNatures_fixture1_12() + throws Exception { + ProjectInfo fixture = getFixture1(); + List projectNatures = new Vector(); + + fixture.setProjectNatures(projectNatures); + + // add additional test code here + } + + /** + * Run the String toJson() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testToJson_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + String result = fixture.toJson(); + + // add additional test code here + assertEquals("{\"name\":\"\",\"isJava\":false,\"isEar\":false,\"isEjb\":false,\"isWeb\":false,\"isGwt\":false,\"isGae\":false,\"isGroovy\":false,\"isGrails\":false,\"isPde\":false,\"isJet\":false}", result); + } + + /** + * Run the String toJson() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testToJson_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + String result = fixture.toJson(); + + // add additional test code here + assertEquals("{\"name\":\"DEFAULT\",\"isJava\":false,\"isEar\":false,\"isEjb\":false,\"isWeb\":false,\"isGwt\":false,\"isGae\":false,\"isGroovy\":false,\"isGrails\":false,\"isPde\":false,\"isJet\":false}", result); + } + + /** + * Run the String toString() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testToString_fixture1_1() + throws Exception { + ProjectInfo fixture = getFixture1(); + + String result = fixture.toString(); + + // add additional test code here + assertEquals(" dependencies [] natures [] facets [] classpath []", result); + } + + /** + * Run the String toString() method test. + * + * @throws Exception + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Test + public void testToString_fixture2_1() + throws Exception { + ProjectInfo fixture = getFixture2(); + + String result = fixture.toString(); + + // add additional test code here + assertEquals("DEFAULT dependencies [] natures [] facets [] classpath []", result); + } + + /** + * Perform pre-test initialization. + * + * @throws Exception + * if the initialization fails for some reason + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @Before + public void setUp() + throws Exception { + // add additional set up code here + } + + /** + * Perform post-test clean-up. + * + * @throws Exception + * if the clean-up fails for some reason + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + @After + public void tearDown() + throws Exception { + // Add additional tear down code here + } + + /** + * Launch the test. + * + * @param args the command line arguments + * + * @generatedBy CodePro at 26/06/13 21:36 + */ + public static void main(String[] args) { + new org.junit.runner.JUnitCore().run(ProjectInfoTest.class); + } +} diff --git a/类图和开发视图.vsdx b/类图和开发视图.vsdx new file mode 100644 index 0000000..95c006a Binary files /dev/null and b/类图和开发视图.vsdx differ