text:
<?php

use Mockery as m;
use Illuminate\Http\Request;
use PHPUnit\Framework\TestCase;
use Illuminate\Http\RedirectResponse;

class HttpRedirectResponseTest extends TestCase
{
    public function tearDown()
    {
        m::close();
    }

    public function testHeaderOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $this->assertNull($response->headers->get('foo'));
        $response->header('foo', 'bar');
        $this->assertEquals('bar', $response->headers->get('foo'));
        $response->header('foo', 'baz', false);
        $this->assertEquals('bar', $response->headers->get('foo'));
        $response->header('foo', 'baz');
        $this->assertEquals('baz', $response->headers->get('foo'));
    }

    public function testWithOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('flash')->twice();
        $response->with(['name', 'age']);
    }

    public function testWithCookieOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $this->assertCount(0, $response->headers->getCookies());
        $this->assertEquals($response, $response->withCookie(new Symfony\Component\HttpFoundation\Cookie('foo', 'bar')));
        $cookies = $response->headers->getCookies();
        $this->assertCount(1, $cookies);
        $this->assertEquals('foo', $cookies[0]->getName());
        $this->assertEquals('bar', $cookies[0]->getValue());
    }

    public function testInputOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('flashInput')->once()->with(['name' => 'Taylor', 'age' => 26]);
        $response->withInput();
    }

    public function testOnlyInputOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('flashInput')->once()->with(['name' => 'Taylor']);
        $response->onlyInput('name');
    }

    public function testExceptInputOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('flashInput')->once()->with(['name' => 'Taylor']);
        $response->exceptInput('age');
    }

    public function testFlashingErrorsOnRedirect()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('get')->with('errors', m::type('Illuminate\Support\ViewErrorBag'))->andReturn(new Illuminate\Support\ViewErrorBag);
        $session->shouldReceive('flash')->once()->with('errors', m::type('Illuminate\Support\ViewErrorBag'));
        $provider = m::mock('Illuminate\Contracts\Support\MessageProvider');
        $provider->shouldReceive('getMessageBag')->once()->andReturn(new Illuminate\Support\MessageBag);
        $response->withErrors($provider);
    }

    public function testSettersGettersOnRequest()
    {
        $response = new RedirectResponse('foo.bar');
        $this->assertNull($response->getRequest());
        $this->assertNull($response->getSession());

        $request = Request::create('/', 'GET');
        $session = m::mock('Illuminate\Session\Store');
        $response->setRequest($request);
        $response->setSession($session);
        $this->assertSame($request, $response->getRequest());
        $this->assertSame($session, $response->getSession());
    }

    public function testRedirectWithErrorsArrayConvertsToMessageBag()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('get')->with('errors', m::type('Illuminate\Support\ViewErrorBag'))->andReturn(new Illuminate\Support\ViewErrorBag);
        $session->shouldReceive('flash')->once()->with('errors', m::type('Illuminate\Support\ViewErrorBag'));
        $provider = ['foo' => 'bar'];
        $response->withErrors($provider);
    }

    public function testMagicCall()
    {
        $response = new RedirectResponse('foo.bar');
        $response->setRequest(Request::create('/', 'GET', ['name' => 'Taylor', 'age' => 26]));
        $response->setSession($session = m::mock('Illuminate\Session\Store'));
        $session->shouldReceive('flash')->once()->with('foo', 'bar');
        $response->withFoo('bar');
    }

    /**
     * @expectedException BadMethodCallException
     */
    public function testMagicCallException()
    {
        $response = new RedirectResponse('foo.bar');
        $response->doesNotExist('bar');
    }
}


text:
// independent from idl_parser, since this code is not needed for most clients

#include "flatbuffers/flatbuffers.h"
#include "flatbuffers/idl.h"
#include "flatbuffers/util.h"

