text:
---
title:  "Part I: Getting Started"
previous_file:
previous_title:
next_file: part02
next_title: "Driving the Command Line"
layout: tutorial
---

# Introduction

Caius is a functional testing framework written in object-oriented Tcl using
the \[incr Tcl] extension. It provides intuitive, object-oriented programming
interfaces to Expect and Selenium WebDriver.

The `caius` command line tool provides a generic test runner which allows you
to execute tests written in any programming language and test framework. The
integrated report generator collects test results and turns them into legible,
clean test reports.

# Installation

In order to install and try out Caius on your system, follow the instructions
in this section.

## Pre-requisites

Caius is developed and tested on Debian/GNU Linux but should run on other
Linux distributions without problems. Using Caius on BSD or other Unix-like
systems may require minor modifications.

Caius requires Tcl 8.6 or later with thread support, a recent version of
tcllib and Expect. In addition, the tdom package is required for results
parsing and report generation.

## Installation from Source

Caius comes with a simple installer script that will copy modules and scripts
into your Tcl package path. After unpacking the sources, execute the installer
script via

    sudo ./install.tcl

After that you should be able to call `caius` from the command line.

# Writing Tests

This section explains how to write test modules and how to execute them.

## Outline of a Test Class

In Caius, test modules are classes which derive from `Testing::TestObject`. A
minimal test module looks like this:

~~~{tcl}
package require Itcl
package require Testing

itcl::class MyTests {
    inherit Testing::TestObject

    method test_passing {} {
        puts "Hello, I pass!"
    }

    method test_failing {} {
        error "Hello, I'm about to fail!"
    }

    method test_fail_with_assertion {} {
        Testing::assert {1 == 2}
    }
}

