當前位置: 首頁>>代碼示例>>Java>>正文


Java BeforeSuite類代碼示例

本文整理匯總了Java中org.testng.annotations.BeforeSuite的典型用法代碼示例。如果您正苦於以下問題:Java BeforeSuite類的具體用法?Java BeforeSuite怎麽用?Java BeforeSuite使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BeforeSuite類屬於org.testng.annotations包,在下文中一共展示了BeforeSuite類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupForEclipse

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public static synchronized void setupForEclipse() {
    String runInEclipse = System.getenv("RUN_IN_ECLIPSE");
    if (StringUtils.isEmpty(runInEclipse) || !runInEclipse.equalsIgnoreCase("true")) {
        return;
    }
    if (!acsStarted) {
        System.out.println("*** Setting up test for Eclipse ***");
        String springProfilesActive = System.getenv("SPRING_PROFILES_ACTIVE");
        if (StringUtils.isEmpty(springProfilesActive)) {
            springProfilesActive = "h2,public,simple-cache";
        }
        System.setProperty("spring.profiles.active", springProfilesActive);
        AccessControlService.main(new String[] {});
        acsStarted = true;
    }
}
 
開發者ID:eclipse,項目名稱:keti,代碼行數:18,代碼來源:TestConfig.java

示例2: beforeSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@Parameters({"baseURL"})
@BeforeSuite
public void beforeSuite(String baseURL) {
	try {

		rpr = ReadPropertyFile.getInstance("./TestResources/TestConfig/test.properties");

		reportFile = rpr.getKey("reportFile");
		emailConfigFile = rpr.getKey("emailConfigFile");
		sendEmail = rpr.getKey("sendEmail");
		
		// If the we are testing single Web Application. Mention the same in 
		//test.properties file and uncomment below line.
		
		//baseURL = rpr.getKey("baseURL");
		
		// Commnet this line if previous line is uncommented
		BaseClass.baseURL = baseURL;
		browserName = rpr.getKey("browserName");
		reporter = ReportManager.getReporter(reportFile, true);
		
	} catch (Exception e) {
		e.printStackTrace();
		System.out.println("Error occured in @BeforeSuite");
	}
}
 
開發者ID:anilpandeykiet,項目名稱:POM_HYBRID_FRAMEOWRK,代碼行數:27,代碼來源:BaseClass.java

示例3: setup

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public void setup() {
    communoteWebServiceController = new CommunoteWebServiceController();
    communoteWebServiceController.setServletContext(new MockServletContext());

    communoteWebServiceDefinition = new CommunoteWebServiceDefinition();

    communoteWebServiceDefinition.setEndpointName("HelloWorldImpl");
    communoteWebServiceDefinition.setLocalPartName("HelloWorldImpl");
    communoteWebServiceDefinition.setNameSpaceUri("http://www.examples.com/wsdl/HelloService");
    communoteWebServiceDefinition.setPluginName(PLUGIN_NAME);
    communoteWebServiceDefinition.setRelativeUrlPattern(REL_URL_PATTERN);
    communoteWebServiceDefinition.setServiceClass(HelloWorldImpl.class);

    communoteWebServiceController.registerService(communoteWebServiceDefinition);
}
 
開發者ID:Communote,項目名稱:communote-server,代碼行數:17,代碼來源:WebserviceExtensionPointTest.java

示例4: setup

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public void setup() throws IOException {
    defaultAttributes = new Attributes();
    defaultAttributes.putValue("Manifest-Version", "1.0");
    defaultAttributes.putValue("Created-By", "1.8.0-internal");

    mrjar1   = Paths.get("mrjar1.jar");
    mrjar2   = Paths.get("mrjar2.jar");
    nonMRjar = Paths.get("nonMRjar.jar");
    mrjarAllCaps = Paths.get("mrjarAllCaps.jar");

    Attributes mrJarAttrs = new Attributes(defaultAttributes);
    mrJarAttrs.putValue(MRJAR_ATTR, "true");

    build(mrjar1, mrJarAttrs);
    build(mrjar2, mrJarAttrs);
    build(nonMRjar, defaultAttributes);

    // JEP 238 - "Multi-Release JAR Files" states that the attribute name
    // and value are case insensitive.  Try with all caps to ensure that
    // jdeps still recognizes a multi-release jar.
    Attributes allCapsAttrs = new Attributes(defaultAttributes);
    allCapsAttrs.putValue(MRJAR_ATTR.toUpperCase(), "TRUE");
    build(mrjarAllCaps, allCapsAttrs);
}
 
