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