text:
import React, { Component } from 'react';
import TextField from 'material-ui/TextField';
import RaisedButton from 'material-ui/RaisedButton';
import styles from './Register.css';
import InstructForm from './InstructForm';
import LensInformation from './LensInformation';
import DatePicker from 'material-ui/DatePicker';
import InputMask from 'react-input-mask';
import { Field, reduxForm, reset } from 'redux-form';

const afterSubmit = (result, dispatch) => {
  window.alert('Ordem de serviço cadastrada com sucesso!!!');
  return dispatch(reset('Register'));
};

const upper = value => value && value.toUpperCase();

const customStyle = {
  paddingDatePicker: {
    paddingTop: '24px'
  },
  fullRow: {
    flex: '1 100%',
    margin: '0 8px 0 8px',
  },
  upperCase: {
    textTransform: 'uppercase'
  },
  marginTop: {
    marginTop: '20px'
  }
};

const renderTextField = ({
  input,
  floatingLabelText,
  type,
}) =>
  (<TextField
    floatingLabelText={floatingLabelText}
    type={type}
    {...input}
  />);

const renderMaskField = ({
  input,
  floatingLabelText,
  mask,
}) => (
  <TextField floatingLabelText={floatingLabelText} {...input}>
    <InputMask mask={mask} />
  </TextField>
);

const stylezedTextField = ({
  input,
  style,
  floatingLabelText,
  inputStyle
}) => (
  <TextField
    style={style}
    floatingLabelText={floatingLabelText}
    inputStyle={inputStyle}
    {...input}
  />
);

const DateTimeFormat = global.Intl.DateTimeFormat;

const formatDate = date => Intl.DateTimeFormat('PT-BR').format(date);

const renderDatePicker = ({
  input,
  floatingLabelText,
  hintText,
  container,
}) => (

  <DatePicker
    hintText={hintText}
    container={container}
    DateTimeFormat={DateTimeFormat}
    formatDate={formatDate}
    floatingLabelText={floatingLabelText}
    okLabel="OK"
    cancelLabel="Cancelar"
    locale="pt-br"
    onChange={(event, value) => input.onChange(value)}
  />
);

const validate = values => {
  const errors = {};
  if (!values.tso) {
    errors.tso = 'Numero TSO é obrigatório';
  }
  if (!values.name) {
    errors.name = 'Nome do cliente é obrigatório';
  }
  if (!values.dateUser) {
    errors.dateUser = 'Data é obrigatória';
  }
  return errors;
};

class Register extends Component {
  tso: any;
  clientNumber: any;
  submit: () => void;
  props: {
    saveServiceOrder: () => void,
    getListServiceOrder: () => void,
    handleSubmit: () => void,
    register_form: object
  }

  constructor() {
    super();
    this.submit = this.submit.bind(this);
  }

  componentWillMount() {
    this.props.getListServiceOrder();
  }

  submit(payload: object) {
    this.props.saveServiceOrder(payload);
  }

  render() {
    return (

ORDEM DE SERVIÇO

        <form className={styles.form} onSubmit={this.props.handleSubmit(this.submit)}>

            <Field
              name="tso"
              floatingLabelText="TSO"
              type="number"
              component={renderTextField}
            />
            <Field
              name="clientNumber"
              floatingLabelText="NÚMERO DO CLIENTE"
              type="number"
              component={renderTextField}
            />
            <Field
              name="dateUser"
              floatingLabelText="DATA"
              hintText="DATA"
              container="inline"
              component={renderDatePicker}
            />
            <Field
              name="name"
              style={customStyle.fullRow}
              floatingLabelText="NOME"
              normalize={upper}
              component={stylezedTextField}
            />
            <Field
              style={customStyle.fullRow}
              floatingLabelText="PAI"
              normalize={upper}
              name="father"
              component={stylezedTextField}
            />
            <Field
              style={customStyle.fullRow}
              floatingLabelText="MÃE"
              normalize={upper}
              name="mother"
              component={stylezedTextField}
            />
            <Field
              floatingLabelText="RG"
              type="number"
              name="rg"
              component={renderTextField}
            />
            <Field
              floatingLabelText="ORG EXP"
              normalize={upper}
              name="org_exp"
              component={stylezedTextField}
            />
            <Field floatingLabelText="CPF" name="cpf" mask="999.999.999-99" component={renderMaskField} />
            <Field floatingLabelText="DATA DE NASCIMENTO" name="date_of_birth" mask="99/99/9999" component={renderMaskField} />
            <Field
              floatingLabelText="ENDEREÇO"
              normalize={upper}
              name="address"
              component={stylezedTextField}
            />
            <Field
              floatingLabelText="BAIRRO"
              normalize={upper}
              name="neighborhood"
              component={stylezedTextField}
            />
            <Field
              floatingLabelText="CIDADE"
              normalize={upper}
              name="city"
              component={stylezedTextField}
            />
            <Field
              floatingLabelText="UF"
              normalize={upper}
              name="uf"
              component={stylezedTextField}
            />
            <Field floatingLabelText="CEP" name="cep" mask="99999-9999" component={renderMaskField} />
            <Field floatingLabelText="TELEFONE RESIDENCIAL" name="phone" mask="(99) 9999-9999" component={renderMaskField} />
            <Field
              floatingLabelText="REFERÊNCIAL"
              normalize={upper}
              name="reference"
              component={stylezedTextField}
            />
            <Field floatingLabelText="CELULAR" name="cell_phone" mask="(99) 999999999" component={renderMaskField} />

          <InstructForm />
          <LensInformation />
          <RaisedButton type="submit" label="Salvar" primary style={customStyle.marginTop} />
        </form>

    );
  }
}

