This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.ws.rs.*; | |
import aQute.bnd.annotation.component.Component; | |
import aQute.bnd.annotation.headers.RequireCapability; | |
@Component | |
@Path("/echo") | |
@Requieres.JAXRS_Whiteboard | |
public class SampleRessource { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
@Path("/echo") | |
@RequireCapability( | |
ns="osgi.whiteboard", | |
filter="(osgi.whiteboard=java.ee.jaxrs)", | |
effective="active" | |
) | |
public class SampleRessource { | |
@GET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# provider bundle | |
Provide-Capability: \ | |
osgi.whiteboard;\ | |
osgi.whiteboard="java.ee.jaxrs";\ | |
version:Version="1.0.0"; \ | |
effective:=active | |
# consumer bundle | |
Require-Capability: | |
osgi.whiteboard; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package spock.console | |
import semester.* | |
import spock.lang.* | |
class SemsterSpec extends Specification { | |
SemestergebuehrService service = new SemestergebuehrService() | |
@Unroll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import semester.* | |
import spock.lang.* | |
class SemsterSpec extends Specification { | |
def "berechne die Semestergebuehrn"() { | |
given: | |
SemestergebuehrService service = new SemestergebuehrService() | |
when: | |
def gebuehr = service.getSemestergebuehr(5, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.fest.assertions.Assertions.*; | |
import java.util.Arrays; | |
import org.junit.Test; | |
public class QuicksortTest { | |
Quicksort<String> textSorter = Quicksort.createTextSorter(); | |
Quicksort<Integer> intSorter = Quicksort.createIntSorter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.* | |
class StackSpec extends Specification { | |
@Subject stack = new Stack() | |
def "push a element into a stack"(element) { | |
when: | |
stack.push(element) | |
then: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.Specification; | |
class FixedSizeListSpec extends Specification { | |
def "T1 - clear a empty list"() { | |
given: "a empty list" | |
List list = list(maxsize: 2) | |
when: "clear the list" | |
list.clear() | |
then: "the list should be empty" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@Conditional(HotReloadConfiguration.HotReloadCondition.class) | |
public class HotReloadConfiguration { | |
public static class HotReloadCondition implements Condition { | |
@Override | |
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { | |
String hotReloadEnabledProperty = context.getEnvironment().getProperty("hotReload.enabled"); | |
return StringUtils.equals(hotReloadEnabledProperty, "true"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.*; | |
import org.junit.*; | |
public class CalcTest { | |
Calc calc; | |
@Before | |
public void setup() { |