diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-28 09:44:15 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-28 09:44:15 +0000 |
commit | 35f81a620ea2d8423a49d8630bcef1d69027f444 (patch) | |
tree | 944dafaa1d67cc9504674b528416b189ba5834c4 /branches/sca-java-2.0-M2/itest/exceptions/src/main/java | |
parent | 8c9c52940826d8ddf8f9b9a327b6afce316be8eb (diff) |
Remove old m2 branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@759447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-2.0-M2/itest/exceptions/src/main/java')
9 files changed, 0 insertions, 533 deletions
diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java deleted file mode 100644 index 1f57116bac..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.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 org.apache.tuscany.sca.test.exceptions; - -public class Checked extends Exception { - private static final long serialVersionUID = -129752837478357452L; - - /** - * - */ - public Checked() { - - } - - /** - * @param message - */ - public Checked(String message) { - super(message); - - } - - /** - * @param cause - */ - public Checked(Throwable cause) { - super(cause); - - } - - /** - * @param message - * @param cause - */ - public Checked(String message, Throwable cause) { - super(message, cause); - - } - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java deleted file mode 100644 index 112aefc747..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java +++ /dev/null @@ -1,32 +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 org.apache.tuscany.sca.test.exceptions; - -public interface ExceptionHandler { - - void testing(); - - Checked getTheBad(); - - String getTheGood(); - - UnChecked getTheUgly(); - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java deleted file mode 100644 index 53a6c70b57..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java +++ /dev/null @@ -1,30 +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 org.apache.tuscany.sca.test.exceptions; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Remote exception thrower - * @version $Rev$ $Date$ - */ -@Remotable -public interface ExceptionRemoteThrower extends ExceptionThrower { -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java deleted file mode 100644 index ace219991b..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java +++ /dev/null @@ -1,37 +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 org.apache.tuscany.sca.test.exceptions; - -/** - * Local exception thrower - * @version $Rev$ $Date$ - */ -public interface ExceptionThrower { - Checked BAD = new Checked("theBad"); - UnChecked UGLY = new UnChecked("theUgly"); - String SO_THEY_SAY = "All is good that ends good."; - - String theGood() throws Checked; - - String theBad() throws Checked; - - String theUgly() throws Checked; - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java deleted file mode 100644 index 453528444d..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.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 org.apache.tuscany.sca.test.exceptions; - -public class UnChecked extends RuntimeException { - private static final long serialVersionUID = -1318118082838092244L; - - /** - * - */ - public UnChecked() { - - } - - /** - * @param message - */ - public UnChecked(String message) { - super(message); - - } - - /** - * @param cause - */ - public UnChecked(Throwable cause) { - super(cause); - - } - - /** - * @param message - * @param cause - */ - public UnChecked(String message, Throwable cause) { - super(message, cause); - - } - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java deleted file mode 100644 index 26b9f0a383..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java +++ /dev/null @@ -1,115 +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 org.apache.tuscany.sca.test.exceptions.impl; - -import org.apache.tuscany.sca.test.exceptions.Checked; -import org.apache.tuscany.sca.test.exceptions.ExceptionHandler; -import org.apache.tuscany.sca.test.exceptions.ExceptionThrower; -import org.apache.tuscany.sca.test.exceptions.UnChecked; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ExceptionHandlerImpl implements ExceptionHandler { - static final String INIT = "INIT"; - - private ExceptionThrower exceptionThrower; - - private String theGood; - - private Checked theBad; - - private UnChecked theUgly; - - public void testing() { - - assert exceptionThrower != null : "'exceptionThrower' never wired"; - String result = INIT; - try { - theGood = result = exceptionThrower.theGood(); - assert result == ExceptionThrower.SO_THEY_SAY; - } catch (Throwable e) { - assert result == INIT; - assert false; - e.printStackTrace(); - } - - result = INIT; - try { - result = exceptionThrower.theBad(); - // incredible - assert false : "Expected 'Check' Exception"; - - } catch (Checked e) { - // This is good... - assert result == INIT; - theBad = e; - } catch (Throwable t) { - // This is not so good. - t.printStackTrace(); - assert result == INIT; - assert false : "Got wrong exception '" + t.getClass().getName(); - } - - result = INIT; - try { - result = exceptionThrower.theUgly(); - // incredible - assert false : "Expected 'UnCheck' Exception"; - - } catch (Checked e) { - // This is not so good... - assert false : "Got wrong exception '" + e.getClass().getName(); - assert result == INIT; - } catch (UnChecked e) { - theUgly = e; - - } catch (Throwable t) { - // This is not good. - assert false; - assert result == INIT; - - System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT); - } - - } - - @Reference - public void setExceptionThrower(ExceptionThrower exceptionThrower) { - this.exceptionThrower = exceptionThrower; - } - - public String getTheGood() { - return theGood; - } - - public Checked getTheBad() { - return theBad; - } - - public UnChecked getTheUgly() { - return theUgly; - } - - public ExceptionThrower getExceptionThrower() { - return exceptionThrower; - } - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java deleted file mode 100644 index cd62338841..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java +++ /dev/null @@ -1,44 +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 org.apache.tuscany.sca.test.exceptions.impl; - -import org.apache.tuscany.sca.test.exceptions.Checked; -import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower; -import org.oasisopen.sca.annotation.Service; - -/** - * - * @version $Rev$ $Date$ - */ -@Service(ExceptionRemoteThrower.class) -public class ExceptionRemoteThrowerImpl implements ExceptionRemoteThrower { - public String theBad() throws Checked { - throw BAD; - } - - public String theGood() throws Checked { - return SO_THEY_SAY; - } - - public String theUgly() throws Checked { - throw UGLY; - } - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java deleted file mode 100644 index 56b9fc6f5b..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java +++ /dev/null @@ -1,45 +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 org.apache.tuscany.sca.test.exceptions.impl; - -import org.apache.tuscany.sca.test.exceptions.Checked; -import org.apache.tuscany.sca.test.exceptions.ExceptionThrower; -import org.oasisopen.sca.annotation.Service; - -/** - * - * @version $Rev$ $Date$ - */ -@Service(ExceptionThrower.class) -public class ExceptionThrowerImpl implements ExceptionThrower { - - public String theBad() throws Checked { - throw BAD; - } - - public String theGood() throws Checked { - return SO_THEY_SAY; - } - - public String theUgly() throws Checked { - throw UGLY; - } - -} diff --git a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java b/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java deleted file mode 100644 index c5b54ff902..0000000000 --- a/branches/sca-java-2.0-M2/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java +++ /dev/null @@ -1,116 +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 org.apache.tuscany.sca.test.exceptions.impl; - -import org.apache.tuscany.sca.test.exceptions.Checked; -import org.apache.tuscany.sca.test.exceptions.ExceptionHandler; -import org.apache.tuscany.sca.test.exceptions.ExceptionRemoteThrower; -import org.apache.tuscany.sca.test.exceptions.ExceptionThrower; -import org.apache.tuscany.sca.test.exceptions.UnChecked; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class RemoteExceptionHandlerImpl implements ExceptionHandler { - static final String INIT = "INIT"; - - private ExceptionRemoteThrower exceptionThrower; - - private String theGood; - - private Checked theBad; - - private UnChecked theUgly; - - public void testing() { - - assert exceptionThrower != null : "'exceptionThrower' never wired"; - String result = INIT; - try { - theGood = result = exceptionThrower.theGood(); - assert result == ExceptionThrower.SO_THEY_SAY; - } catch (Throwable e) { - assert result == INIT; - assert false; - e.printStackTrace(); - } - - result = INIT; - try { - result = exceptionThrower.theBad(); - // incredible - assert false : "Expected 'Check' Exception"; - - } catch (Checked e) { - // This is good... - assert result == INIT; - theBad = e; - } catch (Throwable t) { - // This is not so good. - t.printStackTrace(); - assert result == INIT; - assert false : "Got wrong exception '" + t.getClass().getName(); - } - - result = INIT; - try { - result = exceptionThrower.theUgly(); - // incredible - assert false : "Expected 'UnCheck' Exception"; - - } catch (Checked e) { - // This is not so good... - assert false : "Got wrong exception '" + e.getClass().getName(); - assert result == INIT; - } catch (UnChecked e) { - theUgly = e; - - } catch (Throwable t) { - // This is not good. - assert false; - assert result == INIT; - - System.out.println(ExceptionThrower.SO_THEY_SAY + " " + INIT); - } - - } - - @Reference - public void setExceptionThrower(ExceptionRemoteThrower exceptionThrower) { - this.exceptionThrower = exceptionThrower; - } - - public String getTheGood() { - return theGood; - } - - public Checked getTheBad() { - return theBad; - } - - public UnChecked getTheUgly() { - return theUgly; - } - - public ExceptionRemoteThrower getExceptionThrower() { - return exceptionThrower; - } - -} |