namespace flatbuffers {

static std::string GenType(const Type &type) {
  switch (type.base_type) {
    case BASE_TYPE_STRUCT: return type.struct_def->name;
    case BASE_TYPE_UNION:  return type.enum_def->name;
    case BASE_TYPE_VECTOR: return "[" + GenType(type.VectorType()) + "]";
    default: return kTypeNames[type.base_type];
  }
}

// Generate a flatbuffer schema from the Parser's internal representation.
std::string GenerateFBS(const Parser &parser, const std::string &file_name,
                        const GeneratorOptions &opts) {
  std::string schema;
  schema += "// Generated from " + file_name + ".proto\n\n";
  if (opts.include_dependence_headers) {
    int num_includes = 0;
    for (AUTO_VAR(it, parser.included_files_.begin());
         it != parser.included_files_.end(); ++it) {
      std::string basename = flatbuffers::StripPath(
                        flatbuffers::StripExtension(it->first));
      if (basename != file_name) {
        schema += "include \"" + basename + ".fbs\";\n";
        num_includes++;
      }
    }
    if (num_includes) schema += "\n";
  }
  schema += "namespace ";
  AUTO_VAR(name_space, parser.namespaces_.back());
  for (AUTO_VAR(it, name_space->components.begin());
           it != name_space->components.end(); ++it) {
    if (it != name_space->components.begin()) schema += ".";
    schema += *it;
  }
  schema += ";\n\n";
  // Generate code for all the enum declarations.
  for (AUTO_VAR(enum_def_it, parser.enums_.vec.begin());
           enum_def_it != parser.enums_.vec.end(); ++enum_def_it) {
    EnumDef &enum_def = **enum_def_it;
    schema += "enum " + enum_def.name + " : ";
    schema += GenType(enum_def.underlying_type) + " {\n";
    for (AUTO_VAR(it, enum_def.vals.vec.begin());
         it != enum_def.vals.vec.end(); ++it) {
      AUTO_VAR(&ev, **it);
      schema += "  " + ev.name + " = " + NumToString(ev.value) + ",\n";
    }
    schema += "}\n\n";
  }
  // Generate code for all structs/tables.
  for (AUTO_VAR(it, parser.structs_.vec.begin());
           it != parser.structs_.vec.end(); ++it) {
    StructDef &struct_def = **it;
    schema += "table " + struct_def.name + " {\n";
    for (AUTO_VAR(field_it, struct_def.fields.vec.begin());
             field_it != struct_def.fields.vec.end(); ++field_it) {
      AUTO_VAR(&field, **field_it);
      schema += "  " + field.name + ":" + GenType(field.value.type);
      if (field.value.constant != "0") schema += " = " + field.value.constant;
      if (field.required) schema += " (required)";
      schema += ";\n";
    }
    schema += "}\n\n";
  }
  return schema;
}

bool GenerateFBS(const Parser &parser,
                 const std::string &path,
                 const std::string &file_name,
                 const GeneratorOptions &opts) {
  return SaveFile((path + file_name + ".fbs").c_str(),
                  GenerateFBS(parser, file_name, opts), false);
}

}  // namespace flatbuffers

redpajama_set_name: RedPajamaGithub


text:
using Morph.Server.Sdk.Client;
using Morph.Server.Sdk.Model;
using MorphCmd.Exceptions;
using MorphCmd.Interfaces;
using MorphCmd.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MorphCmd.BusinessLogic.Commands
{
    internal class GetTaskCommand : BaseCommand, ICommand
    {
        public GetTaskCommand(IOutputEndpoint output, IInputEndpoint input, IMorphServerApiClient apiClient) : base(output, input, apiClient)
        {

        }

        public bool IsApiSessionRequired => true;

        public async Task Execute(Parameters parameters)
        {
            if (parameters.TaskId == null)
            {
                throw new WrongCommandFormatException("TaskId is required");
            }

            _output.WriteInfo($"Attempting to get task {parameters.TaskId.Value.ToString("D")} in space '{parameters.SpaceName}'");

            using (var apiSession = await OpenSession(parameters))
            {

                var task = await _apiClient.GetTaskAsync(apiSession, parameters.TaskId.Value, _cancellationTokenSource.Token);
                _output.WriteInfo("Info about task:");
                _output.WriteInfo(string.Format("Id:'{0}'", task.Id));
                _output.WriteInfo(string.Format("Name:'{0}'", task.TaskName));
                _output.WriteInfo(string.Format("Enabled:'{0}'", task.Enabled));
                _output.WriteInfo(string.Format("Note:'{0}'", task.Note));
                _output.WriteInfo(string.Format("ProjectPath:'{0}'", task.ProjectPath));
                _output.WriteInfo("Task Parameters:");
                foreach (var parameter in task.TaskParameters)
                {
                    _output.WriteInfo($"Parameter '{parameter.Name}' = '{parameter.Value}' [{parameter.ParameterType}] (Note: {parameter.Note})");
                }
                _output.WriteInfo("Done");

            }

        }
    }
}


text:
import * as assert from "assert";
import {getGeneratedCode} from "./../main";

