View Javadoc

1   /*
2    * $Id: SpiUtilsTestCase.java 22387 2011-07-12 03:53:36Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.util;
12  
13  import org.mule.tck.junit4.AbstractMuleTestCase;
14  
15  import org.junit.Test;
16  
17  public class SpiUtilsTestCase extends AbstractMuleTestCase
18  {
19  
20      @Test
21      public void testThisIsJustAnEmptyPlaceholder() {
22          // needed to avoid triggering false TestSuite failures with no test methods.
23      }
24  
25  //    public void testDiscoverDefault() throws Exception
26  //    {
27  //        Class c = SpiUtils.findService(Fruit.class, Banana.class.getName(), getClass());
28  //        assertNotNull(c);
29  //        assertEquals(Banana.class.getName(), c.getName());
30  //    }
31  //
32  //    public void testDiscoverNotFound() throws Exception
33  //    {
34  //        Class c = SpiUtils.findService(Fruit.class, getClass());
35  //        assertNull(c);
36  //    }
37  //
38  //    public void testDiscoverFromProperty() throws Exception
39  //    {
40  //        System.setProperty(Fruit.class.getName(), Apple.class.getName());
41  //        Class c = SpiUtils.findService(Fruit.class, getClass());
42  //        assertNotNull(c);
43  //        assertEquals(Apple.class.getName(), c.getName());
44  //        Properties p = System.getProperties();
45  //        p.remove(Fruit.class.getName());
46  //        System.setProperties(p);
47  //    }
48  //
49  //    public void testDiscoverFromPropertyFile() throws Exception
50  //    {
51  //        InputStream is = IOUtils.getResourceAsStream("test-spi.properties", getClass());
52  //        assertNotNull("Test resource not found.", is);
53  //        Properties p = new Properties();
54  //        p.load(is);
55  //        assertNotNull(p);
56  //        Class c = SpiUtils.findService(Fruit.class, p, getClass());
57  //        assertNotNull(c);
58  //        assertEquals(Banana.class.getName(), c.getName());
59  //    }
60  //
61  //    public void testDiscoverFromResource() throws Exception
62  //    {
63  //        Class c = SpiUtils.findService(Fruit.class, "test-spi.properties", Apple.class.getName(), getClass());
64  //        assertNotNull(c);
65  //        assertEquals(Banana.class.getName(), c.getName());
66  //    }
67  
68  }