開發者ID:ojdkbuild,項目名稱:lookaside_java-1.8.0-openjdk,代碼行數:26,代碼來源:MRJarWarning.java

示例5: installationStep1InitializeDatabase

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
/**
 * Installation test that creates the DB schema.
 *
 * @throws Exception
 *             in case the test fails
 */
@BeforeSuite(dependsOnMethods = "prepareDatabase")
public void installationStep1InitializeDatabase() throws Exception {
    CommunoteInstaller installer = CommunoteRuntime.getInstance().getInstaller();

    Map<CoreConfigurationPropertyConstant, String> settings = new HashMap<CoreConfigurationPropertyConstant, String>();

    settings.put(CorePropertyDatabase.DATABASE_HOST, databaseHost);
    settings.put(CorePropertyDatabase.DATABASE_PORT, databasePort);
    settings.put(CorePropertyDatabase.DATABASE_NAME, databaseName);
    settings.put(CorePropertyDatabase.DATABASE_USER_NAME, databaseUsername);
    settings.put(CorePropertyDatabase.DATABASE_USER_PASSWORD, databasePassword);

    StartupProperties newSettings = installer.updateDatabaseSettings(this.databaseType,
            settings);
    String url = newSettings.getDatabaseUrl();
    Assert.assertNotNull(url);
    LOGGER.info("Database Url: {}", url);
    boolean success = installer.initializeDatabase(new LogDatabaseInstallationCallback());
    Assert.assertTrue(success, "DB-setup failed");
}
 
開發者ID:Communote,項目名稱:communote-server,代碼行數:27,代碼來源:InstallerTest.java

示例6: beforeSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite(groups = { "simple" }, timeOut = SETUP_TIMEOUT)
public static void beforeSuite() throws Exception {
    houseKeepingClient = createRxWrapperDocumentClient().build();
    Database d = new Database();
    d.setId(DATABASE_ID);
    createdDatabase = safeCreateDatabase(houseKeepingClient, d);
    createdCollection = safeCreateCollection(houseKeepingClient, createdDatabase.getSelfLink(), getCollectionDefinition());
    for(int i = 0; i < 5; i++) {
        createDocument(houseKeepingClient, i);
    }
}
 
開發者ID:Azure,項目名稱:azure-documentdb-rxjava,代碼行數:12,代碼來源:DocumentQueryTest.java

示例7: beforeSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite(groups = { "simple" }, timeOut = SETUP_TIMEOUT)
public static void beforeSuite() {
    houseKeepingClient = createGatewayRxDocumentClient().build();
    Database d = new Database();
    d.setId(DATABASE_ID);
    createdDatabase = safeCreateDatabase(houseKeepingClient, d);
    createdCollection = safeCreateCollection(houseKeepingClient, createdDatabase.getSelfLink(), getCollectionDefinition());
}
 
開發者ID:Azure,項目名稱:azure-documentdb-rxjava,代碼行數:9,代碼來源:DocumentCrudTest.java

示例8: beforeSuiteHtmlEngineBaseTest

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public void beforeSuiteHtmlEngineBaseTest() throws Exception {

    UiEngineConfigurator configurator = UiEngineConfigurator.getInstance();

    // set the base folder with the map files
    // configurator.setMapFilesBaseDir( "resources/com/axway/ats/uiengine/maps" );

    // overwrite some configuration properties for faster test execution
    configurator.setCommandDelay(-1);
    configurator.setElementStateChangeDelay(2000);
    configurator.setHighlightElements(false);
}
 
開發者ID:Axway,項目名稱:ats-framework,代碼行數:14,代碼來源:HtmlEngineBaseTest.java