export default reduxForm({
  form: 'Register',
  onSubmitSuccess: afterSubmit,
  validate
})(Register);


text:
using System;

namespace Governer.Internal
{
	public interface ITimeServer : IDisposable
	{
		DateTime GetCurrentUtcTime();
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.bongiorno.aspects.latency.esper.listeners;

import java.time.LocalDateTime;
import java.util.*;

public class BookKeepingLatencyListener extends AbstractLatencyListener {

    private long hoursToKeep = 3;

    private final Map<String, List<HistoryEntry>> history = new HashMap<>();

    @Override
    protected void notify(Class clazz, String methodName, Number latency, int callCount, int windowSize) {
        if (callCount > 0) {
            String key = clazz.getName() + '.' + methodName;
            List<HistoryEntry> entries;
            synchronized (history) {
                entries = history.get(key);
                if (entries == null) {
                    entries = new LinkedList<>();
                    history.put(key, entries);
                }
            }
            synchronized (entries) { //The code I'm trying to avoid stepping on is in MessageService.constructGraph
                LocalDateTime now = LocalDateTime.now();
                entries.add(new HistoryEntry(latency, now));

                dropEntriesBefore(now.minusHours(hoursToKeep), entries);
            }
        }
    }

    private void dropEntriesBefore(LocalDateTime minTime, List<HistoryEntry> entries) {
        Iterator<HistoryEntry> iterator = entries.iterator();
        HistoryEntry entry = iterator.next();
        while (entry.getTime().isBefore(minTime)) {
            iterator.remove();
            entry = iterator.next();
        }
    }

    public List<HistoryEntry> getHistoryFor(Class clazz, String methodName) {
        synchronized (history) {
            return history.get(clazz.getName() + '.' + methodName);
        }
    }

    public static class HistoryEntry {
        private LocalDateTime time;

        private Number latency;

        public HistoryEntry(Number latency, LocalDateTime time) {
            this.latency = latency;
            this.time = time;
        }

        public Number getLatency() {
            return latency;
        }

        public LocalDateTime getTime() {
            return time;
        }
    }
}


text:
demo section {
	display: block;
	margin: 24px 0;
}

demo.primitives section,
demo section section  {
	display: inline-block;
	background-color: #E7EBEE;
	margin: 9px;
	padding: 6px 6px;
}

demo section title  {
	display: block;
	font-size: 18pt;
	font-weight: 700;
	margin-bottom: 12px;
}

demo section section title  {
	display: block;
	font-size: 14pt;
	font-weight: 700;
}

demo.scale > div > div {
	display: inline-block;
}


text:
package cz.mjanys.web.layout;

import cz.mjanys.iface.dto.Layout;
import cz.mjanys.iface.dto.Page;
import cz.mjanys.iface.dto.RootPage;
import cz.mjanys.web.layout.pto.PageTreeNode;
import org.apache.commons.io.FilenameUtils;
import org.apache.http.client.utils.URIBuilder;
import org.springframework.context.MessageSource;
import org.springframework.util.Assert;

import java.io.File;
import java.util.*;

/**
 * @author Martin Janys
 */
public class LayoutHelper {

    public static List<Layout> getAvailableLayouts(String dirName, MessageSource messages, Locale locale) {
        List<Layout> layouts = new ArrayList<Layout>();
        File dir = new File(dirName);
        Assert.state(dir.exists());
        Assert.state(dir.isDirectory());

        for (File file : dir.listFiles()) {
            String fileName = FilenameUtils.removeExtension(file.getName());
            layouts.add(new Layout(
                    messages.getMessage(fileName, null, locale),
                    fileName));
        }

        Collections.sort(layouts);
        return layouts;
    }

    public static PageTreeNode makePageTree(String contextPath, String rootLabel, RootPage pageTree) throws Exception {
        PageTreeNode rootTreeNode = new PageTreeNode();
        rootTreeNode.setText(rootLabel);
        rootTreeNode.setId(0l);

        List<PageTreeNode> nodes = new ArrayList<PageTreeNode>();
        for (Page page : pageTree.getChilds()) {
            nodes.add(makePageTree(page));
        }
        rootTreeNode.setNodes(nodes);
        return rootTreeNode;
    }

    private static PageTreeNode makePageTree(Page page) throws Exception {
        PageTreeNode treeNode = new PageTreeNode();
        treeNode.setText(page.getTitle());
        treeNode.setOrder(page.getOrder());
        treeNode.setId(page.getId());
        treeNode.setVisible(page.isVisible());
        treeNode.setFriendlyUrl(page.getFriendlyUrl());
        List<PageTreeNode> nodes = new ArrayList<PageTreeNode>();
        for (Page p : page.getChilds()) {
            nodes.add(makePageTree(p));
        }
        treeNode.setNodes(nodes.isEmpty() ? null : nodes);
        return treeNode;
    }
}


text:
using System;
using Xunit;

namespace Eisk.Helpers
{
    public class TestBase
    {
        public virtual void TestInitialize()
        {
            //Initialize the dependency container to clear any explicit mapping (non-config) done by previous tests
            //Initializing depency container in TestInitialize method is required if we want to mix integration and mock test together.
            //DependencyHelper.Initialize();
        }

        protected void AssertValidationAttribute(Type entityType, string fieldName, Type attributeType)
        {
            var pi = entityType.GetProperty(fieldName);
            var hasIsIdentity = Attribute.IsDefined(pi, attributeType);
            Assert.True(hasIsIdentity);
        }

    }
}


text:
module Clusterstruck

