...
 
Commits (439)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# Created by https://www.gitignore.io/api/java,eclipse,intellij
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Ruby plugin and RubyMine
/.rakeTasks
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# End of https://www.gitignore.io/api/java,eclipse,intellij
# IntelliJ
*.iml
.idea/
out/
*.iml
\ No newline at end of file
# kit package
src/edu/kit/informatik/
!src/edu/kit/informatik/Terminal.java
*IOTestExample.io
# private tests
src/final_assignment/task_1.tests/private
src/final_assignment/task_2.tests/private
# User id file
UserId.id
# Checkstyle file
*.xml
# Assignment
*.pdf
\ No newline at end of file
<h1>Kit assignment tests<h1>
In this repo are serveral tests for the "Abschlussaufgaben".
This repository also provides classes to simplify creating tests.
<h6>For further information take look at our <a href="https://git.scc.kit.edu/WS-17-18/assignment-tests/wikis/home">wiki</a>.</h6>
Also have a look at our [Discord-Server](https://discord.gg/RVxBMVa).
<h4>package test</h4>
The test helper classes.
<h4>package test_examples</h4>
Examples showing how to use the package test.
<h4>package program_examples</h4>
Contains programs needed for the test examples.
<h4>package final_assignment.task_1.tests</h4>
Contains **all** tests for the **"1. Abschlussaufgabe"**
<h4>package final_assignment.task_2.tests</h4>
Contains **all** tests for the **"2. Abschlussaufgabe"**
</br>
</br>
\ No newline at end of file
package edu.kit.informatik;
import java.util.Vector;
/**
* Modified Terminal Class, simplified for testing purpose.
* Doesn't affect the original functionality of the official Terminal Class.
* Inspired by Alexander Sommer
*
* Note: The only interesting thing in this class are these two methods
* getLastIn : String -> last in from Terminal.printLine
* getLastError : String -> last in from Terminal.printError
*
*/
public final class SimplifiedTerminal {
/*
Notice: Can stay turned on.
*/
private static boolean IS_UNIT_TEST = true;
/*
Memory for last Input you made via calling Terminal.printLine or Terminal.printError
*/
private static Vector<String> messageList = new Vector<String>();
private static Vector<String> errorList = new Vector<String>();
public static void printError(final String message) {
SimplifiedTerminal.printLine("Error, " + message);
if(IS_UNIT_TEST){
errorList.add("Error, " + message);
}
}
public static void printLine(final Object object) {
System.out.println(object);
if(IS_UNIT_TEST){
messageList.add(object.toString());
}
}
public static void printLine(final char[] charArray) {
System.out.println(charArray);
if(IS_UNIT_TEST){
messageList.add(charArray.toString());
}
}
/**
* Provide last Input you made via calling Terminal.printLine
* @return last Input
*/
public static String getLastIn(){
return messageList.lastElement();
}
/**
* Provide last Input you made via calling Terminal.Error
* @return last Error
*/
public static String getLastError(){
return errorList.lastElement();
}
}
\ No newline at end of file
This diff is collapsed.
package edu.kit.informatik.Tests;
import edu.kit.informatik.SimplifiedTerminal;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* JUnit required
* Test-Class for Terminal, you want to read this example carefully for usage in you own tests.
*/
public class SimplifiedTerminalTest {
@org.junit.Test
public void getLast() {
//Example 1)
String eingabe = "Beispiel Eingabe: add-something";
//Example Input you made. (e.g in a method by calling Terminal.printLine
SimplifiedTerminal.printLine(eingabe);
//Checks if the output you expect equals the actual output
assertEquals(eingabe, SimplifiedTerminal.getLastIn());
//Example 2)
//Same just with error
String error = "Fehler bei Eingabe";
SimplifiedTerminal.printError(error);
assertEquals("Error, " + error, SimplifiedTerminal.getLastError());
}
}
\ No newline at end of file