diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-12 00:43:48 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-12 00:43:48 +0000 |
commit | 9425990f532b1152c2d73db96c0f07ef5216a3d1 (patch) | |
tree | a8986fc31f96eb02484a0ae9d1c14cfa788e30ac /java/sca-contrib/samples/domain-management/src/test | |
parent | 40523f9c6cb1f7a785c2dbd2466dc410ae6ddf66 (diff) |
Moving 2.x contribs
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835178 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca-contrib/samples/domain-management/src/test')
12 files changed, 0 insertions, 494 deletions
diff --git a/java/sca-contrib/samples/domain-management/src/test/java/services/Cart.java b/java/sca-contrib/samples/domain-management/src/test/java/services/Cart.java deleted file mode 100644 index 3fb5439bc3..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Cart extends Collection<String, Item> { - -} diff --git a/java/sca-contrib/samples/domain-management/src/test/java/services/Item.java b/java/sca-contrib/samples/domain-management/src/test/java/services/Item.java deleted file mode 100644 index 81cefcdbef..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/java/services/Item.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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; - - -public class Item { - private String name; - private String price; - private String origin; - - public Item() { - } - - public Item(String name, String price, String origin) { - this.name = name; - this.price = price; - this.origin = origin; - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - -} diff --git a/java/sca-contrib/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java b/java/sca-contrib/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java deleted file mode 100644 index f053ec9f48..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/java/services/ShoppingCartClientImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartClientImpl implements Cart { - - @Reference - public Cart cart; - - public Entry<String, Item>[] getAll() { - return cart.getAll(); - } - - public Item get(String key) throws NotFoundException { - return cart.get(key); - } - - public String post(String key, Item item) { - return cart.post(key, item); - } - - public void put(String key, Item item) throws NotFoundException { - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - cart.delete(key); - } - - public Entry<String, Item>[] query(String queryString) { - return cart.query(queryString); - } - -} diff --git a/java/sca-contrib/samples/domain-management/src/test/java/services/ShoppingCartImpl.java b/java/sca-contrib/samples/domain-management/src/test/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9ef59df7a8..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart { - - private Map<String, Item> cart; - - @Init - public void init() { - cart = new HashMap<String, Item>(); - } - - public Entry<String, Item>[] getAll() { - Entry<String, Item>[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry<String, Item> e: cart.entrySet()) { - entries[i++] = new Entry<String, Item>(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry<String, Item>[] query(String queryString) { - List<Entry<String, Item>> entries = new ArrayList<Entry<String,Item>>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry<String, Item> e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry<String, Item>(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - -} diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/assembly/assets.xml b/java/sca-contrib/samples/domain-management/src/test/resources/assembly/assets.xml deleted file mode 100644 index 10693a89e6..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/assembly/assets.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<assembly> - <id>assets</id> - <includeBaseDirectory>false</includeBaseDirectory> - <formats> - <format>jar</format> - </formats> - - <fileSets> - <fileSet> - <directory>target/test-classes/assets</directory> - <outputDirectory>/</outputDirectory> - </fileSet> - <fileSet> - <directory>target/test-classes/services</directory> - <outputDirectory>/services</outputDirectory> - </fileSet> - </fileSets> - -</assembly> diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/assembly/client.xml b/java/sca-contrib/samples/domain-management/src/test/resources/assembly/client.xml deleted file mode 100644 index 5b34693bee..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/assembly/client.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<assembly> - <id>client</id> - <includeBaseDirectory>false</includeBaseDirectory> - <formats> - <format>jar</format> - </formats> - - <fileSets> - <fileSet> - <directory>target/test-classes/client</directory> - <outputDirectory>/</outputDirectory> - </fileSet> - </fileSets> - -</assembly> diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/assembly/store.xml b/java/sca-contrib/samples/domain-management/src/test/resources/assembly/store.xml deleted file mode 100644 index d19b7eb161..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/assembly/store.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<assembly> - <id>store</id> - <includeBaseDirectory>false</includeBaseDirectory> - <formats> - <format>jar</format> - </formats> - - <fileSets> - <fileSet> - <directory>target/test-classes/store</directory> - <outputDirectory>/</outputDirectory> - </fileSet> - </fileSets> - -</assembly> diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/assets/META-INF/sca-contribution.xml b/java/sca-contrib/samples/domain-management/src/test/resources/assets/META-INF/sca-contribution.xml deleted file mode 100644 index 33fe814c3a..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/assets/META-INF/sca-contribution.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"> - <export.java package="services"/> -</contribution>
\ No newline at end of file diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/client/META-INF/sca-contribution.xml b/java/sca-contrib/samples/domain-management/src/test/resources/client/META-INF/sca-contribution.xml deleted file mode 100644 index 14e1cdb672..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/client/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:s="http://store"> - <import.java package="services"/> - <deployable composite="s:client"/> -</contribution>
\ No newline at end of file diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/client/client.composite b/java/sca-contrib/samples/domain-management/src/test/resources/client/client.composite deleted file mode 100644 index 1279b319c4..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/client/client.composite +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store" - name="client"> - - <component name="ShoppingCartClient">
- <implementation.java class="services.ShoppingCartClientImpl"/> - <service name="Cart"> - <t:binding.atom uri="/ShoppingCartClient/Cart"/> - </service> - <reference name="cart" target="ShoppingCart"> - <t:binding.atom/> - </reference>
- </component>
-
-</composite>
diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/store/META-INF/sca-contribution.xml b/java/sca-contrib/samples/domain-management/src/test/resources/store/META-INF/sca-contribution.xml deleted file mode 100644 index 52348106f2..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/store/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:s="http://store"> - <import.java package="services"/> - <deployable composite="s:store"/> -</contribution>
\ No newline at end of file diff --git a/java/sca-contrib/samples/domain-management/src/test/resources/store/store.composite b/java/sca-contrib/samples/domain-management/src/test/resources/store/store.composite deleted file mode 100644 index d4f18771d8..0000000000 --- a/java/sca-contrib/samples/domain-management/src/test/resources/store/store.composite +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" - targetNamespace="http://store" - name="store"> - - <component name="ShoppingCart">
- <implementation.java class="services.ShoppingCartImpl"/>
- <service name="Cart">
- <t:binding.atom uri="/ShoppingCart/Cart"/>
- </service>
- </component>
-
-</composite>
|