	class HadoopCluster

    S3_URI_PATTERN = /s3:\/\//

    include Clusterstruck::Configurable

    def initialize
      @bootstrap_paths = []
      @instance_groups = {
        :master => InstanceGroup.new(:master)
      }
      @ami_version = :latest
      @keep_alive = false
    end

    def properties
      %w{
        ami_version
        bucket
        ec2_key_name
        keep_alive
        log_uri
        name
      }
    end

    def bootstrap(path)
      @bootstrap_paths.push path
    end

    def master_instance_group(&config_block)
      @instance_groups[:master] ||= InstanceGroup.new(:master)
      @instance_groups[:master].instance_eval(&config_block)
    end

    def core_instance_group(&config_block)
      @instance_groups[:core] ||= InstanceGroup.new(:core)
      @instance_groups[:core].instance_eval(&config_block)
    end

    def to_hash
      validate

      config_hash = {
        :name => @name,
        :ami_version => @ami_version.to_s,
        :log_uri => get_log_uri,
        :instances => {
          :ec2_key_name => @ec2_key_name,
          :keep_job_flow_alive_when_no_steps => @keep_alive,
          :instance_groups => @instance_groups.map { |role, group| group.to_hash }
        },
        :bootstrap_actions => get_bootstrap_actions,
        :steps => []
      }
    end

    private

    def validate
    	if !@name
    		raise ValidationException.new("Cluster name must be set.")
    	end
    	if !@ec2_key_name
    		raise ValidationException.new("EC2 key pair name must be set.")
    	end
    end

    def get_log_uri
      return @log_uri if @log_uri
      return "s3://#{@bucket}/logs" if @bucket
      nil
    end

    def get_bootstrap_actions
      @bootstrap_paths.map do |path|
        name = ''
        if (path.rindex('/'))
          name = path.slice(path.rindex('/') + 1, path.length)
        else
          name = path
        end

        qualified_path = ''
        if S3_URI_PATTERN.match(path)
          qualified_path = path
        else
          qualified_path = "s3://#{@bucket}/bootstrap/#{path}"
        end

        { :name => name, :script_bootstrap_action => { :path => qualified_path } }
      end

    end

  end

  class InstanceGroup

    include Clusterstruck::Configurable

    def initialize(role, type = 'm1.large', count = 1)
      @role = role
      @type = type
      @count = count
    end

    def properties
      %w{
        type
        role
        count
        bid_price
      }
    end

    def to_hash
      validate

      config_hash = {
        :instance_role => @role.to_s.upcase,
        :instance_type => @type,
        :instance_count => @role == :master ? 1 : @count,
        :market => @bid_price ? 'SPOT' : 'ON_DEMAND',
      }

      if @bid_price
        config_hash[:bid_price] = @bid_price.to_s
      end

      config_hash
    end

    private

    def validate
    end

  end

end


text:
using System;
using System.Collections;
using System.Text.RegularExpressions;
using Xunit;

namespace Test
{
    public class MatchCollectionTests
    {
        [Fact]
        public static void EnumeratorTest1()
        {
            Regex regex = new Regex("e");
            MatchCollection collection = regex.Matches("dotnet");
            IEnumerator enumerator = collection.GetEnumerator();

            Assert.Throws<InvalidOperationException>(() => enumerator.Current);
            Assert.True(enumerator.MoveNext());
            Assert.IsAssignableFrom<Match>(enumerator.Current);
            Assert.Equal(4, ((Match)enumerator.Current).Index);
            Assert.Equal("e", ((Match)enumerator.Current).Value);
            Assert.False(enumerator.MoveNext());
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);

            enumerator.Reset();
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);
            Assert.True(enumerator.MoveNext());
            Assert.IsAssignableFrom<Match>(enumerator.Current);
            Assert.Equal(4, ((Match)enumerator.Current).Index);
            Assert.Equal("e", ((Match)enumerator.Current).Value);
            Assert.False(enumerator.MoveNext());
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);
        }

        [Fact]
        public static void EnumeratorTest2()
        {
            Regex regex = new Regex("t");
            MatchCollection collection = regex.Matches("dotnet");
            IEnumerator enumerator = collection.GetEnumerator();

            for (int i = 0; i < collection.Count; i++)
            {
                enumerator.MoveNext();

                Assert.Equal(enumerator.Current, collection[i]);
            }

            Assert.False(enumerator.MoveNext());
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);

            enumerator.Reset();

            for (int i = 0; i < collection.Count; i++)
            {
                enumerator.MoveNext();

                Assert.Equal(enumerator.Current, collection[i]);
            }

            Assert.False(enumerator.MoveNext());
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);
        }
    }
}


