summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-squid-java-plugin/test-resources
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-10-21 08:19:55 +0000
committerGodin <mandrikov@gmail.com>2010-10-21 08:19:55 +0000
commitd79015f0743d21c67b54efd02c4418cc9bdcac3a (patch)
tree90a381e9e1a9416437d1a502924a3317d75e15ed /plugins/sonar-squid-java-plugin/test-resources
parent417217bca95368825bc4ffa6244e90b18ed41286 (diff)
downloadsonarqube-d79015f0743d21c67b54efd02c4418cc9bdcac3a.tar.gz
sonarqube-d79015f0743d21c67b54efd02c4418cc9bdcac3a.zip
SONAR-1832: Create an architecture rule engine
Diffstat (limited to 'plugins/sonar-squid-java-plugin/test-resources')
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckDateForbidden.classbin0 -> 648 bytes
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckOneErrorMessage.classbin0 -> 444 bytes
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckToSqlFromUI.classbin0 -> 846 bytes
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/pom.xml23
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckDateForbidden.java11
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckOneErrorMessage.java8
-rw-r--r--plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckToSqlFromUI.java21
7 files changed, 63 insertions, 0 deletions
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckDateForbidden.class b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckDateForbidden.class
new file mode 100644
index 00000000000..8bd45accfc0
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckDateForbidden.class
Binary files differ
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckOneErrorMessage.class b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckOneErrorMessage.class
new file mode 100644
index 00000000000..ca6d35538d7
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckOneErrorMessage.class
Binary files differ
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckToSqlFromUI.class b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckToSqlFromUI.class
new file mode 100644
index 00000000000..03cfe2219d7
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/bin/ArchitectureCheckToSqlFromUI.class
Binary files differ
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/pom.xml b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/pom.xml
new file mode 100644
index 00000000000..3689efdf57a
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/pom.xml
@@ -0,0 +1,23 @@
+<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>org.codehaus.sonar</groupId>
+ <version>0.1-SNAPSHOT</version>
+ <artifactId>sonar-bytecode</artifactId>
+ <packaging>jar</packaging>
+
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <outputDirectory>bin</outputDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <target>1.5</target>
+ <source>1.5</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckDateForbidden.java b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckDateForbidden.java
new file mode 100644
index 00000000000..be4c58f3e4e
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckDateForbidden.java
@@ -0,0 +1,11 @@
+import java.sql.Date;
+import java.util.Calendar;
+
+public class ArchitectureCheckDateForbidden {
+
+ public ArchitectureCheckDateForbidden() {
+ Date dateSql = new Date(200000);
+ java.util.Date dateUtil = Calendar.getInstance().getTime();
+ long time = dateUtil.getTime();
+ }
+}
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckOneErrorMessage.java b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckOneErrorMessage.java
new file mode 100644
index 00000000000..46f02755655
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckOneErrorMessage.java
@@ -0,0 +1,8 @@
+import java.util.regex.Pattern;
+
+public class ArchitectureCheckOneErrorMessage {
+
+ public ArchitectureCheckOneErrorMessage() {
+ Pattern.compile("*.java");
+ }
+}
diff --git a/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckToSqlFromUI.java b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckToSqlFromUI.java
new file mode 100644
index 00000000000..18f58ba4801
--- /dev/null
+++ b/plugins/sonar-squid-java-plugin/test-resources/bytecode/architecture/src/ArchitectureCheckToSqlFromUI.java
@@ -0,0 +1,21 @@
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+
+public class ArchitectureCheckToSqlFromUI {
+
+ ResultSet result;
+
+ Connection connection;
+
+ public ArchitectureCheckToSqlFromUI(Statement statement, String requete) {
+ try {
+ connection = statement.getConnection();
+ result = statement.executeQuery(requete);
+ } catch (SQLException sql) {
+ sql.printStackTrace();
+ }
+ }
+}