VSensorLoader extends Thread { public AbstractWrapper findWrapper(AddressBean addressBean) throws InstantiationException, IllegalAccessException { if ( Main.getWrapperClass ( addressBean.getWrapper ( ) ) == null ) { logger.error ( "The wrapper >" + addressBean.getWrapper ( ) + "< is not defined in the >" + WrappersUtil.DEFAULT_WRAPPER_PROPERTIES_FILE + "< file." ); return null; } AbstractWrapper wrapper = ( AbstractWrapper ) Main.getWrapperClass ( addressBean.getWrapper ( ) ).newInstance ( ); wrapper.setActiveAddressBean ( addressBean ); boolean initializationResult = wrapper.initialize ( ); if ( initializationResult == false ) return null; try { logger.debug("Wrapper name: "+wrapper.getWrapperName()+ " -- view name "+ wrapper.getDBAliasInStr()); if (!Main.getWindowStorage().tableExists(wrapper.getDBAliasInStr(),wrapper.getOutputFormat())) Main.getWindowStorage().executeCreateTable ( wrapper.getDBAliasInStr ( ) , wrapper.getOutputFormat ( ),wrapper.isTimeStampUnique() ); } catch ( SQLException e ) { logger.error ( e.getMessage ( ) , e ); return null; } activeWrappers.add ( wrapper ); return wrapper; } VSensorLoader();  VSensorLoader( String pluginsPath ); void addVSensorStateChangeListener(VSensorStateChangeListener listener); void removeVSensorStateChangeListener(VSensorStateChangeListener listener); boolean fireVSensorLoading(VSensorConfig config); boolean fireVSensorUnLoading(VSensorConfig config); static VSensorLoader getInstance(String path); void startLoading(); void run( ); void loadVirtualSensor(String vsConfigurationFileContent, String fileName); static String getVSConfigurationFilePath(String fileName); synchronized void loadPlugin(); synchronized boolean loadPlugin(String fileFilterName); boolean isVirtualSensorValid(VSensorConfig configuration); void removeAllVSResources( VirtualSensor pool ); void releaseStreamSource(StreamSource streamSource); static Modifications getUpdateStatus(String virtualSensorsPath); static Modifications getUpdateStatus(String virtualSensorsPath, String filterFileName); boolean createInputStreams( VirtualSensor pool ); AbstractWrapper findWrapper(AddressBean addressBean); boolean prepareStreamSource( VSensorConfig vsensorConfig,InputStream inputStream , StreamSource streamSource  ); boolean prepareStreamSource( StreamSource streamSource ,DataField[] outputformat, AbstractWrapper wrapper ); void stopLoading( ); static final String VSENSOR_POOL; static final String STREAM_SOURCE; static final String INPUT_STREAM; }
@Test public void testPrepareWrapper() throws ClassNotFoundException, InstantiationException, IllegalAccessException { VSensorLoader loader = new VSensorLoader(); MockWrapper wrapper = (MockWrapper) loader.findWrapper(addressing[0]); assertNotNull(wrapper); }