text:
MY_Scene_Box2D::MY_Scene_Box2D(Game * _game) :
	MY_Scene_Base(_game),
	box2dWorld(new Box2DWorld(b2Vec2(0.f, -10.0f))),
	box2dDebugDrawer(new Box2DDebugDrawer(box2dWorld))
{
	// Setup the debug drawer and add it to the scene
	childTransform->addChild(box2dDebugDrawer, false);
	box2dDebugDrawer->drawing = false;
	box2dWorld->b2world->SetDebugDraw(box2dDebugDrawer);
	box2dDebugDrawer->AppendFlags(b2Draw::e_shapeBit);
	box2dDebugDrawer->AppendFlags(b2Draw::e_centerOfMassBit);
	box2dDebugDrawer->AppendFlags(b2Draw::e_jointBit);

	// Setup the ground
	ground = new Box2DMeshEntity(box2dWorld, MeshFactory::getCubeMesh(5), b2_staticBody, baseShader);
	ground->createFixture(); // when we're using a Box2DMeshEntity, createFixture will make a collider which matches the bounding box (or bounding circle, if you use the argument)
	childTransform->addChild(ground);

	// Setup the player
	player = new Box2DSprite(box2dWorld, b2_dynamicBody, baseShader, MY_ResourceManager::globalAssets->getTexture("DEFAULT")->texture, 1, 1);
	player->createFixture(); // when we're using a Box2DSprite, createFixture will make a collider which matches the provided width and height of the sprite (note that this is different from the actual texture size)
	childTransform->addChild(player);

	// when dealing with physics nodes, we use translatePhysical instead of editing the Transform nodes directly
	// this is because we need to inform the physics simulation of the change, not our Transform hierarchy
	// the physics node will handle the placement of its childTransform automatically later during the update loop
	player->translatePhysical(glm::vec3(0, 6, 0), false);
}

MY_Scene_Box2D::~MY_Scene_Box2D(){
	// we need to destruct the scene elements before the physics world to avoid memory issues
	deleteChildTransform();
	delete box2dWorld;
}

void MY_Scene_Box2D::update(Step * _step){
	// Physics update
	box2dWorld->update(_step);
	// Scene update
	MY_Scene_Base::update(_step);

	// player input
	player->applyLinearImpulseRight(controller->getAxis(controller->axisLeftX));
	if(controller->buttonJustDown(controller->faceButtonDown)){
		player->applyLinearImpulseUp(5);
	}
}

void MY_Scene_Box2D::enableDebug(){
	MY_Scene_Base::enableDebug();
	box2dDebugDrawer->drawing = true;
	childTransform->addChildAtIndex(box2dDebugDrawer, -1, false); // make sure the debug drawer is the last thing drawn
}
void MY_Scene_Box2D::disableDebug(){
	MY_Scene_Base::disableDebug();
	box2dDebugDrawer->drawing = false;
}


text:
//
//  ContactsViewController.m
//  PetPal
//
//  Created by Miguel Conde on 12/08/15.
//  Copyright (c) 2015 Miguel Conde. All rights reserved.
//

#import "ContactsViewController.h"

@interface ContactsViewController ()

@end

@implementation ContactsViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.tableView registerClass: [UITableViewCell class] forCellReuseIdentifier: @"UITableViewCell"];

    //set the tital to my contacts
    self.navigationItem.title = @"My Contacts";
    //Create an add button and associate the method addContact to it
    UIBarButtonItem *add = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd target: self action: @selector (addContact:)];
    self.navigationItem.rightBarButtonItem = add;
    self.tableView.rowHeight = 100;

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    //Reload the cells with update information
    [self.tableView reloadData];
}

//Method to add a new contact
-(IBAction) addContact:(id)sender
{
    //create an init Contact with empty params
    MyContact *newContact = [[ContactBook sharedContacts] addContactWitFirstName: @"" lastName:@"" email:@"" association:@"" phoneNumber:@""];

    //init the Contact view controller
    ContactInfoViewController *ContactInfoView = [[ContactInfoViewController alloc] init];

    //Set the contact to this new contact
    //used to fill out the text fields and image field
    ContactInfoView.contact = newContact;

    //Transition to contactinfo View with animation
    [self.navigationController pushViewController: ContactInfoView animated: YES];
}

#pragma mark - Table view data source

//Get the total number of contacts
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [[ContactBook sharedContacts] contacts];
}

//Used to set the cells
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell" forIndexPath:indexPath];
    MyContact *contact = [ContactBook sharedContacts].myContacts[indexPath.row];

    //String that will be used to represent the contact information to the user
    NSString *contactInfo = @"";

    contactInfo = [contactInfo stringByAppendingString:contact.firstName];
    contactInfo = [contactInfo stringByAppendingString: @" "];
    contactInfo = [contactInfo stringByAppendingString:contact.lastName];
    contactInfo = [contactInfo stringByAppendingString:@"         "];
    contactInfo = [contactInfo stringByAppendingString:contact.association];
    contactInfo = [contactInfo stringByAppendingString:@"         "];
    contactInfo = [contactInfo stringByAppendingString:contact.phoneNumber];

    //set cell image and contact info
    cell.imageView.image = contact.image;
    cell.textLabel.text = contactInfo;

    // Configure the cell...

    cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:20];
    return cell;
}

-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    //create & push COntactInfoViewController *dpivc onto nav controller's stack
    //give detail view controller a pointer to the pet object in row
    ContactInfoViewController *contactInfo = [[ContactInfoViewController alloc] init];
    contactInfo.contact = [ContactBook sharedContacts].myContacts[indexPath.row];
    [self.navigationController pushViewController: contactInfo animated: YES];
}

/*
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];

 // Configure the cell...

 return cell;
 }
 */

/*
 // Override to support conditional editing of the table view.
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the specified item to be editable.
 return YES;
 }
 */

/*
 // Override to support editing the table view.
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
 if (editingStyle == UITableViewCellEditingStyleDelete) {
 // Delete the row from the data source
 [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
 } else if (editingStyle == UITableViewCellEditingStyleInsert) {
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
 }
 }
 */

/*
 // Override to support rearranging the table view.
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
 }
 */

/*
 // Override to support conditional rearranging of the table view.
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the item to be re-orderable.
 return YES;
 }
 */