const expected =
`import {Main as Main1, Other as Other2} from "./tests/test-files/recursiveRelationship";

type Main1Type = { name?: string; other?: Other2Type; };
type Other2Type = { prop?: string; main?: Main1Type; };

export namespace Tests {
    export namespace TestFiles {
        export namespace RecursiveRelationship {
            export namespace Main {
                export function create(obj: Main1Type) {
                    const o = Object.create(Main1.prototype) as any;
                    objectAssign(o, obj);
                    if (typeof obj.other !== "undefined") {
                        o.other = Tests.TestFiles.RecursiveRelationship.Other.create(obj.other);
                    }
                    return o as Main1;
                }
            }

            export namespace Other {
                export function create(obj: Other2Type) {
                    const o = Object.create(Other2.prototype) as any;
                    objectAssign(o, obj);
                    if (typeof obj.main !== "undefined") {
                        o.main = Tests.TestFiles.RecursiveRelationship.Main.create(obj.main);
                    }
                    return o as Other2;
                }
            }
        }
    }
}

function objectAssign(a: any, b: any) {
    Object.keys(b).forEach(key => a[key] = b[key]);
}
`;

describe("recursive relationship", () => {
    it("should do the code", () => {
        const code = getGeneratedCode({
            srcRoot: "./src",
            files: ["./src/tests/test-files/recursiveRelationship.ts"]
        });

        assert.equal(code, expected);
    });
});


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using CloudBedlam.Config;
using CloudBedlam.Extensions;

namespace CloudBedlam.Operations
{
	internal class MemoryPressure : OperationBase
	{
		private readonly ChaosOperation _config;

		public MemoryPressure(ChaosOperation config, TimeSpan testDuration)
			: base(config.PressureLevel > 0,
				  config.Duration > testDuration ? testDuration : config.Duration,
				  config.RunOrder)
		{
			_config = config;
		}

		protected override ProcessParams CreateProcessParams()
		{
			const string filePath = "/usr/bin/bash";
			return new ProcessParams(new FileInfo(filePath), "Bash/stress-mem.sh " + _config.PressureLevel + " " + _config.DurationInSeconds);
		}

        internal override void Kill()
        {
	        if (Process == null || !Process.IsRunning() || Process.HasExited)
		        return;

	        Thread.Sleep(4000);
	        Process?.Kill();
        }
    }
}


text:
package edu.utah.ece.async.ibiosim.dataModels.biomodel.annotation;

import java.util.LinkedList;

/**
 *
 *
 * @author
 * @author Chris Myers
 * @author <a href="http://www.async.ece.utah.edu/ibiosim#Credits"> iBioSim Contributors </a>
 * @version %I%
 */
public class AnnotationElement {

	private String prefix;
	private String name;
	private String literal;
	private LinkedList<AnnotationAttribute> attributes = new LinkedList<AnnotationAttribute>();
	private LinkedList<AnnotationNamespace> namespaces = new LinkedList<AnnotationNamespace>();
	private LinkedList<AnnotationElement> children = new LinkedList<AnnotationElement>();

	public AnnotationElement(String name) {
		this.name = name;
	}

	public AnnotationElement(String prefix, String name) {
		this.prefix = prefix;
		this.name = name;
	}

	public AnnotationElement(String prefix, String name, String literal) {
		this.prefix = prefix;
		this.name = name;
		this.literal = literal;
	}

	public String getPrefix() {
		return prefix;
	}

	public String getName() {
		return name;
	}

	public LinkedList<AnnotationAttribute> getAttributes() {
		return attributes;
	}

	public LinkedList<AnnotationNamespace> getNamespaces() {
		return namespaces;
	}

	public LinkedList<AnnotationElement> getChildren() {
		return children;
	}

	public AnnotationElement getChild(int index) {
		return children.get(index);
	}

	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void addAttribute(AnnotationAttribute attribute) {
		attributes.add(attribute);
	}

	public void setAttributes(LinkedList<AnnotationAttribute> attributes) {
		this.attributes = attributes;
	}

	public void addNamespace(AnnotationNamespace namespace) {
		namespaces.add(namespace);
	}

	public void setNamespaces(LinkedList<AnnotationNamespace> namespaces) {
		this.namespaces = namespaces;
	}

	public void addChild(AnnotationElement child) {
		children.add(child);
	}

	public void addChild(int index, AnnotationElement child) {
		children.add(index, child);
	}

	public void setChildren(LinkedList<AnnotationElement> children) {
		this.children = children;
	}

