Skip to content

Instantly share code, notes, and snippets.

View chbaranowski's full-sized avatar

Christian Baranowski chbaranowski

View GitHub Profile
@chbaranowski
chbaranowski / TestDescription.java
Created October 24, 2010 09:38
Demo Annotation für SWQS
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
// Mit der Annotation kann man definieren ob eine Annotation zur
// Laufzeit ausgewertet werden kann.
@Retention(RetentionPolicy.RUNTIME)
// Mit der Target Annotation kann man eine Annotation markieren
@chbaranowski
chbaranowski / TestDescriptionTest.java
Created October 24, 2010 09:39
Demo TestDescriptionTest arbeiten mit Annotations
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;
public class TestDescriptionTest {
@chbaranowski
chbaranowski / CustomerModel.java
Created October 24, 2010 09:41
SWQS JAXB Beispiel Klasse Kunde
import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class CustomerModel implements Serializable {
private static final long serialVersionUID = 1L;
@chbaranowski
chbaranowski / CustomerModelTest.java
Created October 24, 2010 09:43
JAXB Demo Test SWQS
import java.io.File;
import javax.xml.bind.JAXB;
import org.junit.Test;
import static org.junit.Assert.*;
public class CustomerModelTest {
@chbaranowski
chbaranowski / TextParserTest.java
Created October 24, 2010 12:47
Beispiel Test SWQS Komponententests (Modultests) und Testabdeckung - Übung3 TDD
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;
public class TextParserTest {
TextParser parser;
HashMap<String, Integer> expedtedWordCounts;
@chbaranowski
chbaranowski / TextParser.java
Created October 24, 2010 13:07
TextParser Implementierung - TDD Demo
import java.util.HashMap;
import java.util.Map;
public class TextParser {
public Map<String, Integer> parseTextWordCount(String text) {
HashMap<String, Integer> result = new HashMap<String, Integer>();
if(text != null)
{
if(!text.trim().isEmpty())
@chbaranowski
chbaranowski / pom.xml
Created October 25, 2010 07:41
Build OSGi Bundle with Maven
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>plugin.xml</include>
@chbaranowski
chbaranowski / function.js
Created October 25, 2010 19:56
Funktion Deklaration und Aufruf in JavaScript - Demo SOTE Vorlesung
// Die Funktion wird deklariert mit einem Übergabeparameter und einem return Wert true.
function sayHello(message){
alert('Hello World : ' + message);
return true;
}
// Die Methode wird aufgerufen mit dem Parameterwert ' to JavaScript!'
sayHello(' to JavaScript!');
@chbaranowski
chbaranowski / function-parameter.js
Created October 25, 2010 20:14
Funktion als Parameter - Demo SOTE Vorlesung
function windowLoadListener(event){
var div = document.getElementById('textAusgabeDiv');
var helloWorld = document.createTextNode('Hello World');
div.appendChild(helloWorld);
}
window.onload = windowLoadListener;
<html>
<head>
<title>JavaScript Demo</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<script type="text/javascript" src="javascript/core.js"></script>
</head>
<body>
<div id="textAusgabeDiv"></div>
</body>
</html>