/*
 #pragma mark - Table view delegate

 // In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
 // Navigation logic may go here, for example:
 // Create the next view controller.
 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil];

 // Pass the selected object to the new view controller.

 // Push the view controller.
 [self.navigationController pushViewController:detailViewController animated:YES];
 }
 */

/*
 #pragma mark - Navigation

 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end


text:
class CreateValues < ActiveRecord::Migration
  def self.up
    create_table :parameter_values do |t|
    	t.integer :parameter_id
    	t.string :value

      t.timestamps
    end
  end

  def self.down
    drop_table :values
  end
end


text:
int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([KNDAppDelegate class]));
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>UE4AM: UE4_AccountManager Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

UE4AM
    0.1

Main Page

Data Structures

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Data Structures

Data Structure Index

Data Fields

 All Data Structures Functions Variables

Public Member Functions

UE4_AccountManager Class Reference

Public Member Functions

 	Init ()

 	AuthCMD ()

 	Install ()

 	IsInstalled ()

Detailed Description

UE4_AccountManager This is the main class which handles all communication between database and clients

Member Function Documentation

          AuthCMD
          (
          )

The AuthCMD checks if appid and token fit together and then process the command provided by received json array

          Init
          (
          )

The Init Function is the first function you want to start after creating a new instance

          Install
          (
          )

The Install function installs all necessary tables

          IsInstalled
          (
          )

Checks if Database prerequisites are installed

< Returns true if prerequisites installed

< Returns false if prerequisites are not installed

The documentation for this class was generated from the following file:

/Users/timkoepsel/Desktop/Archiv/Alter Mist/xzessmedia/Webprojects/UE4AccountHandler/ue4am.php

<address class="footer">
Generated on Thu Mar 12 2015 09:24:20 for UE4AM by

 1.8.4
</address>


text:
require_relative "test_helper.rb"

describe GoogleDriveCompanion::Server do

  before do
    @instance = GoogleDriveCompanion::Server.instance
  end

  it "returns socket filename" do
    @instance.socket_file.must_equal "/tmp/gdc_socket.sock"

    ENV["gdc_socket"] = "/foo"
    @instance.socket_file.must_equal "/foo"
  end

  it "returns pid filename" do
    @instance.pid_file.must_equal "/tmp/gdc.pid"

    ENV["gdc_pid"] = "/foo"
    @instance.pid_file.must_equal "/foo"
  end

  describe "checks if the server is running" do

    it "may be running because of the unix socket file" do
      @instance.expects(:socket_file).times(2).returns(:foo)
      @instance.expects(:pid_file).returns(:bar)

      File.expects(:exists?).with(:foo).returns(true)
      File.expects(:exists?).with(:bar).returns(false)

      @instance.expects(:exit).with(1)
      refute @instance.check_if_running!
    end

    it "may be running because of the pidfile" do
      @instance.expects(:socket_file).returns(:foo)
      @instance.expects(:pid_file).times(2).returns(:bar)

      File.expects(:exists?).with(:foo).returns(false)
      File.expects(:exists?).with(:bar).returns(true)
      File.expects(:read).with(:bar)

      @instance.expects(:exit).with(1)
      refute @instance.check_if_running!
    end

    it "isn't running" do
      @instance.expects(:socket_file).returns(:foo)
      @instance.expects(:pid_file).returns(:bar)

      File.expects(:exists?).with(:foo).returns(false)
      File.expects(:exists?).with(:bar).returns(false)

      @instance.expects(:exit).times(0)
      refute @instance.check_if_running!
    end
  end

  it "grabs a new unix socket it appropriate" do
    @instance.expects(:check_if_running!)
    @instance.expects(:write)
    @instance.expects(:socket_file).returns(:socket!)
    UNIXServer.expects(:new).with(:socket!).returns(:success!)

    @instance.server.must_equal(:success!)
  end

  it "closes its socket" do
    @instance.expects(:server).returns(mock(close: :success!))
    @instance.close.must_equal(:success!)
  end

  it "kills the server" do
    @instance.expects(:close)
    @instance.expects(:socket_file).times(2).returns(:yar!)
    @instance.expects(:pid_file).times(2).returns(:she_blows!)

    File.expects(:exists?).with(:yar!).returns(true)
    File.expects(:exists?).with(:she_blows!).returns(true)
    FileUtils.expects(:rm).times(2)
    Process.expects(:kill)

    @instance.close!
  end

  describe "runs the server" do
      it "as a daemon process" do
      @instance.expects(:server)
      Process.expects(:daemon).times(1)
      @instance.expects(:msg_pump).returns []
      @instance.run!
    end

    it "in the foreground" do
      @instance.expects(:server)
      Process.expects(:daemon).times(0)
      @instance.expects(:msg_pump).returns []
      @instance.run! :foo!
    end
  end
end


text:
module Azure::RecoveryServicesBackup::Mgmt::V2016_12_01
  module Models
    #
    # Container with items backed up using MAB backup engine.
    #
    class MabContainer < ProtectionContainer

      include MsRestAzure

      def initialize
        @containerType = "Windows"
      end

      attr_accessor :containerType

      # @return [Boolean] Can the container be registered one more time.
      attr_accessor :can_re_register

      # @return [Integer] ContainerID represents the container.
      attr_accessor :container_id

      # @return [Integer] Number of items backed up in this container.
      attr_accessor :protected_item_count

      # @return [String] Agent version of this container.
      attr_accessor :agent_version

      # @return [MabContainerExtendedInfo] Additional information for this
      # container
      attr_accessor :extended_info

      # @return [Array<MABContainerHealthDetails>] Health details on this mab
      # container.
      attr_accessor :mab_container_health_details

      # @return [String] Health state of mab container.
      attr_accessor :container_health_state

      #
      # Mapper for MabContainer class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Windows',
          type: {
            name: 'Composite',
            class_name: 'MabContainer',
            model_properties: {
              friendly_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'friendlyName',
                type: {
                  name: 'String'
                }
              },
              backup_management_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'backupManagementType',
                type: {
                  name: 'String'
                }
              },
              registration_status: {
                client_side_validation: true,
                required: false,
                serialized_name: 'registrationStatus',
                type: {
                  name: 'String'
                }
              },
              health_status: {
                client_side_validation: true,
                required: false,
                serialized_name: 'healthStatus',
                type: {
                  name: 'String'
                }
              },
              containerType: {
                client_side_validation: true,
                required: true,
                serialized_name: 'containerType',
                type: {
                  name: 'String'
                }
              },
              can_re_register: {
                client_side_validation: true,
                required: false,
                serialized_name: 'canReRegister',
                type: {
                  name: 'Boolean'
                }
              },
              container_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'containerId',
                type: {
                  name: 'Number'
                }
              },
              protected_item_count: {
                client_side_validation: true,
                required: false,
                serialized_name: 'protectedItemCount',
                type: {
                  name: 'Number'
                }
              },
              agent_version: {
                client_side_validation: true,
                required: false,
                serialized_name: 'agentVersion',
                type: {
                  name: 'String'
                }
              },
              extended_info: {
                client_side_validation: true,
                required: false,
                serialized_name: 'extendedInfo',
                type: {
                  name: 'Composite',
                  class_name: 'MabContainerExtendedInfo'
                }
              },
              mab_container_health_details: {
                client_side_validation: true,
                required: false,
                serialized_name: 'mabContainerHealthDetails',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'MABContainerHealthDetailsElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'MABContainerHealthDetails'
                      }
                  }
                }
              },
              container_health_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'containerHealthState',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--

 Copyright 2003 - 2016 The eFaps Team

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->
<ui-table xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>33f1f2d5-195e-4571-b181-b04004b4d10f</uuid>
    <file-application>eFapsApp-Products</file-application>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Products_CostingTable</name>
        <field name="documentType">
            <property name="Select">linkto[TransactionAbstractLink].linkto[Document].type.label</property>
            <property name="Label">Products_TransactionAbstract/Type.Label</property>
            <property name="UIProvider">org.efaps.admin.datamodel.ui.StringUI</property>
            <property name="FilterType">PICKLIST</property>
        </field>
        <field name="document">
            <property name="SelectAlternateOID">linkto[TransactionAbstractLink].linkto[Document].oid</property>
            <property name="HRef">TREE</property>
            <property name="Select">linkto[TransactionAbstractLink].linkto[Document].attribute[Name]</property>
            <property name="Label">Products_TransactionAbstract/Document.Label</property>
        </field>
        <field name="contact">
            <property name="SelectAlternateOID">linkto[TransactionAbstractLink].linkto[Document].linkto[Contact].oid</property>
            <property name="HRef">TREE</property>
            <property name="Select">linkto[TransactionAbstractLink].linkto[Document].linkto[Contact].attribute[Name]</property>
            <property name="Label">Products_CostingTable.contact.Label</property>
            <property name="FilterType">PICKLIST</property>
        </field>
         <field name="status">
            <property name="Select">linkto[TransactionAbstractLink].linkto[Document].status.label</property>
            <property name="Label">ERP_DocumentAbstract/StatusAbstract.Label</property>
            <property name="UIProvider">org.efaps.admin.datamodel.ui.StringUI</property>
            <property name="FilterType">PICKLIST</property>
        </field>
        <field name="transactionQuantity">
            <property name="SelectAlternateOID">linkto[TransactionAbstractLink].oid</property>
            <property name="Select">linkto[TransactionAbstractLink].attribute[Quantity]</property>
            <property name="Label">Products_CostingTable.transactionQuantity.Label</property>
            <property name="Align">right</property>
            <property name="UIProvider">org.efaps.admin.datamodel.ui.DecimalUI</property>
            <trigger program="org.efaps.esjp.products.Transaction"
                method="getQuantityFieldValue"
                name="Products_CostingTable.transactionQuantity.UI_FIELD_VALUE"
                event="UI_FIELD_VALUE"/>
        </field>
        <field name="date">
            <property name="FilterType">FREETEXT</property>
            <property name="FilterRequired">TRUE</property>
            <property name="FilterBase">DATABASE</property>
            <property name="FilterDefault">TODAY</property>
            <property name="Select">linkto[TransactionAbstractLink].attribute[Date]</property>
            <property name="Label">Products_TransactionAbstract/Date.Label</property>
            <property name="UIProvider">org.efaps.admin.datamodel.ui.DateUI</property>
        </field>
        <field name="quantity">
            <property name="Attribute">Quantity</property>
            <property name="Label">Products_CostingAbstract/Quantity.Label</property>
            <property name="Align">right</property>
        </field>
        <field name="cost">
            <property name="Attribute">Cost</property>
            <property name="Label">Products_CostingAbstract/Cost.Label</property>
            <property name="Align">right</property>
        </field>
        <field name="result">
            <property name="Attribute">Result</property>
            <property name="Label">Products_CostingAbstract/Result.Label</property>
            <property name="Align">right</property>
            <property name="HRef">TREE</property>
        </field>
        <field name="currencyLink">
            <property name="Select">linkto[CurrencyLink].attribute[Symbol]</property>
            <property name="Label">Products_CostingAbstract/CurrencyLink.Label</property>
            <property name="FilterType">PICKLIST</property>
        </field>
        <field name="stockTotal">
            <property name="Attribute">Result</property>
            <property name="Label">Products_CostingTable.stockTotal.Label</property>
            <property name="Align">right</property>
            <property name="UIProvider">org.efaps.admin.datamodel.ui.DecimalUI</property>
            <trigger program="org.efaps.esjp.products.Transaction"
                method="getStockTotalFieldValue"
                name="Products_CostingTable.stockTotal.UI_FIELD_VALUE"
                event="UI_FIELD_VALUE"/>
        </field>
        <field name="transNumber">
            <property name="Phrase">$<linkto[TransactionAbstractLink].attribute[Date].format[YYDDD]>$<linkto[TransactionAbstractLink].attribute[Position].format[00]></property>
            <property name="Label">Products_TransactionAbstractTable.transNumber.Label</property>
            <property name="UIProvider">org.efaps.admin.datamodel.ui.StringUI</property>
        </field>
        <field name="state">
            <property name="Attribute">State</property>
            <property name="Label">Products_CostingAbstract/State.Label</property>
        </field>
    </definition>
</ui-table>


text:
package com.alibaba.otter.canal.sink.entry;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.LockSupport;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

import com.alibaba.otter.canal.protocol.CanalEntry;
import com.alibaba.otter.canal.protocol.CanalEntry.Entry;
import com.alibaba.otter.canal.protocol.CanalEntry.EntryType;
import com.alibaba.otter.canal.protocol.position.LogIdentity;
import com.alibaba.otter.canal.sink.AbstractCanalEventSink;
import com.alibaba.otter.canal.sink.CanalEventDownStreamHandler;
import com.alibaba.otter.canal.sink.CanalEventSink;
import com.alibaba.otter.canal.sink.exception.CanalSinkException;
import com.alibaba.otter.canal.store.CanalEventStore;
import com.alibaba.otter.canal.store.model.Event;

/**
 * mysql binlog数据对象输出
 *
 * @author jianghang 2012-7-4 下午03:23:16
 * @version 1.0.0
 */
