Java 类org.testng.annotations.BeforeSuite 实例源码

项目:keti    文件:TestConfig.java   
@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;
    }
}
项目:POM_HYBRID_FRAMEOWRK    文件:BaseClass.java   
@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");
    }
}
项目:communote-server    文件:WebserviceExtensionPointTest.java   
@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);
}
项目:lookaside_java-1.8.0-openjdk    文件:MRJarWarning.java   
@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);
}
项目:communote-server    文件:InstallerTest.java   
/**
 * 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");
}
项目:azure-documentdb-rxjava    文件:DocumentQueryTest.java   
@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);
    }
}
项目:azure-documentdb-rxjava    文件:DocumentCrudTest.java   
@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());
}
项目:azure-documentdb-rxjava    文件:StoredProcedureCrudTest.java   
@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());
}
项目:ats-framework    文件:HtmlEngineBaseTest.java   
@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);
}
项目:Equella    文件:AbstractRestAssuredTest.java   
@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);
    }
}
项目:coteafs-appium    文件:DefaultTest.java   
/**
 * @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 ();
}
项目:Log4Reports    文件:BaseCase.java   
@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");
}
项目:heat    文件:TestBaseRunner.java   
/**
 * 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();

}
项目:heat    文件:SingleMode.java   
/**
 * 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);
}
项目:keti    文件:TestConfig.java   
@BeforeSuite
public static synchronized void setup() {
    if (!acsStarted) {
        AccessControlService.main(new String[] {});
        acsStarted = true;
    }
}
项目:jdk8u-jdk    文件:RegistryFilterTest.java   
@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);
}
项目:jdk8u-jdk    文件:FDTest.java   
@BeforeSuite
static void init() {
    // create default shared JavaCompiler - reused across multiple
    // compilations

    comp = ToolProvider.getSystemJavaCompiler();
    fm = comp.getStandardFileManager(null, null, null);
}
项目:openjdk-jdk10    文件:FDTest.java   
@BeforeSuite
static void init() {
    // create default shared JavaCompiler - reused across multiple
    // compilations

    comp = ToolProvider.getSystemJavaCompiler();
    fm = comp.getStandardFileManager(null, null, null);
}
项目:openjdk-jdk10    文件:RegistryFilterTest.java   
@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);
}
项目:openjdk-jdk10    文件:ParallelPrefix.java   
@BeforeSuite
public static void setup() {
    java.lang.management.OperatingSystemMXBean bean =
            ManagementFactory.getOperatingSystemMXBean();
    if (bean instanceof OperatingSystemMXBean) {
        OperatingSystemMXBean os = (OperatingSystemMXBean)bean;
        long physicalMemorySize = os.getTotalPhysicalMemorySize() / (1024 * 1024);
        System.out.println("System memory size: " + physicalMemorySize + "M");
        // when we can get system memory size, and it's larger than 2G,
        // then we enable large array size test below,
        // else disable large array size test below.
        if (physicalMemorySize > (2 * 1024)) {
            arraySizeCollection  = new int[]{
                    SMALL_ARRAY_SIZE,
                    THRESHOLD_ARRAY_SIZE,
                    MEDIUM_ARRAY_SIZE,
                    LARGE_ARRAY_SIZE
                };
            System.out.println("System memory is large enough, add large array size test");
            return;
        }
    }
    arraySizeCollection  = new int[]{
            SMALL_ARRAY_SIZE,
            THRESHOLD_ARRAY_SIZE,
            MEDIUM_ARRAY_SIZE
        };
    System.out.println("System memory is not large enough, remove large array size test");
}
项目:AutomationFrameworkTPG    文件:TestBase.java   
@BeforeSuite(alwaysRun = true)
protected void suiteInit() throws Exception {
    File defaultLog = new File(DEFAULT_SUITE_LOG);
    if (defaultLog.exists() && !defaultLog.delete()){
        logger.warn("Unable to delete default log file [{}].", defaultLog.getAbsolutePath());
    }
    logger.info("Preparing spring context...");
    super.springTestContextPrepareTestInstance();
}
项目:revature-automation-framework-remastered    文件:HybridTest.java   
/**
 * @throws IOException If the data provided is not found.
 */
