text:
Bipartite connectivity mapping (BCM)
======================================

The program **vbcm** implements a new approach for
analyzing connectivity in rs-fMRI between two brain regions.
The two regions can be of any size, but should be non-overlapping.
The main idea is to represent connectivity between the regions as a bipartite graph and analyse
it using bipartite network projections. The advantage of this approach is that it allows to fully
preserve spatial precision in both ROIs. This sets it apart from traditional seed-based connectivity mapping
where the seed ROI must be averaged so that its spatial information is lost.

Example:
``````````

 ::

   vbcm -in func.v -roi1 roi1.v -roi2 roi2.v -out result.v

References
^^^^^^^^^^^^^^

.. [2018a_Lohmann] Lohmann, G. et al (2018), 6th Biennial Conf on Resting State and Brain
   Connectivity, Montreal, Canada,

Parameters of 'vbcm'
````````````````````````````````

 -help    Prints usage information.
 -in      Input file.
 -out     Output file.
 -roi1    ROI 1
 -roi2    ROI 2

.. index:: bcm


text:
<?php
/**
 * WordPress Coding Standard.
 *
 * @package WPCS\WordPressCodingStandards
 * @link    https://github.com/WordPress/WordPress-Coding-Standards
 * @license https://opensource.org/licenses/MIT MIT
 */

namespace WordPressCS\WordPress;

use WordPressCS\WordPress\Sniff;
use PHP_CodeSniffer\Util\Tokens;

/**
 * Restricts usage of some functions.
 *
 * @package WPCS\WordPressCodingStandards
 *
 * @since   0.3.0
 * @since   0.10.0 Class became a proper abstract class. This was already the behaviour.
 *                 Moved the file and renamed the class from
 *                 `\WordPressCS\WordPress\Sniffs\Functions\FunctionRestrictionsSniff` to
 *                 `\WordPressCS\WordPress\AbstractFunctionRestrictionsSniff`.
 * @since   0.11.0 Extends the WordPressCS native `Sniff` class.
 */
abstract class AbstractFunctionRestrictionsSniff extends Sniff {

	/**
	 * Exclude groups.
	 *
	 * Example: 'switch_to_blog,user_meta'
	 *
	 * @since 0.3.0
	 * @since 1.0.0 This property now expects to be passed an array.
	 *              Previously a comma-delimited string was expected.
	 *
	 * @var array
	 */
	public $exclude = array();

	/**
	 * Groups of function data to check against.
	 * Don't use this in extended classes, override getGroups() instead.
	 * This is only used for Unit tests.
	 *
	 * @since 0.10.0
	 *
	 * @var array
	 */
	public static $unittest_groups = array();

	/**
	 * Regex pattern with placeholder for the function names.
	 *
	 * @since 0.10.0
	 *
	 * @var string
	 */
	protected $regex_pattern = '`\b(?:%s)\b`i';

	/**
	 * Cache for the group information.
	 *
	 * @since 0.10.0
	 *
	 * @var array
	 */
	protected $groups = array();

	/**
	 * Cache for the excluded groups information.
	 *
	 * @since 0.11.0
	 *
	 * @var array
	 */
	protected $excluded_groups = array();

	/**
	 * Regex containing the name of all functions handled by a sniff.
	 *
	 * Set in `register()` and used to do an initial check.
	 *
	 * @var string
	 */
	private $prelim_check_regex;

	/**
	 * Groups of functions to restrict.
	 *
	 * This method should be overridden in extending classes.
	 *
	 * Example: groups => array(
	 *     'lambda' => array(
	 *         'type'      => 'error' | 'warning',
	 *         'message'   => 'Use anonymous functions instead please!',
	 *         'functions' => array( 'file_get_contents', 'create_function', 'mysql_*' ),
	 *         // Only useful when using wildcards:
	 *         'whitelist' => array( 'mysql_to_rfc3339' => true, ),
	 *     )
	 * )
	 *
	 * You can use * wildcards to target a group of functions.
	 * When you use * wildcards, you may inadvertently restrict too many
	 * functions. In that case you can add the `whitelist` key to
	 * whitelist individual functions to prevent false positives.
	 *
	 * @return array
	 */
	abstract public function getGroups();

	/**
	 * Returns an array of tokens this test wants to listen for.
	 *
	 * @return array
	 */
	public function register() {
		// Prepare the function group regular expressions only once.
		if ( false === $this->setup_groups( 'functions' ) ) {
			return array();
		}

		return array(
			\T_STRING,
		);
	}

	/**
	 * Set up the regular expressions for each group.
	 *
	 * @since 0.10.0
	 *
	 * @param string $key The group array index key where the input for the regular expression can be found.
	 * @return bool True if the groups were setup. False if not.
	 */
	protected function setup_groups( $key ) {
		// Prepare the function group regular expressions only once.
		$this->groups = $this->getGroups();

		if ( empty( $this->groups ) && empty( self::$unittest_groups ) ) {
			return false;
		}

		// Allow for adding extra unit tests.
		if ( ! empty( self::$unittest_groups ) ) {
			$this->groups = array_merge( $this->groups, self::$unittest_groups );
		}

		$all_items = array();
		foreach ( $this->groups as $groupName => $group ) {
			if ( empty( $group[ $key ] ) ) {
				unset( $this->groups[ $groupName ] );
			} else {
				$items       = array_map( array( $this, 'prepare_name_for_regex' ), $group[ $key ] );
				$all_items[] = $items;
				$items       = implode( '|', $items );

				$this->groups[ $groupName ]['regex'] = sprintf( $this->regex_pattern, $items );
			}
		}

		if ( empty( $this->groups ) ) {
			return false;
		}

		// Create one "super-regex" to allow for initial filtering.
		$all_items                = \call_user_func_array( 'array_merge', $all_items );
		$all_items                = implode( '|', array_unique( $all_items ) );
		$this->prelim_check_regex = sprintf( $this->regex_pattern, $all_items );

		return true;
	}

	/**
	 * Processes this test, when one of its tokens is encountered.
	 *
	 * @param int $stackPtr The position of the current token in the stack.
	 *
	 * @return int|void Integer stack pointer to skip forward or void to continue
	 *                  normal file processing.
	 */
	public function process_token( $stackPtr ) {

		$this->excluded_groups = $this->merge_custom_array( $this->exclude );
		if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) {
			// All groups have been excluded.
			// Don't remove the listener as the exclude property can be changed inline.
			return;
		}

		// Preliminary check. If the content of the T_STRING is not one of the functions we're
		// looking for, we can bow out before doing the heavy lifting of checking whether
		// this is a function call.
		if ( preg_match( $this->prelim_check_regex, $this->tokens[ $stackPtr ]['content'] ) !== 1 ) {
			return;
		}

