@@ -13,6 +13,7 @@ env: | |||
- JOB=ITS IT_CATEGORY=issue | |||
- JOB=ITS IT_CATEGORY=analysis | |||
- JOB=ITS IT_CATEGORY=administration | |||
- JOB=ITS IT_CATEGORY=batch | |||
- JOB=ITS IT_CATEGORY=server | |||
- JOB=ITS IT_CATEGORY=plugins | |||
- JOB=ITS IT_CATEGORY=qualitygate |
@@ -0,0 +1,38 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.sonarsource.it</groupId> | |||
<artifactId>it-plugins</artifactId> | |||
<version>5.2-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>access-secured-props-plugin</artifactId> | |||
<packaging>sonar-plugin</packaging> | |||
<name>Plugins :: Access Secured Properties</name> | |||
<version>1.0-SNAPSHOT</version> | |||
<description>Access .secured properties</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<version>${apiVersion}</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-packaging-maven-plugin</artifactId> | |||
<version>1.12.1</version> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<pluginClass>AccessSecuredPropsPlugin</pluginClass> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,12 @@ | |||
import org.sonar.api.SonarPlugin; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
public class AccessSecuredPropsPlugin extends SonarPlugin { | |||
public List getExtensions() { | |||
return Arrays.asList(AccessSecuredPropsSensor.class, AccessSecuredPropsTaskExtension.class); | |||
} | |||
} |
@@ -0,0 +1,31 @@ | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.Property; | |||
import org.sonar.api.batch.Sensor; | |||
import org.sonar.api.batch.SensorContext; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.resources.Project; | |||
@Properties({ | |||
@Property( | |||
key = "accessSecuredFromSensor", | |||
name = "Property to decide if sensor should access secured properties", | |||
defaultValue = "false") | |||
}) | |||
public class AccessSecuredPropsSensor implements Sensor { | |||
private Settings settings; | |||
public AccessSecuredPropsSensor(Settings settings) { | |||
this.settings = settings; | |||
} | |||
public boolean shouldExecuteOnProject(Project project) { | |||
return true; | |||
} | |||
public void analyse(Project project, SensorContext sensorContext) { | |||
if ("true".equals(settings.getString("accessSecuredFromSensor"))) { | |||
settings.getString("foo.bar.secured"); | |||
} | |||
} | |||
} |
@@ -0,0 +1,28 @@ | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.Property; | |||
import org.sonar.api.batch.Sensor; | |||
import org.sonar.api.batch.SensorContext; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.task.TaskExtension; | |||
import org.sonar.api.resources.Project; | |||
@Properties({ | |||
@Property( | |||
key = "accessSecuredFromTask", | |||
name = "Property to decide if task extension should access secured properties", | |||
defaultValue = "false") | |||
}) | |||
public class AccessSecuredPropsTaskExtension implements TaskExtension { | |||
private Settings settings; | |||
public AccessSecuredPropsTaskExtension(Settings settings) { | |||
this.settings = settings; | |||
} | |||
public void start() { | |||
if ("true".equals(settings.getString("accessSecuredFromTask"))) { | |||
settings.getString("foo.bar.secured"); | |||
} | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.sonarsource.it</groupId> | |||
<artifactId>it-plugins</artifactId> | |||
<version>5.2-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>batch-plugin</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>sonar-plugin</packaging> | |||
<name>SonarQube Integration Tests :: Plugins :: Batch</name> | |||
<description>Main plugin for batch tests</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<version>${apiVersion}</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-packaging-maven-plugin</artifactId> | |||
<version>1.12.1</version> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<pluginClass>com.sonarsource.BatchPlugin</pluginClass> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,17 @@ | |||
package com.sonarsource; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import org.sonar.api.SonarPlugin; | |||
public class BatchPlugin extends SonarPlugin { | |||
public List getExtensions() { | |||
return Arrays.asList( | |||
DumpSettingsInitializer.class, | |||
RaiseMessageException.class, | |||
TempFolderExtension.class | |||
); | |||
} | |||
} |
@@ -0,0 +1,43 @@ | |||
package com.sonarsource; | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.Property; | |||
import org.sonar.api.PropertyType; | |||
import org.sonar.api.batch.Initializer; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.resources.Project; | |||
import java.util.Map.Entry; | |||
import java.util.TreeMap; | |||
@Properties({ | |||
@Property( | |||
key = DumpSettingsInitializer.SONAR_SHOW_SETTINGS, | |||
type = PropertyType.BOOLEAN, | |||
name = "Property to decide if it should output settings", | |||
defaultValue = "false") | |||
}) | |||
public class DumpSettingsInitializer extends Initializer { | |||
public static final String SONAR_SHOW_SETTINGS = "sonar.showSettings"; | |||
private Settings settings; | |||
public DumpSettingsInitializer(Settings settings) { | |||
this.settings = settings; | |||
} | |||
@Override | |||
public boolean shouldExecuteOnProject(Project project) { | |||
return true; | |||
} | |||
@Override | |||
public void execute(Project project) { | |||
if (settings.getBoolean(SONAR_SHOW_SETTINGS)) { | |||
TreeMap<String, String> treemap = new TreeMap<String, String>(settings.getProperties()); | |||
for (Entry<String, String> prop : treemap.entrySet()) { | |||
System.out.println(" o " + project.getKey() + ":" + prop.getKey() + " = " + prop.getValue()); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
package com.sonarsource; | |||
import org.sonar.api.batch.Sensor; | |||
import org.sonar.api.batch.SensorContext; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.resources.Project; | |||
import org.sonar.api.utils.MessageException; | |||
public class RaiseMessageException implements Sensor { | |||
private final Settings settings; | |||
public RaiseMessageException(Settings settings) { | |||
this.settings = settings; | |||
} | |||
@Override | |||
public boolean shouldExecuteOnProject(Project project) { | |||
return settings.getBoolean("raiseMessageException"); | |||
} | |||
@Override | |||
public void analyse(Project project, SensorContext sensorContext) { | |||
throw MessageException.of("Error message from plugin"); | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
package com.sonarsource; | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.Property; | |||
import org.sonar.api.PropertyType; | |||
import org.sonar.api.batch.Initializer; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.resources.Project; | |||
import org.sonar.api.utils.TempFolder; | |||
@Properties({ | |||
@Property( | |||
key = TempFolderExtension.CREATE_TEMP_FILES, | |||
type = PropertyType.BOOLEAN, | |||
name = "Property to decide if it should create temp files", | |||
defaultValue = "false") | |||
}) | |||
public class TempFolderExtension extends Initializer { | |||
public static final String CREATE_TEMP_FILES = "sonar.createTempFiles"; | |||
private Settings settings; | |||
private TempFolder tempFolder; | |||
public TempFolderExtension(Settings settings, TempFolder tempFolder) { | |||
this.settings = settings; | |||
this.tempFolder = tempFolder; | |||
} | |||
@Override | |||
public boolean shouldExecuteOnProject(Project project) { | |||
return true; | |||
} | |||
@Override | |||
public void execute(Project project) { | |||
if (settings.getBoolean(CREATE_TEMP_FILES)) { | |||
System.out.println("Creating temp directory: " + tempFolder.newDir("sonar-it").getAbsolutePath()); | |||
System.out.println("Creating temp file: " + tempFolder.newFile("sonar-it", ".txt").getAbsolutePath()); | |||
} | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.sonarsource.it</groupId> | |||
<artifactId>it-plugins</artifactId> | |||
<version>5.2-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>crash-plugin</artifactId> | |||
<packaging>sonar-plugin</packaging> | |||
<name>Plugins :: Crash</name> | |||
<version>1.0-SNAPSHOT</version> | |||
<description>Crash on demand</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<version>${apiVersion}</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-packaging-maven-plugin</artifactId> | |||
<version>1.12.1</version> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<pluginClass>CrashPlugin</pluginClass> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,12 @@ | |||
import org.sonar.api.SonarPlugin; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
public class CrashPlugin extends SonarPlugin { | |||
public List getExtensions() { | |||
return Arrays.asList(CrashSensor.class); | |||
} | |||
} |
@@ -0,0 +1,31 @@ | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.Property; | |||
import org.sonar.api.batch.Sensor; | |||
import org.sonar.api.batch.SensorContext; | |||
import org.sonar.api.config.Settings; | |||
import org.sonar.api.resources.Project; | |||
@Properties({ | |||
@Property( | |||
key = "crash", | |||
name = "Property to decide if it crash or not", | |||
defaultValue = "false") | |||
}) | |||
public class CrashSensor implements Sensor { | |||
private Settings settings; | |||
public CrashSensor(Settings settings) { | |||
this.settings = settings; | |||
} | |||
public boolean shouldExecuteOnProject(Project project) { | |||
return true; | |||
} | |||
public void analyse(Project project, SensorContext sensorContext) { | |||
if ("true".equals(settings.getString("crash"))) { | |||
throw new RuntimeException("Crash!"); | |||
} | |||
} | |||
} |
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.sonarsource.it</groupId> | |||
<artifactId>it-plugins</artifactId> | |||
<version>5.2-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>extension-lifecycle-plugin</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>sonar-plugin</packaging> | |||
<description>Plugins :: Extension Lifecycle</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<version>${apiVersion}</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-packaging-maven-plugin</artifactId> | |||
<version>1.12.1</version> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<pluginClass>ExtensionLifecyclePlugin</pluginClass> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,53 @@ | |||
import org.sonar.api.BatchExtension; | |||
import org.sonar.api.batch.InstantiationStrategy; | |||
import org.sonar.api.config.Settings; | |||
@InstantiationStrategy(InstantiationStrategy.PER_BATCH) | |||
public class BatchService implements BatchExtension { | |||
private boolean started=false; | |||
private int projectServices=0; | |||
private Settings settings; | |||
public BatchService(Settings settings) { | |||
this.settings = settings; | |||
} | |||
public void start() { | |||
if (!settings.getBoolean("extension.lifecycle")) { | |||
return; | |||
} | |||
System.out.println("Start BatchService"); | |||
if (started) { | |||
throw new IllegalStateException("Already started"); | |||
} | |||
if (projectServices>0) { | |||
throw new IllegalStateException("BatchService must be started before ProjectServices"); | |||
} | |||
started=true; | |||
} | |||
public boolean isStarted() { | |||
return started; | |||
} | |||
public void stop() { | |||
if (!settings.getBoolean("extension.lifecycle")) { | |||
return; | |||
} | |||
System.out.println("Stop BatchService"); | |||
if (!started) { | |||
System.out.println("BatchService is not started !"); | |||
System.exit(1); | |||
} | |||
if (projectServices!=3) { | |||
// there are three maven modules in the project extension-lifecycle (pom + 2 modules) | |||
System.out.println("Invalid nb of ProjectServices: " + projectServices); | |||
System.exit(1); | |||
} | |||
started=false; | |||
} | |||
public void incrementProjectService() { | |||
projectServices++; | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
import org.sonar.api.SonarPlugin; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
public class ExtensionLifecyclePlugin extends SonarPlugin { | |||
public List getExtensions() { | |||
return Arrays.asList(BatchService.class, ProjectService.class, ServerService.class); | |||
} | |||
} |
@@ -0,0 +1,39 @@ | |||
import org.sonar.api.BatchExtension; | |||
import org.sonar.api.config.Settings; | |||
/** | |||
* As many instances as projects (maven modules) | |||
*/ | |||
public class ProjectService implements BatchExtension { | |||
private BatchService batchService; | |||
private Settings settings; | |||
public ProjectService(BatchService batchService, Settings settings) { | |||
this.batchService = batchService; | |||
this.settings = settings; | |||
} | |||
public void start() { | |||
if (!settings.getBoolean("extension.lifecycle")) { | |||
return; | |||
} | |||
System.out.println("Start ProjectService"); | |||
if (!batchService.isStarted()) { | |||
throw new IllegalStateException("ProjectService must be started after BatchService"); | |||
} | |||
batchService.incrementProjectService(); | |||
} | |||
public void stop() { | |||
if (!settings.getBoolean("extension.lifecycle")) { | |||
return; | |||
} | |||
System.out.println("Stop ProjectService"); | |||
if (!batchService.isStarted()) { | |||
System.out.println("ProjectService must be stopped before BatchService"); | |||
System.exit(1); | |||
} | |||
} | |||
} |
@@ -0,0 +1,4 @@ | |||
import org.sonar.api.ServerExtension; | |||
public class ServerService implements ServerExtension { | |||
} |
@@ -31,12 +31,18 @@ | |||
</properties> | |||
<modules> | |||
<module>access-secured-props-plugin</module> | |||
<module>batch-plugin</module> | |||
<module>crash-plugin</module> | |||
<module>extension-lifecycle-plugin</module> | |||
<module>global-property-change-plugin</module> | |||
<module>l10n-fr-pack</module> | |||
<module>license-plugin</module> | |||
<module>project-builder-plugin</module> | |||
<module>property-relocation-plugin</module> | |||
<module>property-sets-plugin</module> | |||
<module>server-plugin</module> | |||
<module>settings-encryption-plugin</module> | |||
<module>settings-plugin</module> | |||
<module>sonar-fake-plugin</module> | |||
<module>sonar-subcategories-plugin</module> |
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.sonarsource.it</groupId> | |||
<artifactId>it-plugins</artifactId> | |||
<version>5.2-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>project-builder-plugin</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>sonar-plugin</packaging> | |||
<description>Plugins :: Project Builder</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<version>${apiVersion}</version> | |||
<scope>provided</scope> | |||
</dependency> </dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-packaging-maven-plugin</artifactId> | |||
<version>1.12.1</version> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<pluginClass>ProjectBuilderPlugin</pluginClass> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,58 @@ | |||
import org.sonar.api.batch.bootstrap.ProjectBuilder; | |||
import org.sonar.api.batch.bootstrap.ProjectDefinition; | |||
import org.sonar.api.batch.bootstrap.ProjectReactor; | |||
import org.sonar.api.config.Settings; | |||
import java.io.File; | |||
/** | |||
* This plugin relates to projects/project-builder sample | |||
*/ | |||
public final class CreateSubProjects extends ProjectBuilder { | |||
private Settings settings; | |||
public CreateSubProjects(ProjectReactor reactor, Settings settings) { | |||
super(reactor); | |||
// A real implementation should for example use the configuration | |||
this.settings = settings; | |||
} | |||
@Override | |||
protected void build(ProjectReactor reactor) { | |||
if (!settings.getBoolean("sonar.enableProjectBuilder")) { | |||
return; | |||
} | |||
System.out.println("---> Creating sub-projects"); | |||
ProjectDefinition root = reactor.getRoot(); | |||
// add two modules | |||
createSubProjectWithSourceDir(root); | |||
createSubProjectWithSourceFiles(root); | |||
} | |||
private ProjectDefinition createSubProjectWithSourceDir(ProjectDefinition root) { | |||
File baseDir = new File(root.getBaseDir(), "module_a"); | |||
ProjectDefinition subProject = ProjectDefinition.create(); | |||
subProject.setBaseDir(baseDir).setWorkDir(new File(baseDir, "target/.sonar")); | |||
subProject.setKey("com.sonarsource.it.projects.batch:project-builder-module-a"); | |||
subProject.setVersion(root.getVersion()); | |||
subProject.setName("Module A"); | |||
subProject.setSourceDirs("src"); | |||
root.addSubProject(subProject); | |||
return subProject; | |||
} | |||
private ProjectDefinition createSubProjectWithSourceFiles(ProjectDefinition root) { | |||
File baseDir = new File(root.getBaseDir(), "module_b"); | |||
ProjectDefinition subProject = ProjectDefinition.create(); | |||
subProject.setBaseDir(baseDir).setWorkDir(new File(baseDir, "target/.sonar")); | |||
subProject.setKey("com.sonarsource.it.projects.batch:project-builder-module-b"); | |||
subProject.setVersion(root.getVersion()); | |||
subProject.setName("Module B"); | |||
subProject.addSourceFiles("src/HelloB.java"); | |||
root.addSubProject(subProject); | |||
return subProject; | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
import org.sonar.api.SonarPlugin; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
public class ProjectBuilderPlugin extends SonarPlugin { | |||
public List getExtensions() { | |||
return Arrays.asList(CreateSubProjects.class, RenameProject.class); | |||
} | |||
} |
@@ -0,0 +1,28 @@ | |||
import org.sonar.api.batch.bootstrap.ProjectBuilder; | |||
import org.sonar.api.batch.bootstrap.ProjectDefinition; | |||
import org.sonar.api.batch.bootstrap.ProjectReactor; | |||
import org.sonar.api.config.Settings; | |||
/** | |||
* This plugin relates to projects/project-builder sample | |||
*/ | |||
public final class RenameProject extends ProjectBuilder { | |||
private Settings settings; | |||
public RenameProject(ProjectReactor reactor, Settings settings) { | |||
super(reactor); | |||
this.settings = settings; | |||
} | |||
@Override | |||
protected void build(ProjectReactor reactor) { | |||
if (!settings.getBoolean("sonar.enableProjectBuilder")) { | |||
return; | |||
} | |||
System.out.println("---> Renaming project"); | |||
// change name of root project | |||
ProjectDefinition root = reactor.getRoot(); | |||
root.setName("Name changed by plugin"); | |||
} | |||
} |
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.sonarsource.it</groupId> | |||
<artifactId>it-plugins</artifactId> | |||
<version>5.2-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>settings-encryption-plugin</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>sonar-plugin</packaging> | |||
<description>Plugins :: Settings Encryption</description> | |||
<dependencies> | |||
<dependency> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<version>${apiVersion}</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.codehaus.sonar</groupId> | |||
<artifactId>sonar-packaging-maven-plugin</artifactId> | |||
<version>1.12.1</version> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<pluginClass>SettingsEncryptionPlugin</pluginClass> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,21 @@ | |||
import org.sonar.api.BatchExtension; | |||
import org.sonar.api.batch.InstantiationStrategy; | |||
import org.sonar.api.config.Settings; | |||
@InstantiationStrategy(InstantiationStrategy.PER_BATCH) | |||
public class EncryptionVerifier implements BatchExtension { | |||
private Settings settings; | |||
public EncryptionVerifier(Settings settings) { | |||
this.settings = settings; | |||
} | |||
public void start() { | |||
System.out.println("Start EncryptionVerifier"); | |||
String decryptedValue = settings.getString("encryptedProperty"); | |||
if (!"this is a secret".equals(decryptedValue)) { | |||
throw new IllegalStateException("The property 'encryptedProperty' can not be decrypted"); | |||
} | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
import org.sonar.api.SonarPlugin; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
public class SettingsEncryptionPlugin extends SonarPlugin { | |||
public List getExtensions() { | |||
return Arrays.asList(EncryptionVerifier.class); | |||
} | |||
} |
@@ -0,0 +1,5 @@ | |||
sonar.projectKey=case-sensitive-file-extensions | |||
sonar.projectName=Case Sensitive | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=src | |||
sonar.language=xoo |
@@ -0,0 +1,2 @@ | |||
File extension is upper case. | |||
It should not be ignored since SQ 4.0. |
@@ -0,0 +1 @@ | |||
ncloc:2 |
@@ -0,0 +1,10 @@ | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1 @@ | |||
ncloc:5 |
@@ -0,0 +1,2 @@ | |||
sonar.projectName=Module A | |||
sonar.moduleKey=com.sonarsource.it.samples:moduleA |
@@ -0,0 +1,16 @@ | |||
package com.sonar.it.samples.modules.a1; | |||
public class HelloA1 { | |||
private int i; | |||
private HelloA1() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " xoo"); | |||
} | |||
protected String getHello() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,2 @@ | |||
sonar.projectName=Module B | |||
sonar.moduleKey=com.sonarsource.it.samples:moduleB |
@@ -0,0 +1,12 @@ | |||
package com.sonar.it.samples.modules.a2; | |||
public class HelloA2 { | |||
private int i; | |||
private HelloA2() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " xoo"); | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,12 @@ | |||
# Root project information | |||
sonar.projectKey=com.sonarsource.it.samples:multi-modules-sample | |||
sonar.projectName=Sonar :: Integration Tests :: Multi-modules Sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.language=xoo | |||
# Some properties that will be inherited by the modules | |||
sonar.sources=src/main/xoo | |||
# List of the module identifiers | |||
sonar.modules=module_a,module_b |
@@ -0,0 +1,6 @@ | |||
sonar.projectKey=com.sonarsource.it.projects.batch:duplicate-source | |||
sonar.projectName=exclusions | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=src/main/xoo,src/main/xoo2 | |||
sonar.tests=src/test/xoo | |||
sonar.language=xoo |
@@ -0,0 +1,5 @@ | |||
package org.sonar.tests; | |||
public class ClassOne { | |||
} |
@@ -0,0 +1,5 @@ | |||
package org.sonar.tests; | |||
public class ClassOne { | |||
} |
@@ -0,0 +1,5 @@ | |||
package org.sonar.tests; | |||
public class ClassOne { | |||
} |
@@ -0,0 +1,14 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<artifactId>module_a</artifactId> | |||
<packaging>jar</packaging> | |||
<name>Module A</name> | |||
<parent> | |||
<groupId>com.sonarsource.it.projects.batch</groupId> | |||
<artifactId>extension-lifecycle</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
</parent> | |||
</project> |
@@ -0,0 +1,10 @@ | |||
public class HelloA { | |||
private int i; | |||
private HelloA() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " world"); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<artifactId>module_b</artifactId> | |||
<packaging>jar</packaging> | |||
<name>Module B</name> | |||
<parent> | |||
<groupId>com.sonarsource.it.projects.batch</groupId> | |||
<artifactId>extension-lifecycle</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
</parent> | |||
</project> |
@@ -0,0 +1,10 @@ | |||
public class HelloB { | |||
private int i; | |||
private HelloB() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " world"); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>com.sonarsource.it.projects.batch</groupId> | |||
<artifactId>extension-lifecycle</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>pom</packaging> | |||
<name>Sonar :: Integration Tests :: Extension Lifecycle Sample</name> | |||
<modules> | |||
<module>module_a</module> | |||
<module>module_b</module> | |||
</modules> | |||
</project> |
@@ -0,0 +1,31 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>com.sonarsource.it.samples</groupId> | |||
<artifactId>simple-sample</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<name>Sonar :: Integration Tests :: Simple Sample</name> | |||
<url>http://www.simplesample.org</url> | |||
<issueManagement> | |||
<system>jira</system> | |||
<url>http://jira.codehaus.org/browse/SIMPLESAMPLE</url> | |||
</issueManagement> | |||
<scm> | |||
<connection>scm:git:git@github.com:SonarSource/simplesample.git</connection> | |||
<developerConnection>scm:git:git@github.com:SonarSource/simplesample.git</developerConnection> | |||
<url>https://github.com/SonarSource/simplesample</url> | |||
</scm> | |||
<ciManagement> | |||
<system>bamboo</system> | |||
<url>http://bamboo.ci.codehaus.org/browse/SIMPLESAMPLE</url> | |||
</ciManagement> | |||
<properties> | |||
<!-- The following property MUST override the <url> definition of the POM --> | |||
<sonar.links.homepage>http://www.simplesample.org_OVERRIDDEN</sonar.links.homepage> | |||
</properties> | |||
</project> |
@@ -0,0 +1,11 @@ | |||
sonar.projectKey=com.sonarsource.it.samples:simple-sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.projectName=Sonar :: Integration Tests :: Simple Sample | |||
sonar.sources=src/main/java | |||
sonar.links.homepage=http://www.simplesample.org_OVERRIDDEN | |||
sonar.links.ci=http://bamboo.ci.codehaus.org/browse/SIMPLESAMPLE | |||
sonar.links.issue=http://jira.codehaus.org/browse/SIMPLESAMPLE | |||
sonar.links.scm=https://github.com/SonarSource/simplesample | |||
sonar.links.scm_dev=scm:git:git@github.com:SonarSource/simplesample.git |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>com.sonarsource.it.projects.batch.multi-languages</groupId> | |||
<artifactId>multi-languages</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>java-module</artifactId> | |||
<name>Java Module</name> | |||
<properties> | |||
<sonar.language>java</sonar.language> | |||
</properties> | |||
</project> |
@@ -0,0 +1,10 @@ | |||
public class HelloJava { | |||
private int i; | |||
private HelloJava() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " java"); | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>com.sonarsource.it.projects.batch.multi-languages</groupId> | |||
<artifactId>multi-languages</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>javascript-module</artifactId> | |||
<name>Javascript Module</name> | |||
<properties> | |||
<sonar.language>js</sonar.language> | |||
</properties> | |||
<build> | |||
<sourceDirectory>src</sourceDirectory> | |||
</build> | |||
</project> |
@@ -0,0 +1,14 @@ | |||
var Person = function(first, last, middle) { | |||
this.first = first; | |||
this.middle = middle; | |||
this.last = last; | |||
}; | |||
Person.prototype = { | |||
whoAreYou : function() { | |||
return this.first + (this.middle ? ' ' + this.middle: '') + ' ' + this.last; | |||
} | |||
}; |
@@ -0,0 +1,16 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>com.sonarsource.it.projects.batch.multi-languages</groupId> | |||
<artifactId>multi-languages</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>pom</packaging> | |||
<name>Multi Languages</name> | |||
<description>One language per module</description> | |||
<modules> | |||
<module>java-module</module> | |||
<module>javascript-module</module> | |||
<module>python-module</module> | |||
</modules> | |||
</project> |
@@ -0,0 +1,19 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>com.sonarsource.it.projects.batch.multi-languages</groupId> | |||
<artifactId>multi-languages</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>python-module</artifactId> | |||
<name>Python Module</name> | |||
<properties> | |||
<sonar.language>py</sonar.language> | |||
</properties> | |||
<build> | |||
<sourceDirectory>src</sourceDirectory> | |||
</build> | |||
</project> |
@@ -0,0 +1,92 @@ | |||
# fortune.py -- chooses a random fortune, as the fortune(8) program in | |||
# the BSD-games package does | |||
# | |||
# Copyright (c) 2010, Andrew M. Kuchling | |||
# | |||
# Permission is hereby granted, free of charge, to any person obtaining a copy | |||
# of this software and associated documentation files (the "Software"), to deal | |||
# in the Software without restriction, including without limitation the rights | |||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
# copies of the Software, and to permit persons to whom the Software is | |||
# furnished to do so, subject to the following conditions: | |||
# | |||
# The above copyright notice and this permission notice shall be included in | |||
# all copies or substantial portions of the Software. | |||
# | |||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
# THE SOFTWARE. | |||
import struct, random, string | |||
# C long variables are different sizes on 32-bit and 64-bit machines, | |||
# so we have to measure how big they are on the machine where this is running. | |||
LONG_SIZE = struct.calcsize('L') | |||
is_64_bit = (LONG_SIZE == 8) | |||
def get(filename): | |||
"Select a random quotation, using a pregenerated .dat file" | |||
# First, we open the .dat file, and read the header information. | |||
# The C structure containing this info looks like: | |||
## typedef struct { /* information table */ | |||
## #define VERSION 1 | |||
## unsigned long str_version; /* version number */ | |||
## unsigned long str_numstr; /* # of strings in the file */ | |||
## unsigned long str_longlen; /* length of longest string */ | |||
## unsigned long str_shortlen; /* length of shortest string */ | |||
## #define STR_RANDOM 0x1 /* randomized pointers */ | |||
## #define STR_ORDERED 0x2 /* ordered pointers */ | |||
## #define STR_ROTATED 0x4 /* rot-13'd text */ | |||
## unsigned long str_flags; /* bit field for flags */ | |||
## unsigned char stuff[4]; /* long aligned space */ | |||
## #define str_delim stuff[0] /* delimiting character */ | |||
## } STRFILE; | |||
datfile = open(filename+'.dat', 'r') | |||
data = datfile.read(5 * LONG_SIZE) | |||
if is_64_bit: | |||
v1, v2, n1, n2, l1, l2, s1, s2, f1, f2 = struct.unpack('!10L', data) | |||
version = v1 + (v2 << 32) | |||
numstr = n1 + (n2 << 32) | |||
longlen = l1 + (l2 << 32) | |||
shortlen = s1 + (s2 << 32) | |||
flags = f1 + (f2 << 32) | |||
else: | |||
version, numstr, longlen, shortlen, flags = struct.unpack('5l', data) | |||
delimiter = datfile.read(1) | |||
datfile.read(3) # Throw away padding bytes | |||
if is_64_bit: datfile.read(4) # 64-bit machines align to 8 bytes | |||
# Pick a random number | |||
r = random.randint(0, numstr) | |||
datfile.seek(LONG_SIZE * r, 1) # Seek to the chosen pointer | |||
data = datfile.read(LONG_SIZE * 2) | |||
if is_64_bit: | |||
s1, s2, e1, e2 = struct.unpack('!4L', data) | |||
start, end = s1 + (s2 << 32), e1 + (e2 << 32) | |||
else: | |||
start, end = struct.unpack('!ll', data) | |||
datfile.close() | |||
file = open(filename, 'r') | |||
file.seek(start) | |||
quotation = file.read(end-start) | |||
L=string.split(quotation, '\n') | |||
while string.strip(L[-1]) == delimiter or string.strip(L[-1]) == "": | |||
L=L[:-1] | |||
return string.join(L, '\n') | |||
if __name__ == '__main__': | |||
import sys | |||
if len(sys.argv) == 1: | |||
print 'Usage: fortune.py <filename>' | |||
sys.exit() | |||
print get(sys.argv[1]) |
@@ -0,0 +1,19 @@ | |||
sonar.projectKey=multi-languages | |||
sonar.projectName=Multi Languages | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.modules=java-module,javascript-module,python-module | |||
# not used but mandatory parameter because of https://jira.codehaus.org/browse/SONARPLUGINS-2297 | |||
sonar.sources=src | |||
java-module.sonar.projectName=Java Module | |||
java-module.sonar.sources=src/main/java | |||
java-module.sonar.language=java | |||
javascript-module.sonar.projectName=Javascript Module | |||
javascript-module.sonar.sources=src | |||
javascript-module.sonar.language=js | |||
python-module.sonar.projectName=Python Module | |||
python-module.sonar.sources=src | |||
python-module.sonar.language=py |
@@ -0,0 +1,2 @@ | |||
sonar.projectName=Module A | |||
sonar.moduleKey=com.sonarsource.it.samples:moduleA |
@@ -0,0 +1,16 @@ | |||
package com.sonar.it.samples.modules.a1; | |||
public class HelloA1 { | |||
private int i; | |||
private HelloA1() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " xoo"); | |||
} | |||
protected String getHello() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,2 @@ | |||
sonar.projectName=Module B | |||
sonar.moduleKey=com.sonarsource.it.samples:moduleB |
@@ -0,0 +1,12 @@ | |||
package com.sonar.it.samples.modules.a2; | |||
public class HelloA2 { | |||
private int i; | |||
private HelloA2() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " xoo"); | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,12 @@ | |||
# Root project information | |||
sonar.projectKey=projectAB | |||
sonar.projectName=Project AB | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.language=xoo | |||
# Some properties that will be inherited by the modules | |||
sonar.sources=src/main/xoo | |||
# List of the module identifiers | |||
sonar.modules=module_a,module_b |
@@ -0,0 +1,2 @@ | |||
sonar.projectName=Module A | |||
sonar.moduleKey=com.sonarsource.it.samples:moduleA |
@@ -0,0 +1,16 @@ | |||
package com.sonar.it.samples.modules.a1; | |||
public class HelloA1 { | |||
private int i; | |||
private HelloA1() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " xoo"); | |||
} | |||
protected String getHello() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,2 @@ | |||
sonar.projectName=Module C | |||
sonar.moduleKey=com.sonarsource.it.samples:moduleC |
@@ -0,0 +1,12 @@ | |||
package com.sonar.it.samples.modules.a2; | |||
public class HelloA2 { | |||
private int i; | |||
private HelloA2() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " xoo"); | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,12 @@ | |||
# Root project information | |||
sonar.projectKey=projectAC | |||
sonar.projectName=Project AC | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.language=xoo | |||
# Some properties that will be inherited by the modules | |||
sonar.sources=src/main/xoo | |||
# List of the module identifiers | |||
sonar.modules=module_a,module_c |
@@ -0,0 +1,10 @@ | |||
public class HelloA { | |||
private int i; | |||
private HelloA() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " world"); | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
public class HelloB { | |||
private int i; | |||
private HelloB() { | |||
} | |||
public void hello() { | |||
System.out.println("hello" + " world"); | |||
} | |||
} |
@@ -0,0 +1 @@ | |||
this file has been selected by the extension CreateSubProjects. |
@@ -0,0 +1,15 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>com.sonarsource.it.projects.batch</groupId> | |||
<artifactId>project-builder</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<packaging>pom</packaging> | |||
<name>Sonar :: Integration Tests :: Project Builder Sample</name> | |||
<!-- modules are not defined in pom but in sonar plugin --> | |||
<!-- <modules> | |||
<module>module_a</module> | |||
<module>module_b</module> | |||
</modules>--> | |||
</project> |
@@ -0,0 +1,5 @@ | |||
sonar.projectKey=sample | |||
sonar.projectName=Sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=src/main/xoo | |||
sonar.language=xoo |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1 @@ | |||
ncloc:8 |
@@ -0,0 +1,5 @@ | |||
sonar.projectKey=sample | |||
sonar.projectName=Sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=src/main/xoo | |||
sonar.language=xoo |
@@ -0,0 +1,14 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
System.out.println("foo"); | |||
} | |||
private String myMethod() { | |||
System.out.println("foo"); | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1 @@ | |||
ncloc:10 |
@@ -0,0 +1,5 @@ | |||
sonar.projectKey=sample | |||
sonar.projectName=Sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=src/main/xoo | |||
sonar.language=xoo |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class ClassAdded { | |||
public ClassAdded(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,3 @@ | |||
ncloc:12 | |||
classes:1 | |||
@@ -0,0 +1,16 @@ | |||
package sample; | |||
public class ClassToModify { | |||
public ClassToModify(int i) { | |||
int j = i++; | |||
} | |||
public String addedMethod() { | |||
return "This method was added in v2"; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,3 @@ | |||
ncloc:16 | |||
classes:1 | |||
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class ClassToModify { | |||
public ClassToModify(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,2 @@ | |||
ncloc:12 | |||
classes:1 |
@@ -0,0 +1,4 @@ | |||
sonar.projectKey=multi-language-sample | |||
sonar.projectName=Multi-Language Sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=src |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
ncloc:13 | |||
#Used by dashboard/widgets tests | |||
complexity_in_classes:3 | |||
classes:1 | |||
comment_lines:3 | |||
public_api:5 | |||
public_undocumented_api:2 | |||
duplicated_files:1 | |||
duplicated_blocks:2 | |||
duplicated_lines:3 |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
ncloc:13 | |||
#Used by dashboard/widgets tests | |||
complexity_in_classes:3 | |||
classes:1 | |||
comment_lines:3 | |||
public_api:5 | |||
public_undocumented_api:2 | |||
duplicated_files:1 | |||
duplicated_blocks:2 | |||
duplicated_lines:3 |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod() { | |||
return "hello"; | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
ncloc:13 | |||
#Used by dashboard/widgets tests | |||
complexity:3 | |||
complexity_in_classes:3 | |||
classes:1 | |||
comment_lines:3 | |||
public_api:5 | |||
public_undocumented_api:2 | |||
duplicated_files:1 | |||
duplicated_blocks:2 | |||
duplicated_lines:3 |
@@ -0,0 +1,5 @@ | |||
sonar.projectKey=sample | |||
sonar.projectName=Sample | |||
sonar.projectVersion=1.0-SNAPSHOT | |||
sonar.sources=my sources/main/xoo | |||
sonar.language=xoo |
@@ -0,0 +1,12 @@ | |||
package sample; | |||
public class Sample { | |||
public Sample(int i) { | |||
int j = i++; | |||
} | |||
private String myMethod_modified() { | |||
return "hello"; | |||
} | |||
} |