1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/growingparameters/src-impl/impl/Impl.java Sat Jun 14 09:53:37 2008 +0200
1.3 @@ -0,0 +1,38 @@
1.4 +package impl;
1.5 +
1.6 +import api.classes.Compute;
1.7 +import api.classes.Support;
1.8 +import java.util.Collections;
1.9 +import java.util.List;
1.10 +import java.util.Map;
1.11 +
1.12 +public class Impl {
1.13 + public static void main(String[] args) {
1.14 + class ProviderWrittenAgainstVersion1 extends Compute {
1.15 + @Override
1.16 + public List<String> getData() {
1.17 + return Collections.singletonList("Hello");
1.18 + }
1.19 + }
1.20 + int index1 = Support.searchByDescription("Hello", new ProviderWrittenAgainstVersion1());
1.21 + assert index1 == 0;
1.22 + int index2 = Support.searchByDescription("Unknown", new ProviderWrittenAgainstVersion1());
1.23 + assert index2 == -1;
1.24 +
1.25 +
1.26 + class ProviderWrittenAgainstVersion2 extends Compute {
1.27 + @Override
1.28 + public List<String> getData() {
1.29 + return Collections.singletonList("Hello");
1.30 + }
1.31 +
1.32 + @Override
1.33 + public Map<String, String> getDataAndDescription() {
1.34 + return Collections.singletonMap("Hello", "Says hello");
1.35 + }
1.36 + }
1.37 +
1.38 + int index3 = Support.searchByDescription("Says hello", new ProviderWrittenAgainstVersion2());
1.39 + assert index3 == 0;
1.40 + }
1.41 +}