From b29fa03782e0cd40a688e38d7c1b77c48e0bd326 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Mon, 10 Mar 2014 15:56:17 +0100 Subject: [PATCH] ParameterInsertTest added --- src/typinferenz/TypeInsertPoint.java | 14 +++++++++++++- test/plugindevelopment/ParameterInsertTest.java | 13 +++++++++++++ test/plugindevelopment/ParameterTypeInsertTest.jav | 7 +++++++ .../ParameterTypeInsertTestSolution.jav | 7 +++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 test/plugindevelopment/ParameterInsertTest.java create mode 100644 test/plugindevelopment/ParameterTypeInsertTest.jav create mode 100644 test/plugindevelopment/ParameterTypeInsertTestSolution.jav diff --git a/src/typinferenz/TypeInsertPoint.java b/src/typinferenz/TypeInsertPoint.java index 1d46012dd..3f61eb2e9 100644 --- a/src/typinferenz/TypeInsertPoint.java +++ b/src/typinferenz/TypeInsertPoint.java @@ -35,7 +35,19 @@ public class TypeInsertPoint { return this.getTypeInsertString().length(); } - private String getTypeInsertString(){ + /** + * + * @return Der Offset des TypeInsertPoints in dem geparsten Source für dessen Klasse er erstellt wurde. + */ + public int getOffset(){ + return this.point.getOffset(); + } + + /** + * Die Zeichenkette die durch diesen TypeInsertPoint eingesetzt wird. (Der Typ als String) + * @return + */ + public String getTypeInsertString(){ String ret = type.printJavaCode(this.resultSet).toString()+" "; return ret; } diff --git a/test/plugindevelopment/ParameterInsertTest.java b/test/plugindevelopment/ParameterInsertTest.java new file mode 100644 index 000000000..63b108196 --- /dev/null +++ b/test/plugindevelopment/ParameterInsertTest.java @@ -0,0 +1,13 @@ +package plugindevelopment; + +import org.junit.Test; + +public class ParameterInsertTest { + private static final String TEST_FILE = "ParameterTypeInsertTest.jav"; + private static final String SOLUTION_FILE = "ParameterTypeInsertTestSolution.jav"; + + @Test + public void run(){ + TypeInsertTester.test(this.TEST_FILE, this.SOLUTION_FILE); + } +} diff --git a/test/plugindevelopment/ParameterTypeInsertTest.jav b/test/plugindevelopment/ParameterTypeInsertTest.jav new file mode 100644 index 000000000..9a2405af3 --- /dev/null +++ b/test/plugindevelopment/ParameterTypeInsertTest.jav @@ -0,0 +1,7 @@ + +class VariableTypeInsertTest{ + String var; + void methode(test){ + var = test; + } +} diff --git a/test/plugindevelopment/ParameterTypeInsertTestSolution.jav b/test/plugindevelopment/ParameterTypeInsertTestSolution.jav new file mode 100644 index 000000000..151fcd40a --- /dev/null +++ b/test/plugindevelopment/ParameterTypeInsertTestSolution.jav @@ -0,0 +1,7 @@ + +class VariableTypeInsertTest{ + String var; + void methode(String test){ + var = test; + } +}