Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d2c3cf2
package angabe fehlte
sabine12345 Jun 30, 2016
fee7ec7
excercise objekt und compilable methode erstellt
sabine12345 Jun 30, 2016
82a9f4e
gitignore
sabine12345 Jun 30, 2016
0a8c014
gitignore aktualisiert, exercise ebenfalls
sabine12345 Jun 30, 2016
0ea5bfd
gitignore
sabine12345 Jun 30, 2016
008dedf
ursprüngliche gitignore wieder eingefügt
Jul 4, 2016
0fefd5f
Merge remote-tracking branch 'origin/Logik' into Logik
Jul 4, 2016
1277bfc
Merge remote-tracking branch 'refs/remotes/origin/master' into Logik
Jul 4, 2016
e2d8fea
added comments
Jul 4, 2016
59f9115
minor fixes
Jul 4, 2016
a9f8e1c
update
Jul 7, 2016
1a83c18
Delete gradle.prefs
Jul 7, 2016
8fffc1c
Delete org.eclipse.buildship.core.prefs
Jul 7, 2016
b678b27
Delete Main.class
Jul 7, 2016
16cf039
Delete Logik.class
Jul 7, 2016
77b315e
Delete LogikZuGui.class
Jul 7, 2016
b815308
Delete TestMain.class
Jul 7, 2016
dab5cab
Delete .classpath
Jul 7, 2016
bda593f
Delete .project
Jul 7, 2016
04116e2
merge from main
Jul 7, 2016
3c9303a
Update Logik.java
Jul 7, 2016
ddbdfac
bug fixed
Jul 7, 2016
8494619
Delete Code.java
Jul 12, 2016
b2b641a
Delete CodeList.java
Jul 12, 2016
b8b367c
Delete Excercise.java
Jul 12, 2016
f8b56e6
Delete Exercise.java
Jul 12, 2016
f5fa0ad
Delete Loader.java
Jul 12, 2016
7509e70
Delete Store.java
Jul 12, 2016
ae6094c
Delete Test.java
Jul 12, 2016
9bcea72
Delete TestList.java
Jul 12, 2016
2432ea5
Delete excercises.dtd
Jul 12, 2016
79f0882
Delete .classpath
Jul 12, 2016
49405ba
Delete .project
Jul 12, 2016
a964a3b
Delete Controller.class
Jul 12, 2016
c9bf062
Delete Controller.java
Jul 12, 2016
cac8ea5
Delete GUIMain.class
Jul 12, 2016
c5d82cc
Delete GUIMain.java
Jul 12, 2016
3ba7b64
Delete ProPra.fxml
Jul 12, 2016
a4c7da2
Delete TestMain.java
Jul 12, 2016
0092969
Delete .gitignore
Jul 12, 2016
565d0c4
Delete .travis.yml
Jul 12, 2016
fdf26be
Delete README.md
Jul 12, 2016
ccbfc0e
Delete build.gradle
Jul 12, 2016
921aede
Update Logik.java
Jul 12, 2016
2863f5f
Update LogikZuGui.java
Jul 12, 2016
fc12115
Update Main.java
Jul 12, 2016
621f0e0
Create .travis.yml
Jul 12, 2016
1817761
Create build.gradle
Jul 12, 2016
6192ac0
Create .gitignore
Jul 12, 2016
82c4a11
Create Code.java
Jul 12, 2016
90005ad
Create CodeList.java
Jul 12, 2016
3230dcf
Create Exercise.java
Jul 12, 2016
088b7fd
Create Loader.java
Jul 12, 2016
2d44455
Create Store.java
Jul 12, 2016
a595228
Create Test.java
Jul 12, 2016
ca68840
Create TestList.java
Jul 12, 2016
c49707d
Create excercises.dtd
Jul 12, 2016
42f037a
Create .classpath
Jul 12, 2016
aec5b77
Create .project
Jul 12, 2016
a1d859e
Create Controller.java
Jul 12, 2016
aee23b1
Create GUIMain.java
Jul 12, 2016
e18e2f1
Create ProPra.fxml
Jul 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ bin/application/logik/Logik.class
*.classpath
.classpath
.project
.settings/
.settings/
5 changes: 0 additions & 5 deletions README.md