		if ( true === $this->is_targetted_token( $stackPtr ) ) {
			return $this->check_for_matches( $stackPtr );
		}
	}

	/**
	 * Verify is the current token is a function call.
	 *
	 * @since 0.11.0 Split out from the `process()` method.
	 *
	 * @param int $stackPtr The position of the current token in the stack.
	 *
	 * @return bool
	 */
	public function is_targetted_token( $stackPtr ) {

		// Exclude function definitions, class methods, and namespaced calls.
		if ( \T_STRING === $this->tokens[ $stackPtr ]['code'] ) {
			if ( $this->is_class_object_call( $stackPtr ) === true ) {
				return false;
			}

			if ( $this->is_token_namespaced( $stackPtr ) === true ) {
				return false;
			}

			$prev = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true );

			if ( false !== $prev ) {
				// Skip sniffing if calling a same-named method, or on function definitions.
				$skipped = array(
					\T_FUNCTION        => \T_FUNCTION,
					\T_CLASS           => \T_CLASS,
					\T_AS              => \T_AS, // Use declaration alias.
				);

				if ( isset( $skipped[ $this->tokens[ $prev ]['code'] ] ) ) {
					return false;
				}
			}

			return true;
		}

		return false;
	}

	/**
	 * Verify if the current token is one of the targetted functions.
	 *
	 * @since 0.11.0 Split out from the `process()` method.
	 *
	 * @param int $stackPtr The position of the current token in the stack.
	 *
	 * @return int|void Integer stack pointer to skip forward or void to continue
	 *                  normal file processing.
	 */
	public function check_for_matches( $stackPtr ) {
		$token_content = strtolower( $this->tokens[ $stackPtr ]['content'] );
		$skip_to       = array();

		foreach ( $this->groups as $groupName => $group ) {

			if ( isset( $this->excluded_groups[ $groupName ] ) ) {
				continue;
			}

			if ( isset( $group['whitelist'][ $token_content ] ) ) {
				continue;
			}

			if ( preg_match( $group['regex'], $token_content ) === 1 ) {
				$skip_to[] = $this->process_matched_token( $stackPtr, $groupName, $token_content );
			}
		}

		if ( empty( $skip_to ) || min( $skip_to ) === 0 ) {
			return;
		}

		return min( $skip_to );
	}

	/**
	 * Process a matched token.
	 *
	 * @since 0.11.0 Split out from the `process()` method.
	 *
	 * @param int    $stackPtr        The position of the current token in the stack.
	 * @param string $group_name      The name of the group which was matched.
	 * @param string $matched_content The token content (function name) which was matched.
	 *
	 * @return int|void Integer stack pointer to skip forward or void to continue
	 *                  normal file processing.
	 */
	public function process_matched_token( $stackPtr, $group_name, $matched_content ) {

		$this->addMessage(
			$this->groups[ $group_name ]['message'],
			$stackPtr,
			( 'error' === $this->groups[ $group_name ]['type'] ),
			$this->string_to_errorcode( $group_name . '_' . $matched_content ),
			array( $matched_content )
		);
	}

	/**
	 * Prepare the function name for use in a regular expression.
	 *
	 * The getGroups() method allows for providing function names with a wildcard * to target
	 * a group of functions. This prepare routine takes that into account while still safely
	 * escaping the function name for use in a regular expression.
	 *
	 * @since 0.10.0
	 *
	 * @param string $function Function name.
	 * @return string Regex escaped function name.
	 */
	protected function prepare_name_for_regex( $function ) {
		$function = str_replace( array( '.*', '*' ), '@@', $function ); // Replace wildcards with placeholder.
		$function = preg_quote( $function, '`' );
		$function = str_replace( '@@', '.*', $function ); // Replace placeholder with regex wildcard.

		return $function;
	}

}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.IO;
using System.Reflection;

namespace DeveImageOptimizer.Helpers
{
    public static class FolderHelperMethods
    {
        //public static Lazy<string> EntryAssemblyDirectory { get; } = new Lazy<string>(() => CreateEntryAssemblyDirectory());

        //private static string CreateEntryAssemblyDirectory()
        //{
        //    var assembly = Assembly.GetEntryAssembly();
        //    var assemblyDir = Path.GetDirectoryName(assembly.Location);
        //    return assemblyDir;
        //}

        //public static Lazy<string> EntryTempDirectory { get; } = new Lazy<string>(() => Path.Combine(EntryAssemblyDirectory.Value, ConstantsAndConfig.TempDirectoryName));

        /// <summary>
        /// This is the folder all configuration / state stuff should be stored in
        /// </summary>
        public static string ConfigFolder => Internal_AppDataFolder.Value;
        /// <summary>
        /// This is the folder contains all the Temp files
        /// </summary>
        public static string TempDirectory => Internal_TempDirectory.Value;
        /// <summary>
        /// This folder contains all the Failed Files
        /// </summary>
        public static string FailedFilesDirectory => Internal_FailedFilesDirectory.Value;

        public static Lazy<string> Internal_AppDataFolder { get; } = new Lazy<string>(() => EnsureExists(CreateAppDataFolder()));
        public static Lazy<string> Internal_AssemblyDirectory { get; } = new Lazy<string>(() => DeveCoolLib.PathHelpers.FolderHelperMethods.AssemblyDirectory);
        public static Lazy<string> Internal_TempDirectory { get; } = new Lazy<string>(() => EnsureExists(Path.Combine(Path.GetTempPath(), ConstantsAndConfig.TempDirectoryName)));
        public static Lazy<string> Internal_FailedFilesDirectory { get; } = new Lazy<string>(() => EnsureExists(Path.Combine(ConfigFolder, ConstantsAndConfig.FailedFilesDirectoryName)));

        public static Lazy<string> Internal_TempForTestDirectory { get; } = new Lazy<string>(() => EnsureExists(Path.Combine(Internal_AssemblyDirectory.Value, "TempForTest")));

        private static string CreateAppDataFolder()
        {
            var appdataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            if (string.IsNullOrWhiteSpace(appdataPath))
            {
                //Fall back to assembly directory (this is not ideal but it's required to be ran inside a windows nanoserver docker container)
                appdataPath = DeveCoolLib.PathHelpers.FolderHelperMethods.AssemblyDirectory;
            }
            var combinedPath = Path.Combine(appdataPath, ConstantsAndConfig.AppDataDirectoryName);
            return combinedPath;
        }

        private static string EnsureExists(string dir)
        {
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            return dir;
        }
    }
}


text:
"""
    Created by 捡龙眼
    3/11/2016
"""
from __future__ import unicode_literals, print_function, absolute_import
import signal

import tornado.ioloop

import public.tcp_server
import public.global_manager
import public.simple_log
import public.tcp_client
import public.connect_data
import config
import root_logic.handle_server_process

class RootServerConnect(public.tcp_server.ServerConnect):
    def handle_process(self, data):
        root_logic.handle_server_process.handle_process(self, data)

    def on_close_callback(self, data):
        print(self.get_address_flag(), "on_connect_close_process", len(data))

class RootTcpServer(public.tcp_server.SimpleTcpServer):
    def create_server(self, stream, address):
        connect = RootServerConnect(stream, address)
        return connect

def handle_terminal(signum=0, e=0):
    print("handle_terminal", signum, e)
    tornado.ioloop.IOLoop.instance().stop()
    public.global_manager.clear_thread()
    print("handle_terminal end")

