Author: jmarino
Date: Thu Jan 4 15:00:15 2007
New Revision: 492799
URL: http://svn.apache.org/viewvc?view=rev&rev=492799
Log:
fix for optional autowires
Added:
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java
(with props)
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundWireImpl.java
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundWireImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundWireImpl.java?view=diff&rev=492799&r1=492798&r2=492799
==============================================================================
---
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundWireImpl.java
(original)
+++
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundWireImpl.java
Thu Jan 4 15:00:15 2007
@@ -67,7 +67,9 @@
}
public Object getTargetService() throws TargetResolutionException {
- assert targetWire != null;
+ if (targetWire == null) {
+ return null;
+ }
// optimized, no interceptors or handlers on either end
return targetWire.getTargetService();
}
Added:
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java?view=auto&rev=492799
==============================================================================
---
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java
(added)
+++
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java
Thu Jan 4 15:00:15 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.core.wire;
+
+import org.apache.tuscany.spi.wire.OutboundWire;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class OutboundWireTestCase extends TestCase {
+
+ /**
+ * Tests that the target wire returns null if there is no connected wire.
This behavior is needed for optional
+ * autowires.
+ */
+ public void testGetNonExistentTargetService() throws Exception {
+ OutboundWire wire = new OutboundWireImpl();
+ assertNull(wire.getTargetService());
+ }
+}
Propchange:
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]