This file was deleted.

46 changes: 29 additions & 17 deletions src/FileHandling/Code.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/*******************************************************************************
* Copyright (c) 2016 The Fellowship of the String and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marcel Beek - initial API and implementation
* Patrick Pirig - initial API and implementation
* Phillippe Weise - initial API and implementation
* Sabine Timmer - initial API and implementation
*******************************************************************************/
package FileHandling;


import vk.core.api.CompilationUnit;
import vk.core.api.CompileError;
import vk.core.api.CompilerFactory;

import vk.core.api.CompilerResult;
Expand All @@ -18,30 +31,29 @@ public class Code {
private String className;
private CompilationUnit compilationUnitCode;
private boolean compilable;


public Code(String className,String code){
this.code=code;
this.className=className;
this.compilationUnitCode = new CompilationUnit(className, code, false );

public Code(String className, String code) {
this.code = code;
this.className = className;
this.compilationUnitCode = new CompilationUnit(className, code, false);
this.compilable = testingCompilationUnit();

}
public boolean testingCompilationUnit(){

public boolean testingCompilationUnit() {
JavaStringCompiler compiler = CompilerFactory.getCompiler(compilationUnitCode);
compiler.compileAndRunTests();
CompilerResult result = compiler.getCompilerResult();

if(result.hasCompileErrors() == true) compilable = true;

else{
TestHelpers.getErrorMessages(compiler, result);

if (result.hasCompileErrors() == true) {
System.out.println(TestHelpers.getErrorMessages(compiler, result));
compilable = false;
}


else if (result.hasCompileErrors() == false)
compilable = true;

return compilable;
}



}
39 changes: 26 additions & 13 deletions src/FileHandling/CodeList.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
/*******************************************************************************
* Copyright (c) 2016 The Fellowship of the String and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marcel Beek - initial API and implementation
* Patrick Pirig - initial API and implementation
* Phillippe Weise - initial API and implementation
* Sabine Timmer - initial API and implementation
*******************************************************************************/
package FileHandling;

import java.util.ArrayList;

public class CodeList extends ArrayList<Code>{
public class CodeList extends ArrayList<Code> {

/**
*
*/
private static final long serialVersionUID = 1L;
private boolean compilable;


public CodeList(){
public CodeList() {
super();
}

public boolean compilable(){

Code[] codeArray = (Code[]) this.toArray();

for(int i = 0; i< codeArray.length; i++){
compilable = codeArray[i].testingCompilationUnit();

if(compilable == false) return false;

public boolean compilable() {

Object[] codeArray = this.toArray();

for (int i = 0; i < codeArray.length; i++) {
compilable = ((Code) codeArray[i]).testingCompilationUnit();

if (compilable == false)
return false;
}
return true;
}
Expand Down
50 changes: 31 additions & 19 deletions src/FileHandling/Exercise.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
/*******************************************************************************
* Copyright (c) 2016 The Fellowship of the String and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marcel Beek - initial API and implementation
* Patrick Pirig - initial API and implementation
* Phillippe Weise - initial API and implementation
* Sabine Timmer - initial API and implementation
*******************************************************************************/
package FileHandling;

public class Exercise {

private String description;
private CodeList klassen;
private TestList tests;
private boolean baby,timer;


public Exercise(String description,CodeList klassen,TestList tests,boolean baby,boolean timer){
this.description=description;
this.klassen=klassen;
this.tests=tests;
this.baby=baby;
this.timer=timer;
private boolean baby, timer;

public Exercise(String description, CodeList klassen, TestList tests, boolean baby, boolean timer) {
this.description = description;
this.klassen = klassen;
this.tests = tests;
this.baby = baby;
this.timer = timer;
}

public Exercise(){



public Exercise() {

}
public boolean codeCompiles(){


public boolean codeCompiles() {

return this.klassen.compilable();

}
public boolean testsRunning(){

public boolean testsRunning() {

return this.tests.allPassing();
}

Expand Down
64 changes: 33 additions & 31 deletions src/FileHandling/Loader.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/*******************************************************************************
* Copyright (c) 2016 The Fellowship of the String and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marcel Beek - initial API and implementation
* Patrick Pirig - initial API and implementation
* Phillippe Weise - initial API and implementation
* Sabine Timmer - initial API and implementation
*******************************************************************************/
package FileHandling;

import org.xml.sax.*;

import javafx.scene.Scene;
Expand All @@ -13,49 +27,42 @@

import javax.xml.parsers.*;


public class Loader {

public Exercise loadExcercise(){
Stage loadStage= new Stage();
TextField fileName=new TextField("Katalogdatei");
Label anzeige=new Label("");




Button laden=new Button("Katalog laden");
laden.setOnAction(e-> laden(fileName.getText(),anzeige,loadStage));


public Exercise loadExcercise() {
Stage loadStage = new Stage();
TextField fileName = new TextField("Katalogdatei");
Label anzeige = new Label("");

Button laden = new Button("Katalog laden");
laden.setOnAction(e -> laden(fileName.getText(), anzeige, loadStage));

return null;
}

private void laden(String filename,Label anzeige,Stage stage) {
private void laden(String filename, Label anzeige, Stage stage) {
try {
Document xmldoc=loadDoc(filename);
Scene choiseScreen=katalogView(xmldoc);
Document xmldoc = loadDoc(filename);
Scene choiseScreen = katalogView(xmldoc);

} catch (SAXException | IOException e) {
anzeige.setText("Datei nicht vorhanden oder nicht kompatibel");
e.printStackTrace();
}



}



private Scene katalogView(Document xmldoc) {

return null;
}

private Document loadDoc(String fileLocation) throws SAXException, IOException{
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
private Document loadDoc(String fileLocation) throws SAXException, IOException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
Document toReturn;
factory.setIgnoringComments(true);
factory.setValidating(true);



DocumentBuilder builder;
try {
builder = factory.newDocumentBuilder();
Expand All @@ -64,10 +71,5 @@ private Document loadDoc(String fileLocation) throws SAXException, IOException{
e.printStackTrace();
return null;
}





}
}
13 changes: 13 additions & 0 deletions src/FileHandling/Store.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*******************************************************************************
* Copyright (c) 2016 The Fellowship of the String and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marcel Beek - initial API and implementation
* Patrick Pirig - initial API and implementation
* Phillippe Weise - initial API and implementation
* Sabine Timmer - initial API and implementation
*******************************************************************************/
package FileHandling;

public class Store {
Expand Down
44 changes: 30 additions & 14 deletions src/FileHandling/Test.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*******************************************************************************
* Copyright (c) 2016 The Fellowship of the String and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marcel Beek - initial API and implementation
* Patrick Pirig - initial API and implementation
* Phillippe Weise - initial API and implementation
* Sabine Timmer - initial API and implementation
*******************************************************************************/
package FileHandling;

import vk.core.api.CompilationUnit;
Expand All @@ -10,30 +23,33 @@
public class Test {
private String testCode;
private CompilationUnit compilationUnitTest;
public Test(String testCode, String testName){
this.testCode=testCode;
this.compilationUnitTest= new CompilationUnit(testName, testCode, true);

public Test(String testCode, String testName) {
this.testCode = testCode;
this.compilationUnitTest = new CompilationUnit(testName, testCode, true);
}
public boolean oneTestFailing(){

public boolean oneTestFailing() {
JavaStringCompiler compiler = CompilerFactory.getCompiler(compilationUnitTest);
compiler.compileAndRunTests();
TestResult result = compiler.getTestResult();
int fails = result.getNumberOfFailedTests();

if(fails == 1) return true;
return false; //mehr als ein test schl�gt fehl sollte nicht sein im tddt kreislauf

if (fails == 1)
return true;
return false; // mehr als ein test schlägt fehl sollte nicht sein im
// tddt kreislauf
}
public boolean allTestsPassing(){

public boolean allTestsPassing() {
JavaStringCompiler compiler = CompilerFactory.getCompiler(compilationUnitTest);
compiler.compileAndRunTests();
TestResult result = compiler.getTestResult();
int fails = result.getNumberOfFailedTests();

if(fails == 0) return true;

if (fails == 0)
return true;
return false;

}
}
Loading