1   /*
2    * $Id: DefaultModelNames.java 11378 2008-03-16 18:26:04Z dfeist $
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 CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.config.spring;
12  
13  import org.mule.api.model.Model;
14  import org.mule.tck.FunctionalTestCase;
15  
16  import java.util.Collection;
17  import java.util.HashSet;
18  import java.util.Iterator;
19  import java.util.Set;
20  
21  public class DefaultModelNames extends FunctionalTestCase
22  {
23  
24      protected String getConfigResources()
25      {
26          return "default-model-names.xml";
27      }
28  
29      public void testNames()
30      {
31          Collection models = muleContext.getRegistry().lookupObjects(Model.class);
32          assertEquals(3, models.size()); // includes system model
33          Set modelNames = new HashSet();
34          for (Iterator each = models.iterator(); each.hasNext();)
35          {
36              modelNames.add(((Model) each.next()).getName());
37          }
38          assertEquals(3, modelNames.size());
39      }
40  
41  }