summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorsalsolatragus2012-11-09 09:45:35 (EST)
committer salsolatragus2012-11-09 09:45:35 (EST)
commit33a18641d3b8eab2732863fd9ea273baf027d038 (patch)
treea966498ac42721a14bae07d7acf6cce26143a266
parentfadde38f72e074b88752d5ea9fb0ac7dadf56e08 (diff)
downloadorg.eclipse.recommenders-33a18641d3b8eab2732863fd9ea273baf027d038.zip
org.eclipse.recommenders-33a18641d3b8eab2732863fd9ea273baf027d038.tar.gz
org.eclipse.recommenders-33a18641d3b8eab2732863fd9ea273baf027d038.tar.bz2
introduced new smoke test scenarios with unresolvable typesrefs/changes/18/8618/2
-rw-r--r--tests/org.eclipse.recommenders.tests/src/org/eclipse/recommenders/tests/SmokeTestScenarios.xtend38
-rw-r--r--tests/org.eclipse.recommenders.tests/xtend-gen/org/eclipse/recommenders/tests/SmokeTestScenarios.java89
2 files changed, 122 insertions, 5 deletions
diff --git a/tests/org.eclipse.recommenders.tests/src/org/eclipse/recommenders/tests/SmokeTestScenarios.xtend b/tests/org.eclipse.recommenders.tests/src/org/eclipse/recommenders/tests/SmokeTestScenarios.xtend
index f647bbc..f12e0d6 100644
--- a/tests/org.eclipse.recommenders.tests/src/org/eclipse/recommenders/tests/SmokeTestScenarios.xtend
+++ b/tests/org.eclipse.recommenders.tests/src/org/eclipse/recommenders/tests/SmokeTestScenarios.xtend
@@ -1,6 +1,7 @@
package org.eclipse.recommenders.tests
import java.util.Arrays
+
import static org.eclipse.recommenders.tests.CodeBuilder.*
class SmokeTestScenarios {
@@ -9,7 +10,9 @@ class SmokeTestScenarios {
Arrays::asList(
IMPORT_01, IMPORT_02,
PACKAGE_01, PACKAGE_02, PACKAGE_03,
- METHOD_STMT_01, METHOD_STMT_02, METHOD_STMT_03, METHOD_STMT_04, METHOD_STMT_05,METHOD_STMT_06,
+ CLASSBODY_01, CLASSBODY_02, CLASSBODY_03, CLASSBODY_04, CLASSBODY_05,
+ METHOD_STMT_01, METHOD_STMT_02, METHOD_STMT_03, METHOD_STMT_04, METHOD_STMT_05,METHOD_STMT_06,
+ METHOD_STMT_07, METHOD_STMT_08, METHOD_STMT_09, METHOD_STMT_10,
COMMENTS_01, COMMENTS_02
)
}
@@ -47,6 +50,22 @@ class SmokeTestScenarios {
«someClass»
'''
+ public static CharSequence CLASSBODY_01 = classDeclaration(
+ '''class ExtendingClass1 extends UnknownType''',
+ '''$'''
+ )
+
+ public static CharSequence CLASSBODY_02 = classDeclaration(
+ '''class ExtendingClass2 extends UnknownType''',
+ '''siz$'''
+ )
+
+ public static CharSequence CLASSBODY_03 = classbody('''private UnknownType field = $''')
+
+ public static CharSequence CLASSBODY_04 = classbody('''modifier Object o = $''')
+
+ public static CharSequence CLASSBODY_05 = classbody('''public List = $''')
+
public static CharSequence METHOD_STMT_01 = method('''Ob$;''')
public static CharSequence METHOD_STMT_02 = method('''Object $''')
@@ -63,8 +82,17 @@ class SmokeTestScenarios {
public static CharSequence METHOD_STMT_06 = classbody('''void <T> m(T t){
t.$
}''')
-
-
+
+ public static CharSequence METHOD_STMT_07 = method('''UnknownType.$exit$($)''')
+
+ public static CharSequence METHOD_STMT_08 = method('''UnknownType o = $new $File($to$String())''')
+
+ public static CharSequence METHOD_STMT_09 = method('''
+ UnknownType o = "";
+ o.$''')
+
+ public static CharSequence METHOD_STMT_10 = method('''undef$inedMethod($).$call($)''')
+
public static CharSequence COMMENTS_01 =
'''
/**
@@ -91,8 +119,8 @@ class SmokeTestScenarios {
*/
static {
}''')
-
-
+
+
def static OLD_TEST_CLASS(){
'''
/**
diff --git a/tests/org.eclipse.recommenders.tests/xtend-gen/org/eclipse/recommenders/tests/SmokeTestScenarios.java b/tests/org.eclipse.recommenders.tests/xtend-gen/org/eclipse/recommenders/tests/SmokeTestScenarios.java
index a594a56..5af6174 100644
--- a/tests/org.eclipse.recommenders.tests/xtend-gen/org/eclipse/recommenders/tests/SmokeTestScenarios.java
+++ b/tests/org.eclipse.recommenders.tests/xtend-gen/org/eclipse/recommenders/tests/SmokeTestScenarios.java
@@ -12,7 +12,9 @@ public class SmokeTestScenarios {
List<CharSequence> _asList = Arrays.<CharSequence>asList(
SmokeTestScenarios.IMPORT_01, SmokeTestScenarios.IMPORT_02,
SmokeTestScenarios.PACKAGE_01, SmokeTestScenarios.PACKAGE_02, SmokeTestScenarios.PACKAGE_03,
+ SmokeTestScenarios.CLASSBODY_01, SmokeTestScenarios.CLASSBODY_02, SmokeTestScenarios.CLASSBODY_03, SmokeTestScenarios.CLASSBODY_04, SmokeTestScenarios.CLASSBODY_05,
SmokeTestScenarios.METHOD_STMT_01, SmokeTestScenarios.METHOD_STMT_02, SmokeTestScenarios.METHOD_STMT_03, SmokeTestScenarios.METHOD_STMT_04, SmokeTestScenarios.METHOD_STMT_05, SmokeTestScenarios.METHOD_STMT_06,
+ SmokeTestScenarios.METHOD_STMT_07, SmokeTestScenarios.METHOD_STMT_08, SmokeTestScenarios.METHOD_STMT_09, SmokeTestScenarios.METHOD_STMT_10,
SmokeTestScenarios.COMMENTS_01, SmokeTestScenarios.COMMENTS_02);
return _asList;
}
@@ -91,6 +93,55 @@ public class SmokeTestScenarios {
}
}.apply();
+ public static CharSequence CLASSBODY_01 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("class ExtendingClass1 extends UnknownType");
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append("$");
+ CharSequence _classDeclaration = CodeBuilder.classDeclaration(_builder, _builder_1);
+ return _classDeclaration;
+ }
+ }.apply();
+
+ public static CharSequence CLASSBODY_02 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("class ExtendingClass2 extends UnknownType");
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append("siz$");
+ CharSequence _classDeclaration = CodeBuilder.classDeclaration(_builder, _builder_1);
+ return _classDeclaration;
+ }
+ }.apply();
+
+ public static CharSequence CLASSBODY_03 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("private UnknownType field = $");
+ CharSequence _classbody = CodeBuilder.classbody(_builder);
+ return _classbody;
+ }
+ }.apply();
+
+ public static CharSequence CLASSBODY_04 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("modifier Object o = $");
+ CharSequence _classbody = CodeBuilder.classbody(_builder);
+ return _classbody;
+ }
+ }.apply();
+
+ public static CharSequence CLASSBODY_05 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("public List = $");
+ CharSequence _classbody = CodeBuilder.classbody(_builder);
+ return _classbody;
+ }
+ }.apply();
+
public static CharSequence METHOD_STMT_01 = new Function0<CharSequence>() {
public CharSequence apply() {
StringConcatenation _builder = new StringConcatenation();
@@ -154,6 +205,44 @@ public class SmokeTestScenarios {
}
}.apply();
+ public static CharSequence METHOD_STMT_07 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("UnknownType.$exit$($)");
+ CharSequence _method = CodeBuilder.method(_builder);
+ return _method;
+ }
+ }.apply();
+
+ public static CharSequence METHOD_STMT_08 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("UnknownType o = $new $File($to$String())");
+ CharSequence _method = CodeBuilder.method(_builder);
+ return _method;
+ }
+ }.apply();
+
+ public static CharSequence METHOD_STMT_09 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("UnknownType o = \"\";");
+ _builder.newLine();
+ _builder.append("o.$");
+ CharSequence _method = CodeBuilder.method(_builder);
+ return _method;
+ }
+ }.apply();
+
+ public static CharSequence METHOD_STMT_10 = new Function0<CharSequence>() {
+ public CharSequence apply() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("undef$inedMethod($).$call($)");
+ CharSequence _method = CodeBuilder.method(_builder);
+ return _method;
+ }
+ }.apply();
+
public static CharSequence COMMENTS_01 = new Function0<CharSequence>() {
public CharSequence apply() {
StringConcatenation _builder = new StringConcatenation();