@BeforeSuite
public void setUp() throws IOException{

    driver = DriverHolder.getDriver(OSName, driverName, Bit);
    WebOp = new WebOperation(driver);

    objectProperties = ReadObjectFile.getObjectData(PropertiesFilePath);
       // TODO: find way to dynamically change the sheet name
    //Get row counts
}
项目:openjdk9    文件:FDTest.java   
@BeforeSuite
static void init() {
    // create default shared JavaCompiler - reused across multiple
    // compilations

    comp = ToolProvider.getSystemJavaCompiler();
    fm = comp.getStandardFileManager(null, null, null);
}
项目:aliyun-jclouds    文件:OSSTest.java   
@BeforeSuite
public void beforeSuite() {
   BasicConfigurator.configure();
   BlobStoreContext context = ContextBuilder
         .newBuilder(provider)
         .credentials(key, secret)
         .buildView(BlobStoreContext.class);
   blobStore = context.getBlobStore();
}
项目:aliyun-jclouds    文件:ECSTest.java   
@BeforeSuite
public void beforeSuite() {
   BasicConfigurator.configure();
   ComputeServiceContext context = ContextBuilder
         .newBuilder(provider)
         .credentials(key, secret)
         .buildView(ComputeServiceContext.class);
   computeService = context.getComputeService();
}
项目:aliyun-jclouds    文件:SLBTest.java   
@BeforeSuite
public void beforeSuite() {
   BasicConfigurator.configure();
   LoadBalancerServiceContext context = ContextBuilder
         .newBuilder(provider)
         .credentials(key, secret)
         .buildView(LoadBalancerServiceContext.class);
   loadBalancerService = context.getLoadBalancerService();
}
项目:carbon-identity-framework    文件:IdentityEventConfigBuilderTest.java   
@BeforeSuite
public void setup() throws NoSuchFieldException, IllegalAccessException {

    String home = IdentityEventConfigBuilder.class.getResource("/").getFile();
    String config = IdentityEventConfigBuilder.class.getResource("/").getFile();
    System.setProperty("carbon.home", home);
    System.setProperty("carbon.config.dir.path", config);
}
项目:xframium-java    文件:WebHome.java   
/**
 * The setupSuite method allows you to use the xFramium configuration XML or property file.
 */