exit [[MyTests #auto] run $::argv]
~~~

The test class `MyTests` inherits a lot of functionality from
`Testing::TestObject`, most importantly the `run` method. The `run` method is
responsible for parsing any command line arguments and initiating the test
execution.

A test is any method that starts with the prefix `test`. Tests are executed
in lexicographical order. If you absolutely need your tests to run in a certain
order, you can use prefixes like `test_01`, `test_02`, etc.

Test methods don't take any parameters and their return value is ignored. To
make a test fail, you have to raise an error. This can be a normal Tcl error or
an Exception thrown using the `raise` command from Caius' `Error` package.

## Repeated Setup and Teardown

If you need to do repeated setup and cleanup work before and after each test
case, you can define methods `setup` and `teardown`. They will be invoked
automatically for you.

## One-time Preparation and Cleanup

If you need work to be done once on entry to your test module and once again
after the last test case has been run, *don't* use the constructor and
destructor of your test class for this purpose. Instead define methods
`setup_before` and `teardown_after`.

## Documenting Your Tests

In order to document your tests, you may define *docstrings* for your test
methods as shown in the following example:

~~~~{tcl}
itcl::class MyTest {
    inherit Testing::TestObject

    method test_something {} {
        docstr "This is an example docstring.

        Test steps:

        * step 1
        * step 2

        Docstrings are written in
        \[markdown syntax](http://daringfireball.net/projects/markdown/syntax).
        "

        # implementation here
    }
}
~~~~

Docstrings are a concept stolen from Python. They are a special feature
of Caius and not generally available in Tcl. They only work in test methods.
The `docstr` command must be the *very first* statement in the method body.

Docstrings are written in [markdown syntax](http://daringfireball.net/projects/markdown/syntax).
They are included in the test results output and converted to HTML for
display in test reports. Note that since docstrings are Tcl strings, braces,
brackets and quotation marks need to be escaped.

## Making the Test Script Executable

In order to make a test script executable, simply add a shebang line at the top
of the script:

    #!/usr/bin/tclsh

Then mark the script as executable:

    chmod +x test.tcl

If your distribution ships with multiple versions of Tcl, or if Tcl 8.6 is not
the default version, you may have to be explicit about which `tclsh` you would
like to be invoked.

# Running Tests

This section explains how to execute your tests individually or as part of
a test plan.

## Direct Execution of Test Scripts

Test scripts that invoke the `run` method on a test object are fully
self-contained and can be called directly. In order to see which parameters
you can pass to your script, call it with the `--help` command line switch:

    ./test.tcl --help

In order to run all the tests, invoke the script without any arguments. Or if
you would like to run only selected tests, specify them separately on the
command line:

    ./test.tcl test1 test2 ...

In order to see which tests are available in your module, use the `--list`
command line switch:

    ./test.tcl -l

Per default, test scripts print the test results in an XML-based reporting
format. These XML reports have a simple structure, but if you need something
more readable, you can instruct the script to output logs and results in a
nicely indented text format using the `--format` parameter:

    ./test.tcl -f text

## Using the Caius Testrunner Application

When executing your tests in an automated fashion, for example from a CI
system, it is recommended that you invoke them indirectly using the
`caius run` command. Among other things, `caius run` can let your test scripts
timeout, which is essential if you want to avoid getting stuck on badly
written or misbehaving test cases.

In order to execute a test script with a 60 seconds timeout invoke it like
this:

    caius run -t 60 path/to/test

The `caius run` command will also do the right thing and recover in case your
script dies prematurely and/or for some reason produces an incomplete or
invalid results XML. Whenever the output of a script is valid XML, the test
runner will save it as it is. If a script produces broken XML or *any other*
format, the test runner will automatically convert it into a valid XML report.

An important implication of this is that `caius run` can run tests written in
any language and any framework. The only requirement is that tests terminate
with a non-zero exit status on failure.

## Creating and Executing a Test Plan

Test plans are written in a simple XML format and define a sequence of test
scripts to be executed. The following listing shows a basic example:

~~~~{xml}
<testplan>
    <run timeout="60">/home/tobias/Demo/test1.tcl</run>
    <run timeout="60">/home/tobias/Demo/test2.tcl</run>
    ...
</testplan>
~~~~

Test plans are loaded and executed with the `caius runplan` command. For each
test, a subdirectory will be created inside the current working directory. This
subdirectory will be made the working directory of the respective test script
itself.

You can explicitly set the initial working directory of the `runplan` command
using the `--work-dir` command line switch.

## Working with Constraints

Let's say you are testing a range of network devices offering connectivity
through an arbitrary combination of Ethernet, Wifi, DSL and UMTS. You have
tests for each feature and want to enable them selectively according to the
capabilities of the device under test.

To this end, you may attach constraints to arbitrary blocks of code or entire
test methods:

~~~{tcl}
# test works only for devices that have a wifi chip and a DSL modem
::Testing::constraints {wifi dsl} {
    method test_share_dsl_connection_over_wifi {} {
        # test code here ...
    }
}
~~~

When executing your test module, you can use the `--constraint` command line
parameter (also multiple times) to declare constraints to be true for the
duration of the test run:

    ./mytest.tcl -c wifi -c dsl

Alternatively, you can export a list of constraints to the environment
variable `CAIUS_TEST_CONSTRAINTS`.

## Executing Tests Matching a Pattern

You may choose to execute only certain tests from a test module by matching
test names against a wildcard pattern with the `--match` command line parameter.
For example, in order to run all tests that have the string *connectivity* in
their name you could say:

    ./mytest.tcl -m "*connectivity*"

Be careful to quote patterns to prevent your shell from interpreting them. The
`--match` option or its `-m` short-hand may be used multiple times.

# Generating Reports

In order to generate a report from the results of a testrun, use the
`caius report` command. It takes as a single argument the directory which to
scan for results.

The directory should contain subdirectories created by a previous call to
`caius runplan`. Each of these in turn should contain exactly one results XML
file named *result.xml* plus any number of artifacts.

The test report will be created inside the given directory as one or more HTML
files.

## Integration with Jenkins

In Jenkins, create a new project and configure your build as you normally would.
Then open the project settings, go to the *Build* section and add an extra build
step for running the tests. The following snippet might serve as an example:

    cd test
    rm -fr spool/*
    caius runplan -d spool -f junit testplan.xml

Note that we pass `-f junit`  to `caius runplan` indicating that test results
should be emitted in JUnit XML result format. Next, go to section *Post-build
Actions* and choose *Publish JUnit test result report*. As the fileset specify

    test/spool/*/result.xml

Finally double check that Jenkins has all the necessary permissions and access
to relevant infrastructure required for executing your tests successfully.
Trigger a build and enjoy your test results being reported natively in Jenkins.


text:
#include "config.h"
#include "DFACombiner.h"

#if ENABLE(CONTENT_EXTENSIONS)

#include "MutableRangeList.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>

namespace WebCore {

namespace ContentExtensions {

class DFAMerger {
    typedef MutableRangeList<char, uint64_t, 128> CombinedTransitionsMutableRangeList;

    enum class WhichDFA {
        A,
        B
    };

    template<WhichDFA whichDFA>
    struct TargetConverter {
        uint64_t convert(uint32_t target)
        {
            uint64_t value = 0xffffffffffffffff;
            extend(value, target);
            return value;
        }

        void extend(uint64_t& destination, uint32_t target)
        {
            setHalfSignature(destination, target);
        }
    private:
        void setHalfSignature(uint64_t& signature, uint32_t value)
        {
            unsigned shiftAmount = (whichDFA == WhichDFA::A) ? 32 : 0;
            uint64_t mask = static_cast<uint64_t>(0xffffffff) << (32 - shiftAmount);
            signature = (signature & mask) | static_cast<uint64_t>(value) << shiftAmount;
        }
    };

public:
    DFAMerger(const DFA& a, const DFA& b)
        : m_dfaA(a)
        , m_dfaB(b)
    {
    }

    DFA merge()
    {
        if (!m_nodeMapping.isEmpty())
            return m_output;

        uint64_t rootSignature = signatureForIndices(m_dfaA.root, m_dfaB.root);
        getOrCreateCombinedNode(rootSignature);

        CombinedTransitionsMutableRangeList combinedTransitions;
        while (!m_unprocessedNodes.isEmpty()) {
            combinedTransitions.clear();

            uint64_t unprocessedNode = m_unprocessedNodes.takeLast();

            uint32_t indexA = extractIndexA(unprocessedNode);
            if (indexA != invalidNodeIndex) {
                const DFANode& nodeA = m_dfaA.nodes[indexA];
                auto transitionsA = nodeA.transitions(m_dfaA);
                TargetConverter<WhichDFA::A> converterA;
                combinedTransitions.extend(transitionsA.begin(), transitionsA.end(), converterA);
            }

            uint32_t indexB = extractIndexB(unprocessedNode);
            if (indexB != invalidNodeIndex) {
                const DFANode& nodeB = m_dfaB.nodes[indexB];
                auto transitionsB = nodeB.transitions(m_dfaB);
                TargetConverter<WhichDFA::B> converterB;
                combinedTransitions.extend(transitionsB.begin(), transitionsB.end(), converterB);
            }

            unsigned transitionsStart = m_output.transitionRanges.size();
            for (const auto& range : combinedTransitions) {
                unsigned targetNodeId = getOrCreateCombinedNode(range.data);
                m_output.transitionRanges.append({ range.first, range.last });
                m_output.transitionDestinations.append(targetNodeId);
            }
            unsigned transitionsEnd = m_output.transitionRanges.size();
            unsigned transitionsLength = transitionsEnd - transitionsStart;

            uint32_t sourceNodeId = m_nodeMapping.get(unprocessedNode);
            DFANode& dfaSourceNode = m_output.nodes[sourceNodeId];
            dfaSourceNode.setTransitions(transitionsStart, static_cast<uint8_t>(transitionsLength));
        }
        return m_output;
    }

private:
    uint32_t invalidNodeIndex = 0xffffffff;

    static uint64_t signatureForIndices(uint32_t aIndex, uint32_t bIndex)
    {
        return static_cast<uint64_t>(aIndex) << 32 | bIndex;
    }

    static uint32_t extractIndexA(uint64_t signature)
    {
        return static_cast<uint32_t>(signature >> 32);
    }

    static uint32_t extractIndexB(uint64_t signature)
    {
        return static_cast<uint32_t>(signature);
    }

    uint32_t getOrCreateCombinedNode(uint64_t newNodeSignature)
    {
        auto addResult = m_nodeMapping.add(newNodeSignature, invalidNodeIndex);
        if (!addResult.isNewEntry)
            return addResult.iterator->value;

        m_output.nodes.append(DFANode());
        uint32_t newNodeIndex = m_output.nodes.size() - 1;
        addResult.iterator->value = newNodeIndex;
        m_unprocessedNodes.append(newNodeSignature);

        uint32_t indexA = extractIndexA(newNodeSignature);
        uint32_t indexB = extractIndexB(newNodeSignature);

        HashSet<uint64_t, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> actions;
        if (indexA != invalidNodeIndex) {
            const DFANode& node = m_dfaA.nodes[indexA];
            uint32_t actionsStart = node.actionsStart();
            uint32_t actionsEnd = actionsStart + node.actionsLength();
            for (uint32_t i = actionsStart; i < actionsEnd; ++i)
                actions.add(m_dfaA.actions[i]);
        }
        if (indexB != invalidNodeIndex) {
            const DFANode& node = m_dfaB.nodes[indexB];
            uint32_t actionsStart = node.actionsStart();
            uint32_t actionsEnd = actionsStart + node.actionsLength();
            for (uint32_t i = actionsStart; i < actionsEnd; ++i)
                actions.add(m_dfaB.actions[i]);
        }

        uint32_t actionsStart = m_output.actions.size();
        for (uint64_t action : actions)
            m_output.actions.append(action);
        uint32_t actionsEnd = m_output.actions.size();
        uint16_t actionsLength = static_cast<uint16_t>(actionsEnd - actionsStart);

        m_output.nodes.last().setActions(actionsStart, actionsLength);
        return newNodeIndex;
    }

    const DFA& m_dfaA;
    const DFA& m_dfaB;
    DFA m_output;
    HashMap<uint64_t, uint32_t, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> m_nodeMapping;
    Vector<uint64_t, 0, ContentExtensionsOverflowHandler> m_unprocessedNodes;
};

void DFACombiner::combineDFAs(unsigned minimumSize, const WTF::Function<void(DFA&&)>& handler)
{
    if (m_dfas.isEmpty())
        return;

    for (unsigned i = m_dfas.size(); i--;) {
        if (m_dfas[i].graphSize() > minimumSize) {
            handler(WTFMove(m_dfas[i]));
            m_dfas.remove(i);
        }
    }

    while (!m_dfas.isEmpty()) {
        if (m_dfas.size() == 1) {
            handler(WTFMove(m_dfas.first()));
            return;
        }

        DFA a = m_dfas.takeLast();
        DFA b = m_dfas.takeLast();
        DFAMerger dfaMerger(a, b);
        DFA c = dfaMerger.merge();

        if (c.graphSize() > minimumSize || m_dfas.isEmpty()) {
            // Minimizing is somewhat expensive. We only do it in bulk when we reach the threshold
            // to reduce the load.
            c.minimize();
        }

        if (c.graphSize() > minimumSize)
            handler(WTFMove(c));
        else
            m_dfas.append(c);
    }
}

}

} // namespace WebCore

#endif

redpajama_set_name: RedPajamaGithub


text:
deFilepath deFilepathCreate(char *path, deFilepath parent, bool isPackage) {
  utSym pathSym = utSymCreate(path);
  deFilepath filepath = deRootFindFilepath(deTheRoot, pathSym);
  if (filepath != deFilepathNull) {
    return filepath;
  }
  filepath = deFilepathAlloc();
  deFilepathSetSym(filepath, pathSym);
  deRootInsertFilepath(deTheRoot, filepath);
  deFilepathSetIsPackage(filepath, isPackage);
  if (parent != deFilepathNull) {
    deFilepathAppendFilepath(parent, filepath);
  }
  return filepath;
}

// Returns the path relative to the current working directory.
char *deFilepathGetRelativePath(deFilepath filepath) {
  char *path = deFilepathGetName(filepath);
  char *cwd = utGetcwd();
  while (*path != '\0' && *path == *cwd) {
    path++;
    cwd++;
  }
  if (*path == '/') {
    path++;
  }
  return path;
}


text:
<!DOCTYPE html>

    <title><%- title %></title>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Plain HTML template">
    <meta name="author" content="Rutha">
        <link rel="stylesheet" href="../dist/components/bootstrap/dist/css/bootstrap.min.css" >
    <link rel="stylesheet" href="../dist/css/deps.min.css" >
    <link rel="stylesheet" href="../dist/css/app.min.css">

    <%= navbar %>

Rutha / MIT Licensed / Made in Panama.


text:
package fm.serializer

import scala.collection.generic.Growable

final class GrowableDeserializer[Elem,Col <: Growable[Elem]](newInstance: => Col)(implicit elemDeser: Deserializer[Elem]) extends CollectionDeserializerBase[Col] {
  def defaultValue: Col = newInstance

  protected def readCollection(input: CollectionInput): Col = {
    val col: Col = newInstance

    while (input.hasAnotherElement) {
      col += elemDeser.deserializeNested(input)
    }

    col
  }
}


text:
package importer

import (
	"fmt"
	"io"

	"github.com/spf13/cobra"
	"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
	cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"

	"github.com/openshift/origin/pkg/oc/cli/util/clientcmd"
)

var (
	importLong = templates.LongDesc(`
		Import outside applications into OpenShift

		These commands assist in bringing existing applications into OpenShift.`)
)

// NewCmdImport exposes commands for modifying objects.
func NewCmdImport(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "import COMMAND",
		Short: "Commands that import applications",
		Long:  importLong,
		Run:   cmdutil.DefaultSubCommandRun(errout),
	}

	name := fmt.Sprintf("%s import", fullName)

	cmd.AddCommand(NewCmdAppJSON(name, f, in, out, errout))
	return cmd
}


text:
namespace AutoMapper.Configuration.Conventions
{
    using System;
    using System.Collections.Generic;
    using System.Reflection;

    public interface IGetTypeInfoMembers
    {
        IEnumerable<MemberInfo> GetMemberInfos(TypeDetails typeInfo);
        IGetTypeInfoMembers AddCondition(Func<MemberInfo, bool> predicate);
    }
}


text:
"""
Module implementing scan geometries and their methods to get subscans for
specific targets
"""

import logging
logger = logging.getLogger(__name__)
from persistent import Persistent

from basie.errors import ScanError

class ScanMode(Persistent):
    """
    Base class for all Scan types. Gives a unique ID to the scan and implements
    L{iter_subscans<self.iter_subscans>} method valid for all subclasses.
    """
    ID = 0
    def __init__(self):
        """
        """
        self.ID = ScanMode.ID
        ScanMode.ID += 1 #increment instance counter
        self.unit_subscans = 1 #number of logically grouped subscans
        self.subscans = []
        self.current_target = None
        self.name = "SCAN"

    def __lt__(self, other):
        return self.ID < other.ID

    def __eq__(self, other):
        if not hasattr(other, 'ID'):
            return False
        return self.ID == other.ID

    def __str__(self):
        return "Scan {0:d}: {1}".format(self.ID, self.__class__.__name__)

    def do_scan(self, _target, _receiver, _frequency):
        """
        Set the current taraget and calls the L{_do_scan} implementation of the
        specific subclass
        @param _target: the current target
        @type _target: L{target.Target}
        @param _receiver: the selected receiver
        @param _frequency: the selected frequency
        @raise ScanError: if frequency is not within receiver range
        """
        logger.debug("scheduling %s on target %s" % (self.name, _target.label))
        try:
            return self._do_scan(_target, _receiver, _frequency)
        except Exception as e:
            message = "Scan %s on target %s\n\t%s" %\
                    (self.name,
                     _target.label,
                     e.message)
            raise ScanError(message)

    def _do_scan(self, _target, _receiver, _frequency):
        """
        This is meant to be overridden by subclasses
        Implements logics used to get all the subscans starting from scan and
        target specifications.
        """
        raise NotImplementedError


text:
agent_labels=""
WELCOME_TEXT="Run-agent interactive installation\n##################################\n"
TOKEN_HELP_TEXT="1. Run-agent need your Pikacloud API Token to start:\nyou can generate and retrieve one here: https://pikacloud.com/settings/api/tokens/\n"
LABELS_HELP_TEXT="2. You can configure here some labels for your Run-agent (or none if you prefer).\nAgents labels are conditions used by Pikacloud to select specific hosts or group of hosts to run workload or schedule resources.\n"

function askToken() {
	echo -n "Enter your Pikacloud API token: "
	read api_token
	if [[ -z "$api_token" ]];
	then
		echo "Please specify your token!"
		askToken
	fi
}

function askLabels() {
	echo -n "Agent label (leave empty and press Enter to finish labels configuration:"
	read label
	if [[ ! -z "$label" ]];
	then
		if [[ -z "$agent_labels" ]];
		then
			agent_labels="$label"
		else
			agent_labels="$label,$agent_labels"
		fi
		askLabels
	fi
}

EXISTS=$(docker ps -q -f "ancestor=pikacloud/run-agent" -f "status=running" | xargs)
if [[ ! -z "$EXISTS" ]];
then
	docker ps -f "id=$EXISTS"
	echo -e "/!\ You already have a run-agent running in container $EXISTS\nPress Enter to destroy this run-agent and create a new one. Cancel with ctrl-c."
	read override_agent
	echo -ne "Removing container... "
  docker rm -fv $EXISTS
fi

echo -e $WELCOME_TEXT

echo -e $TOKEN_HELP_TEXT
askToken

echo -e $LABELS_HELP_TEXT
askLabels

docker pull pikacloud/run-agent
docker run -e PIKACLOUD_API_TOKEN="$api_token" \
           -e PIKACLOUD_AGENT_LABELS="$agent_labels" \
           --net=host -v /var/run/docker.sock:/var/run/docker.sock \
           --restart=always \
           --name=run-agent \
           -d pikacloud/run-agent
sleep 2
docker logs --tail=10 run-agent


text:
/*************************************************************
 * Project: Avatar Demo
 * Class: avatar.core.utils.mapmatching.algorithm.NRM
 * Author: Huajian Mao
 * Purpose: ...
 * LastChanged: 2011-12-28 14:52:07
 * Email: huajianmao@gmail.com
*************************************************************/
package avatar.core.utils.mapmatching.algorithm;

import avatar.core.model.geometry.Region;
import avatar.core.model.mobject.Trace;
import avatar.core.model.mobject.Trajectory;
import avatar.core.utils.common.Constant;
import avatar.core.utils.mapmatching.MMBase;
import avatar.core.utils.mapmatching.MMIface;
import avatar.core.utils.route.Route;

public class NRM extends MMBase implements MMIface {

	public NRM(Region region, Route route) {
		super(region, route);
	}

	//FIXME: arraylist version
	/*
	@Override
	public Match map(Trace trace) {
		Match match = null;
		try {
			match = setupCandidates(trace, Constant.MAX_CAND_NUM);
			getBestRoute(match);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return match;
	}
	 */
//	public String estimate (Trace trace) {
//		ArrayList<Match> matches = null;
//		String content = "";
//		try {
//			matches = setupCandidates(trace, Constant.MAX_CAND_NUM);
//			for (Match match: matches) {
//				List<VertexTime> vertices = estimateVertexTime(match);
//				for (VertexTime vertexTime: vertices) {
//					content += vertexTime + "\n";
//				}
//			}
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		return content;
//	}

	@Override
	public Trajectory  map(Trace trace) {
		Trajectory traj = null;
		try {
			traj = setupCandidates(trace, Constant.MAX_CAND_NUM);
			getBestRoute(traj);
			traj.setTraceID(trace.getTraceID());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return traj;
	}

//	public static void main(String[] args) {
//		String mapfile = "/home/avatar/data/maps/shanghai.region";
//		Map map = new Reg();
//		map.load(mapfile);
//		Region region = new Region(map);
//		Route route = new Route(region);
//		MMIface mm = new NRM(region, route);
//		System.out.println("NRM::map loadded");
//		try {
//			TracePool tracePool = new TracePool(TracePoolType.FS);
//			Trace trace = Trace.get("107", 0, 1, tracePool);
//			System.out.println("NRM::trace loadded");
//			Match match = mm.map(trace);
//			System.out.println(match.getPath().getLength());
//			System.out.println("NRM::map matching done");
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//	}
}


text:
layout: default
---

{% include base_path %}

{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
  {% include page__hero.html %}
{% endif %}

{% if page.url != "/" and site.breadcrumbs %}
  {% unless paginator %}
    {% include breadcrumbs.html %}
  {% endunless %}
{% endif %}

  {% include sidebar.html %}

    {% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
    {% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
    {% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date: "%B %d, %Y" }}">{% endif %}
    {% if page.modified %}<meta itemprop="dateModified" content="{{ page.modified | date: "%B %d, %Y" }}">{% endif %}

      {% unless page.header.overlay_color or page.header.overlay_image %}

          {% if page.title %}
{{ page.title | markdownify | remove: "
" | remove: "
" }}
{% endif %}
          {% if post.read_time %}
          {% elsif post.read_time and post.collection == 'posts' %}

 {% include read-time.html %}

          {% endif %}
        {% if page.modified %}

 <time datetime="{{ page.modified | date: "%Y-%m-%d" }}">{{ page.modified | date: "%B %d, %Y" }}</time>

        {% endif %}

        {% if page.collection == 'teaching' %}

 {{ page.type }}, {{ page.venue }}, {{ page.date | default: "1900-01-01" | date: "%Y" }}

        {% elsif page.venue and page.date %}

Published in {{ page.venue }}, {{ page.date | default: "1900-01-01" | date: "%Y" }}

        {% elsif page.date and page.read_time %}

             <time datetime="{{ post.date | default: "1900-01-01" | date_to_xmlschema }}">{{ page.date | default: "1900-01-01" | date: "%B %d, %Y" }}</time>
             {% include read-time.html %}

        {% elsif page.date %}

 <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | default: "1900-01-01" | date: "%B %d, %Y" }}</time>

        {% endif %}

        {% if page.citation and page.paperurl %}

Recommended citation: {{ page.citation }} {{ page.paperurl }}

        {% elsif page.citation %}

Recommended citation: {{ page.citation }}

        {% endif %}

      {% endunless %}

        {% if page.toc %}

 {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label | default: "On this page" }}

              {% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" %}

        {% endif %}
        {{ content }}
        {% if page.link %}
{{ site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}
{% endif %}

        {% if site.data.ui-text[site.locale].meta_label %}

{{ site.data.ui-text[site.locale].meta_label }}

        {% endif %}
        {% include page__taxonomy.html %}

      {% if page.share %}{% include social-share.html %}{% endif %}

      {% include post_pagination.html %}

    {% if site.comments.provider and page.comments %}
      {% include comments.html %}
    {% endif %}

  {% comment %}{% endcomment %}
  {% if page.id and page.related and site.related_posts.size > 0 %}

      {% if site.data.ui-text[site.locale].related_label %}

{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}

      {% endif %}

        {% comment %}{% endcomment %}
        {% assign maxRelated = 3 %}
        {% assign minCommonTags =  1 %}
        {% assign maxRelatedCounter = 0 %}

        {% for post in site.posts %}

          {% assign sameTagCount = 0 %}
          {% assign commonTags = '' %}

          {% for tag in post.tags %}
            {% if post.url != page.url %}
              {% if page.tags contains tag %}
                {% assign sameTagCount = sameTagCount | plus: 1 %}
                {% capture tagmarkup %} {{ tag }} {% endcapture %}
                {% assign commonTags = commonTags | append: tagmarkup %}
              {% endif %}
            {% endif %}
          {% endfor %}

          {% if sameTagCount >= minCommonTags %}
            {% include archive-single.html type="grid" %}
            {% assign maxRelatedCounter = maxRelatedCounter | plus: 1 %}
            {% if maxRelatedCounter >= maxRelated %}
              {% break %}
            {% endif %}
          {% endif %}

        {% endfor %}

        {% comment %}{% endcomment %}
        {% assign remainingRelated = maxRelated | minus: maxRelatedCounter %}
        {% for post in site.related_posts limit:remainingRelated %}
          {% include archive-single.html type="grid" %}
        {% endfor %}

  {% endif %}


text:
package edu.wustl.catissuecore.smoketest.admin;

import java.util.HashMap;
import java.util.Map;

import edu.wustl.catissuecore.actionForm.CollectionProtocolForm;
import edu.wustl.catissuecore.actionForm.ProtocolEventDetailsForm;
import edu.wustl.catissuecore.smoketest.CaTissueSuiteSmokeBaseTest;
import edu.wustl.common.beans.SessionDataBean;
import edu.wustl.simplequery.actionForm.SimpleQueryInterfaceForm;
import edu.wustl.testframework.util.DataObject;

public class CollectionProtocolTestCases  extends CaTissueSuiteSmokeBaseTest
{
	public CollectionProtocolTestCases(String name, DataObject dataObject)
	{
		super(name,dataObject);
	}
	public CollectionProtocolTestCases(String name)
	{
		super(name);
	}
	public CollectionProtocolTestCases()
	{
		super();
	}

	public void testAddCollectionProtocol()
	{

		String array[] = getDataObject().getValues();
		/*Collection Protocol Details*/
		CollectionProtocolForm collForm = new CollectionProtocolForm();

		long principalInvestigatorId = Long.parseLong(array[0]);
		collForm.setPrincipalInvestigatorId(principalInvestigatorId) ;
		collForm.setTitle(array[1]);
		collForm.setOperation("add") ;
		collForm.setShortTitle(array[2]);
		collForm.setStartDate(array[3]);
		String protocolCoordinatorIds[]=new String[2];
		protocolCoordinatorIds[0] = array[49];
		protocolCoordinatorIds[1] = array[50];
		collForm.setProtocolCoordinatorIds(protocolCoordinatorIds);

		long coordinatorIds[]=new long[1];
		coordinatorIds[0]=Long.parseLong(array[51]);
		collForm.setCoordinatorIds(coordinatorIds);
		collForm.setIrbID(array[52]);

		boolean consentWaived = Boolean.parseBoolean(array[53]);
		collForm.setConsentWaived(consentWaived);
		collForm.setEnrollment(array[54]);
		collForm.setDescriptionURL(array[55]);

		boolean aliqoutInSameContainer = Boolean.parseBoolean(array[56]);
		collForm.setAliqoutInSameContainer(aliqoutInSameContainer);

		collForm.setUnsignedConsentURLName(array[57]);

		Map<String,String> consentValuesmap=new HashMap<String,String>();
		consentValuesmap.put("ConsentBean:"+array[58]+"_statement",array[59]);
		consentValuesmap.put("ConsentBean:"+array[60]+"_statement",array[61]);
		collForm.setConsentValues(consentValuesmap);

		collForm.setSpecimenLabelFormat(array[4]);
		collForm.setDerivativeLabelFormat(array[5]);
		collForm.setAliquotLabelFormat(array[6]);
		setRequestPathInfo("/OpenCollectionProtocol");
		setActionForm(collForm);
		actionPerform();
        verifyForward("success");

        /*Event Details*/
        setRequestPathInfo("/DefineEvents");
        addRequestParameter("pageOf", "pageOfDefineEvents");
		addRequestParameter("operation", "add");
		actionPerform();
		verifyForward("pageOfDefineEvents");

        setRequestPathInfo("/SaveProtocolEvents");
		addRequestParameter("pageOf", "pageOfDefineEvents");
		addRequestParameter("studyCalendarEventPoint",array[7]);
		addRequestParameter("collectionProtocolEventkey",array[8]);
		addRequestParameter("collectionPointLabel",array[9] );
		addRequestParameter("clinicalStatus",array[10]);
		addRequestParameter("clinicalDiagnosis",array[11]);

		addRequestParameter("collectionEventId",array[12]);
		addRequestParameter("collectionEventUserId", array[13]);
		addRequestParameter("collectionUserName", array[14]);
		addRequestParameter("collectionEventSpecimenId",array[15]);

		addRequestParameter("receivedEventId", array[16] );
		addRequestParameter("receivedEventUserId",array[17]);
		addRequestParameter("receivedUserName", array[18]);
		addRequestParameter("receivedEventSpecimenId", array[19]);
		addRequestParameter("pageOf", "specimenRequirement");
		addRequestParameter("operation", "add");

		addRequestParameter("labelFormat", array[20]);

		addRequestParameter("labelFormatForAliquot", array[21]);

		actionPerform();
		verifyForwardPath("/CreateSpecimenTemplate.do?operation=add");

		setRequestPathInfo("/SaveSpecimenRequirements");
		addRequestParameter("displayName",array[22] );

		SessionDataBean bean = (SessionDataBean)getSession().getAttribute("sessionData");
		addRequestParameter("collectionUserName", "" + bean.getLastName() + "," + bean.getFirstName());

		addRequestParameter("collectionEventContainer", array[23]);

		addRequestParameter("key",array[24] );
		addRequestParameter("receivedEventReceivedQuality",array[25]);
		addRequestParameter("collectionEventId", array[26]);
		addRequestParameter("collectionEventUserId", array[27]);
		addRequestParameter("collectionUserName", array[28]);
		addRequestParameter("collectionEventSpecimenId", array[29]);

		addRequestParameter("receivedEventId", array[30] );
		addRequestParameter("receivedEventUserId", array[31]);
		addRequestParameter("receivedUserName", array[32]);
		addRequestParameter("receivedEventSpecimenId", array[33]);

		addRequestParameter("collectionEventCollectionProcedure", array[34]);
		addRequestParameter("collectionEventContainer", array[35]);
		addRequestParameter("className", array[36]);
		addRequestParameter("tissueSite", array[37]);
		addRequestParameter("tissueSide", array[38]);
		addRequestParameter("pathologicalStatus", array[39]);
		addRequestParameter("storageLocationForSpecimen",array[40]);
		addRequestParameter("type",array[41]);
		addRequestParameter("receivedEventReceivedQuality",array[42]);
		addRequestParameter("quantity", array[43]);
		addRequestParameter("quantityPerAliquot", array[44]);
		addRequestParameter("noOfAliquots", array[45]);
		addRequestParameter("storageLocationForAliquotSpecimen", array[46]);
		addRequestParameter("operation", "add");
		addRequestParameter("labelFormat", array[47]);

		addRequestParameter("labelFormatForAliquot", array[48]);
		actionPerform();
		verifyForward("success");
		verifyNoActionErrors();

		setRequestPathInfo("/SubmitCollectionProtocol");
		addRequestParameter("operation", "add");
		actionPerform();
		verifyForward("success");
		verifyNoActionErrors();
	}

	/*Test case for Edit Collection Protocol*/
		public void testEditCollectionProtocol2()
	{
		String[] arr = getDataObject().getValues();

		SimpleQueryInterfaceForm simpleQueryInterfaceForm = new SimpleQueryInterfaceForm();
		setRequestPathInfo("/SimpleQueryInterface");
		addRequestParameter("aliasName", "CollectionProtocol");
		addRequestParameter("pageOf", "pageOfCollectionProtocol" );
		setActionForm(simpleQueryInterfaceForm);
		actionPerform();
		verifyForward("pageOfCollectionProtocol");
		verifyTilesForward("pageOfDepartment",".catissuecore.editSearchPageDef");
		verifyNoActionErrors();

		simpleQueryInterfaceForm = (SimpleQueryInterfaceForm)getActionForm();
		simpleQueryInterfaceForm.setValue("SimpleConditionsNode:1_Condition_DataElement_table", "CollectionProtocolForm");
		simpleQueryInterfaceForm.setValue("SimpleConditionsNode:1_Condition_DataElement_field", "CollectionProtocolForm."+arr[0]+".varchar");
		simpleQueryInterfaceForm.setValue("SimpleConditionsNode:1_Condition_Operator_operator",arr[1]);
		simpleQueryInterfaceForm.setValue("SimpleConditionsNode:1_Condition_value",arr[2]);
		simpleQueryInterfaceForm.setPageOf("pageOfCollectionProtocol");
		setRequestPathInfo("/SimpleSearch");
		setActionForm(simpleQueryInterfaceForm);
		actionPerform();

		setRequestPathInfo("/SpreadsheetView");
		actionPerform();
		verifyTilesForward("pageOfCollectionProtocol",".catissuecore.editSearchResultsDef");

		setRequestPathInfo("/SearchObject");
		addRequestParameter("pageOf", "pageOfCollectionProtocol");
		addRequestParameter("operation", "search");
		addRequestParameter("id", arr[2]);
		actionPerform();

		setRequestPathInfo("/CollectionProtocolSearch");
		addRequestParameter("pageOf", "pageOfCollectionProtocol");
		actionPerform();
		verifyForward("pageOfCollectionProtocol");

		CollectionProtocolForm collectionProtocolForm = (CollectionProtocolForm) getActionForm() ;
		setRequestPathInfo("/CollectionProtocol");
		addRequestParameter("operation", "edit");
		addRequestParameter("pageOf", "pageOfCollectionProtocol");
		addRequestParameter("menuSelected", "9");
		setActionForm(collectionProtocolForm);
		actionPerform();
		verifyForward("pageOfCollectionProtocol");
		//verifyTilesForward("pageOfCollectionProtocol",".catissuecore.collectionProtocolDef");

		collectionProtocolForm.setPrincipalInvestigatorId(Long.parseLong(arr[3]));
		collectionProtocolForm.setTitle(arr[4]);
		collectionProtocolForm.setShortTitle(arr[5]);
		collectionProtocolForm.setIrbID(arr[6]);
		collectionProtocolForm.setStartDate(arr[7]);

		 boolean theConsent = Boolean.parseBoolean(arr[8]);
		collectionProtocolForm.setConsentWaived(theConsent);

		collectionProtocolForm.setEnrollment(arr[9]);
		collectionProtocolForm.setDescriptionURL(arr[10]);
		collectionProtocolForm.setActivityStatus(arr[11]);

		String[] protocolCoordinatorIds={(arr[12].trim())};
		collectionProtocolForm.setProtocolCoordinatorIds(protocolCoordinatorIds);

		boolean aliqoutInSameContainer = Boolean.parseBoolean(arr[13]);
		collectionProtocolForm.setAliqoutInSameContainer(aliqoutInSameContainer);

		collectionProtocolForm.setDescriptionURL(arr[14]);
		/*Map consentValues = new HashMap();
		consentValues.put(arr[15],arr[16]);                     //13,14
		collectionProtocolForm.setConsentValues(consentValues);*/

		double StudyCalendarEventPoint = Double.parseDouble(arr[15]);         //17
		collectionProtocolForm.setStudyCalendarEventPoint(arr[15]);

		collectionProtocolForm.setUnsignedConsentURLName(arr[16]);
		//collectionProtocolForm.set

		collectionProtocolForm.setOperation("edit");

		setRequestPathInfo("/CollectionProtocolEdit");
		setActionForm(collectionProtocolForm);
		actionPerform();
		verifyForward("success");
		verifyActionMessages(new String[]{"object.edit.successOnly"});

	}

		public void testCPAddWithPrivileges()
		{
			String arr[] = getDataObject().getValues();

			CollectionProtocolForm collectionForm = new CollectionProtocolForm();

			setRequestPathInfo("/OpenCollectionProtocol");
			addRequestParameter("pageOf","pageOfmainCP");
			addRequestParameter("operation", "add");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/CollectionProtocol");
			addRequestParameter("pageOf","pageOfCollectionProtocol");
			addRequestParameter("operation", "add");
			setActionForm(collectionForm);
			actionPerform();

			collectionForm = (CollectionProtocolForm)getActionForm();
			collectionForm.setPrincipalInvestigatorId(Long.parseLong(arr[0].trim()));
			long ar[]={Long.parseLong(arr[1])};
			collectionForm.setCoordinatorIds(ar);
			String[] arr1={arr[2]};
			collectionForm.setProtocolCoordinatorIds(arr1);
			collectionForm.setTitle(arr[3]);
			collectionForm.setShortTitle(arr[4]);
			collectionForm.setStartDate(arr[5]);
			collectionForm.setIrbID(arr[6]);
			collectionForm.setConsentWaived(Boolean.parseBoolean(arr[7].trim()));
			collectionForm.setDescriptionURL(arr[8]);
			collectionForm.setAliqoutInSameContainer(Boolean.parseBoolean(arr[9].trim()));

			setRequestPathInfo("/DefineEvents");
			addRequestParameter("pageOf","pageOfDefineEvents");
			addRequestParameter("operation", "add");
			setActionForm(collectionForm);
			actionPerform();

			ProtocolEventDetailsForm protocolEvent = new ProtocolEventDetailsForm();

			setRequestPathInfo("/ProtocolEventsDetails");
			addRequestParameter("operation", "add");
			addRequestParameter("pageOf", "newEvent");
			setActionForm(protocolEvent);
			actionPerform();

			protocolEvent = (ProtocolEventDetailsForm)getActionForm();

			protocolEvent.setStudyCalendarEventPoint(arr[10]);
			protocolEvent.setCollectionPointLabel(arr[11]);
			protocolEvent.setClinicalDiagnosis(arr[12]);
			protocolEvent.setClinicalStatus(arr[13]);

			setRequestPathInfo("/SaveProtocolEvents");
			addRequestParameter("pageOf","defineEvents");
			addRequestParameter("operation","add");
			setActionForm(protocolEvent);
			actionPerform();

			setRequestPathInfo("/SubmitCollectionProtocol");
			addRequestParameter("operation","add");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/OpenCollectionProtocol");
			addRequestParameter("pageOf", "collectionProtocol");
			addRequestParameter("operation","edit");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/CollectionProtocol");
			addRequestParameter("pageOf","pageOfCollectionProtocol");
			addRequestParameter("operation","edit");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/DefineEvents");
			addRequestParameter("pageOf","pageOfAssignPrivilegePage");
			addRequestParameter("operation", "edit");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/ShowAssignPrivilegePage");
			addRequestParameter("operation","edit");
			addRequestParameter("pageOf","pageOfAssignPrivilegePage");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/SaveCollectionProtocol");
			addRequestParameter("operation","edit");
			addRequestParameter("pageOf","submitSpecimen");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/SubmitCollectionProtocol");
			addRequestParameter("operation","edit");
			addRequestParameter("pageOf","submitSpecimen");
			setActionForm(collectionForm);
			actionPerform();

			setRequestPathInfo("/OpenCollectionProtocol");
			addRequestParameter("operation","edit");
			addRequestParameter("pageOf","collectionProtocol");
			setActionForm(collectionForm);
			actionPerform();

			verifyForward("success");
			verifyNoActionErrors();
		    verifyActionMessages(new String[]{"object.add.successOnly"});

		}

		public void testAddCollectionProtocolWithSPP()
		{

			String array[] = getDataObject().getValues();
			/*Collection Protocol Details*/
			CollectionProtocolForm collForm = new CollectionProtocolForm();

			long principalInvestigatorId = Long.parseLong(array[0]);
			collForm.setPrincipalInvestigatorId(principalInvestigatorId) ;
			collForm.setTitle(array[1]);
			collForm.setOperation("add") ;
			collForm.setShortTitle(array[2]);
			collForm.setStartDate(array[3]);
			String protocolCoordinatorIds[]=new String[2];
			protocolCoordinatorIds[0] = array[49];
			protocolCoordinatorIds[1] = array[50];
			collForm.setProtocolCoordinatorIds(protocolCoordinatorIds);

			long coordinatorIds[]=new long[1];
			coordinatorIds[0]=Long.parseLong(array[51]);
			collForm.setCoordinatorIds(coordinatorIds);
			collForm.setIrbID(array[52]);

			boolean consentWaived = Boolean.parseBoolean(array[53]);
			collForm.setConsentWaived(consentWaived);
			collForm.setEnrollment(array[54]);
			collForm.setDescriptionURL(array[55]);

			boolean aliqoutInSameContainer = Boolean.parseBoolean(array[56]);
			collForm.setAliqoutInSameContainer(aliqoutInSameContainer);

			collForm.setUnsignedConsentURLName(array[57]);

			Map<String,String> consentValuesmap=new HashMap<String,String>();
			consentValuesmap.put("ConsentBean:"+array[58]+"_statement",array[59]);
			consentValuesmap.put("ConsentBean:"+array[60]+"_statement",array[61]);
			collForm.setConsentValues(consentValuesmap);

			collForm.setSpecimenLabelFormat(array[4]);
			collForm.setDerivativeLabelFormat(array[5]);
			collForm.setAliquotLabelFormat(array[6]);
			setRequestPathInfo("/OpenCollectionProtocol");
			setActionForm(collForm);
			actionPerform();
	        verifyForward("success");

	        /*Event Details*/
	        setRequestPathInfo("/DefineEvents");
	        addRequestParameter("pageOf", "pageOfDefineEvents");
			addRequestParameter("operation", "add");
			actionPerform();
			verifyForward("pageOfDefineEvents");

			addRequestParameter("limit","15");
			addRequestParameter("start","0");
			addRequestParameter("query","");
			setRequestPathInfo("/SPPData");
			actionPerform();

	        setRequestPathInfo("/SaveProtocolEvents");
			addRequestParameter("pageOf", "pageOfDefineEvents");
			addRequestParameter("studyCalendarEventPoint",array[7]);
			addRequestParameter("collectionProtocolEventkey",array[8]);
			addRequestParameter("collectionPointLabel",array[9] );
			addRequestParameter("clinicalStatus",array[10]);
			addRequestParameter("clinicalDiagnosis",array[11]);

			addRequestParameter("collectionEventId",array[12]);
			addRequestParameter("collectionEventUserId", array[13]);
			addRequestParameter("collectionUserName", array[14]);
			addRequestParameter("collectionEventSpecimenId",array[15]);

			addRequestParameter("receivedEventId", array[16] );
			addRequestParameter("receivedEventUserId",array[17]);
			addRequestParameter("receivedUserName", array[18]);
			addRequestParameter("receivedEventSpecimenId", array[19]);
			addRequestParameter("pageOf", "specimenRequirement");
			addRequestParameter("operation", "add");
			addRequestParameter("specimenProcessingProcedure", new String[ ]{"SPP_With_SpunEvent"});

			addRequestParameter("labelFormat", array[20]);

			addRequestParameter("labelFormatForAliquot", array[21]);

			actionPerform();
			verifyForwardPath("/CreateSpecimenTemplate.do?operation=add");

			setRequestPathInfo("/CreateSpecimenTemplate.do?operation=add");
			actionPerform();

			addRequestParameter("limit","15");
			addRequestParameter("start","0");
			addRequestParameter("query","");
			addRequestParameter("requestFor", "specimenEvent");
			addRequestParameter("processingSPPName", "SPP_With_SpunEvent");
			setRequestPathInfo("/ClinincalStatusComboAction");
			actionPerform();

			setRequestPathInfo("/SaveSpecimenRequirements");
			addRequestParameter("displayName",array[22] );

			SessionDataBean bean = (SessionDataBean)getSession().getAttribute("sessionData");
			addRequestParameter("collectionUserName", "" + bean.getLastName() + "," + bean.getFirstName());

			addRequestParameter("collectionEventContainer", array[23]);

			addRequestParameter("key",array[24] );
			addRequestParameter("receivedEventReceivedQuality",array[25]);
			addRequestParameter("collectionEventId", array[26]);
			addRequestParameter("collectionEventUserId", array[27]);
			addRequestParameter("collectionUserName", array[28]);
			addRequestParameter("collectionEventSpecimenId", array[29]);

			addRequestParameter("receivedEventId", array[30] );
			addRequestParameter("receivedEventUserId", array[31]);
			addRequestParameter("receivedUserName", array[32]);
			addRequestParameter("receivedEventSpecimenId", array[33]);

			addRequestParameter("collectionEventCollectionProcedure", array[34]);
			addRequestParameter("collectionEventContainer", array[35]);
			addRequestParameter("className", array[36]);
			addRequestParameter("tissueSite", array[37]);
			addRequestParameter("tissueSide", array[38]);
			addRequestParameter("pathologicalStatus", array[39]);
			addRequestParameter("storageLocationForSpecimen",array[40]);
			addRequestParameter("type",array[41]);
			addRequestParameter("receivedEventReceivedQuality",array[42]);
			addRequestParameter("quantity", array[43]);
			addRequestParameter("quantityPerAliquot", array[44]);
			addRequestParameter("noOfAliquots", array[45]);
			addRequestParameter("storageLocationForAliquotSpecimen", array[46]);
			addRequestParameter("operation", "add");
			addRequestParameter("labelFormat", array[47]);
			addRequestParameter("processingSPPForSpecimen","SPP_With_SpunEvent");
			addRequestParameter("creationEventForSpecimen","SPP_With_SpunEvent : 6 : Spun Event Parameters");

			addRequestParameter("labelFormatForAliquot", array[48]);
			actionPerform();
			verifyForward("success");
			//verifyNoActionErrors();

			setRequestPathInfo("/SubmitCollectionProtocol");
			addRequestParameter("operation", "add");
			actionPerform();
			verifyForward("success");
			verifyNoActionErrors();
		}

}


text:
var buttonToContainerMap = {
  "toggl": "personal",
  "toggl1": "work",
  "toggl2": "education",
  "toggl3": "skills"
}

var createClickHandler = function (container) {
  return function () {
    if (container.style.display === 'none') {
      container.style.display = 'block'
    } else {
      container.style.display = 'none'
    }
  }
}

module.exports.init = function () {
  for(var key in buttonToContainerMap) {
    console.log(key)
    console.log(buttonToContainerMap[key])

    var btn = document.getElementById(key)
    var container = document.getElementById(buttonToContainerMap[key])

    if (!container || !btn) return console.error(key, buttonToContainerMap[key], "not found")
    btn.addEventListener('click', createClickHandler(container))
  }

}


text:
<?php
use rock\base\Alias;

$composerAutoload = dirname(__DIR__) . '/vendor/autoload.php';
if (is_file($composerAutoload)) {
    /** @var \Composer\Autoload\ClassLoader $loader */
    $loader = require($composerAutoload);
}

$loader->addPsr4('rockunit\\', __DIR__);

defined('ROCKUNIT_RUNTIME') or define('ROCKUNIT_RUNTIME', __DIR__ . '/runtime');
Alias::setAlias('rockunit', __DIR__);

$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'] = 'site.com';
$_SERVER['REQUEST_URI'] = '/';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';


text:
goog.provide('ol.style.Text');

/**
 * @classdesc
 * Set text style for vector features.
 *
 * @constructor
 * @param {olx.style.TextOptions=} opt_options Options.
 * @api
 */
ol.style.Text = function(opt_options) {

  var options = goog.isDef(opt_options) ? opt_options : {};

  /**
   * @private
   * @type {string|undefined}
   */
  this.font_ = options.font;

  /**
   * @private
   * @type {number|undefined}
   */
  this.rotation_ = options.rotation;

  /**
   * @private
   * @type {number|undefined}
   */
  this.scale_ = options.scale;

  /**
   * @private
   * @type {string|undefined}
   */
  this.text_ = options.text;

  /**
   * @private
   * @type {string|undefined}
   */
  this.textAlign_ = options.textAlign;

  /**
   * @private
   * @type {string|undefined}
   */
  this.textBaseline_ = options.textBaseline;

  /**
   * @private
   * @type {ol.style.Fill}
   */
  this.fill_ = goog.isDef(options.fill) ? options.fill : null;

  /**
   * @private
   * @type {ol.style.Stroke}
   */
  this.stroke_ = goog.isDef(options.stroke) ? options.stroke : null;

  /**
   * @private
   * @type {number}
   */
  this.offsetX_ = goog.isDef(options.offsetX) ? options.offsetX : 0;

  /**
   * @private
   * @type {number}
   */
  this.offsetY_ = goog.isDef(options.offsetY) ? options.offsetY : 0;
};

/**
 * @return {string|undefined} Font.
 * @api
 */
ol.style.Text.prototype.getFont = function() {
  return this.font_;
};

/**
 * @return {number} Horizontal text offset.
 */
ol.style.Text.prototype.getOffsetX = function() {
  return this.offsetX_;
};

/**
 * @return {number} Vertical text offset.
 */
ol.style.Text.prototype.getOffsetY = function() {
  return this.offsetY_;
};

/**
 * @return {ol.style.Fill} Fill style.
 * @api
 */
ol.style.Text.prototype.getFill = function() {
  return this.fill_;
};

/**
 * @return {number|undefined} Rotation.
 * @api
 */
ol.style.Text.prototype.getRotation = function() {
  return this.rotation_;
};

/**
 * @return {number|undefined} Scale.
 * @api
 */
ol.style.Text.prototype.getScale = function() {
  return this.scale_;
};

/**
 * @return {ol.style.Stroke} Stroke style.
 * @api
 */
ol.style.Text.prototype.getStroke = function() {
  return this.stroke_;
};

/**
 * @return {string|undefined} Text.
 * @api
 */
ol.style.Text.prototype.getText = function() {
  return this.text_;
};

/**
 * @return {string|undefined} Text align.
 * @api
 */
ol.style.Text.prototype.getTextAlign = function() {
  return this.textAlign_;
};

/**
 * @return {string|undefined} Text baseline.
 * @api
 */
ol.style.Text.prototype.getTextBaseline = function() {
  return this.textBaseline_;
};


text:
@interface V2EXTopicsListInSingleNodeViewController : V2EXTableViewController <V2EXAfterTopicActionDelegate>
{
    BOOL _isLogin;
}

@property (weak, nonatomic) NSMutableString *uri;

//+ (V2EXTopicsListInSingleNodeViewController *)sharedController;
- (void)loadNewNodeWithData:(NSData *)data;

@end


text:
package hu.akarnokd.queue;

import java.util.concurrent.atomic.AtomicLong;

import rx.internal.util.unsafe.Pow2;

public final class SpscIntArrayQueueAtomic {
    final int mask;
    final long[] array;
    final AtomicLong producerIndex = new AtomicLong();
    final AtomicLong consumerIndex = new AtomicLong();

    int calcOffset(long index, int m) {
        return (int)index & m;
    }

    long lvElement(long[] a, int offset) {
        return a[offset];
    }

    void soElement(long[] a, int offset, long value) {
        a[offset] = value;
    }

    void soProducerIndex(long value) {
        producerIndex.lazySet(value);
    }

    long lpProducerIndex() {
        return producerIndex.get();
    }

    void soConsumerIndex(long value) {
        consumerIndex.lazySet(value);
    }

    long lpConsumerIndex() {
        return consumerIndex.get();
    }
    public SpscIntArrayQueueAtomic(int capacity) {
        int c = Pow2.roundToPowerOfTwo(capacity);
        array = new long[c];
        mask = c - 1;
    }

    public boolean offer(int value) {
        final int m = mask;
        final long[] a = array;
        final long pi = lpProducerIndex();

        final int offset = calcOffset(pi, m);
        final long v = lvElement(a, offset);
        if (v != 0L) {
            return false;
        }
        soElement(a, offset, value | 0x1_0000_0000L);
        soProducerIndex(pi + 1);

        return true;
    }

    public int peek(boolean[] hasValue) {
        final int m = mask;
        final long[] a = array;
        final long ci = lpConsumerIndex();

        final int offset = calcOffset(ci, m);
        final long v = lvElement(a, offset);
        if (v != 0L) {
            hasValue[0] = true;
            return (int)v;
        }
        hasValue[0] = false;
        return 0;
    }

    public int peek() {
        final int m = mask;
        final long[] a = array;
        final long ci = lpConsumerIndex();

        final int offset = calcOffset(ci, m);
        final long v = lvElement(a, offset);
        if (v != 0L) {
            return (int)v;
        }
        return 0;
    }

    public int poll(boolean[] hasValue) {
        final int m = mask;
        final long[] a = array;
        final long ci = lpConsumerIndex();

        final int offset = calcOffset(ci, m);
        final long v = lvElement(a, offset);
        if (v != 0L) {
            soElement(a, offset, 0L);
            soConsumerIndex(ci + 1);
            hasValue[0] = true;
            return (int)v;
        }
        hasValue[0] = false;
        return 0;
    }

    public int poll() {
        final int m = mask;
        final long[] a = array;
        final long ci = lpConsumerIndex();

        final int offset = calcOffset(ci, m);
        final long v = lvElement(a, offset);
        if (v != 0L) {
            soElement(a, offset, 0L);
            soConsumerIndex(ci + 1);
            return (int)v;
        }
        return 0;
    }

    public boolean isEmpty() {
        return lpProducerIndex() == lpConsumerIndex();
    }

    public boolean hasValue() {
        return !isEmpty();
    }

    public void clear() {
        while (hasValue()) {
            poll();
        }
    }

    public int size() {
        long ci = lpConsumerIndex();

        for (;;) {
            long pi = lpProducerIndex();
            long ci2 = lpConsumerIndex();
            if (ci2 == ci) {
                return (int)((pi - ci) >> 1);
            }
            ci = ci2;
        }
    }
}