def main():
    print(config.VERSION, config.SERVER_NAME, config.ROOT_SERVER_PORT)
    public.simple_log.initialize(config.LOG_PATH, config.SERVER_NAME)
    signal.signal(signal.SIGINT, handle_terminal)
    signal.signal(signal.SIGTERM, handle_terminal)
    io_loop = tornado.ioloop.IOLoop.instance()
    public.tcp_server.initialize(io_loop)
    public.connect_data.initialize(config.CLIENT_TYPE_LIST)
    tcp_server = RootTcpServer()
    tcp_server.listen(config.ROOT_SERVER_PORT)
    io_loop.start()

if __name__ == "__main__":
    main()


text:
vm_driver="kvm2"

case "${OSTYPE}" in
  darwin*) vm_driver="hyperkit";;
  linux*)
    DISTRO="$(lsb_release -i -s)"
    case "${DISTRO}" in
      Debian|Ubuntu)
        vm_driver="kvm2";;
      *) echo "unsupported distro: ${DISTRO}" ;;
    esac;;
  *) echo "unsupported: ${OSTYPE}" ;;
esac

echo "Using $vm_driver as VM for Minikube."

# Delete any previous minikube cluster
minikube delete

echo "Starting Minikube."

# Start minikube
minikube start \
    --extra-config=controller-manager.cluster-signing-cert-file="/var/lib/localkube/certs/ca.crt" \
    --extra-config=controller-manager.cluster-signing-key-file="/var/lib/localkube/certs/ca.key" \
    --extra-config=apiserver.admission-control="NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" \
    --kubernetes-version=v1.10.0 \
    --insecure-registry="localhost:5000" \
    --cpus=4 \
    --memory=8192 \
    --vm-driver=$vm_driver

#Setup docker to talk to minikube
eval $(minikube docker-env)

kubectl get pods -n kube-system | grep kube-proxy |  grep Running > /dev/null
while [ $? -ne 0 ]; do
  echo "kube-proxy not ready, will check again in 5 sec"
  sleep 5
  kubectl get pods -n kube-system |  grep kube-proxy | grep Running > /dev/null
done

# Set up env ISTIO if not done yet
if [[ -z "${ISTIO// }" ]]; then
  if [[ -z "${GOPATH// }" ]]; then
    echo GOPATH is not set. Please set and run script again.
    exit
  fi
  export ISTIO=$GOPATH/src/istio.io
  echo 'Set ISTIO to' $ISTIO
fi

#Setup LocalRegistry
kubectl apply -f $ISTIO/istio/tests/util/localregistry/localregistry.yaml
echo "local registry started"

kubectl get pods -n kube-system | grep kube-registry-v0 | grep Running > /dev/null
while [ $? -ne 0 ]; do
  echo "kube-registry-v0 not ready, will check again in 5 sec"
  sleep 5
  kubectl get pods -n kube-system | grep kube-registry-v0 | grep Running > /dev/null
done

#Setup port forwarding
echo "Setting up port forwarding"
POD=`kubectl get po -n kube-system | grep kube-registry-v0 | awk '{print $1;}'`
kubectl port-forward --namespace kube-system $POD 5000:5000 &

echo "Host Setup Completed"


text:
#ifndef UTILS_ORCASTATE_H
#define UTILS_ORCASTATE_H

#include "Utils/IO/NativeFilenames.h"
#include "Utils/Technical/UniqueIdentifier.h"
#include <Core/BaseClasses/StateHandableObject.h>
#include <cstdio>
#include <exception>
#include <utility>

namespace Scine {
namespace Utils {
namespace ExternalQC {

/**
 * @brief Exception for the case that a state is requested which is empty.
 */
class EmptyStateException : public std::exception {
 public:
  const char* what() const noexcept final {
    return "ORCA state is empty and cannot be loaded.";
  }
};

/**
 * @brief Exception for a failure to save or load an ORCA state.
 */
class OrcaStateSavingException : public std::exception {
 public:
  const char* what() const noexcept final {
    return "Failure while saving or loading ORCA state.";
  }
};

/**
 * @brief Definition of a calculation state for ORCA calculations.
 *        The calculation state is defined as a unique identifier. Only a string state is saved here.
 */
struct OrcaState final : public Core::State {
  /**
   * @brief Constructor, calls the base class constructor to initialize the size of the state.
   */
  explicit OrcaState(std::string dir) : directory(std::move(dir)) {
    UniqueIdentifier id;
    stateIdentifier = id.getStringRepresentation();
  }
  /// @brief Destructor, deletes the .gbw file.
  ~OrcaState() final {
    auto file = NativeFilenames::combinePathSegments(directory, stateIdentifier + ".gbw");
    std::remove(file.c_str());
  }

  /**
   * @brief Initializer for the state.
   */
  void initialize();

  std::string directory;
  std::string stateIdentifier;
};

} // namespace ExternalQC
} // namespace Utils
} // namespace Scine

#endif // UTILS_ORCASTATE_H


text:
<?php

/**
 * Skeleton subclass for representing a row from the 'cms_lang' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.prestashop
 */
class Oops_Db_CmsLang extends Oops_Db_Propel_CmsLang {

} // Oops_Db_CmsLang


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Source: models/envelope.js</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Source: models/envelope.js

/**
 * Represents an Envelope object, responsible for holding metadata of an incoming message.
 * @param {String}      text    Incoming text of the messsage. May have been changed by the
 *                              active adapter. This value will be used by all subsystems
 *                              responsible for parsing and matching input data.
 * @param {AnyObject}   message Original adapter message object.
 * @param {AnyObject}   user    User who sent this message.
 * @param {AnyObject}   channel Channel where this message was sent.
 * @constructor
 */
var Envelope = function(text, message, user, channel) {
    this.text = text;
    this.message = message;
    this.user = user;
    this.channel = channel;
    this.stopPropagation = false;
};

Envelope.prototype = {

    /**
     * Indicates underlaying mechanisms that the parsing of this message should continue.
     * Upstream mechanisms automatically voids messages; use this if your module is supposed
     * to let the message continue traversing the matching chain.
     * @return {undefined}              Nothing.
     */
    allowPropagation: function() {
        this.stopPropagation = false;
    }
};

module.exports = Envelope;

Home

Classes

Adapters

ApiManager

BaseAdapter

BaseModule

Channel

Context

ContextManager

Envelope

InputManager

InstallationManager

MessageComparator

ModuleManager

ModuleMeta

Response

User

UserNetworkAssoc

    Documentation generated by JSDoc 3.4.0 on Wed Jun 15 2016 13:56:00 GMT-0300 (BRT)


text:
#ifndef PLATFORMTOPO_HPP_INCLUDE
#define PLATFORMTOPO_HPP_INCLUDE

#include <vector>
#include <set>
#include <map>
#include <string>

#include "geopm_topo.h"

extern "C"
{
    /// @brief Identify host CPU.
    int geopm_read_cpuid(void);
}