public class EntryEventSink extends AbstractCanalEventSink<List<CanalEntry.Entry>> implements CanalEventSink<List<CanalEntry.Entry>> {

    private static final Logger    logger                      = LoggerFactory.getLogger(EntryEventSink.class);
    private static final int       maxFullTimes                = 10;
    private CanalEventStore<Event> eventStore;
    protected boolean              filterTransactionEntry      = false;                                        // 是否需要过滤事务头/尾
    protected boolean              filterEmtryTransactionEntry = true;                                         // 是否需要过滤空的事务头/尾
    protected AtomicBoolean        isInterrupt                 = new AtomicBoolean(false);

    public void start() {
        super.start();
        Assert.notNull(eventStore);
    }

    public void stop() {
        super.stop();
    }

    public boolean filter(List<Entry> event, InetSocketAddress remoteAddress, String destination) {

        return false;
    }

    public boolean sink(List<CanalEntry.Entry> entrys, InetSocketAddress remoteAddress, String destination)
                                                                                throws CanalSinkException,
                                                                                InterruptedException {
        List rowDatas = entrys;
        if (filterTransactionEntry) {
            rowDatas = new ArrayList<CanalEntry.Entry>();
            for (CanalEntry.Entry entry : entrys) {
                if (entry.getEntryType() == EntryType.ROWDATA) {
                    rowDatas.add(entry);
                }
            }
        }

        return sinkData(rowDatas, remoteAddress);
    }

