diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store')
3 files changed, 43 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Catalog.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Catalog.java index 9ffe8fe931..7e579c6aba 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Catalog.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Catalog.java @@ -33,7 +33,7 @@ import org.oasisopen.sca.annotation.Remotable; public interface Catalog { @GET - Item[] getItem(); + Items getItem(); @GET @Path("{id}") diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/FruitsCatalogImpl.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/FruitsCatalogImpl.java index c7a9807878..126b8e7d7a 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/FruitsCatalogImpl.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/FruitsCatalogImpl.java @@ -19,6 +19,7 @@ package services.store; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -46,10 +47,10 @@ public class FruitsCatalogImpl implements Catalog { catalog.put("Pear", new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); } - public Item[] getItem() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.values().toArray(catalogArray); - return catalogArray; + public Items getItem() { + Items items = new Items(); + items.setItems(new ArrayList<Item>(catalog.values())); + return items; } public Item getItemById(String itemId) { diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Items.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Items.java new file mode 100644 index 0000000000..82a995943d --- /dev/null +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/store/Items.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services.store; + +import java.util.List; + +/** + * + */ +public class Items { + private List<Item> items; + + public List<Item> getItems() { + return items; + } + + public void setItems(List<Item> items) { + this.items = items; + } +} |