namespace geopm
{
    class PlatformTopo
    {
        public:
            PlatformTopo() = default;
            virtual ~PlatformTopo() = default;
            /// @brief Number of domains on the platform of a
            ///        particular geopm_domain_e type.
            virtual int num_domain(int domain_type) const = 0;
            /// @brief Get the domain index for a particular domain
            ///        type that contains the given Linux logical CPU
            ///        index
            virtual int domain_idx(int domain_type,
                                   int cpu_idx) const = 0;
            /// @brief Check if one domain type is contained in another.
            ///
            /// @param [in] inner_domain The contained domain type.
            ///
            /// @param [in] outer_domain The containing domain type.
            ///
            /// @return True if the inner_domain is contained within
            ///         the outer_domain.
            virtual bool is_nested_domain(int inner_domain, int outer_domain) const = 0;
            /// @brief Get the set of smaller domains contained in a larger one.
            ///        If the inner domain is not the same as or contained within
            ///        the outer domain, it throws an error.
            ///
            /// @param [in] inner_domain The contained domain type.
            ///
            /// @param [in] outer_domain The containing domain type.
            ///
            /// @param [in] outer_idx The containing domain index.
            ///
            /// @return The set of domain indices for the inner domain that are
            ///         within the indexed outer domain.
            virtual std::set<int> domain_nested(int inner_domain, int outer_domain, int outer_idx) const = 0;
            /// @brief Convert a domain type enum to a string.
            ///
            /// @details These strings are used by the geopmread and geopmwrite tools.
            ///
            /// @param [in] domain_type Domain type from the
            ///        geopm_domain_e enum.
            ///
            /// @return Domain name which is the enum name in
            ///         lowercase with GEOPM_DOMAIN_ prefix removed.
            static std::string domain_type_to_name(int domain_type);
            /// @brief Convert a domain name to its corresponding
            ///        enum.
            ///
            /// @param [in] name Domain name which is the enum
            ///        in lowercase with GEOPM_DOMAIN_ prefix removed.
            ///
            /// @return Domain type from the geopm_domain_e enum.
            static int domain_name_to_type(const std::string &domain_name);
            /// @brief Create cache file in tmpfs that can be read
            ///        instead of popen() call.
            static void create_cache(void);
        private:
            static std::vector<std::string> domain_names(void);
            static std::map<std::string, int> domain_types(void);
    };

    const PlatformTopo &platform_topo(void);
}
#endif


text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "unity/examples/unity_config.h"
#include "unity/src/unity.h"
#include "common.h"

static cJSON item[1];

static const unsigned char *error_pointer = NULL;

static void assert_is_object(cJSON *object_item)
{
    TEST_ASSERT_NOT_NULL_MESSAGE(object_item, "Item is NULL.");

    assert_not_in_list(object_item);
    assert_has_type(object_item, cJSON_Object);
    assert_has_no_reference(object_item);
    assert_has_no_const_string(object_item);
    assert_has_no_valuestring(object_item);
    assert_has_no_string(object_item);
}

static void assert_is_child(cJSON *child_item, const char *name, int type)
{
    TEST_ASSERT_NOT_NULL_MESSAGE(child_item, "Child item is NULL.");
    TEST_ASSERT_NOT_NULL_MESSAGE(child_item->string, "Child item doesn't have a name.");
    TEST_ASSERT_EQUAL_STRING_MESSAGE(name, child_item->string, "Child item has the wrong name.");
    TEST_ASSERT_BITS(0xFF, type, child_item->type);
}

static void assert_not_object(const char *json)
{
    TEST_ASSERT_NULL(parse_object(item, (const unsigned char*)json, &error_pointer, &global_hooks));
    assert_is_invalid(item);
    reset(item);
}

static void assert_parse_object(const char *json)
{
    TEST_ASSERT_NOT_NULL(parse_object(item, (const unsigned char*)json, &error_pointer, &global_hooks));
    assert_is_object(item);
}

static void parse_object_should_parse_empty_objects(void)
{
    assert_parse_object("{}");
    assert_has_no_child(item);
    reset(item);

    assert_parse_object("{\n\t}");
    assert_has_no_child(item);
    reset(item);
}

static void parse_object_should_parse_objects_with_one_element(void)
{

    assert_parse_object("{\"one\":1}");
    assert_is_child(item->child, "one", cJSON_Number);
    reset(item);

    assert_parse_object("{\"hello\":\"world!\"}");
    assert_is_child(item->child, "hello", cJSON_String);
    reset(item);

    assert_parse_object("{\"array\":[]}");
    assert_is_child(item->child, "array", cJSON_Array);
    reset(item);

    assert_parse_object("{\"null\":null}");
    assert_is_child(item->child, "null", cJSON_NULL);
    reset(item);
}

static void parse_object_should_parse_objects_with_multiple_elements(void)
{
    assert_parse_object("{\"one\":1\t,\t\"two\"\n:2, \"three\":3}");
    assert_is_child(item->child, "one", cJSON_Number);
    assert_is_child(item->child->next, "two", cJSON_Number);
    assert_is_child(item->child->next->next, "three", cJSON_Number);
    reset(item);

    {
        size_t i = 0;
        cJSON *node = NULL;
        int expected_types[7] =
        {
            cJSON_Number,
            cJSON_NULL,
            cJSON_True,
            cJSON_False,
            cJSON_Array,
            cJSON_String,
            cJSON_Object
        };
        const char *expected_names[7] =
        {
            "one",
            "NULL",
            "TRUE",
            "FALSE",
            "array",
            "world",
            "object"
        };
        assert_parse_object("{\"one\":1, \"NULL\":null, \"TRUE\":true, \"FALSE\":false, \"array\":[], \"world\":\"hello\", \"object\":{}}");

        node = item->child;
        for (
                i = 0;
                (i < (sizeof(expected_types)/sizeof(int)))
                && (node != NULL);
                (void)i++, node = node->next)
        {
            assert_is_child(node, expected_names[i], expected_types[i]);
        }
        TEST_ASSERT_EQUAL_INT(i, 7);
        reset(item);
    }
}

static void parse_object_should_not_parse_non_objects(void)
{
    assert_not_object("");
    assert_not_object("{");
    assert_not_object("}");
    assert_not_object("[\"hello\",{}]");
    assert_not_object("42");
    assert_not_object("3.14");
    assert_not_object("\"{}hello world!\n\"");
}

int main(void)
{
    /* initialize cJSON item */
    memset(item, 0, sizeof(cJSON));

    UNITY_BEGIN();
    RUN_TEST(parse_object_should_parse_empty_objects);
    RUN_TEST(parse_object_should_not_parse_non_objects);
    RUN_TEST(parse_object_should_parse_objects_with_multiple_elements);
    RUN_TEST(parse_object_should_parse_objects_with_one_element);
    return UNITY_END();
}