示例9: setupProxy

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public void setupProxy(ITestContext testContext)
{
	testContext.getSuite().setAttribute("cleanups", Lists.newArrayList());
	String proxyHost = testConfig.getProperty("proxy.host");
	String proxyPortString = testConfig.getProperty("proxy.port");
	if( proxyPortString != null )
	{
		System.setProperty("http.proxyHost", proxyHost);
		System.setProperty("http.proxyPort", proxyPortString);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:13,代碼來源:AbstractRestAssuredTest.java

示例10: setupTestSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
/**
 * @author wasiq.bhamla
 * @since 13-Apr-2017 10:10:45 PM
 */
@BeforeSuite (alwaysRun = true)
public void setupTestSuite () {
	this.androidServer = new AppiumServer ("android");
	this.androidServer.start ();

	this.androidDevice = new AndroidDevice (this.androidServer, "test");
	this.androidDevice.start ();
}
 
開發者ID:WasiqB,項目名稱:coteafs-appium,代碼行數:13,代碼來源:DefaultTest.java

示例11: beforeSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public void beforeSuite(){
	System.out.println("BaseCase: beforeSuite");
	initConfig();
	TestReport.startTime = DateUtil.getNow("yyyy-MM-dd HH:mm:ss");
	TestReport.startMsTime = DateUtil.getNow("yyyy-MM-dd HH:mm:ss.SSS");
}
 
開發者ID:AlanYangs,項目名稱:Log4Reports,代碼行數:8,代碼來源:BaseCase.java

示例12: beforeTestSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
/**
 * Method that takes test suites parameters and sets some environment properties.
 * @param propFilePath path of the property file data
 * @param inputWebappName name of the service to test (optional parameter)
 * @param context testNG context
 */
@BeforeSuite
@Override
@Parameters(value = {ENV_PROP_FILE_PATH, WEBAPP_NAME})
public void beforeTestSuite(String propFilePath,
                            @Optional(NO_INPUT_WEBAPP_NAME) String inputWebappName,
                            ITestContext context) {
    TestSuiteHandler testSuiteHandler = TestSuiteHandler.getInstance();
    testSuiteHandler.setPropertyFilePath(propFilePath);
    testSuiteHandler.populateEnvironmentHandler();
    testSuiteHandler.populateTestCaseUtils();

}
 
開發者ID:HotelsDotCom,項目名稱:heat,代碼行數:19,代碼來源:TestBaseRunner.java

示例13: beforeTestSuite

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
/**
 * Method that takes test suites parameters and sets some environment properties.
 * @param propFilePath path of the property file data
 * @param inputWebappName name of the service to test (optional parameter)
 * @param context testNG context
 */
@BeforeSuite
@Override
@Parameters(value = {ENV_PROP_FILE_PATH, WEBAPP_NAME})
public void beforeTestSuite(String propFilePath,
                            @Optional(NO_INPUT_WEBAPP_NAME) String inputWebappName,
                            ITestContext context) {
    super.beforeTestSuite(propFilePath, inputWebappName, context);
    TestSuiteHandler.getInstance().setWebappName(inputWebappName);
}
 
開發者ID:HotelsDotCom,項目名稱:heat,代碼行數:16,代碼來源:SingleMode.java

示例14: setup

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
public static synchronized void setup() {
    if (!acsStarted) {
        AccessControlService.main(new String[] {});
        acsStarted = true;
    }
}
 
開發者ID:eclipse,項目名稱:keti,代碼行數:8,代碼來源:TestConfig.java

示例15: setupRegistry

import org.testng.annotations.BeforeSuite; //導入依賴的package包/類
@BeforeSuite
static void setupRegistry() {
    try {
        impl = TestLibrary.createRegistryOnEphemeralPort();
        port = TestLibrary.getRegistryPort(impl);
        registry = LocateRegistry.getRegistry("localhost", port);
    } catch (RemoteException ex) {
        Assert.fail("initialization of registry", ex);
    }

    System.out.printf("RMI Registry filter: %s%n", registryFilter);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:13,代碼來源:RegistryFilterTest.java


注:本文中的org.testng.annotations.BeforeSuite類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。