	public String toXMLString() {
		String xml = "<";
		if (prefix != null)
			xml = xml + prefix + ":";
		xml += name;
		for (AnnotationNamespace namespace : namespaces) {
			xml = xml + " " + namespace.toXMLString();
		}
		for (AnnotationAttribute attribute : attributes)
			xml = xml + " " + attribute.toXMLString();
		if (literal != null || children.size() > 0) {
			xml += ">";
			if (children.size() > 0)
				for (AnnotationElement child : children)
					xml += child.toXMLString();
			else
				xml += literal;
			xml += "</";
			if (prefix != null)
				xml = xml + prefix + ":";
			xml = xml + name + ">";
		} else
			xml += "/>";

		return xml;
	}

}


text:
/**
 *
 */
package com.velocity.model.transactions.query.response;

import com.velocity.gson.annotations.SerializedName;

/**
 * @author ranjitk
 *
 */
public class ElectronicCheckingMerchantData {

    @SerializedName("OriginatorId")
	private String originatorId;
    @SerializedName("ProductId")
	private String productId;
    @SerializedName("SiteId")
	private String  siteId;
	public String getOriginatorId() {
		return originatorId;
	}
	public void setOriginatorId(String originatorId) {
		this.originatorId = originatorId;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getSiteId() {
		return siteId;
	}
	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>  <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="edu.pdx.oss.asthmacontrol" >

<!--
  <Copyright (c) 2015 Azzam Enajjar

  This project is licensed under the terms of the MIT license. Please see LICENSE.md for full license terms.
  -->

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name=".SplashScreenActivity"
            android:label="Asthma Control" >
            android:screenOrientation="portrait"
            android:noHistory="true" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".NewLogActivity"
            android:label="New Log" >
        </activity>
        <activity
            android:name=".UpdateLogMenu"
            android:label="Show / Update Sub-Menu" >
        </activity>
        <activity
            android:name=".UpdateAsthmaTimeActivity"
            android:label="Show / Update date(s)" >
        </activity>
        <activity
            android:name=".UpdateAsthmaBreathActivity"
            android:label="Show / Update date(s)" >
        </activity>
        <activity
            android:name=".UpdateAsthmaSymptomsActivity"
            android:label="Show / Update date(s)" >
        </activity>
        <activity
            android:name=".UpdateAsthmaMedicationActivity"
            android:label="Show / Update date(s)" >
        </activity>
        <activity
            android:name=".ScoreActivity"
            android:label="Asthma Score" >
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="Main Menu" >
        </activity>
    </application>

</manifest>


text:
package org.apereo.cas.authentication.handler.support;

import org.apereo.cas.authentication.HandlerResult;
import org.apereo.cas.authentication.PreventedException;
import org.apereo.cas.authentication.UsernamePasswordCredential;
import org.apereo.cas.authentication.principal.Principal;
import org.apereo.cas.authentication.principal.PrincipalFactory;
import org.apereo.cas.services.ServicesManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.Configuration;
import javax.security.auth.login.LoginContext;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Set;

/**
 * JAAS Authentication Handler for CAAS. This is a simple bridge from CAS'
 * authentication to JAAS.
 *

 * Using the JAAS Authentication Handler requires you to configure the
 * appropriate JAAS modules. You can specify the location of a jass.conf file
 * using the following VM parameter:
 *

 * -Djava.security.auth.login.config=$PATH_TO_JAAS_CONF/jaas.conf
 *

 *

 * This example jaas.conf would try Kerberos based authentication, then try LDAP
 * authentication:
 *

 * CAS {
 *   com.sun.security.auth.module.Krb5LoginModule sufficient
 *     client=TRUE
 *     debug=FALSE
 *     useTicketCache=FALSE;
 *   edu.uconn.netid.jaas.LDAPLoginModule sufficient
 *     java.naming.provider.url="ldap://ldapserver.my.edu:389/dc=my,dc=edu"
 *     java.naming.security.principal="uid=jaasauth,dc=my,dc=edu"
 *     java.naming.security.credentials="password"
 *     Attribute="uid"
 *     startTLS="true";
 * };
 *

 *
 * @author Matthew J. Smith
 * @author Marvin S. Addison
 * @author Misagh Moayyed
 * @see javax.security.auth.callback.CallbackHandler
 * @see javax.security.auth.callback.PasswordCallback
 * @see javax.security.auth.callback.NameCallback
 * @since 3.0.0
 */
public class JaasAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler {
    private static final Logger LOGGER = LoggerFactory.getLogger(JaasAuthenticationHandler.class);

    /**
     * System property key to specify kerb5 realm.
     */
    private static final String SYS_PROP_KRB5_REALM = "java.security.krb5.realm";

    /**
     * System property key to specify kerb5 kdc.
     */
    private static final String SYS_PROP_KERB5_KDC = "java.security.krb5.kdc";

    /**
     * The realm that contains the login module information.
     */
    private String realm = "CAS";

    /**
     * System property value to overwrite the realm in krb5 config.
     */
    private String kerberosRealmSystemProperty;

    /**
     * System property value to overwrite the kdc in krb5 config.
     */
    private String kerberosKdcSystemProperty;

    /**
     * Instantiates a new Jaas authentication handler,
     * and attempts to load/verify the configuration.
     *
     * @param name the name
     * @param servicesManager the services manager
     */
    public JaasAuthenticationHandler(final String name, final ServicesManager servicesManager, final PrincipalFactory principalFactory, final Integer order) {
        super(name, servicesManager, principalFactory, order);
        Assert.notNull(Configuration.getConfiguration(),
                "Static Configuration cannot be null. Did you remember to specify \"java.security.auth.login.config\"?");
    }

    @Override
    protected HandlerResult authenticateUsernamePasswordInternal(final UsernamePasswordCredential credential, final String originalPassword)
            throws GeneralSecurityException, PreventedException {

        if (this.kerberosKdcSystemProperty != null) {
            LOGGER.debug("Configured kerberos system property [{}] to [{}]", SYS_PROP_KERB5_KDC, this.kerberosKdcSystemProperty);
            System.setProperty(SYS_PROP_KERB5_KDC, this.kerberosKdcSystemProperty);
        }
        if (this.kerberosRealmSystemProperty != null) {
            LOGGER.debug("Setting kerberos system property [{}] to [{}]", SYS_PROP_KRB5_REALM, this.kerberosRealmSystemProperty);
            System.setProperty(SYS_PROP_KRB5_REALM, this.kerberosRealmSystemProperty);
        }

        final String username = credential.getUsername();
        final String password = credential.getPassword();

        final LoginContext lc = new LoginContext(this.realm, new UsernamePasswordCallbackHandler(username, password));
        try {
            LOGGER.debug("Attempting authentication for: [{}]", username);
            lc.login();
        } finally {
            lc.logout();
        }

        Principal principal = null;
        final Set<java.security.Principal> principals = lc.getSubject().getPrincipals();
        if (principals != null && !principals.isEmpty()) {
            final java.security.Principal secPrincipal = principals.iterator().next();
            principal = this.principalFactory.createPrincipal(secPrincipal.getName());
        }
        return createHandlerResult(credential, principal, null);
    }

    public void setRealm(final String realm) {
        this.realm = realm;
    }

    /**
     * Typically, the default realm and the KDC for that realm are indicated in the Kerberos {@code krb5.conf} configuration file.
     * However, if you like, you can instead specify the realm value by setting this following system property value.
     *
If you set the realm property, you SHOULD also configure the {@link #setKerberosKdcSystemProperty(String)}.
     *
Also note that if you set these properties, then no cross-realm authentication is possible unless
     * a {@code krb5.conf} file is also provided from which the additional information required for cross-realm authentication
     * may be obtained.
     *
If you set values for these properties, then they override the default realm and KDC values specified
     * in {@code krb5.conf} (if such a file is found). The {@code krb5.conf} file is still consulted if values for items
     * other than the default realm and KDC are needed. If no {@code krb5.conf} file is found,
     * then the default values used for these items are implementation-specific.
     *
     * @param kerberosRealmSystemProperty system property to indicate realm.
     * @see
     * Oracle documentation
     * @since 4.1.0
     */
    public void setKerberosRealmSystemProperty(final String kerberosRealmSystemProperty) {
        this.kerberosRealmSystemProperty = kerberosRealmSystemProperty;
    }

    /**
     * Typically, the default realm and the KDC for that realm are indicated in the Kerberos {@code krb5.conf} configuration file.
     * However, if you like, you can instead specify the kdc value by setting this system property value.
     *
If you set the realm property, you SHOULD also configure the {@link #setKerberosRealmSystemProperty(String)}.
     *
Also note that if you set these properties, then no cross-realm authentication is possible unless
     * a {@code krb5.conf} file is also provided from which the additional information required for cross-realm authentication
     * may be obtained.
     *
If you set values for these properties, then they override the default realm and KDC values specified
     * in {@code krb5.conf} (if such a file is found). The {@code krb5.conf} file is still consulted if values for items
     * other than the default realm and KDC are needed. If no {@code krb5.conf} file is found,
     * then the default values used for these items are implementation-specific.
     *
     * @param kerberosKdcSystemProperty system property to indicate kdc
     * @see
     * Oracle documentation
     * @since 4.1.0
     */
    public void setKerberosKdcSystemProperty(final String kerberosKdcSystemProperty) {
        this.kerberosKdcSystemProperty = kerberosKdcSystemProperty;
    }

    /**
     * A simple JAAS CallbackHandler which accepts a Name String and Password
     * String in the constructor. Only NameCallbacks and PasswordCallbacks are
     * accepted in the callback array. This code based loosely on example given
     * in Sun's javadoc for CallbackHandler interface.
     */
    protected static class UsernamePasswordCallbackHandler implements CallbackHandler {

        /**
         * The username of the principal we are trying to authenticate.
         */
        private String userName;

        /**
         * The password of the principal we are trying to authenticate.
         */
        private String password;

        /**
         * Constructor accepts name and password to be used for authentication.
         *
         * @param userName name to be used for authentication
         * @param password Password to be used for authentication
         */
        protected UsernamePasswordCallbackHandler(final String userName, final String password) {
            this.userName = userName;
            this.password = password;
        }

        @Override
        public void handle(final Callback[] callbacks) throws UnsupportedCallbackException {
            Arrays.stream(callbacks).filter(callback -> {
                if (callback.getClass().equals(NameCallback.class)) {
                    ((NameCallback) callback).setName(this.userName);
                    return false;
                } else if (callback.getClass().equals(PasswordCallback.class)) {
                    ((PasswordCallback) callback).setPassword(this.password.toCharArray());
                    return false;
                }
                return true;
            }).findFirst().ifPresent(callback -> {
                throw new RuntimeException(new UnsupportedCallbackException(callback, "Unrecognized Callback"));
            });
        }
    }
}


text:
Git-tfs could be easily used to work with TFS.

# Cloning

## Find the tfs branch to clone (optional)

Note: This command is not supported in TFS2008

If you don't know (or remember) the path of the project you want to clone on a TFS server,
 you could use the `list-remote-branches` command :

    git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection

You will have an output like that (showing branch linked to its parent branch) :

     $/project/trunk [*]
     |
     +- $/project/branch1
     |
     +- $/project/branch2
     |
     +- $/project/branch3
     |  |
     |  +- $/project/branche3-1
     |
     +- $/project/git_central_repo

     $/other_project/trunk [*]
     |
     +- $/other_project/b1
     |
     +- $/other_project/b2

    Cloning root branches (marked by [*]) is recommended!

    PS:if your branch is not listed here, perhaps you should convert the containing folder to a branch in TFS.

If you want to work with tfs branches, you should clone one of the root branches (marked by [*]) :
`$/project/trunk` or `$/other_project/trunk`

## Clone just the trunk

You could clone only the trunk of your project (and init the other branches later).
For that, use the command:

    git tfs clone http://tfs:8080/tfs/DefaultCollection $/project/trunk .

See [clone](../commands/clone.md) command if you should use a password or an author file, ...

Wait quite some time, fetching changesets from TFS is a slow process :(

Pros & Cons: See [Manage Tfs branches](manage_tfs_branches.md).

# Working with the trunk

## Fetch Tfs changesets

To fetch the new changesets, just do:

    git tfs fetch

but be aware that this command DON'T include the new changesets in your git branch (like the git fetch).
To do so, you have to use the `merge` or `rebase` git command or prefer the git-tfs `pull` command.

## Merge or Rebase fetched Tfs changesets

### Rebase

If you want to rebase all your local commits onto the newly fetch changesets, use the command:

    git tfs pull -r

### Merge

You could also merge your commits into the ones fetch with the command:

    git tfs pull

but this solution is discouraged because merged commits couldn't be push to tfs as this and you will finish with strange git history!

## Check in TFS

Once you've rebased your commits onto the newly fetched changesets, you could check them in TFS:

    git tfs rcheckin


text:
This repo contains a working progress for compiling Web-CAT.

Or so I hope.

[![Build Status](https://travis-ci.org/paulproteus/webcat-src-vagrant.svg?branch=master)](https://travis-ci.org/paulproteus/webcat-src-vagrant)