text:
<project name="pavome" default="release" basedir=".">
	<property name="version" value="1.1.2" />
	<property environment="env" />
	<property name="enable_debug" value="false" />
	<property name="dist.dir" value="dist" />
	<property name="src.dir" value="src" />
    <property name="midp.src.dir" value="src-midp" />
    <property name="bb.src.dir" value="src-bb" />
	<property name="lib.dir" value="lib" />
	<property name="build.dir" value="build" />
	<property name="resources" value="res" />
	<property name="output.target" value="${ant.project.name}.jar" />
	<property name="wtk.home" value="${env.WTK_HOME}" />

	<property name="bb43.home" value="C:/java/BlackBerry_JDE_4.3.0" />
    <property name="bb43.dist" value="dist-bb43" />
    <property name="bb50.home" value="C:/java/BlackBerry JDE 5.0.0" />
    <property name="bb50.dist" value="dist-bb50" />

    <property name="bb.build.dir" value="build-bb" />
	<property name="lwuit.src.dir" value="../lwuit-head/src" />
	<property name="lwuit.bb.src.dir" value="../lwuit-bb/src" />
    <property name="bb.eclipse.dir" value="C:\Documents and Settings\anton\My Documents\workspacebb\mocobb\src" />

	<taskdef resource="antenna.properties" classpath="${lib.dir}/antenna-bin-1.2.0-beta.jar" />
	<typedef resource="bb-ant-defs.xml" classpath="${lib.dir}/bb-ant-tools.jar" />

	<property name="bootlib" value="${lib.dir}/cldcapi11.jar" />
	<path id="wtklibs">
		<pathelement path="${lib.dir}/midpapi20.jar" />
		<pathelement path="${lib.dir}/mmapi.jar" />
		<pathelement path="${lib.dir}/jsr75.jar" />
		<pathelement path="${lib.dir}/jsr082.jar" />
		<pathelement path="${lib.dir}/jsr184.jar" />
		<pathelement path="${lib.dir}/m2g1_0b.jar" />
	</path>

	<target name="prepare">
		<mkdir dir="${build.dir}" />
		<mkdir dir="${dist.dir}" />
		<mkdir dir="${build.dir}/META-INF" />
		<copy todir="${build.dir}">
			<fileset dir="${resources}">
				<exclude name="**/default.res" />
				<exclude name="**/Thumbs.db" />
			</fileset>
		</copy>
        <copy todir="${build.dir}">
            <fileset dir="theme/default">
                <exclude name="**/default.conf" />
                <exclude name="**/Thumbs.db" />
                <exclude name="**/*.gif" />
            </fileset>
        </copy>
		<mkdir dir="${bb.build.dir}" />
		<mkdir dir="${bb.build.dir}/src" />
		<mkdir dir="${bb.build.dir}/res" />
		<mkdir dir="${bb.build.dir}/preprocessed" />
		<mkdir dir="${bb.build.dir}/classes" />
        <tstamp/>
	</target>

	<target name="resource" depends="prepare">
		<taskdef classpath="lib/ResourceEditor.jar" classname="com.sun.lwuit.tools.resourcebuilder.LWUITTask" name="build" />

        <build dest="${build.dir}/busy-anim.res">
            <animation file="theme/default/ani-busy2.gif" name="wait" />
        </build>

        <build dest="${build.dir}/progress-anim.res">
            <animation file="theme/default/progress.gif" name="progress" />
        </build>

		<build dest="${build.dir}/default.res">

			<l10n name="localize">
				<locale name="en" file="l10n/localize.properties" />
			</l10n>

			<theme file="theme/default/default.conf" name="Default" />

		</build>

	</target>

	<target name="compile" depends="prepare, resource">
		<javac srcdir="${src.dir}:${midp.src.dir}" destdir="${build.dir}" target="1.1" source="1.2" bootclasspath="${bootlib}" debug="${enable_debug}">
			<classpath>
				<path refid="wtklibs" />
				<pathelement path="${lib.dir}/LWUIT.jar" />
			</classpath>
		</javac>
	</target>

	<target name="rresource" depends="resource">
		<delete file="res/default.res" />
		<copy file="build/default.res" tofile="res/default.res" />
	</target>

	<target name="manifest-clean" depends="prepare">
		<property name="midlet.name" value="pavo" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="PavoMe" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Server" value="delta.pavo.me:2222" />
			<attribute name="Navi-Key-Hidden" value="true" />
			<attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
		</manifest>
	</target>

	<target name="manifest-anton" depends="prepare">
		<property name="midlet.name" value="anton" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="anton" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Token" value="Cabk3DSFbxKxRevZ" />
			<attribute name="Pavo-Server" value="delta.pavo.me:2222" />
			<attribute name="Navi-Key-Hidden" value="true" />
			<attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
		</manifest>
	</target>

	<target name="manifest-ak" depends="prepare">
		<property name="midlet.name" value="ak" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="ak" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Token" value="BWMFhFiVHCgGcY0B" />
			<attribute name="Pavo-Server" value="delta.pavo.me:2222" />
			<attribute name="Navi-Key-Hidden" value="true" />
			<attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
		</manifest>
	</target>

	<target name="manifest-pavo" depends="prepare">
		<property name="midlet.name" value="pavopavo" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="PavoMe-pavo" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Token" value="NhdDdm9m89GX1-Zq" />
			<attribute name="Pavo-Server" value="delta.pavo.me:2222" />
		</manifest>
	</target>

    <target name="manifest-alpha" depends="prepare">
        <property name="midlet.name" value="pavo-alpha-${DSTAMP}" />
        <manifest file="${build.dir}/META-INF/MANIFEST.MF">
            <attribute name="Manifest-Version" value="1.0" />
            <attribute name="MIDlet-Vendor" value="PavoMe" />
            <attribute name="MIDlet-Version" value="${version}" />
            <attribute name="MIDlet-1" value="PavoMe-A,/peacock46x48.png,me.pavo.Main" />
            <attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
            <attribute name="MIDlet-Name" value="PavoMe-A" />
            <attribute name="MicroEdition-Profile" value="MIDP-2.0" />
            <attribute name="Navi-Key-Hidden" value="true" />
            <attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
        </manifest>
    </target>

	<target name="manifest-pavo-beta" depends="prepare">
		<property name="midlet.name" value="beta-pavopavo" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="beta-pavopavo" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Token" value="NhdDdm9m89GX1-Zq" />
			<attribute name="Pavo-Server" value="beta.pavo.me:2222" />
			<attribute name="Navi-Key-Hidden" value="true" />
			<attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
		</manifest>
	</target>

	<target name="manifest-anton-beta" depends="prepare">
		<property name="midlet.name" value="beta-anton" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="anton-beta" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Token" value="Cabk3DSFbxKxRevZ" />
			<attribute name="Pavo-Server" value="beta.pavo.me:2222" />
			<attribute name="Navi-Key-Hidden" value="true" />
			<attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
		</manifest>
	</target>

	<target name="manifest-ak-beta" depends="prepare">
		<property name="midlet.name" value="ak-beta" />
		<manifest file="${build.dir}/META-INF/MANIFEST.MF">
			<attribute name="Manifest-Version" value="1.0" />
			<attribute name="MIDlet-Vendor" value="PavoMe" />
			<attribute name="MIDlet-Version" value="${version}" />
			<attribute name="MIDlet-1" value="PavoMe,/peacock46x48.png,me.pavo.Main" />
			<attribute name="MicroEdition-Configuration" value="CLDC-1.1" />
			<attribute name="MIDlet-Name" value="ak-beta" />
			<attribute name="MicroEdition-Profile" value="MIDP-2.0" />
			<attribute name="Pavo-Token" value="BWMFhFiVHCgGcY0B" />
			<attribute name="Pavo-Server" value="beta.pavo.me:2222" />
			<attribute name="Navi-Key-Hidden" value="true" />
			<attribute name="Nokia-MIDlet-On-Screen-Keypad" value="no" />
		</manifest>
	</target>

	<target name="obfuscate" depends="compile, resource">
		<taskdef name="proguard" classname="proguard.ant.ProGuardTask" classpath="${lib.dir}/proguard.jar" />
		<proguard obfuscate="on" optimize="off" usemixedcaseclassnames="off" verbose="on" shrink="on" microedition="off" allowaccessmodification="on" overloadaggressively="on" repackageclasses="" ignorewarnings="off">
			<libraryjar name="${bootlib}" />
			<libraryjar refid="wtklibs" />
			<injar name="${build.dir}" />
			<injar name="${lib.dir}/LWUIT.jar" filter="!META-INF/MANIFEST.MF" />
			<outjar name="${dist.dir}/${midlet.name}-obfuscated.jar" />
			<keep name="me.pavo.Main" />
		</proguard>
	</target>

	<target name="preverify" depends="obfuscate">
		<wtkpreverify classpathref="wtklibs" jarfile="${dist.dir}/${midlet.name}-obfuscated.jar" tojarfile="${dist.dir}/${midlet.name}.jar" />
		<delete file="${dist.dir}/${midlet.name}-obfuscated.jar" />
	</target>

	<target name="bb-prepare" depends="resource">
		<mkdir dir="${bb.build.dir}" />
		<mkdir dir="${bb.build.dir}/src" />
		<mkdir dir="${bb.build.dir}/res" />
		<mkdir dir="${bb.build.dir}/preprocessed" />
		<mkdir dir="${bb.build.dir}/obfuscated" />
        <mkdir dir="${bb.build.dir}/classes" />
        <mkdir dir="${bb43.dist}" />
        <mkdir dir="${bb50.dist}" />
		<copy todir="${bb.build.dir}/res">
			<fileset dir="${resources}">
				<exclude name="**/default.res" />
				<exclude name="**/Thumbs.db" />
			</fileset>
		</copy>
        <copy file="${build.dir}/default.res" todir="${bb.build.dir}/res" />
        <copy file="${build.dir}/busy-anim.res" todir="${bb.build.dir}/res" />
        <copy file="${build.dir}/progress-anim.res" todir="${bb.build.dir}/res" />
	</target>

	<target name="bb-source-43" depends="bb-prepare">
		<copy todir="${bb.build.dir}/src" verbose="false">

			<fileset dir="${lwuit.src.dir}">
				<exclude name="**/.svn/**" />

				<exclude name="**/M3G.java" />
				<exclude name="**/SVGImage.java" />
				<exclude name="**/SVGImplementation.java" />
				<exclude name="**/Transition3D.java" />
			</fileset>

			<fileset dir="${lwuit.bb.src.dir}">
				<exclude name="**/.svn/**" />

				<exclude name="**/BlackBerryTouchSupport.java" />
				<exclude name="**/BlackBerryTouchImplementation.java" />
			</fileset>
            <fileset dir="${src.dir}"/>
            <fileset dir="${bb.src.dir}">
            	<exclude name="**/Main50.java" />
            </fileset>
		</copy>
        <wtkpreprocess verbose="false" srcdir="${bb.build.dir}/src" destdir="${bb.build.dir}/preprocessed" symbols="RIM" printsymbols="true"/>
	</target>

    <target name="bb-source-50" depends="bb-prepare">
        <copy todir="${bb.build.dir}/src" verbose="false">

            <fileset dir="${lwuit.src.dir}">
                <exclude name="**/.svn/**" />

                <exclude name="**/M3G.java" />
                <exclude name="**/SVGImage.java" />
                <exclude name="**/SVGImplementation.java" />
                <exclude name="**/Transition3D.java" />
            </fileset>

            <fileset dir="${lwuit.bb.src.dir}">
                <exclude name="**/.svn/**" />
            </fileset>
            <fileset dir="${src.dir}"/>
            <fileset dir="${bb.src.dir}">
                <exclude name="**/Main43.java" />
            </fileset>
        </copy>
        <wtkpreprocess verbose="false" srcdir="${bb.build.dir}/src" destdir="${bb.build.dir}/preprocessed" symbols="RIM,touch" printsymbols="true"/>
    </target>

    <target name="bb-eclipse" depends="bb-source-43">
    	  <delete includeemptydirs="true">
    	    <fileset dir="${bb.eclipse.dir}" includes="**/*" defaultexcludes="false"/>
    	  </delete>
        <copy todir="${bb.eclipse.dir}" verbose="false">
            <fileset dir="${bb.build.dir}/preprocessed"/>
            <fileset dir="${bb.build.dir}/res"/>
            <fileset file="${build.dir}/*.res"/>
        </copy>
    </target>

	<target name="bb-compile" depends="bb-prepare">
		<javac destdir="${bb.build.dir}/classes" bootclasspath="${bb.home}/lib/net_rim_api.jar" debug="on" optimize="on" source="1.3" target="1.1">
            <src path="${bb.build.dir}/preprocessed" />
		</javac>

		<copy todir="${bb.build.dir}/obfuscated" verbose="false">
			<fileset dir="${bb.build.dir}/classes">
			</fileset>
		</copy>

		<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" dir="${bb.build.dir}/obfuscated" executable="${bb.home}/bin/preverify.exe" failonerror="true" resolveExecutable="true">
			<arg value="-d" />
			<arg path="${bb.build.dir}/preverified" />
			<arg value="-classpath" />
			<arg value="${bb.home}/lib/net_rim_api.jar" />
			<arg value="." />
		</exec>

		<copy todir="${bb.build.dir}/preverified" verbose="false">
			<fileset dir="${bb.build.dir}/res"/>
		</copy>

		<rapc output="${bb.modulename}" jdehome="${bb.home}" destdir="${bb.dist}" generatesourcelist="true" verbose="false" quiet="true" nowarn="true" srcdir="${bb.build.dir}/preverified" exepath="${bb.home}/bin">
			<jdp vendor="PavoMe" version="${version}" type="cldc" icon="../${resources}/peacock46x48.png" title="PavoMe">
			</jdp>
		</rapc>

		<sigtool jdehome="${bb.home}" codfile="${bb.dist}/${bb.modulename}.cod"/>

		<jadtool input="${bb.dist}/${bb.modulename}.jad" destdir="${bb.dist}/smallcod">
			<fileset dir="${bb.dist}" includes="${bb.modulename}.cod" />
		</jadtool>

	</target>

	<target name="bb-compile-43" depends="bb-prepare, bb-source-43">
		<antcall target="bb-compile">
            <param name="bb.modulename" value="pavome" />
            <param name="bb.home" value="${bb43.home}" />
            <param name="bb.dist" value="${bb43.dist}" />
		</antcall>
	</target>

    <target name="bb-compile-50" depends="bb-prepare, bb-source-50">
        <antcall target="bb-compile">
            <param name="bb.modulename" value="pavome" />
            <param name="bb.home" value="${bb50.home}" />
            <param name="bb.dist" value="${bb50.dist}" />
        </antcall>
    </target>

	<target name="clean">
		<delete dir="${build.dir}" />
		<delete dir="${dist.dir}" />
        <delete dir="${bb43.dist}" />
        <delete dir="${bb50.dist}" />
        <delete dir="${bb.build.dir}" />
	</target>

	<target name="release" depends="manifest-clean, obfuscate, preverify">
	</target>

	<target name="anton" depends="manifest-anton, obfuscate, preverify">
	</target>

	<target name="ak" depends="manifest-ak, obfuscate, preverify">
	</target>

    <target name="pavo" depends="manifest-pavo, obfuscate, preverify">
    </target>

    <target name="alpha" depends="manifest-alpha, obfuscate, preverify">
    </target>

	<target name="anton-beta" depends="manifest-anton-beta, obfuscate, preverify">
	</target>

	<target name="pavo-beta" depends="manifest-pavo-beta, obfuscate, preverify">
	</target>

	<target name="ak-beta" depends="manifest-ak-beta, obfuscate, preverify">
	</target>