    private boolean sinkData(List<CanalEntry.Entry> entrys, InetSocketAddress remoteAddress)
                                                                                throws InterruptedException {
        List<Event> events = new ArrayList<Event>();
        for (CanalEntry.Entry entry : entrys) {
            Event event = new Event(new LogIdentity(remoteAddress, -1L), entry);
            if (!doFilter(event)) {
                continue;
            }

            events.add(event);
        }

        return doSink(events);
    }

    protected boolean doFilter(Event event) {
        if (filter != null && event.getEntry().getEntryType() == EntryType.ROWDATA) {
            String name = getSchemaNameAndTableName(event.getEntry());
            boolean need = filter.filter(name);
            if (!need) {
                logger.debug("filter name[{}] entry : {}:{}",
                             new Object[] { name, event.getEntry().getHeader().getLogfileName(),
                                     event.getEntry().getHeader().getLogfileOffset() });
            }

            return need;
        } else {
            return true;
        }
    }

    protected boolean doSink(List<Event> events) {
        for (CanalEventDownStreamHandler<Event> handler : getHandlers()) {
            handler.before(events);
        }

        int fullTimes = 0;
        do {
            if (eventStore.tryPut(events)) {
                for (CanalEventDownStreamHandler<Event> handler : getHandlers()) {
                    handler.after(events);
                }
                return true;
            } else {
                applyWait(++fullTimes);
            }

            for (CanalEventDownStreamHandler<Event> handler : getHandlers()) {
                handler.retry(events);
            }
            // isInterrupt 只会被响应一次,一旦true改为false后,就会退出无限的tryPut操作
            if (isInterrupt.compareAndSet(true, false)) {
                return false;
            }
        } while (running && !Thread.currentThread().isInterrupted());
        return false;
    }

