View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.config.spring;
8   
9   import org.mule.api.model.Model;
10  import org.mule.tck.junit4.FunctionalTestCase;
11  
12  import java.util.Collection;
13  import java.util.HashSet;
14  import java.util.Iterator;
15  import java.util.Set;
16  
17  import org.junit.Test;
18  
19  import static org.junit.Assert.assertEquals;
20  
21  public class DefaultModelNames extends FunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "default-model-names.xml";
28      }
29  
30      @Test
31      public void testNames()
32      {
33          Collection models = muleContext.getRegistry().lookupObjects(Model.class);
34          assertEquals(3, models.size()); // includes system model
35          Set modelNames = new HashSet();
36          for (Iterator each = models.iterator(); each.hasNext();)
37          {
38              modelNames.add(((Model) each.next()).getName());
39          }
40          assertEquals(3, modelNames.size());
41      }
42  
43  }