</project>


text:
'use strict';

import * as assert from 'assert';
import * as Platform from 'vs/platform/platform';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { Extensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actionRegistry';
import { prepareActions } from 'vs/workbench/browser/actionBarRegistry';
import { Action } from 'vs/base/common/actions';

class MyClass extends Action {
	constructor(id: string, label: string) {
		super(id, label);
	}
}

suite('Workbench Action Registry', () => {

	test('Workbench Action Registration', function () {
		let Registry = <IWorkbenchActionRegistry>Platform.Registry.as(Extensions.WorkbenchActions);

		let d = new SyncActionDescriptor(MyClass, 'id', 'name');

		let oldActions = Registry.getWorkbenchActions().slice(0);
		let oldCount = Registry.getWorkbenchActions().length;

		Registry.registerWorkbenchAction(d, 'My Alias', 'category');
		Registry.registerWorkbenchAction(d, null);

		assert.equal(Registry.getWorkbenchActions().length, 1 + oldCount);
		assert.strictEqual(d, Registry.getWorkbenchAction('id'));

		assert.deepEqual(Registry.getAlias(d.id), 'My Alias');
		assert.equal(Registry.getCategory(d.id), 'category');

		(<any>Registry).setWorkbenchActions(oldActions);
	});

	test('Workbench Action Bar prepareActions()', function () {
		let a1 = new Separator();
		let a2 = new Separator();
		let a3 = new Action('a3');
		let a4 = new Separator();
		let a5 = new Separator();
		let a6 = new Action('a6');
		let a7 = new Separator();

		let actions = prepareActions([a1, a2, a3, a4, a5, a6, a7]);
		assert.strictEqual(actions.length, 3); // duplicate separators get removed
		assert(actions[0] === a3);
		assert(actions[1] === a5);
		assert(actions[2] === a6);
	});
});


text:
include ../mk/include.mk

export UPSTREAMNAME     = Blinding Dark
export SHORTDESCRIPTION = First Person Shooter horror game
export VERSION          = 1.0.0
export MAINTAINER       = Marshall Banana <djcj@gmx.de>
export HOMEPAGE         = http://www.moddb.com/games/blinding-dark
export YEAR             = 2014
export COPYRIGHT        = primus88

deps           = unzip
bin            = BlindingDark_Linux_Demo.zip
dir            = blindingdark
cleanfiles     = $(dir)
distcleanfiles = $(bin)

download:
	@ $(call download,$(bin),http://media1.gamefront.com/moddb/2014/02/12/$(bin))
	@ $(call verifysha256,$(bin),84a3abce54a42a80376d47c66b4a05bac3b3320c8fec7351d82861f473f00d2e)

prepare:
	unzip $(bin) -d $(dir)
	u2deb prepare $(dir) --data --gzip


text:
<?hh // strict

use type Facebook\HackTest\HackTest;
use type Ytake\HHContainer\Scope;
use type Ytake\HHContainer\ServiceFactory;
use type Ytake\HHContainer\FactoryContainer;
use type Ytake\HHContainer\FactoryInterface;

use function Facebook\FBExpect\expect;

class FactoryTest extends HackTest {
  public function testShouldReturnExpectValues(): void {
    $factory = new ServiceFactory(new FactoryContainer());
    $factory->registerFactory(new StringFactory());
    expect($factory->create('testing'))->toBeSame('testing');
  }

  public function testShouldReturnStdClass(): void {
    $factory = new ServiceFactory(new FactoryContainer());
    $factory->registerFactory(new MockClassFactory());
    $i = $factory->create(MockClass::class);
    expect($i)->toBeInstanceOf(MockClass::class);
    if($i instanceof MockClass) {
      expect($i->getT())->toBeSame(1);
    }
    expect($factory->create(MockClass::class))->toBeInstanceOf(MockClass::class);
    expect($factory->create(MockClass::class))->toBeSame($factory->create(MockClass::class));
  }
}

class StringFactory implements FactoryInterface {
  const type T = string;

  public function provide(FactoryContainer $_container): this::T {
    return 'testing';
  }

  <<__Rx>>
  public function scope(): Scope {
    return Scope::SINGLETON;
  }

  <<__Rx>>
  public function name(): string {
    return 'testing';
  }
}

class MockClassFactory implements FactoryInterface {
  const type T = MockClass;

  public function provide(FactoryContainer $_container): this::T {
    return new MockClass(1);
  }

  <<__Rx>>
  public function scope(): Scope {
    return Scope::SINGLETON;
  }

  <<__Rx>>
  public function name(): string {
    return MockClass::class;
  }
}

class MockClass {
  public function __construct(private int $t) {}

  public function getT(): int {
    return $this->t;
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="e428de75-4fac-4ac2-b01b-e1a2bef4983e" name="Default" comment="" />
    <ignored path="ppbench.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CoverageDataManager">
    <SUITE FILE_PATH="coverage/ppbench@build__ppbench.coverage" NAME="build: ppbench Coverage Results" MODIFIED="1442594808344" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="ppbench" />
    <SUITE FILE_PATH="coverage/ppbench@install__ppbench.coverage" NAME="install: ppbench Coverage Results" MODIFIED="1466597171463" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="ppbench" />
    <SUITE FILE_PATH="coverage/ppbench@release__ppbench.coverage" NAME="release: ppbench Coverage Results" MODIFIED="1442475151952" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="ppbench" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="ppbench" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
      <file leaf-file-name="ppbench.rb" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="33" column="0" selection-start-line="33" selection-start-column="0" selection-end-line="33" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ppbench.gemspec" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="23" column="28" selection-start-line="23" selection-start-column="28" selection-end-line="23" selection-end-column="28" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.024495678">
              <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ppbench.rb" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Rakefile" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Rakefile">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/ppbench.gemspec" />
        <option value="$PROJECT_DIR$/bin/ppbench.rb" />
        <option value="$PROJECT_DIR$/lib/ppbench.rb" />
        <option value="$PROJECT_DIR$/lib/ppbench/version.rb" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" />
  <component name="JsBuildToolPackageJson" detection-done="true" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="148" />
    <option name="y" value="106" />
    <option name="width" value="1927" />
    <option name="height" value="1213" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scratches" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ppbench" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="RakeTaksPopup.undocumentedIncluded" value="false" />
    <property name="recentsLimit" value="5" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  </component>
  <component name="RunManager" selected="Rake.install: ppbench">
    <configuration default="false" name="install: ppbench" type="RakeRunConfigurationType" factoryName="Rake" temporary="true">
      <module name="ppbench" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="install" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
      <method />
    </configuration>
    <configuration default="false" name="release: ppbench" type="RakeRunConfigurationType" factoryName="Rake" temporary="true">
      <module name="ppbench" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="release" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="--trace" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
      <method />
    </configuration>
    <configuration default="false" name="build: ppbench" type="RakeRunConfigurationType" factoryName="Rake" temporary="true">
      <module name="ppbench" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="build" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
      <predefined_log_file id="RUBY_RSPEC" enabled="true" />
      <module name="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
      <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
      <method />
    </configuration>
    <configuration default="true" type="RakeRunConfigurationType" factoryName="Rake">
      <module name="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE="" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
      <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
      <method />
    </configuration>
    <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
      <module name="" />
      <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
      <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
      <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
      <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
      <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
      <method />
    </configuration>
    <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
      <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
      <module name="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
      <envs />
      <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
      <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
      <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
        <COVERAGE_PATTERN ENABLED="true">
          <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
        </COVERAGE_PATTERN>
      </EXTENSION>
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
      <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <pass-parent-envs>true</pass-parent-envs>
      <envs />
      <method />
    </configuration>
    <list size="3">
      <item index="0" class="java.lang.String" itemvalue="Rake.install: ppbench" />
      <item index="1" class="java.lang.String" itemvalue="Rake.release: ppbench" />
      <item index="2" class="java.lang.String" itemvalue="Rake.build: ppbench" />
    </list>
    <recent_temporary>
      <list size="3">
        <item index="0" class="java.lang.String" itemvalue="Rake.install: ppbench" />
        <item index="1" class="java.lang.String" itemvalue="Rake.build: ppbench" />
        <item index="2" class="java.lang.String" itemvalue="Rake.release: ppbench" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="e428de75-4fac-4ac2-b01b-e1a2bef4983e" name="Default" comment="" />
      <created>1440059262970</created>
      <option name="number" value="Default" />
      <updated>1440059262970</updated>
    </task>
    <task id="LOCAL-00001" summary="Added ppbench">
      <created>1440245699898</created>
      <option name="number" value="00001" />
      <option name="project" value="LOCAL" />
      <updated>1440245699898</updated>
    </task>
    <option name="localTasksCounter" value="2" />
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="148" y="106" width="1927" height="1213" extended-state="0" />
    <editor active="false" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2956846" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32890365" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32465115" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.27272728" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32753888" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <MESSAGE value="Added ppbench" />
    <option name="LAST_COMMIT_MESSAGE" value="Added ppbench" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="33" column="0" selection-start-line="33" selection-start-column="0" selection-end-line="33" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="23" column="28" selection-start-line="23" selection-start-column="28" selection-end-line="23" selection-end-column="28" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="20" column="38" selection-start-line="20" selection-start-column="38" selection-end-line="20" selection-end-column="38" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="19" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="282" column="27" selection-start-line="282" selection-start-column="27" selection-end-line="282" selection-end-column="27" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="20" column="38" selection-start-line="20" selection-start-column="38" selection-end-line="20" selection-end-column="38" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="28" selection-start-line="1" selection-start-column="28" selection-end-line="1" selection-end-column="28" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="122" column="11" selection-start-line="122" selection-start-column="11" selection-end-line="122" selection-end-column="11" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="134" column="11" selection-start-line="134" selection-start-column="11" selection-end-line="134" selection-end-column="11" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="134" column="11" selection-start-line="134" selection-start-column="11" selection-end-line="134" selection-end-column="11" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="134" column="11" selection-start-line="134" selection-start-column="11" selection-end-line="134" selection-end-column="11" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="29" column="43" selection-start-line="29" selection-start-column="43" selection-end-line="29" selection-end-column="43" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="5" column="9" selection-start-line="5" selection-start-column="9" selection-end-line="5" selection-end-column="9" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="29" column="46" selection-start-line="29" selection-start-column="46" selection-end-line="29" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="33" column="43" selection-start-line="33" selection-start-column="43" selection-end-line="33" selection-end-column="43" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Rakefile">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ppbench.gemspec">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="23" column="28" selection-start-line="23" selection-start-column="28" selection-end-line="23" selection-end-column="28" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bin/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="33" column="0" selection-start-line="33" selection-start-column="0" selection-end-line="33" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/lib/ppbench/version.rb">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.024495678">
          <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
require 'unit_spec_helper'
require 'rpush/daemon/store/active_record/reconnectable'

describe Rpush::Daemon::Store::ActiveRecord::Reconnectable do
  class TestDouble
    include Rpush::Daemon::Store::ActiveRecord::Reconnectable

    attr_reader :name

    def initialize(error, max_calls)
      @error = error
      @max_calls = max_calls
      @calls = 0
    end

    def perform
      with_database_reconnect_and_retry do
        @calls += 1
        raise @error if @calls <= @max_calls
      end
    end
  end

  let(:adapter_error_class) do
    case $adapter
    when 'postgresql'
      PGError
    when 'mysql'
      Mysql::Error
    when 'mysql2'
      Mysql2::Error
    when 'jdbcpostgresql'
      ActiveRecord::JDBCError
    when 'jdbcmysql'
      ActiveRecord::JDBCError
    when 'jdbch2'
      ActiveRecord::JDBCError
    when 'sqlite3'
      SQLite3::Exception
    else
      raise "Please update #{__FILE__} for adapter #{$adapter}"
    end
  end
  let(:error) { adapter_error_class.new("db down!") }
  let(:test_double) { TestDouble.new(error, 1) }

  before do
    @logger = double("Logger", :info => nil, :error => nil, :warn => nil)
    Rpush.stub(:logger).and_return(@logger)

    ActiveRecord::Base.stub(:clear_all_connections!)
    ActiveRecord::Base.stub(:establish_connection)
    test_double.stub(:sleep)
  end

  it "should log the error raised" do
    Rpush.logger.should_receive(:error).with(error)
    test_double.perform
  end

  it "should log that the database is being reconnected" do
    Rpush.logger.should_receive(:warn).with("Lost connection to database, reconnecting...")
    test_double.perform
  end

  it "should log the reconnection attempt" do
    Rpush.logger.should_receive(:warn).with("Attempt 1")
    test_double.perform
  end

  it "should clear all connections" do
    ActiveRecord::Base.should_receive(:clear_all_connections!)
    test_double.perform
  end

  it "should establish a new connection" do
    ActiveRecord::Base.should_receive(:establish_connection)
    test_double.perform
  end

  it "should test out the new connection by performing a count" do
    Rpush::Notification.should_receive(:count)
    test_double.perform
  end

  context "when the reconnection attempt is not successful" do
    before do
      class << Rpush::Notification
        def count
          @count_calls += 1
          return if @count_calls == 2
          raise @error
        end
      end
      Rpush::Notification.instance_variable_set("@count_calls", 0)
      Rpush::Notification.instance_variable_set("@error", error)
    end

    it "should log the 2nd attempt" do
      Rpush.logger.should_receive(:warn).with("Attempt 2")
      test_double.perform
    end

    it "should log errors raised when the reconnection is not successful" do
      Rpush.logger.should_receive(:error).with(error)
      test_double.perform
    end

    it "should sleep to avoid thrashing when the database is down" do
      test_double.should_receive(:sleep).with(2)
      test_double.perform
    end
  end
end