@Test(expected = IllegalArgumentException.class) public void getConnectionSpecClassThrowsIllegalArgumentWhenGivenClassIsNotAConnectionSpec() throws Exception { factory.getConnectionSpecClass(String.class.getName()); }
protected Class<? extends ConnectionSpec> getConnectionSpecClass(final String connectionSpecClass) throws ClassNotFoundException { Class<?> connSpecClass = ReflectionHelper.getClassForName(connectionSpecClass); if (!ConnectionSpec.class.isAssignableFrom(connSpecClass)) { throw new IllegalArgumentException( connSpecClass.getName() + " does not implement " + ConnectionSpec.class); } return (Class<? extends ConnectionSpec>) connSpecClass; }
AbstractConnectionSpecFactory implements ConnectionSpecFactory { protected Class<? extends ConnectionSpec> getConnectionSpecClass(final String connectionSpecClass) throws ClassNotFoundException { Class<?> connSpecClass = ReflectionHelper.getClassForName(connectionSpecClass); if (!ConnectionSpec.class.isAssignableFrom(connSpecClass)) { throw new IllegalArgumentException( connSpecClass.getName() + " does not implement " + ConnectionSpec.class); } return (Class<? extends ConnectionSpec>) connSpecClass; } }
AbstractConnectionSpecFactory implements ConnectionSpecFactory { protected Class<? extends ConnectionSpec> getConnectionSpecClass(final String connectionSpecClass) throws ClassNotFoundException { Class<?> connSpecClass = ReflectionHelper.getClassForName(connectionSpecClass); if (!ConnectionSpec.class.isAssignableFrom(connSpecClass)) { throw new IllegalArgumentException( connSpecClass.getName() + " does not implement " + ConnectionSpec.class); } return (Class<? extends ConnectionSpec>) connSpecClass; }  }
AbstractConnectionSpecFactory implements ConnectionSpecFactory { protected Class<? extends ConnectionSpec> getConnectionSpecClass(final String connectionSpecClass) throws ClassNotFoundException { Class<?> connSpecClass = ReflectionHelper.getClassForName(connectionSpecClass); if (!ConnectionSpec.class.isAssignableFrom(connSpecClass)) { throw new IllegalArgumentException( connSpecClass.getName() + " does not implement " + ConnectionSpec.class); } return (Class<? extends ConnectionSpec>) connSpecClass; }   }
AbstractConnectionSpecFactory implements ConnectionSpecFactory { protected Class<? extends ConnectionSpec> getConnectionSpecClass(final String connectionSpecClass) throws ClassNotFoundException { Class<?> connSpecClass = ReflectionHelper.getClassForName(connectionSpecClass); if (!ConnectionSpec.class.isAssignableFrom(connSpecClass)) { throw new IllegalArgumentException( connSpecClass.getName() + " does not implement " + ConnectionSpec.class); } return (Class<? extends ConnectionSpec>) connSpecClass; }    }