@BeforeSuite
public void setupSuite( ITestContext tC )
{
    //
    // Register our Test Artifact
    //

    String xFID = UUID.randomUUID().toString();
    Initializable.xFID.set( xFID ); 
    Map<String,String> customConfig = new HashMap<String,String>(5);
    customConfig.put( "xF-ID", Initializable.xFID.get() );

    ArtifactManager.instance( xFID ).registerArtifact( ArtifactTime.AFTER_TEST, "TAB_WEBHOME", WebHomeArtifact.class );

    //
    // Specify your xFramium configuration file here as TXT or XML
    //

    File configurationFile = new File( "resources\\driverConfig.xml" );
    System.out.println( configurationFile.getAbsolutePath() );

    if ( configurationFile.getName().toLowerCase().endsWith( ".xml" ) )
        cR = new XMLConfigurationReader();
    else if ( configurationFile.getName().toLowerCase().endsWith( ".txt" ) )
        cR = new TXTConfigurationReader();
    cR.readConfiguration( configurationFile, false, customConfig );

}
项目:lookaside_java-1.8.0-openjdk    文件:FDTest.java   
@BeforeSuite
static void init() {
    // create default shared JavaCompiler - reused across multiple
    // compilations

    comp = ToolProvider.getSystemJavaCompiler();
    fm = comp.getStandardFileManager(null, null, null);
}
项目:lookaside_java-1.8.0-openjdk    文件:FDTest.java   
@BeforeSuite
static void init() {
    // create default shared JavaCompiler - reused across multiple
    // compilations

    comp = ToolProvider.getSystemJavaCompiler();
    fm = comp.getStandardFileManager(null, null, null);
}
项目:milo    文件:SecurityFixture.java   
@BeforeSuite
public void setUp() throws Exception {
    KeyStore keyStore = KeyStore.getInstance("PKCS12");

    keyStore.load(getClass().getClassLoader().getResourceAsStream("test-keystore.pfx"), PASSWORD);

    Key clientPrivateKey = keyStore.getKey(CLIENT_ALIAS, PASSWORD);
    if (clientPrivateKey instanceof PrivateKey) {
        clientCertificate = (X509Certificate) keyStore.getCertificate(CLIENT_ALIAS);
        clientCertificateBytes = clientCertificate.getEncoded();

        PublicKey clientPublicKey = clientCertificate.getPublicKey();
        clientKeyPair = new KeyPair(clientPublicKey, (PrivateKey) clientPrivateKey);
    }

    Key serverPrivateKey = keyStore.getKey(SERVER_ALIAS, PASSWORD);
    if (serverPrivateKey instanceof PrivateKey) {
        serverCertificate = (X509Certificate) keyStore.getCertificate(SERVER_ALIAS);
        serverCertificateBytes = serverCertificate.getEncoded();

        PublicKey serverPublicKey = serverCertificate.getPublicKey();
        serverKeyPair = new KeyPair(serverPublicKey, (PrivateKey) serverPrivateKey);
    }

    serverCertificateManager = new TestCertificateManager(
        serverKeyPair,
        serverCertificate
    );

    serverCertificateValidator = new TestCertificateValidator(clientCertificate);
}
项目:pipeclamp    文件:AvroConstraintsTests.java   
@BeforeSuite
protected void setup() {

    validator = new AvroValidator(getPersonSchema(), false);
    System.out.println("Validator config:");
    System.out.println(validator);
}
项目:engerek    文件:ExpressionHandlerImplTest.java   
@BeforeSuite
public void setup() throws SchemaException, SAXException, IOException {
    PrettyPrinter.setDefaultNamespacePrefix(MidPointConstants.NS_MIDPOINT_PUBLIC_PREFIX);
    PrismTestUtil.resetPrismContext(MidPointPrismContextFactory.FACTORY);

       // just something to fill into c:actor expression variable
       MidPointPrincipal principal = new MidPointPrincipal(new UserType(PrismTestUtil.getPrismContext()));
       SecurityContext securityContext = SecurityContextHolder.getContext();
       Authentication authentication = new UsernamePasswordAuthenticationToken(principal, null);
       securityContext.setAuthentication(authentication);
}
项目:lookaside_java-1.8.0-openjdk    文件:RegistryFilterTest.java   
@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);
}
项目:engerek    文件:TestExpression.java   
@BeforeSuite
public void setup() throws SchemaException, SAXException, IOException {
    PrettyPrinter.setDefaultNamespacePrefix(MidPointConstants.NS_MIDPOINT_PUBLIC_PREFIX);
    PrismTestUtil.resetPrismContext(MidPointPrismContextFactory.FACTORY);

    prismContext = PrismTestUtil.createInitializedPrismContext();
    ObjectResolver resolver = new DirectoryFileObjectResolver(MidPointTestConstants.OBJECTS_DIR);
    ProtectorImpl protector = ExpressionTestUtil.createInitializedProtector(prismContext);
    expressionFactory = ExpressionTestUtil.createInitializedExpressionFactory(resolver, protector, prismContext, null);
}
项目:engerek    文件:TestMatchingRule.java   
@BeforeSuite
public void setup() throws SchemaException, SAXException, IOException {
    PrettyPrinter.setDefaultNamespacePrefix(DEFAULT_NAMESPACE_PREFIX);
    PrismTestUtil.resetPrismContext(new PrismInternalTestUtil());

    matchingRuleRegistry = MatchingRuleRegistryFactory.createRegistry();
}
项目:gluu    文件:ConfigurableTest.java   
@BeforeSuite
public void initTestSuite(ITestContext context) throws FileNotFoundException, IOException {
    Reporter.log("Invoked init test suite method \n", true);

    String propertiesFile = context.getCurrentXmlTest().getParameter("propertiesFile");
    if (StringHelper.isEmpty(propertiesFile)) {
        propertiesFile = "target/test-classes/testng.properties";
    }

    // Load test paramters
    //propertiesFile = "/Users/JAVIER/IdeaProjects/oxAuth/Client/target/test-classes/testng.properties";
    FileInputStream conf = new FileInputStream(propertiesFile);
    Properties prop = new Properties();
    prop.load(conf);

    Map<String, String> parameters = new HashMap<String, String>();
    for (Entry<Object, Object> entry : prop.entrySet()) {
        Object key = entry.getKey();
        Object value = entry.getValue();

        if (StringHelper.isEmptyString(key) || StringHelper.isEmptyString(value)) {
            continue;
        }
        parameters.put(key.toString(), value.toString());
    }

    // Overrided test paramters
    context.getSuite().getXmlSuite().setParameters(parameters);
}
项目:engerek    文件:TestObjectQuery.java   
@BeforeSuite
public void setupDebug() throws SchemaException, SAXException, IOException {
    PrettyPrinter.setDefaultNamespacePrefix(DEFAULT_NAMESPACE_PREFIX);
    PrismTestUtil.resetPrismContext(new PrismInternalTestUtil());

    matchingRuleRegistry = MatchingRuleRegistryFactory.createRegistry();
}
项目:milo    文件:StackIntegrationTest.java   
@BeforeSuite
public void setUpClientServer() throws Exception {
    UaTcpStackServerConfig serverConfig = configureServer(
        UaTcpStackServerConfig.builder()
            .setServerName("test")
            .setCertificateManager(serverCertificateManager)
            .setCertificateValidator(serverCertificateValidator)
    ).build();

    server = new UaTcpStackServer(serverConfig);

    server
        .addEndpoint("opc.tcp://localhost:12685/test", null)
        .addEndpoint("opc.tcp://localhost:12685/test", null, serverCertificate, SecurityPolicy.Basic128Rsa15, MessageSecurityMode.Sign)
        .addEndpoint("opc.tcp://localhost:12685/test", null, serverCertificate, SecurityPolicy.Basic256, MessageSecurityMode.Sign)
        .addEndpoint("opc.tcp://localhost:12685/test", null, serverCertificate, SecurityPolicy.Basic256Sha256, MessageSecurityMode.Sign)
        .addEndpoint("opc.tcp://localhost:12685/test", null, serverCertificate, SecurityPolicy.Basic128Rsa15, MessageSecurityMode.SignAndEncrypt)
        .addEndpoint("opc.tcp://localhost:12685/test", null, serverCertificate, SecurityPolicy.Basic256, MessageSecurityMode.SignAndEncrypt)
        .addEndpoint("opc.tcp://localhost:12685/test", null, serverCertificate, SecurityPolicy.Basic256Sha256, MessageSecurityMode.SignAndEncrypt);

    server.startup().get();

    EndpointDescription endpoint = selectEndpoint(
        UaTcpStackClient.getEndpoints(
            "opc.tcp://localhost:12685/test").get()
    );

    UaTcpStackClientConfig clientConfig = configureClient(
        UaTcpStackClientConfig.builder()
            .setEndpoint(endpoint)
            .setKeyPair(clientKeyPair)
            .setCertificate(clientCertificate)
    ).build();

    client = new UaTcpStackClient(clientConfig);
    client.connect().get();
}
项目:communote-server    文件:InstallerTest.java   
/**
 * Installation step that initializes the application.
 *
 * @throws Exception
 *             if the test failed
 */
@BeforeSuite(dependsOnMethods = "installationStep4InitializeCommunoteAccount")
public void installationStep5InitializeApplication() throws Exception {
    CommunoteRuntime.getInstance().getInstaller().initializeApplicationAfterInstallation();
    // set the global client as current client
    ClientTO client = ServiceLocator.findService(ClientRetrievalService.class)
            .findClient(ClientHelper.getGlobalClientId());
    ClientAndChannelContextHolder.setClient(client);
    Date creationDate = client.getCreationDate();
    Timestamp encryptedCreationDate = ClientHelper.getCreationDate();
    Assert.assertEquals(creationDate, encryptedCreationDate);
}