Änderungen an Testfiles und Logger

This commit is contained in:
JanUlrich 2015-02-06 15:41:01 +01:00
parent f9bfe6fb44
commit 0922b9e899
17 changed files with 41 additions and 22 deletions

View File

@ -25,6 +25,10 @@ public class Logger {
}); });
} }
public static LoggerConfiguration getConfiguration(){
return Logger.standardConfiguration;
}
/** /**
* Logt eine Debug Message, welche zusätzlich einer bestimmten Section zugewiesen wird. * Logt eine Debug Message, welche zusätzlich einer bestimmten Section zugewiesen wird.
* Dadurch lässt sich die DEBUG ausgabe übersichtlicher gestalten. * Dadurch lässt sich die DEBUG ausgabe übersichtlicher gestalten.

View File

@ -218,6 +218,15 @@ public class GenericTypeVar extends Type
public int getEndOffset() { public int getEndOffset() {
return this.getOffset() + this.name.toString().length(); return this.getOffset() + this.name.toString().length();
} }
@Override
public void parserPostProcessing(SyntaxTreeNode parent) {
//SyntaxTreeNode parentTemp = this.parent;
super.parserPostProcessing(parent);
//if(parentTemp != null)this.parent = parentTemp; //Der Parenttype einer GenericVar soll sich nicht ändern können, falls einmal gesetzt.
}
} }
// ino.end // ino.end

View File

@ -36,6 +36,7 @@ public class FunNMethod extends Method{
this.parserPostProcessing(new Class("Fun"+paralist.size(), 0)); this.parserPostProcessing(new Class("Fun"+paralist.size(), 0));
} }
/*
public FunNMethod(int N){ public FunNMethod(int N){
super(0); //Hat keinen Offset, da nur theoretisch gedachte Methode super(0); //Hat keinen Offset, da nur theoretisch gedachte Methode
this.setType(TypePlaceholder.fresh(this)); this.setType(TypePlaceholder.fresh(this));
@ -53,7 +54,7 @@ public class FunNMethod extends Method{
this.parameterlist = pl; this.parameterlist = pl;
this.parserPostProcessing(new Class("Fun"+N, 0)); this.parserPostProcessing(new Class("Fun"+N, 0));
} }
*/
@Override @Override
public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph, public TypeInsertPoint createTypeInsertPoint(TypePlaceholder tph,
ResultSet resultSet) { ResultSet resultSet) {

View File

@ -27,7 +27,7 @@ public class TypeInsertTester{
private static Logger inferencelog = Logger.getLogger(TypeInsertTester.class.getName()); private static Logger inferencelog = Logger.getLogger(TypeInsertTester.class.getName());
static{ static{
{ {
Logger.setStandardConfiguration(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out)); Logger.getConfiguration().setOutput(Section.TYPEINFERENCE, System.out);
/* /*
// Ausgabeoptionen fuer die Logger // Ausgabeoptionen fuer die Logger
ConsoleAppender logAppender = new ConsoleAppender(new SimpleLayout()); ConsoleAppender logAppender = new ConsoleAppender(new SimpleLayout());

View File

@ -1,5 +1,5 @@
class BoundedGenericTest<A extends String>{ class BoundedGenericTest<A extends String>{
var; var = "test";
<B extends A> B methode(){ <B extends A> B methode(){
return var; return var;
} }

View File

@ -1,9 +1,9 @@
import java.util.Vector; import java.util.Vector;
class ImportTest{ class ImportTest{
var;
void methode(a){ void methode(a){
var;
var.add(a); var.add(a);
} }

View File

@ -1,6 +1,6 @@
class IntTest{ class IntTest{
var;
int methode(){ int methode(){
var;
return var; return var;
} }
} }

View File

@ -1,8 +1,6 @@
class Test{ class Test{
m; <CT extends String> CT methode(m){
<CT, CT extends String> CT methode(){
return m; return m;
} }

View File

@ -1,8 +1,6 @@
class Test{ class Test{
m; <CT> CT methode(m){
<CT> CT methode(){
return m; return m;
} }

View File

@ -1,5 +1,5 @@
class LambdaTest<R,S>{ class LambdaTest<A,B>{
Fun1<Fun1<R, Fun2<R, LambdaTest<R,S>, S>>, S> op = (m) -> (f) -> f.apply(this,m); Fun1<Fun1<A, Fun2<A, LambdaTest<A,B>, B>>, B> op = (m) -> (f) -> f.apply(this,m);
} }

View File

@ -4,12 +4,17 @@ import java.util.Vector;
import org.junit.Test; import org.junit.Test;
import de.dhbwstuttgart.logger.Logger;
import de.dhbwstuttgart.logger.LoggerConfiguration;
import de.dhbwstuttgart.logger.Section;
public class LambdaTest2 { public class LambdaTest2 {
private static final String TEST_FILE = "LambdaTest2.jav"; private static final String TEST_FILE = "LambdaTest2.jav";
@Test @Test
public void run(){ public void run(){
Logger.getConfiguration().setOutput(Section.ASSUMPTIONS, System.out);
Vector<String> mustContain = new Vector<String>(); Vector<String> mustContain = new Vector<String>();
//mustContain.add("S m"); //mustContain.add("S m");
MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); MultipleTypesInsertTester.test(this.TEST_FILE, mustContain);

View File

@ -1,9 +1,11 @@
package plugindevelopment.TypeInsertTests; package plugindevelopment.TypeInsertTests.LargeSourceCodeTests;
import java.util.Vector; import java.util.Vector;
import org.junit.Test; import org.junit.Test;
import plugindevelopment.TypeInsertTests.MultipleTypesInsertTester;
public class LambdaTest22 { public class LambdaTest22 {
private static final String TEST_FILE = "LambdaTest22.jav"; private static final String TEST_FILE = "LambdaTest22.jav";

View File

@ -1,9 +1,10 @@
package plugindevelopment.TypeInsertTests; package plugindevelopment.TypeInsertTests.LargeSourceCodeTests;
import java.util.Vector; import java.util.Vector;
import org.junit.Test; import org.junit.Test;
import plugindevelopment.TypeInsertTests.MultipleTypesInsertTester;
import de.dhbwstuttgart.logger.Logger; import de.dhbwstuttgart.logger.Logger;
import de.dhbwstuttgart.logger.LoggerConfiguration; import de.dhbwstuttgart.logger.LoggerConfiguration;
import de.dhbwstuttgart.logger.Section; import de.dhbwstuttgart.logger.Section;

View File

@ -1,9 +1,11 @@
package plugindevelopment.TypeInsertTests; package plugindevelopment.TypeInsertTests.LargeSourceCodeTests;
import java.util.Vector; import java.util.Vector;
import org.junit.Test; import org.junit.Test;
import plugindevelopment.TypeInsertTests.MultipleTypesInsertTester;
public class TypedMatrixSimpleTest { public class TypedMatrixSimpleTest {
private static final String TEST_FILE = "TypedMatrixSimpleTest.jav"; private static final String TEST_FILE = "TypedMatrixSimpleTest.jav";

View File

@ -1,9 +1,11 @@
package plugindevelopment.TypeInsertTests; package plugindevelopment.TypeInsertTests.LargeSourceCodeTests;
import java.util.Vector; import java.util.Vector;
import org.junit.Test; import org.junit.Test;
import plugindevelopment.TypeInsertTests.MultipleTypesInsertTester;
public class TypedMatrixTest { public class TypedMatrixTest {
private static final String TEST_FILE = "TypedMatrixTest.jav"; private static final String TEST_FILE = "TypedMatrixTest.jav";

View File

@ -22,7 +22,7 @@ public class MultipleTypesInsertTester extends TypeInsertTester{
public MultipleTypesInsertTester(){ public MultipleTypesInsertTester(){
//Output von TYPEINFERENCE auf die Console setzen: //Output von TYPEINFERENCE auf die Console setzen:
Logger.setStandardConfiguration(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out)); Logger.getConfiguration().setOutput(Section.TYPEINFERENCE, System.out);
} }
public static void test(String sourceFileToInfere, Vector<String> mustContain){ public static void test(String sourceFileToInfere, Vector<String> mustContain){

View File

@ -1,16 +1,13 @@
class OverloadingInsertTest{ class OverloadingInsertTest{
var;
overload(){ overload(){
return this; return this;
} }
} }
class Overloading2{ class Overloading2{
var2;
methode(){ methode(var2){
return var2.overload(); return var2.overload();
} }