    // 处理无数据的情况,避免空循环挂死
    private void applyWait(int fullTimes) {
        int newFullTimes = fullTimes > maxFullTimes ? maxFullTimes : fullTimes;
        if (fullTimes <= 3) { // 3次以内
            Thread.yield();
        } else { // 超过3次,最多只sleep 10ms
            LockSupport.parkNanos(1000 * 1000L * newFullTimes);
        }

    }

    private String getSchemaNameAndTableName(CanalEntry.Entry entry) {
        StringBuilder result = new StringBuilder();
        result.append(entry.getHeader().getSchemaName()).append(".").append(entry.getHeader().getTableName());
        return result.toString();
    }

    public void interrupt() {
        super.interrupt();
        isInterrupt.compareAndSet(false, true); // 设置为中断状态
    }

    public void setEventStore(CanalEventStore<Event> eventStore) {
        this.eventStore = eventStore;
    }

    public void setFilterTransactionEntry(boolean filterTransactionEntry) {
        this.filterTransactionEntry = filterTransactionEntry;
    }

    public void setFilterEmtryTransactionEntry(boolean filterEmtryTransactionEntry) {
        this.filterEmtryTransactionEntry = filterEmtryTransactionEntry;
    }

}


text:
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package google.registry.beam.common;

import static com.google.common.truth.Truth.assertThat;
import static google.registry.beam.common.RegistryPipelineOptions.validateRegistryPipelineOptions;
import static org.junit.jupiter.api.Assertions.assertThrows;

import google.registry.config.RegistryEnvironment;
import google.registry.persistence.PersistenceModule.JpaTransactionManagerType;
import google.registry.persistence.PersistenceModule.TransactionIsolationLevel;
import google.registry.testing.SystemPropertyExtension;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

/** Unit tests for {@link RegistryPipelineOptions}. */
class RegistryPipelineOptionsTest {

  /**
   * Restores original RegistryEnvironment after calling {@link
   * RegistryPipelineOptions#validateRegistryPipelineOptions}.
   */
  @RegisterExtension
  final SystemPropertyExtension systemPropertyExtension = new SystemPropertyExtension();

  @BeforeEach
  void beforeEach() {
    // Saves the current RegistryEnvironment for restoration later.
    RegistryEnvironment.get().setup(systemPropertyExtension);
  }

  @Test
  void environment_fromArgs() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs(
                "--registryEnvironment=ALPHA", "--isolationOverride=TRANSACTION_SERIALIZABLE")
            .withValidation()
            .as(RegistryPipelineOptions.class);
    assertThat(options.getRegistryEnvironment()).isSameInstanceAs(RegistryEnvironment.ALPHA);
    assertThat(options.getIsolationOverride())
        .isSameInstanceAs(TransactionIsolationLevel.TRANSACTION_SERIALIZABLE);
  }

  @Test
  void environment_invalidEnvironment() {
    assertThrows(
        IllegalArgumentException.class,
        () ->
            PipelineOptionsFactory.fromArgs("--registryEnvironment=alpha")
                .withValidation()
                .as(RegistryPipelineOptions.class));
  }

  @Test
  void environment_invalidIsolation() {
    assertThrows(
        IllegalArgumentException.class,
        () ->
            PipelineOptionsFactory.fromArgs("--isolationOverride=something_wrong")
                .withValidation()
                .as(RegistryPipelineOptions.class));
  }

  @Test
  void environment_undefined() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs().withValidation().as(RegistryPipelineOptions.class);
    assertThat(options.getRegistryEnvironment()).isNull();
    assertThat(options.getIsolationOverride()).isNull();
  }

  @Test
  void validateProject_projectsMatch() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs(
                "--registryEnvironment=" + RegistryEnvironment.UNITTEST.name(),
                "--project=registry-project-id")
            .withValidation()
            .as(RegistryPipelineOptions.class);
    validateRegistryPipelineOptions(options);
  }

  @Test
  void validateProject_projectsMismatch() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs(
                "--registryEnvironment=" + RegistryEnvironment.UNITTEST.name(), "--project=")
            .withValidation()
            .as(RegistryPipelineOptions.class);
    assertThrows(IllegalArgumentException.class, () -> validateRegistryPipelineOptions(options));
  }

  @Test
  void validateProject_missingProjectAdded() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs(
                "--registryEnvironment=" + RegistryEnvironment.UNITTEST.name())
            .withValidation()
            .as(RegistryPipelineOptions.class);
    // If gcloud is installed and --project not set , project may be inferred.
    options.setProject(null);
    validateRegistryPipelineOptions(options);
    assertThat(options.getProject()).isEqualTo("registry-project-id");
  }

  @Test
  void validateProject_noEnvironment() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs("--project=some-project").as(RegistryPipelineOptions.class);
    validateRegistryPipelineOptions(options);
    assertThat(options.getProject()).isEqualTo("some-project");
  }

  @Test
  void jpaTransactionManagerType_default() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs(
                "--registryEnvironment=" + RegistryEnvironment.UNITTEST.name())
            .withValidation()
            .as(RegistryPipelineOptions.class);
    assertThat(options.getJpaTransactionManagerType()).isEqualTo(JpaTransactionManagerType.REGULAR);
  }

  @Test
  void jpaTransactionManagerType_regularJpa() {
    RegistryPipelineOptions options =
        PipelineOptionsFactory.fromArgs(
                "--registryEnvironment=" + RegistryEnvironment.UNITTEST.name(),
                "--jpaTransactionManagerType=REGULAR")
            .withValidation()
            .as(RegistryPipelineOptions.class);
    assertThat(options.getJpaTransactionManagerType()).isEqualTo(JpaTransactionManagerType.REGULAR);
  }
}