KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > tck > testmodels > mule > TestDependentObject


1 /*
2  * $Id: TestDependentObject.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.tck.testmodels.mule;
12
13 import org.mule.config.PropertyFactory;
14 import org.mule.tck.testmodels.fruit.Orange;
15
16 import java.util.Map JavaDoc;
17
18 /**
19  * <code>TestDependentObject</code> is used as a mock dependency for an object
20  *
21  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
22  * @version $Revision: 3798 $
23  */

24 public class TestDependentObject implements PropertyFactory
25 {
26     public Object JavaDoc create(Map JavaDoc properties) throws Exception JavaDoc
27     {
28         // make sure that both test properties are set here
29
if (properties.get("test1") == null || properties.get("test2") == null)
30         {
31             throw new Exception JavaDoc("Both properties should be set before the factory method is called");
32         }
33         return new Orange();
34     }
35 }
36
Popular Tags