<commit_before>//
//  IBMMobileFirstPlatformFoundationLiveUpdateTests.swift
//  IBMMobileFirstPlatformFoundationLiveUpdateTests
//
//  Created by <NAME> on 21/06/2016.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
import IBMMobileFirstPlatformFoundationLiveUpdate
import IBMMobileFirstPlatformFoundation

class IBMMobileFirstPlatformFoundationLiveUpdateTests: XCTestCase {
    
    override func setUp() {
        super.setUp()
        WLClient.sharedInstance().setServerUrl(NSURL(string: "http://172.16.17.32:9080/mfp/api"))
    }
    
    override func tearDown() {
        super.tearDown()
    }
    
    func testObtainConfigurationWithSegment() {
        let expectation = self.expectationWithDescription("testObtainConfigurationWithSegment")
        
        LiveUpdateManager.sharedInstance.obtainConfiguration("segment1", useCache: false) { (configuration, error) in
            XCTAssertTrue((configuration?.isFeatureEnabled("feature1"))!, "featue1 should be enabled")
            XCTAssertFalse((configuration?.isFeatureEnabled("feature2"))!, "featue2 should be disabled")
            XCTAssertEqual(configuration?.getProperty("property1"), "value1")
            XCTAssertEqual(configuration?.getProperty("property2"), "value2")
            expectation.fulfill()
        }
        
        self.waitForExpectationsWithTimeout(10.0, handler: nil)
    }
    
    func testObtainConfigurationWithParams() {
        let expectation = self.expectationWithDescription("testObtainConfigurationWithSegment")
        
        LiveUpdateManager.sharedInstance.obtainConfiguration(["param1":"value1"], useCache: false) { (configuration, error) in
            XCTAssertFalse((configuration?.isFeatureEnabled("feature1"))!, "featue1 should be disabled")<commit_msg>travis<commit_after>//
//  IBMMobileFirstPlatformFoundationLiveUpdateTests.swift
//  IBMMobileFirstPlatformFoundationLiveUpdateTests
//
//  Created by <NAME> on 21/06/2016.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
import IBMMobileFirstPlatformFoundationLiveUpdate
import IBMMobileFirstPlatformFoundation

class IBMMobileFirstPlatformFoundationLiveUpdateTests: XCTestCase {
    
    override func setUp() {
        super.setUp()
        //WLClient.sharedInstance().setServerUrl(NSURL(string: "http://172.16.17.32:9080/mfp/api"))
    }
    
    override func tearDown() {
        super.tearDown()
    }
    
    func testObtainConfigurationWithSegment() {
        let expectation = self.expectationWithDescription("testObtainConfigurationWithSegment")
        
        LiveUpdateManager.sharedInstance.obtainConfiguration("segment1", useCache: false) { (configuration, error) in
            XCTAssertTrue((configuration?.isFeatureEnabled("feature1"))!, "featue1 should be enabled")
            XCTAssertFalse((configuration?.isFeatureEnabled("feature2"))!, "featue2 should be disabled")
            XCTAssertEqual(configuration?.getProperty("property1"), "value1")
            XCTAssertEqual(configuration?.getProperty("property2"), "value2")
            expectation.fulfill()
        }
        
        self.waitForExpectationsWithTimeout(10.0, handler: nil)
    }
    
    func testObtainConfigurationWithParams() {
        let expectation = self.expectationWithDescription("testObtainConfigurationWithSegment")
        
        LiveUpdateManager.sharedInstance.obtainConfiguration(["param1":"value1"], useCache: false) { (configuration, error) in
            XCTAssertFalse((configuration?.isFeatureEnabled("feature1"))!, "featue1 should be disabled")
{'fraction_non_alphanumeric': 0.10496772382823463, 'fraction_numerical': 0.02301431378052203, 'mean_word_length': 3.8358208955223883, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2377494', 'n_tokens_mistral': 976, 'n_tokens_neox': 929, 'n_words': 157}