• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BaseLifecycle类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.kuali.rice.core.api.lifecycle.BaseLifecycle的典型用法代码示例。如果您正苦于以下问题:Java BaseLifecycle类的具体用法?Java BaseLifecycle怎么用?Java BaseLifecycle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

BaseLifecycle类属于org.kuali.rice.core.api.lifecycle包,在下文中一共展示了BaseLifecycle类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSuiteLifecycles

点赞 3

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
@Override
protected List<Lifecycle> getSuiteLifecycles() {
    List<Lifecycle> lifecycles = new LinkedList<Lifecycle>();

    /**
     * Initializes Rice configuration from the test harness configuration file.
     */
    lifecycles.add(new BaseLifecycle() {
        @Override
        public void start() throws Exception {
            Config config = getTestHarnessConfig();
            ConfigContext.init(config);
            super.start();
        }
    });

    return lifecycles;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:WsdlCompareTestCase.java

示例2: loadLifecycles

点赞 3

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
@Override
public List<Lifecycle> loadLifecycles() throws Exception {
	List<Lifecycle> lifecycles = new LinkedList<Lifecycle>();
	// this validation of our service list needs to happen after we've
	// loaded our configs so it's a lifecycle
	lifecycles.add(new BaseLifecycle() {

		@Override
		public void start() throws Exception {
			// first check if we want to allow self-signed certificates for SSL communication
			if (Boolean.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.KSB_ALLOW_SELF_SIGNED_SSL)).booleanValue()) {
			    Protocol.registerProtocol("https", new Protocol("https",
				    (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
			}
			super.start();
		}
	});
	return lifecycles;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:20,
代码来源:KSBConfigurer.java

示例3: loadLifecycles

点赞 2

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
@Override
public List<Lifecycle> loadLifecycles() throws Exception {
    List<Lifecycle> lifecycles = new LinkedList<Lifecycle>();

    // this validation of our service list needs to happen after we've
    // loaded our configs so it's a lifecycle
    lifecycles.add(new BaseLifecycle() {
        @Override
        public void start() throws Exception {
            super.start();
        }
    });

    return lifecycles;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:KSBConfigurer.java

示例4: getPerTestLifecycles

点赞 2

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
/**
  * @return Lifecycles run every test run
  */
 protected List<Lifecycle> getPerTestLifecycles() {
 	List<Lifecycle> lifecycles = new LinkedList<Lifecycle>();
     lifecycles.add(getPerTestDataLoaderLifecycle());
     lifecycles.add(new BaseLifecycle() {
         @Override
public void start() throws Exception {
             loadPerTestData();
             super.start();
         }
     });
     return lifecycles;
 }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:RiceTestCase.java

示例5: resetDb

点赞 2

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
protected void resetDb() throws Exception {
    // cleanup database from previous @PerSuiteUnitTestData
    ClearDatabaseLifecycle clearDatabaseLifeCycle = new ClearDatabaseLifecycle();
    clearDatabaseLifeCycle.start();

    // Re-Loads Suite Test Data - Needed after adhoc cleanout
    BaseLifecycle baseLifecycle = new BaseLifecycle() {
        @Override
        public void start() throws Exception {
            loadSuiteTestData();
            super.start();
        }
    };
    baseLifecycle.start();
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:AnnotationTestParent.java

示例6: getNotificationPerTestLifecycles

点赞 2

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
protected List<Lifecycle> getNotificationPerTestLifecycles() {
    List<Lifecycle> lifecycles = new ArrayList<Lifecycle>();
    lifecycles.add(new BaseLifecycle() {
        @Override
        public void start() throws Exception {
            // get the composite Rice Spring context
            BeanFactory moduleContext = CompositeBeanFactory.createBeanFactory(
                    RiceResourceLoaderFactory.getSpringResourceLoaders());
            // This method sets up the Spring services so that they can be accessed by the tests.
            services = new SpringNotificationServiceLocator(moduleContext);
            // grab the module's transaction manager
            transactionManager = (PlatformTransactionManager) moduleContext.getBean(TX_MGR_BEAN_NAME, PlatformTransactionManager.class);
            super.start();
        }

    });

    // clear out the KEW cache
    lifecycles.add(new BaseLifecycle() {
        @Override
        public void start() throws Exception {
            super.start();

            LOG.info("Status of Ken scheduler on start: " + (services.getScheduler().isStarted() ? "started" : "stopped"));
            // stop quartz if a test failed to do so
            disableQuartzJobs();
        }
        public void stop() throws Exception {
            //KsbApiServiceLocator.getCacheAdministrator().flushAll();

            LOG.info("Status of Ken scheduler on stop: " + (services.getScheduler().isStarted() ? "started" : "stopped"));
            // stop quartz if a test failed to do so
            disableQuartzJobs();

            super.stop();
        }
    });

    // load the default SQL
    //lifecycles.add(new SQLDataLoaderLifecycle("classpath:org/kuali/rice/ken/test/DefaultPerTestData.sql", ";"));
    
    //lifecycles.add(new KEWXmlDataLoaderLifecycle("classpath:org/kuali/rice/ken/test/DefaultPerTestData.xml"));
    

    return lifecycles;

}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:48,
代码来源:KENTestCase.java

示例7: getSuiteLifecycles

点赞 2

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
/**
  * Returns the List of Lifecycles to start when the unit test suite is started
  */
 protected List<Lifecycle> getSuiteLifecycles() {
     List<Lifecycle> lifecycles = new LinkedList<Lifecycle>();
     
     /**
      * Initializes Rice configuration from the test harness configuration file.
      */
     lifecycles.add(new BaseLifecycle() {
         @Override
public void start() throws Exception {
             Config config = getTestHarnessConfig();
             ConfigContext.init(config);
             super.start();
         }
     });
     
     /**
      * Loads the TestHarnessSpringBeans.xml file which obtains connections to the DB for us
      */
     lifecycles.add(getTestHarnessSpringResourceLoader());
     
     /**
      * Establishes the TestHarnessServiceLocator so that it has a reference to the Spring context
      * created from TestHarnessSpringBeans.xml
      */
     lifecycles.add(new BaseLifecycle() {
         @Override
public void start() throws Exception {
             TestHarnessServiceLocator.setContext(getTestHarnessSpringResourceLoader().getContext());
             super.start();
         }
     });
     
     /**
      * Clears the tables in the database.
      */
     if (clearTables) {
     	lifecycles.add(new ClearDatabaseLifecycle());
     }
     
     /**
      * Loads Suite Test Data
      */
     lifecycles.add(new BaseLifecycle() {
     	@Override
public void start() throws Exception {
     		loadSuiteTestData();
     		super.start();
     	}
     });
     
     Lifecycle loadApplicationLifecycle = getLoadApplicationLifecycle();
     if (loadApplicationLifecycle != null) {
     	lifecycles.add(loadApplicationLifecycle);
     }
     return lifecycles;
 }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:60,
代码来源:RiceTestCase.java

示例8: getSuiteLifecycles

点赞 2

import org.kuali.rice.core.api.lifecycle.BaseLifecycle; //导入依赖的package包/类
@Override
protected List<Lifecycle> getSuiteLifecycles() {
	List<Lifecycle> lifecycles = super.getPerTestLifecycles();
    lifecycles.add(new Lifecycle() {
		boolean started = false;

		public boolean isStarted() {
			return this.started;
		}

		public void start() throws Exception {
			setModuleName(getModuleName());
			setBaseDirSystemProperty(getModuleName());
			Config config = getTestHarnessConfig();
			ConfigContext.init(config);
			this.started = true;
		}

		public void stop() throws Exception {
			this.started = false;
		}
	});
    /**
     * Loads the TestHarnessSpringBeans.xml file which obtains connections to the DB for us
     */
    lifecycles.add(getTestHarnessSpringResourceLoader());

    /**
     * Establishes the TestHarnessServiceLocator so that it has a reference to the Spring context
     * created from TestHarnessSpringBeans.xml
     */
    lifecycles.add(new BaseLifecycle() {
        @Override
        public void start() throws Exception {
            TestHarnessServiceLocator.setContext(getTestHarnessSpringResourceLoader().getContext());
            super.start();
        }
    });

    ClearDatabaseLifecycle clearDatabaseLifecycle = new ClearDatabaseLifecycle();
    clearDatabaseLifecycle.getAlternativeTablesToClear().add("KREW_RULE_T");
    clearDatabaseLifecycle.getAlternativeTablesToClear().add("KREW_RULE_RSP_T");
    clearDatabaseLifecycle.getAlternativeTablesToClear().add("KREW_DLGN_RSP_T");
    clearDatabaseLifecycle.getAlternativeTablesToClear().add("KREW_RULE_ATTR_T");
    clearDatabaseLifecycle.getAlternativeTablesToClear().add("KREW_RULE_TMPL_T");
    clearDatabaseLifecycle.getAlternativeTablesToClear().add("KREW_DOC_TYP_T");
    lifecycles.add(clearDatabaseLifecycle);

    File[] folders = new File(FILE_PREFIX).listFiles();

    if (folders != null) {
           Arrays.sort(folders);
           for (File folder : folders) {
           	if (folder.getName().startsWith("00")) {
           		File[] files = new File(FILE_PREFIX + folder.getName()).listFiles();
           		if (files != null) {
                       // Arrays.sort(files);
                       for (File file : files) {
                       	if (file.getName().endsWith(".xml")) {
                       		lifecycles.add(new KPMEXmlDataLoaderLifecycle(FILE_PREFIX + folder.getName() + "/" + file.getName()));
                       	}
                       }
   		        }
            }		        
           }
    }
	return lifecycles;
}
 

开发者ID:kuali-mirror,
项目名称:kpme,
代码行数:69,
代码来源:KPMEIntegrationTestCase.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)