text:
package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;

import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.core.client.impl.QueueQueryImpl;
import org.apache.activemq.artemis.core.server.QueueQueryResult;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.utils.BufferHelper;

public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryResponseMessage_V2 {

   protected boolean autoCreated;

   protected boolean purgeOnNoConsumers;

   protected RoutingType routingType;

   protected int maxConsumers;

   protected Boolean exclusive;

   protected Boolean groupRebalance;

   protected Integer groupBuckets;

   protected SimpleString groupFirstKey;

   protected Boolean lastValue;

   protected SimpleString lastValueKey;

   protected Boolean nonDestructive;

   private Integer consumersBeforeDispatch;

   private Long delayBeforeDispatch;

   private Boolean autoDelete;

   private Long autoDeleteDelay;

   private Long autoDeleteMessageCount;

   protected Integer defaultConsumerWindowSize;

   public SessionQueueQueryResponseMessage_V3(final QueueQueryResult result) {
      this(result.getName(), result.getAddress(), result.isDurable(), result.isTemporary(), result.getFilterString(), result.getConsumerCount(), result.getMessageCount(), result.isExists(), result.isAutoCreateQueues(), result.isAutoCreated(), result.isPurgeOnNoConsumers(), result.getRoutingType(), result.getMaxConsumers(), result.isExclusive(), result.isGroupRebalance(), result.getGroupBuckets(), result.getGroupFirstKey(), result.isLastValue(), result.getLastValueKey(), result.isNonDestructive(), result.getConsumersBeforeDispatch(), result.getDelayBeforeDispatch(), result.isAutoDelete(), result.getAutoDeleteDelay(), result.getAutoDeleteMessageCount(), result.getDefaultConsumerWindowSize());
   }

   public SessionQueueQueryResponseMessage_V3() {
      this(null, null, false, false, null, 0, 0, false, false, false, false, RoutingType.MULTICAST, -1, null, null,null, null, null, null, null, null, null, null, null, null, null);
   }

   private SessionQueueQueryResponseMessage_V3(final SimpleString name,
                                               final SimpleString address,
                                               final boolean durable,
                                               final boolean temporary,
                                               final SimpleString filterString,
                                               final int consumerCount,
                                               final long messageCount,
                                               final boolean exists,
                                               final boolean autoCreateQueues,
                                               final boolean autoCreated,
                                               final boolean purgeOnNoConsumers,
                                               final RoutingType routingType,
                                               final int maxConsumers,
                                               final Boolean exclusive,
                                               final Boolean groupRebalance,
                                               final Integer groupBuckets,
                                               final SimpleString groupFirstKey,
                                               final Boolean lastValue,
                                               final SimpleString lastValueKey,
                                               final Boolean nonDestructive,
                                               final Integer consumersBeforeDispatch,
                                               final Long delayBeforeDispatch,
                                               final Boolean autoDelete,
                                               final Long autoDeleteDelay,
                                               final Long autoDeleteMessageCount,
                                               final Integer defaultConsumerWindowSize) {
      super(SESS_QUEUEQUERY_RESP_V3);

      this.durable = durable;

      this.temporary = temporary;

      this.consumerCount = consumerCount;

      this.messageCount = messageCount;

      this.filterString = filterString;

      this.address = address;

      this.name = name;

      this.exists = exists;

      this.autoCreateQueues = autoCreateQueues;

      this.autoCreated = autoCreated;

      this.purgeOnNoConsumers = purgeOnNoConsumers;

      this.routingType = routingType;

      this.maxConsumers = maxConsumers;

      this.exclusive = exclusive;

      this.groupRebalance = groupRebalance;

      this.groupBuckets = groupBuckets;

      this.groupFirstKey = groupFirstKey;

      this.lastValue = lastValue;

      this.lastValueKey = lastValueKey;

      this.nonDestructive = nonDestructive;

      this.consumersBeforeDispatch = consumersBeforeDispatch;

      this.delayBeforeDispatch = delayBeforeDispatch;

      this.autoDelete = autoDelete;

      this.autoDeleteDelay = autoDeleteDelay;

      this.autoDeleteMessageCount = autoDeleteMessageCount;

      this.defaultConsumerWindowSize = defaultConsumerWindowSize;
   }

   public boolean isAutoCreated() {
      return autoCreated;
   }

   public void setAutoCreated(boolean autoCreated) {
      this.autoCreated = autoCreated;
   }

   public boolean isPurgeOnNoConsumers() {
      return purgeOnNoConsumers;
   }

   public void setPurgeOnNoConsumers(boolean purgeOnNoConsumers) {
      this.purgeOnNoConsumers = purgeOnNoConsumers;
   }

   public RoutingType getRoutingType() {
      return routingType;
   }

   public void setRoutingType(RoutingType routingType) {
      this.routingType = routingType;
   }

   public int getMaxConsumers() {
      return maxConsumers;
   }

   public void setMaxConsumers(int maxConsumers) {
      this.maxConsumers = maxConsumers;
   }

   public Boolean isExclusive() {
      return exclusive;
   }

   public void setExclusive(Boolean exclusive) {
      this.exclusive = exclusive;
   }

   public Boolean isLastValue() {
      return lastValue;
   }

   public void setLastValue(Boolean lastValue) {
      this.lastValue = lastValue;
   }

   public SimpleString getLastValueKey() {
      return lastValueKey;
   }

   public void setLastValueKey(SimpleString lastValueKey) {
      this.lastValueKey = lastValueKey;
   }

   public Boolean isNonDestructive() {
      return nonDestructive;
   }

   public void setNonDestructive(Boolean nonDestructive) {
      this.nonDestructive = nonDestructive;
   }

   public Integer getConsumersBeforeDispatch() {
      return consumersBeforeDispatch;
   }

   public void setConsumersBeforeDispatch(Integer consumersBeforeDispatch) {
      this.consumersBeforeDispatch = consumersBeforeDispatch;
   }

   public Long getDelayBeforeDispatch() {
      return delayBeforeDispatch;
   }

   public void setDelayBeforeDispatch(Long delayBeforeDispatch) {
      this.delayBeforeDispatch = delayBeforeDispatch;
   }

   public Integer getDefaultConsumerWindowSize() {
      return defaultConsumerWindowSize;
   }

   public void setDefaultConsumerWindowSize(Integer defaultConsumerWindowSize) {
      this.defaultConsumerWindowSize = defaultConsumerWindowSize;
   }

   public Boolean isGroupRebalance() {
      return groupRebalance;
   }

   public void setGroupRebalance(Boolean groupRebalance) {
      this.groupRebalance = groupRebalance;
   }

   public Integer getGroupBuckets() {
      return groupBuckets;
   }

   public void setGroupBuckets(Integer groupBuckets) {
      this.groupBuckets = groupBuckets;
   }

   public SimpleString getGroupFirstKey() {
      return groupFirstKey;
   }

   public void setGroupFirstKey(SimpleString groupFirstKey) {
      this.groupFirstKey = groupFirstKey;
   }

   public Boolean isAutoDelete() {
      return autoDelete;
   }

   public Long getAutoDeleteDelay() {
      return autoDeleteDelay;
   }

   public Long getAutoDeleteMessageCount() {
      return autoDeleteMessageCount;
   }

   @Override
   public void encodeRest(final ActiveMQBuffer buffer) {
      super.encodeRest(buffer);
      buffer.writeBoolean(autoCreated);
      buffer.writeBoolean(purgeOnNoConsumers);
      buffer.writeByte(routingType.getType());
      buffer.writeInt(maxConsumers);
      BufferHelper.writeNullableBoolean(buffer, exclusive);
      BufferHelper.writeNullableBoolean(buffer, lastValue);
      BufferHelper.writeNullableInteger(buffer, defaultConsumerWindowSize);
      buffer.writeNullableSimpleString(lastValueKey);
      BufferHelper.writeNullableBoolean(buffer, nonDestructive);
      BufferHelper.writeNullableInteger(buffer, consumersBeforeDispatch);
      BufferHelper.writeNullableLong(buffer, delayBeforeDispatch);
      BufferHelper.writeNullableBoolean(buffer, groupRebalance);
      BufferHelper.writeNullableInteger(buffer, groupBuckets);
      BufferHelper.writeNullableBoolean(buffer, autoDelete);
      BufferHelper.writeNullableLong(buffer, autoDeleteDelay);
      BufferHelper.writeNullableLong(buffer, autoDeleteMessageCount);
      buffer.writeNullableSimpleString(groupFirstKey);

   }

   @Override
   public void decodeRest(final ActiveMQBuffer buffer) {
      super.decodeRest(buffer);
      autoCreated = buffer.readBoolean();
      purgeOnNoConsumers = buffer.readBoolean();
      routingType = RoutingType.getType(buffer.readByte());
      maxConsumers = buffer.readInt();
      if (buffer.readableBytes() > 0) {
         exclusive = BufferHelper.readNullableBoolean(buffer);
         lastValue = BufferHelper.readNullableBoolean(buffer);
      }
      if (buffer.readableBytes() > 0) {
         defaultConsumerWindowSize = BufferHelper.readNullableInteger(buffer);
      }
      if (buffer.readableBytes() > 0) {
         lastValueKey = buffer.readNullableSimpleString();
         nonDestructive = BufferHelper.readNullableBoolean(buffer);
         consumersBeforeDispatch = BufferHelper.readNullableInteger(buffer);
         delayBeforeDispatch = BufferHelper.readNullableLong(buffer);
         groupRebalance = BufferHelper.readNullableBoolean(buffer);
         groupBuckets = BufferHelper.readNullableInteger(buffer);
         autoDelete = BufferHelper.readNullableBoolean(buffer);
         autoDeleteDelay = BufferHelper.readNullableLong(buffer);
         autoDeleteMessageCount = BufferHelper.readNullableLong(buffer);
      }
      if (buffer.readableBytes() > 0) {
         groupFirstKey = buffer.readNullableSimpleString();
      }
   }

   @Override
   public int hashCode() {
      final int prime = 31;
      int result = super.hashCode();
      result = prime * result + (autoCreated ? 1231 : 1237);
      result = prime * result + (purgeOnNoConsumers ? 1231 : 1237);
      result = prime * result + routingType.hashCode();
      result = prime * result + maxConsumers;
      result = prime * result + (exclusive == null ? 0 : exclusive ? 1231 : 1237);
      result = prime * result + (groupRebalance == null ? 0 : groupRebalance ? 1231 : 1237);
      result = prime * result + (groupBuckets == null ? 0 : groupBuckets.hashCode());
      result = prime * result + (groupFirstKey == null ? 0 : groupFirstKey.hashCode());
      result = prime * result + (lastValue == null ? 0 : lastValue ? 1231 : 1237);
      result = prime * result + (lastValueKey == null ? 0 : lastValueKey.hashCode());
      result = prime * result + (nonDestructive == null ? 0 : nonDestructive ? 1231 : 1237);
      result = prime * result + (consumersBeforeDispatch == null ? 0 : consumersBeforeDispatch.hashCode());
      result = prime * result + (delayBeforeDispatch == null ? 0 : delayBeforeDispatch.hashCode());
      result = prime * result + (autoDelete == null ? 0 : autoDelete.hashCode());
      result = prime * result + (autoDeleteDelay == null ? 0 : autoDeleteDelay.hashCode());
      result = prime * result + (autoDeleteMessageCount == null ? 0 : autoDeleteMessageCount.hashCode());
      result = prime * result + ((defaultConsumerWindowSize == null) ? 0 : defaultConsumerWindowSize.hashCode());
      return result;
   }

   @Override
   public String toString() {
      StringBuffer buff = new StringBuffer(getParentString());
      buff.append("]");
      return buff.toString();
   }

   @Override
   public String getParentString() {
      StringBuffer buff = new StringBuffer(super.getParentString());
      buff.append(", autoCreated=" + autoCreated);
      buff.append(", purgeOnNoConsumers=" + purgeOnNoConsumers);
      buff.append(", routingType=" + routingType);
      buff.append(", maxConsumers=" + maxConsumers);
      buff.append(", exclusive=" + exclusive);
      buff.append(", groupRebalance=" + groupRebalance);
      buff.append(", groupBuckets=" + groupBuckets);
      buff.append(", groupFirstKey=" + groupFirstKey);
      buff.append(", lastValue=" + lastValue);
      buff.append(", lastValueKey=" + lastValueKey);
      buff.append(", nonDestructive=" + nonDestructive);
      buff.append(", consumersBeforeDispatch=" + consumersBeforeDispatch);
      buff.append(", delayBeforeDispatch=" + delayBeforeDispatch);
      buff.append(", autoDelete=" + autoDelete);
      buff.append(", autoDeleteDelay=" + autoDeleteDelay);
      buff.append(", autoDeleteMessageCount=" + autoDeleteMessageCount);
      buff.append(", defaultConsumerWindowSize=" + defaultConsumerWindowSize);
      return buff.toString();
   }

   @Override
   public ClientSession.QueueQuery toQueueQuery() {
      return new QueueQueryImpl(isDurable(), isTemporary(), getConsumerCount(), getMessageCount(), getFilterString(), getAddress(), getName(), isExists(), isAutoCreateQueues(), getMaxConsumers(), isAutoCreated(), isPurgeOnNoConsumers(), getRoutingType(), isExclusive(), isGroupRebalance(), getGroupBuckets(), getGroupFirstKey(), isLastValue(), getLastValueKey(), isNonDestructive(), getConsumersBeforeDispatch(), getDelayBeforeDispatch(), isAutoDelete(), getAutoDeleteDelay(), getAutoDeleteMessageCount(), getDefaultConsumerWindowSize());
   }

   @Override
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (!super.equals(obj))
         return false;
      if (!(obj instanceof SessionQueueQueryResponseMessage_V3))
         return false;
      SessionQueueQueryResponseMessage_V3 other = (SessionQueueQueryResponseMessage_V3) obj;
      if (autoCreated != other.autoCreated)
         return false;
      if (purgeOnNoConsumers != other.purgeOnNoConsumers)
         return false;
      if (exclusive == null) {
         if (other.exclusive != null)
            return false;
      } else if (!exclusive.equals(other.exclusive))
         return false;
      if (groupRebalance == null) {
         if (other.groupRebalance != null)
            return false;
      } else if (!groupRebalance.equals(other.groupRebalance))
         return false;
      if (groupBuckets == null) {
         if (other.groupBuckets != null)
            return false;
      } else if (!groupBuckets.equals(other.groupBuckets))
         return false;
      if (groupFirstKey == null) {
         if (other.groupFirstKey != null)
            return false;
      } else if (!groupFirstKey.equals(other.groupFirstKey))
         return false;
      if (lastValue == null) {
         if (other.lastValue != null)
            return false;
      } else if (!lastValue.equals(other.lastValue))
         return false;
      if (lastValueKey == null) {
         if (other.lastValueKey != null)
            return false;
      } else if (!lastValueKey.equals(other.lastValueKey))
         return false;
      if (nonDestructive == null) {
         if (other.nonDestructive != null)
            return false;
      } else if (!nonDestructive.equals(other.nonDestructive))
         return false;
      if (consumersBeforeDispatch == null) {
         if (other.consumersBeforeDispatch != null)
            return false;
      } else if (!consumersBeforeDispatch.equals(other.consumersBeforeDispatch))
         return false;
      if (delayBeforeDispatch == null) {
         if (other.delayBeforeDispatch != null)
            return false;
      } else if (!delayBeforeDispatch.equals(other.delayBeforeDispatch))
         return false;
      if (autoDelete == null) {
         if (other.autoDelete != null)
            return false;
      } else if (!autoDelete.equals(other.autoDelete))
         return false;
      if (autoDeleteDelay == null) {
         if (other.autoDeleteDelay != null)
            return false;
      } else if (!autoDeleteDelay.equals(other.autoDeleteDelay))
         return false;
      if (autoDeleteMessageCount == null) {
         if (other.autoDeleteMessageCount != null)
            return false;
      } else if (!autoDeleteMessageCount.equals(other.autoDeleteMessageCount))
         return false;
      if (defaultConsumerWindowSize == null) {
         if (other.defaultConsumerWindowSize != null)
            return false;
      } else if (!defaultConsumerWindowSize.equals(other.defaultConsumerWindowSize))
         return false;
      if (routingType == null) {
         if (other.routingType != null)
            return false;
      } else if (!routingType.equals(other.routingType))
         return false;
      if (maxConsumers != other.maxConsumers)
         return false;
      return true;
   }
}


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//-----------------------------------------------------------------------------
var BUGNUMBER = 306633;
var summary = 'report compile warnings in evald code when strict warnings enabled';
var actual = '';
var expect = '';

printBugNumber(BUGNUMBER);
printStatus (summary);

if (!options().match(/strict/))
{
  options('strict');
}
if (!options().match(/werror/))
{
  options('werror');
}

expect = 'SyntaxError';

try
{
  actual = eval('super = 5');
}
catch(e)
{
  actual = e.name;
}

reportCompare(expect, actual, summary);

redpajama_set_name: RedPajamaGithub


text:
Hyperledger Fabric is an implementation of blockchain technology, leveraging familiar and proven technologies. It offers a modular architecture allowing pluggable implementations of various capabilities, such as smart contracts (chaincode), cryptography, consensus, ledger datastore and more. It leverages powerful container technology for its deployment and for providing the execution environment for the smart contracts (chaincode) such that the network is protected from malicious code.

## Documentation, Getting Started and Developer Guides

Please visit our
[online documentation](http://hyperledger-fabric.readthedocs.io/en/latest/) for
information on getting started using and developing with the fabric, SDK and chaincode.

## Contributing

We welcome contributions to the Hyperledger Project in many forms. There's always plenty to do!
Full details of how to contribute to this project are documented [here](http://hyperledger-fabric.readthedocs.io/en/latest/CONTRIBUTING/).

## Community

[Hyperledger Community](https://www.hyperledger.org/community)

[Hyperledger mailing lists and archives](http://lists.hyperledger.org/)

[Hyperledger Chat](http://chat.hyperledger.org)

[Hyperledger Wiki](https://wiki.hyperledger.org)

## License
The Hyperledger Project uses the [Apache License Version 2.0](LICENSE) software
license.


text:
using System;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Network.Models;

namespace Azure.ResourceManager.Network
{
    internal partial class AzureFirewallFqdnTagsRestOperations
    {
        private string subscriptionId;
        private Uri endpoint;
        private ClientDiagnostics _clientDiagnostics;
        private HttpPipeline _pipeline;

        /// <summary> Initializes a new instance of AzureFirewallFqdnTagsRestOperations. </summary>
        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. </param>
        /// <param name="endpoint"> server parameter. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/> is null. </exception>
        public AzureFirewallFqdnTagsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            endpoint ??= new Uri("https://management.azure.com");

            this.subscriptionId = subscriptionId;
            this.endpoint = endpoint;
            _clientDiagnostics = clientDiagnostics;
            _pipeline = pipeline;
        }

        internal HttpMessage CreateListAllRequest()
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/providers/Microsoft.Network/azureFirewallFqdnTags", false);
            uri.AppendQuery("api-version", "2020-04-01", true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        public async Task<Response<AzureFirewallFqdnTagListResult>> ListAllAsync(CancellationToken cancellationToken = default)
        {
            using var message = CreateListAllRequest();
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        AzureFirewallFqdnTagListResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        public Response<AzureFirewallFqdnTagListResult> ListAll(CancellationToken cancellationToken = default)
        {
            using var message = CreateListAllRequest();
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        AzureFirewallFqdnTagListResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendRawNextLink(nextLink, false);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
        /// <param name="nextLink"> The URL to the next page of results. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/> is null. </exception>
        public async Task<Response<AzureFirewallFqdnTagListResult>> ListAllNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
        {
            if (nextLink == null)
            {
                throw new ArgumentNullException(nameof(nextLink));
            }

            using var message = CreateListAllNextPageRequest(nextLink);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        AzureFirewallFqdnTagListResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
        /// <param name="nextLink"> The URL to the next page of results. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/> is null. </exception>
        public Response<AzureFirewallFqdnTagListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToken = default)
        {
            if (nextLink == null)
            {
                throw new ArgumentNullException(nameof(nextLink));
            }

            using var message = CreateListAllNextPageRequest(nextLink);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        AzureFirewallFqdnTagListResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
    }
}


text:
package org.apache.rave.portal.model.conversion;

import org.apache.rave.model.Address;
import org.apache.rave.model.Organization;
import org.apache.rave.model.PersonProperty;
import org.apache.rave.model.User;
import org.apache.rave.portal.model.*;
import org.apache.rave.portal.model.impl.AuthorityImpl;
import org.apache.rave.portal.model.impl.PageLayoutImpl;
import org.apache.rave.portal.model.impl.UserImpl;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.ArrayList;
import java.util.Date;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:test-applicationContext.xml", "classpath:test-dataContext.xml"})
public class JpaUserConverterTest {

    @Autowired
    JpaUserConverter converter;

    @Before
    public void setup() {

    }

    @Test
    public void testNoConversion() {
        JpaUser template = new JpaUser();
        assertThat(converter.convert(template), is(sameInstance(template)));
    }

    @Test
    public void nullConversion() {
        User template = null;
        assertThat(converter.convert(template), is(nullValue()));
    }

    @Test
    public void convertValid() {
        User template = new UserImpl("1");
        template.setUsername("TEST_A");
        template.setEmail("TEST_B");
        template.setDisplayName("TEST_C");
        //template.setAdditionalName("TEST_D");
        //template.setFamilyName("TEST_E");
        //template.setGivenName("TEST_F");
        //template.setHonorificPrefix("TEST_G");
        //template.setHonorificSuffix("TEST_H");
        //template.setPreferredName("TEST_I");
        //template.setAboutMe("TEST_J");
        //template.setStatus("TEST_K");
        template.setAddresses(new ArrayList<Address>());
        template.setOrganizations(new ArrayList<Organization>());
        template.setProperties(new ArrayList<PersonProperty>());
        template.setPassword("TEST_L");
        template.setConfirmPassword("TEST_M");
        template.setDefaultPageLayout(new PageLayoutImpl("CODE"));
        template.setDefaultPageLayoutCode("TEST_N");
        template.setEnabled(true);
        template.setExpired(true);
        template.setLocked(true);
        //template.setOpenId("TEST_O");
        //template.setForgotPasswordHash("TEST_P");
        //template.setForgotPasswordTime(new Date());
        template.addAuthority(new AuthorityImpl(new SimpleGrantedAuthority("HOO")));

        JpaUser jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaUser.class)));
        assertThat(jpaTemplate.getId(), is(equalTo(template.getId())));
        assertThat(jpaTemplate.getUsername(), is(equalTo(template.getUsername())));
        assertThat(jpaTemplate.getEmail(), is(equalTo(template.getEmail())));
        assertThat(jpaTemplate.getDisplayName(), is(equalTo(template.getDisplayName())));
        assertThat(jpaTemplate.getUsername(), is(equalTo(template.getUsername())));
        //assertThat(jpaTemplate.getFamilyName(), is(equalTo(template.getFamilyName())));
        //assertThat(jpaTemplate.getGivenName(), is(equalTo(template.getGivenName())));
        //assertThat(jpaTemplate.getHonorificPrefix(), is(equalTo(template.getHonorificPrefix())));
        //assertThat(jpaTemplate.getHonorificSuffix(), is(equalTo(template.getHonorificSuffix())));
        //assertThat(jpaTemplate.getPreferredName(), is(equalTo(template.getPreferredName())));
        //assertThat(jpaTemplate.getAboutMe(), is(equalTo(template.getAboutMe())));
        //assertThat(jpaTemplate.getStatus(), is(equalTo(template.getStatus())));
        assertThat(jpaTemplate.getAddresses(), is(equalTo(template.getAddresses())));
        assertThat(jpaTemplate.getOrganizations(), is(equalTo(template.getOrganizations())));
        assertThat(jpaTemplate.getProperties(), is(equalTo(template.getProperties())));
        assertThat(jpaTemplate.getPassword(), is(equalTo(template.getPassword())));
        assertThat(jpaTemplate.getConfirmPassword(), is(equalTo(template.getConfirmPassword())));
        assertThat(jpaTemplate.getDefaultPageLayout().getCode(), is(equalTo(template.getDefaultPageLayout().getCode())));
        assertThat(jpaTemplate.getDefaultPageLayoutCode(), is(equalTo(template.getDefaultPageLayoutCode())));
        assertThat(jpaTemplate.isEnabled(), is(equalTo(template.isEnabled())));
        assertThat(jpaTemplate.isExpired(), is(equalTo(template.isExpired())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
        //assertThat(jpaTemplate.getOpenId(), is(equalTo(template.getOpenId())));
        //assertThat(jpaTemplate.getForgotPasswordHash(), is(equalTo(template.getForgotPasswordHash())));
        //assertThat(jpaTemplate.getForgotPasswordTime(), is(equalTo(template.getForgotPasswordTime())));
        assertThat(jpaTemplate.getAuthorities().iterator().next().getAuthority(), is(equalTo(template.getAuthorities().iterator().next().getAuthority())));
    }

}


text:
import { Directive, ElementRef, Input, HostListener } from '@angular/core';

import { FileUploader } from './file-uploader.class';

// todo: filters

@Directive({selector: '[ng2FileSelect]'})
export class FileSelectDirective {
  @Input() public uploader:FileUploader;

  private element:ElementRef;

  public constructor(element:ElementRef) {
    this.element = element;
  }

  public getOptions():any {
    return this.uploader.options;
  }

  public getFilters():any {
    return void 0;
  }

  public isEmptyAfterSelection():boolean {
    return !!this.element.nativeElement.attributes.multiple;
  }

  @HostListener('change')
  public onChange():any {
    // let files = this.uploader.isHTML5 ? this.element.nativeElement[0].files : this.element.nativeElement[0];
    let files = this.element.nativeElement.files;
    let options = this.getOptions();
    let filters = this.getFilters();

    // if(!this.uploader.isHTML5) this.destroy();

    this.uploader.addToQueue(files, options, filters);
    if (this.isEmptyAfterSelection()) {
      // todo
      // this.element.nativeElement.properties.value = '';
      /*this.element.nativeElement
       .replaceWith(this.element = this.element.nativeElement.clone(true)); // IE fix*/
    }
  }
}


text:
<!doctype html>

      <meta charset="utf-8">
      <title>2014-CA-02-shout-your-name</title>

Les discours

                  Le diagramme ci-contre représente l'arbre généalogique de Julien,
                  avec Paul et Émilie (les parents de Julien), César et Hélène
                  (les parents d'Émilie), ainsi que Rodolf et Yasmine (les parents de César).

                  Toutes ces personnes se retrouvent pour une réunion de famille.
                  Chaque personne va donner un petit discours, selon le rituel suivant.

                  Lorsqu'une personne reçoit une tape sur l'épaule :

Si ses parents sont absents :

elle prononce son discours.

Sinon, si ses parents sont présents :

 elle tape sur l'épaule de son père,

 elle attend la fin du discours de son père,

 elle tape sur l'épaule de sa mère,

 elle attend la fin du discours de sa mère,

 elle prononce son propre discours.

                  Pour démarrer le rituel, Julien se tape lui-même sur l'épaule.

                  Votre objectif est de retrouver dans quel ordre les personnes réunies ont fait leurs discours.

 Rodolf     Yasmine
      \     /
       César      Hélène
           \      /
Paul        Émilie
    \      /
     Julien

                    Ordre des discours :

Solution

Voici les détails du rituel appliquée (qui n'est rien d'autre qu'un algorithme) :

		Julien a ses parents, donc il tape sur l'épaule de son père, Paul.

		    Paul n'a pas ses parents, il fait son discours. → 1) Paul

		Julien tape sur l'épaule de sa mère, Émilie.

		    Émilie a ses parents, donc elle tape sur l'épaule de son père, César.

		        César a ses parents, donc il tape sur l'épaule de son père, Rodolf.

		            Rodolf n'a pas ses parents, il fait son discours. → 2) Rodolf

		        César tape sur l'épaule de sa mère, Yasmine.

		            Yasmine n'a pas ses parents, elle fait son discours. → 3) Yasmine

		        César fait son discours. → 4) César

		    Émilie tape sur l'épaule de sa mère, Hélène.

		        Hélène n'a pas ses parents, elle fait son discours. → 5) Hélène

		    Émilie fait son discours. → 6) Émilie

		Julien fait son discours. → 7) Julien

Au final, l'ordre est donc : .

 2:Rodolf     3:Yasmine
        \     /
        4:César      5:Hélène
              \      /
  1:Paul      6:Émilie
       \      /
       7:Julien

C'est de l'informatique !

         Les « structures arborescentes » sont très utilisées en informatique, que ce soit pour concevoir des algorithmes efficaces ou simplement pour représenter des données de manière structurée. Par exemple, une page web est représentée comme un document au format « HTML », dont les balises organisent implicitement le contenu sous forme d'un arbre.

         Par exemple, une page web peut contenir plusieurs sections, chaque section peut contenir des tableaux, qui contiennent eux-mêmes des cases, contenant chacune du texte ou des images. Afin d'afficher le contenu de la page, le navigateur traverse la structure d'arbre selon un « ordre de parcours » particulier. Il peut le faire dans différents ordres, selon la méthode adoptée : d'abord obtenir une vision globale de où vont se trouver les tableaux, ou bien  d'abord déterminer quelle taille auront les textes et les images se trouvant dans les tableaux.

         Dans ce sujet, il fallait suivre un ordre de parcours particulier, appelé « ordre post-fix », selon lequel on commence par afficher les branches d'un « noeud » avant d'afficher le noeud lui-même.


text:
package org.openforis.idm.testfixture;

import org.openforis.idm.metamodel.Survey;
import org.openforis.idm.model.Record;

/**
 *
 * @author D. Wiell
 * @author S. Ricci
 *
 */
public class RecordBuilder {
	private final NodeBuilder[] nodeBuilders;

	private RecordBuilder(NodeBuilder[] nodeBuilders) {
		this.nodeBuilders = nodeBuilders;
	}

	public static RecordBuilder record(NodeBuilder... nodeBuilders) {
		return new RecordBuilder(nodeBuilders);
	}

	public <R extends Record> R build(Survey survey) {
		return build(survey, (String) null, (String) null);
	}

	public <R extends Record> R build(Survey survey, String rootEntityName) {
		return build(survey, rootEntityName, (String) null);
	}

	public <R extends Record> R build(Survey survey, String rootEntityName, String versionName) {
		return NodeBuilder.record(survey, rootEntityName, versionName, nodeBuilders);
	}
}


text:
import { ScaleBehavior, StaticScaleBehavior } from '../../Scale';

ScaleBehavior.editorConfig = {
    category: 'scale',
    title: 'Interpolated Scale',
    props: [
        {
            type: 'numberList',
            name: 'scale',
            title: 'Scale',
            description: 'Scale of the particles, with a minimum value of 0',
            default: 1,
            min: 0,
        },
        {
            type: 'number',
            name: 'minMult',
            title: 'Minimum Scale Multiplier',
            description: 'A value between minimum scale multipler and 1 is randomly '
                + 'generated and multiplied with each scale value to provide the actual scale for each particle.',
            default: 1,
            min: 0,
            max: 1,
        },
    ],
};

StaticScaleBehavior.editorConfig = {
    category: 'scale',
    title: 'Static Scale',
    props: [
        {
            type: 'number',
            name: 'min',
            title: 'Minimum Scale',
            description: 'Minimum scale of the particles, with a minimum value of 0',
            default: 1,
            min: 0,
        },
        {
            type: 'number',
            name: 'max',
            title: 'Maximum Scale',
            description: 'Maximum scale of the particles, with a minimum value of 0',
            default: 1,
            min: 0,
        },
    ],
};


text:
require 'open3'
require_relative '../../lib/conductor/kernel/subprocess'
include Conductor::Kernel

describe Subprocess do
  let(:pid_file_builder) { mock('lambda') }
  let(:pid_file) { stub('pid_file', open: nil) }
  let(:interface) { stub('application_interface', to_s: 'my_command') }
  let(:callback) { lambda { |stdout, stderr, pid, cmd|} }
  subject { Subprocess.new(interface, pid_file_builder, &callback) }

  describe 'spawning a process' do

    before :each do
      pid_file_builder.stubs(:call).returns(pid_file)
    end

    describe 'when the pid file exists' do
      before :each do
        pid_file.stubs(:exists?).returns(true)
      end

      it 'does not spawn a new process' do
        Open3.expects(:popen3).never
        subject.spawn
      end
    end

    describe 'when the pid file does not exist' do
      let(:stdin) { stub('stdin', {close: nil}) }
      let(:stdout) { stub('stdout', {gets: nil}) }
      let(:stderr) { stub('stderr', {gets: nil}) }
      let(:thread) { stub('thread', {join: nil, id: 123}) }

      before :each do
        pid_file.stubs(:exists?).returns(false)
      end

      it 'spawns a new process' do
        Open3.expects(:popen3).once
        subject.spawn
      end

      it 'opens the PID file' do
        Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
        pid_file.expects(:open).once
        subject.spawn
      end

      it 'closes STDIN file descriptor' do
        Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
        stdin.expects(:close).once
        subject.spawn
      end

      it 'joins the process thread to the main thread' do
        Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
        thread.expects(:join).once
        subject.spawn
      end

      it 'spawns a new thread for both the STDOUT and STDERR streams' do
        Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
        Thread.expects(:new).twice
        subject.spawn
      end

      describe 'when the backed process writes to the STDOUT stream' do
        describe 'if a block was passed to the constructor' do
          before :each do
            Thread.stubs(:new).yields
            Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
            thread.stubs(:id).returns(123)
            stdout.stubs(:gets).returns('hello world', nil)
          end
          it 'calls that block with the data from STDOUT' do
            callback.expects(:call).with('hello world', nil, 123, 'my_command')
            subject.spawn
          end
        end

        describe 'if a block was not passed to the constructor' do
          subject { Subprocess.new(interface, pid_file_builder) }
          before :each do
            Thread.stubs(:new).yields
            Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
            thread.stubs(:id).returns(123)
            stdout.stubs(:gets).returns('hello world', nil)
          end
          it 'it does not call that block with the data from STDOUT' do
            callback.expects(:call).with('hello world', nil, 123, 'my_command').never
            subject.spawn
          end
        end

      end

      describe 'when the backed process writes to the STDERR stream' do
        describe 'if a block was passed to the constructor' do
          before :each do
            Thread.stubs(:new).yields
            Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
            thread.stubs(:id).returns(123)
            stderr.stubs(:gets).returns('goodbye world', nil)
          end
          it 'calls that block with the data from stderr' do
            callback.expects(:call).with(nil, 'goodbye world', 123, 'my_command')
            subject.spawn
          end
        end

        describe 'if a block was not passed to the constructor' do
          subject { Subprocess.new(interface, pid_file_builder) }
          before :each do
            Thread.stubs(:new).yields
            Open3.stubs(:popen3).once.yields(stdin, stdout, stderr, thread)
            thread.stubs(:id).returns(123)
            stderr.stubs(:gets).returns('goodbye world', nil)
          end
          it 'calls that block with the data from stderr' do
            callback.expects(:call).with(nil, 'goodbye world', 123, 'my_command').never
            subject.spawn
          end
        end
      end

    end

  end

  describe 'killing a process' do
    let(:process_thread) { stub('process_thread', join: nil) }

    before :each do
      Thread.stubs(:new)
      Open3.stubs(:popen3).yields(stub('stdin', close: nil), nil, nil, process_thread)
      pid_file_builder.stubs(:call).returns(pid_file)
      pid_file.stubs(:exists?).returns(false)
      pid_file.stubs(:open)
      pid_file.stubs(:close)
      subject.spawn
    end

    it 'asks its process thread if it is alive' do
      process_thread.expects(:alive?).once
      subject.kill
    end

    describe 'when the thread is alive' do
      before :each do
        process_thread.expects(:alive?).once.returns(true)
      end
      it 'kills the process backing the thread' do
        process_thread.expects(:kill).once
        subject.kill
      end

      it 'closes the PID file for the process' do
        process_thread.stubs(:kill)
        pid_file.expects(:close).once
        subject.kill
      end

    end

    describe 'when the thread is not alive' do
      before(:each) do
        process_thread.stubs(:alive?).returns(false)
      end

      it 'does not call #kill on the process thread ' do
        process_thread.expects(:kill).never
        subject.kill
      end

      it 'does not call #close on the PID file' do
        pid_file.expects(:close).never
        subject.kill
      end

    end

  end

  describe 'asking a process if its alive' do
    subject { Subprocess.new(interface, pid_file_builder) }
    let(:process_thread) { stub('process_thread', join: nil) }
    before :each do
      Thread.stubs(:new)
      Open3.stubs(:popen3).yields(stub('stdin', close: nil), nil, nil, process_thread)
      pid_file_builder.stubs(:call).returns(pid_file)
      pid_file.stubs(:exists?).returns(false)
      pid_file.stubs(:open)
      pid_file.stubs(:close)
      subject.spawn
    end

    describe 'when the backing thread is dead' do
      before :each do
        process_thread.stubs(:alive?).returns(false)
      end
      it 'returns false' do
        expect(subject.alive?).to eql(false)
      end
    end

    describe 'when the backing thread is alive' do
      before :each do
        process_thread.stubs(:alive?).returns(true)
      end
      it 'returns true' do
        expect(subject.alive?).to eql(true)
      end
    end

  end

  describe 'asking the process for its id' do
    subject { Subprocess.new(interface, pid_file_builder) }
    let(:process_thread) { stub('process_thread', join: nil) }
    before :each do
      Thread.stubs(:new)
      Open3.stubs(:popen3).yields(stub('stdin', close: nil), nil, nil, process_thread)
      pid_file_builder.stubs(:call).returns(pid_file)
      pid_file.stubs(:exists?).returns(false)
      pid_file.stubs(:open)
      pid_file.stubs(:close)
      subject.spawn
    end

    it 'returns the id of the backing thread' do
      process_thread.expects(:pid).once.returns(1234)
      expect(subject.id).to eql(1234)
    end

  end

end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecidea fuscoatra var. leucostigma Erichsen

### Remarks
null


text:
export const CARD_MODAL = 'playtester/modals/CARD_MODAL';
export const SHORTCUTS_MODAL = 'playtester/modals/SHORTCUTS_MODAL';
export const TUTOR_MODAL = 'playtester/modals/TUTOR_MODAL';


text:
// eslint-disable-next-line no-shadow
export enum TasksListCloudPreferences {
    columnOrder = 'tasks-list-cloud-columns-order',
    columnsVisibility = 'tasks-list-cloud-columns-visibility'
}


text:
export * from 'wherehows-web/constants/metadata-acquisition';
export * from 'wherehows-web/constants/dataset-classification';
export * from 'wherehows-web/constants/dataset-compliance';
export * from 'wherehows-web/constants/application';
export * from 'wherehows-web/constants/dataset-comments';
export * from 'wherehows-web/constants/dataset-purge-policy';
export * from 'wherehows-web/constants/datasets/platform';
export * from 'wherehows-web/constants/datasets/compliance';


text:
package volumeclaimbinder

import (
	"testing"

	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/resource"
)

func TestMatchVolume(t *testing.T) {
	volList := NewPersistentVolumeOrderedIndex()
	for _, pv := range createTestVolumes() {
		volList.Add(pv)
	}

	scenarios := map[string]struct {
		expectedMatch string
		claim         *api.PersistentVolumeClaim
	}{
		"successful-match-gce-10": {
			expectedMatch: "gce-pd-10",
			claim: &api.PersistentVolumeClaim{
				ObjectMeta: api.ObjectMeta{
					Name:      "claim01",
					Namespace: "myns",
				},
				Spec: api.PersistentVolumeClaimSpec{
					AccessModes: []api.PersistentVolumeAccessMode{api.ReadOnlyMany, api.ReadWriteOnce},
					Resources: api.ResourceRequirements{
						Requests: api.ResourceList{
							api.ResourceName(api.ResourceStorage): resource.MustParse("8G"),
						},
					},
				},
			},
		},
		"successful-match-nfs-5": {
			expectedMatch: "nfs-5",
			claim: &api.PersistentVolumeClaim{
				ObjectMeta: api.ObjectMeta{
					Name:      "claim01",
					Namespace: "myns",
				},
				Spec: api.PersistentVolumeClaimSpec{
					AccessModes: []api.PersistentVolumeAccessMode{api.ReadOnlyMany, api.ReadWriteOnce, api.ReadWriteMany},
					Resources: api.ResourceRequirements{
						Requests: api.ResourceList{
							api.ResourceName(api.ResourceStorage): resource.MustParse("5G"),
						},
					},
				},
			},
		},
		"successful-skip-1g-bound-volume": {
			expectedMatch: "gce-pd-5",
			claim: &api.PersistentVolumeClaim{
				ObjectMeta: api.ObjectMeta{
					Name:      "claim01",
					Namespace: "myns",
				},
				Spec: api.PersistentVolumeClaimSpec{
					AccessModes: []api.PersistentVolumeAccessMode{api.ReadOnlyMany, api.ReadWriteOnce},
					Resources: api.ResourceRequirements{
						Requests: api.ResourceList{
							api.ResourceName(api.ResourceStorage): resource.MustParse("1G"),
						},
					},
				},
			},
		},
		"successful-no-match": {
			expectedMatch: "",
			claim: &api.PersistentVolumeClaim{
				ObjectMeta: api.ObjectMeta{
					Name:      "claim01",
					Namespace: "myns",
				},
				Spec: api.PersistentVolumeClaimSpec{
					AccessModes: []api.PersistentVolumeAccessMode{api.ReadOnlyMany, api.ReadWriteOnce},
					Resources: api.ResourceRequirements{
						Requests: api.ResourceList{
							api.ResourceName(api.ResourceStorage): resource.MustParse("999G"),
						},
					},
				},
			},
		},
	}

	for name, scenario := range scenarios {
		volume, err := volList.FindBestMatchForClaim(scenario.claim)
		if err != nil {
			t.Errorf("Unexpected error matching volume by claim: %v", err)
		}
		if scenario.expectedMatch != "" && volume == nil {
			t.Errorf("Expected match but received nil volume for scenario: %s", name)
		}
		if scenario.expectedMatch != "" && volume != nil && string(volume.UID) != scenario.expectedMatch {
			t.Errorf("Expected %s but got volume %s in scenario %s", scenario.expectedMatch, volume.UID, name)
		}
		if scenario.expectedMatch == "" && volume != nil {
			t.Errorf("Unexpected match for scenario: %s", name)
		}
	}
}

func TestMatchingWithBoundVolumes(t *testing.T) {
	volumeIndex := NewPersistentVolumeOrderedIndex()
	// two similar volumes, one is bound
	pv1 := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{
			UID:  "gce-pd-1",
			Name: "gce001",
		},
		Spec: api.PersistentVolumeSpec{
			Capacity: api.ResourceList{
				api.ResourceName(api.ResourceStorage): resource.MustParse("1G"),
			},
			PersistentVolumeSource: api.PersistentVolumeSource{
				GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
			},
			AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce, api.ReadOnlyMany},
			// this one we're pretending is already bound
			ClaimRef: &api.ObjectReference{UID: "abc123"},
		},
	}

	pv2 := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{
			UID:  "gce-pd-2",
			Name: "gce002",
		},
		Spec: api.PersistentVolumeSpec{
			Capacity: api.ResourceList{
				api.ResourceName(api.ResourceStorage): resource.MustParse("1G"),
			},
			PersistentVolumeSource: api.PersistentVolumeSource{
				GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
			},
			AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce, api.ReadOnlyMany},
		},
	}

	volumeIndex.Add(pv1)
	volumeIndex.Add(pv2)

	claim := &api.PersistentVolumeClaim{
		ObjectMeta: api.ObjectMeta{
			Name:      "claim01",
			Namespace: "myns",
		},
		Spec: api.PersistentVolumeClaimSpec{
			AccessModes: []api.PersistentVolumeAccessMode{api.ReadOnlyMany, api.ReadWriteOnce},
			Resources: api.ResourceRequirements{
				Requests: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("1G"),
				},
			},
		},
	}

	volume, err := volumeIndex.FindBestMatchForClaim(claim)
	if err != nil {
		t.Fatalf("Unexpected error matching volume by claim: %v", err)
	}
	if volume == nil {
		t.Fatalf("Unexpected nil volume.  Expected %s", pv2.Name)
	}
	if pv2.Name != volume.Name {
		t.Errorf("Expected %s but got volume %s instead", pv2.Name, volume.Name)
	}
}

func TestSort(t *testing.T) {
	volList := NewPersistentVolumeOrderedIndex()
	for _, pv := range createTestVolumes() {
		volList.Add(pv)
	}

	volumes, err := volList.ListByAccessModes([]api.PersistentVolumeAccessMode{api.ReadWriteOnce, api.ReadOnlyMany})
	if err != nil {
		t.Error("Unexpected error retrieving volumes by access modes:", err)
	}

	for i, expected := range []string{"gce-pd-1", "gce-pd-5", "gce-pd-10"} {
		if string(volumes[i].UID) != expected {
			t.Errorf("Incorrect ordering of persistent volumes.  Expected %s but got %s", expected, volumes[i].UID)
		}
	}

	volumes, err = volList.ListByAccessModes([]api.PersistentVolumeAccessMode{api.ReadWriteOnce, api.ReadOnlyMany, api.ReadWriteMany})
	if err != nil {
		t.Error("Unexpected error retrieving volumes by access modes:", err)
	}

	for i, expected := range []string{"nfs-1", "nfs-5", "nfs-10"} {
		if string(volumes[i].UID) != expected {
			t.Errorf("Incorrect ordering of persistent volumes.  Expected %s but got %s", expected, volumes[i].UID)
		}
	}
}

func TestAllPossibleAccessModes(t *testing.T) {
	index := NewPersistentVolumeOrderedIndex()
	for _, pv := range createTestVolumes() {
		index.Add(pv)
	}

	// the mock PVs creates contain 2 types of accessmodes:   RWO+ROX and RWO+ROW+RWX
	possibleModes := index.allPossibleMatchingAccessModes([]api.PersistentVolumeAccessMode{api.ReadWriteOnce})
	if len(possibleModes) != 2 {
		t.Errorf("Expected 2 arrays of modes that match RWO, but got %v", len(possibleModes))
	}
	for _, m := range possibleModes {
		if !contains(m, api.ReadWriteOnce) {
			t.Errorf("AccessModes does not contain %s", api.ReadWriteOnce)
		}
	}

	possibleModes = index.allPossibleMatchingAccessModes([]api.PersistentVolumeAccessMode{api.ReadWriteMany})
	if len(possibleModes) != 1 {
		t.Errorf("Expected 1 array of modes that match RWX, but got %v", len(possibleModes))
	}
	if !contains(possibleModes[0], api.ReadWriteMany) {
		t.Errorf("AccessModes does not contain %s", api.ReadWriteOnce)
	}

}

func TestFindingVolumeWithDifferentAccessModes(t *testing.T) {
	gce := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{UID: "001", Name: "gce"},
		Spec: api.PersistentVolumeSpec{
			Capacity:               api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("10G")},
			PersistentVolumeSource: api.PersistentVolumeSource{GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{}},
			AccessModes: []api.PersistentVolumeAccessMode{
				api.ReadWriteOnce,
				api.ReadOnlyMany,
			},
		},
	}

	ebs := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{UID: "002", Name: "ebs"},
		Spec: api.PersistentVolumeSpec{
			Capacity:               api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("10G")},
			PersistentVolumeSource: api.PersistentVolumeSource{AWSElasticBlockStore: &api.AWSElasticBlockStoreVolumeSource{}},
			AccessModes: []api.PersistentVolumeAccessMode{
				api.ReadWriteOnce,
			},
		},
	}

	nfs := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{UID: "003", Name: "nfs"},
		Spec: api.PersistentVolumeSpec{
			Capacity:               api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("10G")},
			PersistentVolumeSource: api.PersistentVolumeSource{NFS: &api.NFSVolumeSource{}},
			AccessModes: []api.PersistentVolumeAccessMode{
				api.ReadWriteOnce,
				api.ReadOnlyMany,
				api.ReadWriteMany,
			},
		},
	}

	claim := &api.PersistentVolumeClaim{
		ObjectMeta: api.ObjectMeta{
			Name:      "claim01",
			Namespace: "myns",
		},
		Spec: api.PersistentVolumeClaimSpec{
			AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
			Resources:   api.ResourceRequirements{Requests: api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("1G")}},
		},
	}

	index := NewPersistentVolumeOrderedIndex()
	index.Add(gce)
	index.Add(ebs)
	index.Add(nfs)

	volume, _ := index.FindBestMatchForClaim(claim)
	if volume.Name != ebs.Name {
		t.Errorf("Expected %s but got volume %s instead", ebs.Name, volume.Name)
	}

	claim.Spec.AccessModes = []api.PersistentVolumeAccessMode{api.ReadWriteOnce, api.ReadOnlyMany}
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != gce.Name {
		t.Errorf("Expected %s but got volume %s instead", gce.Name, volume.Name)
	}

	// order of the requested modes should not matter
	claim.Spec.AccessModes = []api.PersistentVolumeAccessMode{api.ReadWriteMany, api.ReadWriteOnce, api.ReadOnlyMany}
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != nfs.Name {
		t.Errorf("Expected %s but got volume %s instead", nfs.Name, volume.Name)
	}

	// fewer modes requested should still match
	claim.Spec.AccessModes = []api.PersistentVolumeAccessMode{api.ReadWriteMany}
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != nfs.Name {
		t.Errorf("Expected %s but got volume %s instead", nfs.Name, volume.Name)
	}

	// pretend the exact match is bound.  should get the next level up of modes.
	ebs.Spec.ClaimRef = &api.ObjectReference{}
	claim.Spec.AccessModes = []api.PersistentVolumeAccessMode{api.ReadWriteOnce}
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != gce.Name {
		t.Errorf("Expected %s but got volume %s instead", gce.Name, volume.Name)
	}

	// continue up the levels of modes.
	gce.Spec.ClaimRef = &api.ObjectReference{}
	claim.Spec.AccessModes = []api.PersistentVolumeAccessMode{api.ReadWriteOnce}
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != nfs.Name {
		t.Errorf("Expected %s but got volume %s instead", nfs.Name, volume.Name)
	}

	// partial mode request
	gce.Spec.ClaimRef = nil
	claim.Spec.AccessModes = []api.PersistentVolumeAccessMode{api.ReadOnlyMany}
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != gce.Name {
		t.Errorf("Expected %s but got volume %s instead", gce.Name, volume.Name)
	}
}

func createTestVolumes() []*api.PersistentVolume {
	// these volumes are deliberately out-of-order to test indexing and sorting
	return []*api.PersistentVolume{
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "gce-pd-10",
				Name: "gce003",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("10G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
				},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "gce-pd-20",
				Name: "gce004",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("20G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
				},
				// this one we're pretending is already bound
				ClaimRef: &api.ObjectReference{UID: "def456"},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "nfs-5",
				Name: "nfs002",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("5G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					Glusterfs: &api.GlusterfsVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
					api.ReadWriteMany,
				},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "gce-pd-1",
				Name: "gce001",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("1G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
				},
				// this one we're pretending is already bound
				ClaimRef: &api.ObjectReference{UID: "abc123"},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "nfs-10",
				Name: "nfs003",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("10G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					Glusterfs: &api.GlusterfsVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
					api.ReadWriteMany,
				},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "gce-pd-5",
				Name: "gce002",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("5G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
				},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				UID:  "nfs-1",
				Name: "nfs001",
			},
			Spec: api.PersistentVolumeSpec{
				Capacity: api.ResourceList{
					api.ResourceName(api.ResourceStorage): resource.MustParse("1G"),
				},
				PersistentVolumeSource: api.PersistentVolumeSource{
					Glusterfs: &api.GlusterfsVolumeSource{},
				},
				AccessModes: []api.PersistentVolumeAccessMode{
					api.ReadWriteOnce,
					api.ReadOnlyMany,
					api.ReadWriteMany,
				},
			},
		},
	}
}

func TestFindingPreboundVolumes(t *testing.T) {
	pv1 := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{
			Name:        "pv1",
			Annotations: map[string]string{},
		},
		Spec: api.PersistentVolumeSpec{
			Capacity:               api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("1Gi")},
			PersistentVolumeSource: api.PersistentVolumeSource{HostPath: &api.HostPathVolumeSource{}},
			AccessModes:            []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
		},
	}

	pv5 := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{
			Name:        "pv5",
			Annotations: map[string]string{},
		},
		Spec: api.PersistentVolumeSpec{
			Capacity:               api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("5Gi")},
			PersistentVolumeSource: api.PersistentVolumeSource{HostPath: &api.HostPathVolumeSource{}},
			AccessModes:            []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
		},
	}

	pv8 := &api.PersistentVolume{
		ObjectMeta: api.ObjectMeta{
			Name:        "pv8",
			Annotations: map[string]string{},
		},
		Spec: api.PersistentVolumeSpec{
			Capacity:               api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("8Gi")},
			PersistentVolumeSource: api.PersistentVolumeSource{HostPath: &api.HostPathVolumeSource{}},
			AccessModes:            []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
		},
	}

	claim := &api.PersistentVolumeClaim{
		ObjectMeta: api.ObjectMeta{
			Name:      "claim01",
			Namespace: "myns",
		},
		Spec: api.PersistentVolumeClaimSpec{
			AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
			Resources:   api.ResourceRequirements{Requests: api.ResourceList{api.ResourceName(api.ResourceStorage): resource.MustParse("1Gi")}},
		},
	}

	index := NewPersistentVolumeOrderedIndex()
	index.Add(pv1)
	index.Add(pv5)
	index.Add(pv8)

	// expected exact match on size
	volume, _ := index.FindBestMatchForClaim(claim)
	if volume.Name != pv1.Name {
		t.Errorf("Expected %s but got volume %s instead", pv1.Name, volume.Name)
	}

	// pretend the exact match is pre-bound.  should get the next size up.
	pv1.Annotations[createdForKey] = "some/other/claim"
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != pv5.Name {
		t.Errorf("Expected %s but got volume %s instead", pv5.Name, volume.Name)
	}

	// pretend the exact match is available but the largest volume is pre-bound to the claim.
	delete(pv1.Annotations, createdForKey)
	pv8.Annotations[createdForKey] = "myns/claim01"
	volume, _ = index.FindBestMatchForClaim(claim)
	if volume.Name != pv8.Name {
		t.Errorf("Expected %s but got volume %s instead", pv8.Name, volume.Name)
	}
}


text:
function saveDomainEnabled(){
	saveDomain("Enabled");
}

function saveDomainDisabled(){
	saveDomain("Disabled");
}

function saveDomainNeither(){
	saveDomain("Neither");
}

document.addEventListener('DOMContentLoaded', function () {
	document.getElementById("Enabled").addEventListener("click", saveDomainEnabled);
	document.getElementById("Disabled").addEventListener("click", saveDomainDisabled);
	document.getElementById("Neither").addEventListener("click", saveDomainNeither);
});


text:
#ifndef _SETUP_H
#define _SETUP_H

#include "Tiano.h"
#include "EfiDriverLib.h"
#include "UefiIfrLibrary.h"
#include "TianoHii.h"
#include "Colors.h"

#include EFI_PROTOCOL_DEFINITION (HiiDatabase)
#include EFI_PROTOCOL_DEFINITION (HiiString)
#include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)
#include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)
#include EFI_PROTOCOL_DEFINITION (FormBrowser2)

#include EFI_GUID_DEFINITION (GlobalVariable)
#include EFI_PROTOCOL_DEFINITION (DevicePath)
#include EFI_PROTOCOL_DEFINITION (SimpleTextOut)
#include EFI_PROTOCOL_DEFINITION (SimpleTextIn)
#include EFI_PROTOCOL_DEFINITION (Print)
#include EFI_PROTOCOL_DEFINITION (UnicodeCollation2)

//
// This is the generated header file which includes whatever needs to be exported (strings + IFR)
//
#include "SetupBrowserStrDefs.h"

extern UINT8  SetupBrowserStrings[];

//
// Screen definitions
//
#define BANNER_HEIGHT                 6
#define BANNER_COLUMNS                3

#define FRONT_PAGE_HEADER_HEIGHT      6
#define NONE_FRONT_PAGE_HEADER_HEIGHT 3
#define LEFT_SKIPPED_COLUMNS          4
#define FOOTER_HEIGHT                 4
#define STATUS_BAR_HEIGHT             1
#define SCROLL_ARROW_HEIGHT           1
#define POPUP_PAD_SPACE_COUNT         5
#define POPUP_FRAME_WIDTH             2

//
// Definition for function key setting
//
#define NONE_FUNCTION_KEY_SETTING     0
#define DEFAULT_FUNCTION_KEY_SETTING  (FUNCTION_NINE | FUNCTION_TEN)

#define FUNCTION_NINE                 (1 << 2)
#define FUNCTION_TEN                  (1 << 3)

typedef struct {
  EFI_GUID  FormSetGuid;
  UINTN     KeySetting;
} FUNCTIION_KEY_SETTING;

//
// Character definitions
//
#define CHAR_SPACE              0x0020
#define UPPER_LOWER_CASE_OFFSET 0x20

//
// Time definitions
//
#define ONE_SECOND  10000000

//
// Display definitions
//
#define LEFT_HYPER_DELIMITER      L'<'
#define RIGHT_HYPER_DELIMITER     L'>'

#define LEFT_ONEOF_DELIMITER      L'<'
#define RIGHT_ONEOF_DELIMITER     L'>'

#define LEFT_NUMERIC_DELIMITER    L'['
#define RIGHT_NUMERIC_DELIMITER   L']'

#define LEFT_CHECKBOX_DELIMITER   L'['
#define RIGHT_CHECKBOX_DELIMITER  L']'

#define CHECK_ON                  L'X'
#define CHECK_OFF                 L' '

#define TIME_SEPARATOR            L':'
#define DATE_SEPARATOR            L'/'

#define YES_ANSWER                L'Y'
#define NO_ANSWER                 L'N'

//
// Define this macro to enable the Tiano extended Class/SubClass GUIDed op-code
// support (Note: these GUIDed Class/SubClass op-codes are generated by keyword
// "class" and "subclass" in VFR file).
// To disable the support for this, undefine this macro.
//
#define TIANO_EXTENDED_CLASS_SUBCLASS_SUPPORT  1

//
// This is the Input Error Message
//
#define INPUT_ERROR 1

//
// This is the NV RAM update required Message
//
#define NV_UPDATE_REQUIRED  2

//
// Refresh the Status Bar with flags
//
#define REFRESH_STATUS_BAR  0xff

//
// Incremental string lenght of ConfigRequest
//
#define CONFIG_REQUEST_STRING_INCREMENTAL  1024

//
// HII value compare result
//
#define HII_VALUE_UNDEFINED     0
#define HII_VALUE_EQUAL         1
#define HII_VALUE_LESS_THAN     2
#define HII_VALUE_GREATER_THAN  3

//
// Incremental size of stack for expression
//
#define EXPRESSION_STACK_SIZE_INCREMENT    0x100

#define EFI_SPECIFICATION_ERRATA_VERSION   0

#define EFI_IFR_SPECIFICATION_VERSION  \
        ((((EFI_SPECIFICATION_VERSION) >> 8) & 0xff00) | \
         (((EFI_SPECIFICATION_VERSION) & 0xf) << 4) | \
         ((EFI_SPECIFICATION_ERRATA_VERSION) & 0xf))

#define SETUP_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('F', 'B', 'D', 'V')
typedef struct {
  UINT32                             Signature;

  EFI_HANDLE                         Handle;

  //
  // Produced protocol
  //
  EFI_FORM_BROWSER2_PROTOCOL         FormBrowser2;
  EFI_PRINT_PROTOCOL                 Print;

} SETUP_DRIVER_PRIVATE_DATA;

typedef struct {
  EFI_STRING_ID  Banner[BANNER_HEIGHT][BANNER_COLUMNS];
} BANNER_DATA;

//
// IFR relative definition
//
#define EFI_HII_EXPRESSION_INCONSISTENT_IF   0
#define EFI_HII_EXPRESSION_NO_SUBMIT_IF      1
#define EFI_HII_EXPRESSION_GRAY_OUT_IF       2
#define EFI_HII_EXPRESSION_SUPPRESS_IF       3
#define EFI_HII_EXPRESSION_DISABLE_IF        4
#define EFI_HII_EXPRESSION_VALUE             5
#define EFI_HII_EXPRESSION_RULE              6

#define EFI_HII_VARSTORE_BUFFER              0
#define EFI_HII_VARSTORE_NAME_VALUE          1
#define EFI_HII_VARSTORE_EFI_VARIABLE        2

#define FORM_INCONSISTENT_VALIDATION         0
#define FORM_NO_SUBMIT_VALIDATION            1

#define FORMSET_CLASS_PLATFORM_SETUP         0x0001
#define FORMSET_CLASS_FRONT_PAGE             0x0002

typedef struct {
  UINT8               Type;
  EFI_IFR_TYPE_VALUE  Value;
} EFI_HII_VALUE;

#define NAME_VALUE_NODE_SIGNATURE  EFI_SIGNATURE_32 ('N', 'V', 'S', 'T')

typedef struct {
  UINTN            Signature;
  EFI_LIST_ENTRY   Link;
  CHAR16           *Name;
  CHAR16           *Value;
  CHAR16           *EditValue;
} NAME_VALUE_NODE;

#define NAME_VALUE_NODE_FROM_LINK(a)  CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)

#define FORMSET_STORAGE_SIGNATURE  EFI_SIGNATURE_32 ('F', 'S', 'T', 'G')

typedef struct {
  UINTN            Signature;
  EFI_LIST_ENTRY   Link;

  UINT8            Type;           // Storage type

  UINT16           VarStoreId;
  EFI_GUID         Guid;

  CHAR16           *Name;          // For EFI_IFR_VARSTORE
  UINT16           Size;
  UINT8            *Buffer;
  UINT8            *EditBuffer;    // Edit copy for Buffer Storage

  EFI_LIST_ENTRY   NameValueListHead; // List of NAME_VALUE_NODE

  UINT32           Attributes;     // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute

  CHAR16           *ConfigHdr;     // <ConfigHdr>
  CHAR16           *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
  UINTN            ElementCount;   // Number of <RequestElement> in the <ConfigRequest>
  UINTN            SpareStrLen;    // Spare length of ConfigRequest string buffer
} FORMSET_STORAGE;

#define FORMSET_STORAGE_FROM_LINK(a)  CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)

#define EXPRESSION_OPCODE_SIGNATURE  EFI_SIGNATURE_32 ('E', 'X', 'O', 'P')

typedef struct {
  UINTN             Signature;
  EFI_LIST_ENTRY    Link;

  UINT8             Operand;

  UINT8             Format;      // For EFI_IFR_TO_STRING, EFI_IFR_FIND
  UINT8             Flags;       // For EFI_IFR_SPAN
  UINT8             RuleId;      // For EFI_IFR_RULE_REF

  EFI_HII_VALUE     Value;       // For EFI_IFR_EQ_ID_VAL, EFI_IFR_UINT64, EFI_IFR_UINT32, EFI_IFR_UINT16, EFI_IFR_UINT8, EFI_IFR_STRING_REF1

  EFI_QUESTION_ID   QuestionId;  // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_LIST, EFI_IFR_QUESTION_REF1
  EFI_QUESTION_ID   QuestionId2;

  UINT16            ListLength;  // For EFI_IFR_EQ_ID_LIST
  UINT16            *ValueList;

  EFI_STRING_ID     DevicePath;  // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
  EFI_GUID          Guid;
} EXPRESSION_OPCODE;

#define EXPRESSION_OPCODE_FROM_LINK(a)  CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)

#define FORM_EXPRESSION_SIGNATURE  EFI_SIGNATURE_32 ('F', 'E', 'X', 'P')

typedef struct {
  UINTN             Signature;
  EFI_LIST_ENTRY    Link;

  UINT8             Type;            // Type for this expression

  UINT8             RuleId;          // For EFI_IFR_RULE only
  EFI_STRING_ID     Error;           // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only

  EFI_HII_VALUE     Result;          // Expression evaluation result

  EFI_LIST_ENTRY    OpCodeListHead;  // OpCodes consist of this expression (EXPRESSION_OPCODE)
} FORM_EXPRESSION;

#define FORM_EXPRESSION_FROM_LINK(a)  CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)

#define QUESTION_DEFAULT_SIGNATURE  EFI_SIGNATURE_32 ('Q', 'D', 'F', 'T')

typedef struct {
  UINTN               Signature;
  EFI_LIST_ENTRY      Link;

  UINT16              DefaultId;
  EFI_HII_VALUE       Value;              // Default value

  FORM_EXPRESSION     *ValueExpression;   // Not-NULL indicates default value is provided by EFI_IFR_VALUE
} QUESTION_DEFAULT;

#define QUESTION_DEFAULT_FROM_LINK(a)  CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)

#define QUESTION_OPTION_SIGNATURE  EFI_SIGNATURE_32 ('Q', 'O', 'P', 'T')

typedef struct {
  UINTN               Signature;
  EFI_LIST_ENTRY      Link;

  EFI_STRING_ID       Text;
  UINT8               Flags;
  EFI_HII_VALUE       Value;
  EFI_IMAGE_ID        ImageId;

  FORM_EXPRESSION     *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf
} QUESTION_OPTION;

#define QUESTION_OPTION_FROM_LINK(a)  CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)

#define FORM_BROWSER_STATEMENT_SIGNATURE  EFI_SIGNATURE_32 ('F', 'S', 'T', 'A')
typedef struct {
  UINTN                 Signature;
  EFI_LIST_ENTRY        Link;

  UINT8                 Operand;          // The operand (first byte) of this Statement or Question

  //
  // Statement Header
  //
  EFI_STRING_ID         Prompt;
  EFI_STRING_ID         Help;
  EFI_STRING_ID         TextTwo;          // For EFI_IFR_TEXT

  //
  // Question Header
  //
  EFI_QUESTION_ID       QuestionId;       // The value of zero is reserved
  EFI_VARSTORE_ID       VarStoreId;       // A value of zero indicates no variable storage
  FORMSET_STORAGE       *Storage;
  union {
    EFI_STRING_ID       VarName;
    UINT16              VarOffset;
  }  VarStoreInfo;
  UINT16                StorageWidth;
  UINT8                 QuestionFlags;
  CHAR16                *VariableName;    // Name/Value or EFI Variable name
  CHAR16                *BlockName;       // Buffer storage block name: "OFFSET=...WIDTH=..."

  EFI_HII_VALUE         HiiValue;         // Edit copy for checkbox, numberic, oneof
  UINT8                 *BufferValue;     // Edit copy for string, password, orderedlist
  UINT8                 ValueType;        // Data type for orderedlist value array

  //
  // OpCode specific members
  //
  UINT8                 Flags;            // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
                                          // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
  UINT8                 MaxContainers;    // for EFI_IFR_ORDERED_LIST

  UINT16                BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number
  EFI_STRING_ID         QuestionConfig;   // for EFI_IFR_ACTION, if 0 then no configuration string will be processed

  UINT64                Minimum;          // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
  UINT64                Maximum;          // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
  UINT64                Step;

  EFI_DEFAULT_ID        DefaultId;        // for EFI_IFR_RESET_BUTTON
  EFI_FORM_ID           RefFormId;        // for EFI_IFR_REF
  EFI_QUESTION_ID       RefQuestionId;    // for EFI_IFR_REF2
  EFI_GUID              RefFormSetId;     // for EFI_IFR_REF3
  EFI_STRING_ID         RefDevicePath;    // for EFI_IFR_REF4

  //
  // Get from IFR parsing
  //
  FORM_EXPRESSION       *ValueExpression;    // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
  EFI_LIST_ENTRY        DefaultListHead;     // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
  EFI_LIST_ENTRY        OptionListHead;      // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)

  EFI_IMAGE_ID          ImageId;             // nested EFI_IFR_IMAGE
  UINT8                 RefreshInterval;     // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
  BOOLEAN               InSubtitle;          // nesting inside of EFI_IFR_SUBTITLE

  EFI_LIST_ENTRY        InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)
  EFI_LIST_ENTRY        NoSubmitListHead;    // nested nosubmit expression list (FORM_EXPRESSION)
  FORM_EXPRESSION       *GrayOutExpression;  // nesting inside of GrayOutIf
  FORM_EXPRESSION       *SuppressExpression; // nesting inside of SuppressIf
  FORM_EXPRESSION       *DisableExpression;  // nesting inside of DisableIf

} FORM_BROWSER_STATEMENT;

#define FORM_BROWSER_STATEMENT_FROM_LINK(a)  CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)

#define FORM_BROWSER_FORM_SIGNATURE  EFI_SIGNATURE_32 ('F', 'F', 'R', 'M')

typedef struct {
  UINTN             Signature;
  EFI_LIST_ENTRY    Link;

  UINT16            FormId;
  EFI_STRING_ID     FormTitle;

  EFI_IMAGE_ID      ImageId;

  EFI_LIST_ENTRY    ExpressionListHead;   // List of Expressions (FORM_EXPRESSION)
  EFI_LIST_ENTRY    StatementListHead;    // List of Statements and Questions (FORM_BROWSER_STATEMENT)
} FORM_BROWSER_FORM;

#define FORM_BROWSER_FORM_FROM_LINK(a)  CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)

#define FORMSET_DEFAULTSTORE_SIGNATURE  EFI_SIGNATURE_32 ('F', 'D', 'F', 'S')

typedef struct {
  UINTN            Signature;
  EFI_LIST_ENTRY   Link;

  UINT16           DefaultId;
  EFI_STRING_ID    DefaultName;
} FORMSET_DEFAULTSTORE;

#define FORMSET_DEFAULTSTORE_FROM_LINK(a)  CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)

typedef struct {
  EFI_HII_HANDLE                  HiiHandle;
  EFI_HANDLE                      DriverHandle;
  EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;
  EFI_DEVICE_PATH_PROTOCOL        *DevicePath;

  UINTN                           IfrBinaryLength;
  UINT8                           *IfrBinaryData;

  EFI_GUID                        Guid;
  EFI_STRING_ID                   FormSetTitle;
  EFI_STRING_ID                   Help;
  UINT8                           NumberOfClassGuid;
  EFI_GUID                        ClassGuid[3];         // Up to three ClassGuid
#ifdef TIANO_EXTENDED_CLASS_SUBCLASS_SUPPORT
  UINT16                          Class;                // Tiano extended Class code
  UINT16                          SubClass;             // Tiano extended Subclass code
#endif
  EFI_IMAGE_ID                    ImageId;

  FORM_BROWSER_STATEMENT          *StatementBuffer;     // Buffer for all Statements and Questions
  EXPRESSION_OPCODE               *ExpressionBuffer;    // Buffer for all Expression OpCode

  EFI_LIST_ENTRY                  StorageListHead;      // Storage list (FORMSET_STORAGE)
  EFI_LIST_ENTRY                  DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)
  EFI_LIST_ENTRY                  FormListHead;         // Form list (FORM_BROWSER_FORM)
} FORM_BROWSER_FORMSET;

#define BROWSER_CONTEXT_SIGNATURE  EFI_SIGNATURE_32 ('B', 'C', 'T', 'X')

typedef struct {
  UINTN                 Signature;
  EFI_LIST_ENTRY        Link;

  //
  // Globals defined in Setup.c
  //
  BANNER_DATA           *BannerData;
  UINTN                 ClassOfVfr;
  UINTN                 FunctionKeySetting;
  BOOLEAN               ResetRequired;
  BOOLEAN               NvUpdateRequired;
  UINT16                Direction;
  EFI_SCREEN_DESCRIPTOR ScreenDimensions;
  CHAR16                *FunctionNineString;
  CHAR16                *FunctionTenString;
  CHAR16                *EnterString;
  CHAR16                *EnterCommitString;
  CHAR16                *EnterEscapeString;
  CHAR16                *EscapeString;
  CHAR16                *SaveFailed;
  CHAR16                *MoveHighlight;
  CHAR16                *MakeSelection;
  CHAR16                *DecNumericInput;
  CHAR16                *HexNumericInput;
  CHAR16                *ToggleCheckBox;
  CHAR16                *PromptForData;
  CHAR16                *PromptForPassword;
  CHAR16                *PromptForNewPassword;
  CHAR16                *ConfirmPassword;
  CHAR16                *ConfirmError;
  CHAR16                *PassowordInvalid;
  CHAR16                *PressEnter;
  CHAR16                *EmptyString;
  CHAR16                *AreYouSure;
  CHAR16                *YesResponse;
  CHAR16                *NoResponse;
  CHAR16                *MiniString;
  CHAR16                *PlusString;
  CHAR16                *MinusString;
  CHAR16                *AdjustNumber;
  CHAR16                *SaveChanges;
  CHAR16                *OptionMismatch;
  CHAR16                PromptBlockWidth;
  CHAR16                OptionBlockWidth;
  CHAR16                HelpBlockWidth;
  FORM_BROWSER_FORMSET  *OldFormSet;

  //
  // Globals defined in Ui.c
  //
  EFI_LIST_ENTRY        Menu;
  VOID                 *MenuRefreshHead;
} BROWSER_CONTEXT;

#define BROWSER_CONTEXT_FROM_LINK(a)  CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)

extern EFI_HII_DATABASE_PROTOCOL         *mHiiDatabase;
extern EFI_HII_STRING_PROTOCOL           *mHiiString;
extern EFI_HII_CONFIG_ROUTING_PROTOCOL   *mHiiConfigRouting;

extern BANNER_DATA           *gBannerData;
extern EFI_HII_HANDLE        gFrontPageHandle;
extern UINTN                 gClassOfVfr;
extern UINTN                 gFunctionKeySetting;
extern BOOLEAN               gResetRequired;
extern BOOLEAN               gNvUpdateRequired;
extern EFI_HII_HANDLE        gHiiHandle;
extern UINT16                gDirection;
extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;

//
// Browser Global Strings
//
extern CHAR16            *gFunctionNineString;
extern CHAR16            *gFunctionTenString;
extern CHAR16            *gEnterString;
extern CHAR16            *gEnterCommitString;
extern CHAR16            *gEnterEscapeString;
extern CHAR16            *gEscapeString;
extern CHAR16            *gSaveFailed;
extern CHAR16            *gMoveHighlight;
extern CHAR16            *gMakeSelection;
extern CHAR16            *gDecNumericInput;
extern CHAR16            *gHexNumericInput;
extern CHAR16            *gToggleCheckBox;
extern CHAR16            *gPromptForData;
extern CHAR16            *gPromptForPassword;
extern CHAR16            *gPromptForNewPassword;
extern CHAR16            *gConfirmPassword;
extern CHAR16            *gConfirmError;
extern CHAR16            *gPassowordInvalid;
extern CHAR16            *gPressEnter;
extern CHAR16            *gEmptyString;
extern CHAR16            *gAreYouSure;
extern CHAR16            *gYesResponse;
extern CHAR16            *gNoResponse;
extern CHAR16            *gMiniString;
extern CHAR16            *gPlusString;
extern CHAR16            *gMinusString;
extern CHAR16            *gAdjustNumber;
extern CHAR16            *gSaveChanges;
extern CHAR16            *gOptionMismatch;

extern CHAR16            gPromptBlockWidth;
extern CHAR16            gOptionBlockWidth;
extern CHAR16            gHelpBlockWidth;

extern EFI_GUID          gZeroGuid;
extern EFI_GUID          gTianoHiiIfrGuid;
extern EFI_GUID          gFrontPageClassGuid;

//
// Global Procedure Defines
//
VOID
InitializeBrowserStrings (
  VOID
  )
;

UINTN
_Print (
  IN CHAR16                         *fmt,
  ...
  )
;

UINTN
PrintString (
  CHAR16       *String
  )
;

UINTN
PrintChar (
  CHAR16       Character
  )
;

UINTN
PrintAt (
  IN UINTN     Column,
  IN UINTN     Row,
  IN CHAR16    *fmt,
  ...
  )
;

UINTN
PrintStringAt (
  IN UINTN     Column,
  IN UINTN     Row,
  CHAR16       *String
  )
;

UINTN
PrintCharAt (
  IN UINTN     Column,
  IN UINTN     Row,
  CHAR16       Character
  )
;

BOOLEAN
IsClassGuidMatch (
  IN  FORM_BROWSER_FORMSET  *FormSet,
  IN  EFI_GUID              *ClassGuid
  )
;

EFI_STATUS
ParseOpCodes (
  IN FORM_BROWSER_FORMSET              *FormSet
  )
;

VOID
DestroyFormSet (
  IN OUT FORM_BROWSER_FORMSET  *FormSet
  )
;

VOID
DisplayPageFrame (
  VOID
  )
;

EFI_STRING_ID
NewString (
  IN  CHAR16                   *String,
  IN  EFI_HII_HANDLE           HiiHandle
  )
;

EFI_STATUS
DeleteString (
  IN  EFI_STRING_ID            StringId,
  IN  EFI_HII_HANDLE           HiiHandle
  )
;
CHAR16 *
GetToken (
  IN  EFI_STRING_ID                Token,
  IN  EFI_HII_HANDLE               HiiHandle
  )
;

UINTN
EFIAPI
VSPrint (
  OUT CHAR16        *StartOfBuffer,
  IN  UINTN         BufferSize,
  IN  CONST CHAR16  *FormatString,
  IN  VA_LIST       Marker
  )
;

VOID
CreateSharedPopUp (
  IN  UINTN                       RequestedWidth,
  IN  UINTN                       NumberOfLines,
  IN  CHAR16                      **ArrayOfStrings
  )
;

EFI_STATUS
CreateDialog (
  IN  UINTN                       NumberOfLines,
  IN  BOOLEAN                     HotKey,
  IN  UINTN                       MaximumStringSize,
  OUT CHAR16                      *StringBuffer,
  OUT EFI_INPUT_KEY               *KeyValue,
  IN  CHAR16                      *String,
  ...
  )
;

EFI_STATUS
GetQuestionValue (
  IN FORM_BROWSER_FORMSET             *FormSet,
  IN FORM_BROWSER_FORM                *Form,
  IN OUT FORM_BROWSER_STATEMENT       *Question,
  IN BOOLEAN                          Cached
  )
;

EFI_STATUS
SetQuestionValue (
  IN FORM_BROWSER_FORMSET             *FormSet,
  IN FORM_BROWSER_FORM                *Form,
  IN OUT FORM_BROWSER_STATEMENT       *Question,
  IN BOOLEAN                          Cached
  )
;

EFI_STATUS
ValidateQuestion (
  IN  FORM_BROWSER_FORMSET            *FormSet,
  IN  FORM_BROWSER_FORM               *Form,
  IN  FORM_BROWSER_STATEMENT          *Question,
  IN  UINTN                           Type
  )
;

EFI_STATUS
SubmitForm (
  IN FORM_BROWSER_FORMSET             *FormSet,
  IN FORM_BROWSER_FORM                *Form
  )
;

EFI_STATUS
GetQuestionDefault (
  IN FORM_BROWSER_FORMSET             *FormSet,
  IN FORM_BROWSER_FORM                *Form,
  IN FORM_BROWSER_STATEMENT           *Question,
  IN UINT16                           DefaultId
  )
;

EFI_STATUS
InitializeCurrentSetting (
  IN OUT FORM_BROWSER_FORMSET             *FormSet
  )
;

EFI_STATUS
InitializeFormSet (
  IN  EFI_HII_HANDLE                   Handle,
  IN OUT EFI_GUID                      *FormSetGuid,
  OUT FORM_BROWSER_FORMSET             *FormSet
  )
;

EFI_STATUS
ExtractFormDefault (
  IN FORM_BROWSER_FORMSET             *FormSet,
  IN  FORM_BROWSER_FORM               *Form,
  IN UINT16                           DefaultId
  )
;

EFI_STATUS
LoadFormConfig (
  IN FORM_BROWSER_FORMSET             *FormSet,
  IN FORM_BROWSER_FORM                *Form
  )
;

EFI_STATUS
LoadFormSetConfig (
  IN FORM_BROWSER_FORMSET             *FormSet
  )
;

EFI_STATUS
StorageToConfigResp (
  IN FORMSET_STORAGE         *Storage,
  IN CHAR16                  **ConfigResp
  )
;

EFI_STATUS
ConfigRespToStorage (
  IN FORMSET_STORAGE         *Storage,
  IN CHAR16                  *ConfigResp
  )
;

EFI_STATUS
LoadStorage (
  IN FORM_BROWSER_FORMSET    *FormSet,
  IN FORMSET_STORAGE         *Storage
  )
;

EFI_STATUS
GetIfrBinaryData (
  IN  EFI_HII_HANDLE   Handle,
  IN OUT EFI_GUID      *FormSetGuid,
  OUT UINTN            *BinaryLength,
  OUT UINT8            **BinaryData
  )
;

VOID
SaveBrowserContext (
  VOID
  );

VOID
RestoreBrowserContext (
  VOID
  );

EFI_STATUS
EFIAPI
SendForm (
  IN  CONST EFI_FORM_BROWSER2_PROTOCOL *This,
  IN  EFI_HII_HANDLE                   *Handles,
  IN  UINTN                            HandleCount,
  IN  EFI_GUID                         *FormSetGuid, OPTIONAL
  IN  UINT16                           FormId, OPTIONAL
  IN  CONST EFI_SCREEN_DESCRIPTOR      *ScreenDimensions, OPTIONAL
  OUT EFI_BROWSER_ACTION_REQUEST       *ActionRequest  OPTIONAL
  )
;

EFI_STATUS
EFIAPI
BrowserCallback (
  IN CONST EFI_FORM_BROWSER2_PROTOCOL  *This,
  IN OUT UINTN                         *ResultsDataSize,
  IN OUT EFI_STRING                    ResultsData,
  IN BOOLEAN                           RetrieveData,
  IN CONST EFI_GUID                    *VariableGuid, OPTIONAL
  IN CONST CHAR16                      *VariableName  OPTIONAL
  )
;

#endif


text:
#ifndef TALK_MEDIA_WEBRTC_CONSTANTS_H_
#define TALK_MEDIA_WEBRTC_CONSTANTS_H_

namespace cricket {

extern const int kVideoMtu;
extern const int kVideoRtpBufferSize;

extern const char kVp8CodecName[];

extern const int kDefaultFramerate;
extern const int kMinVideoBitrate;
extern const int kStartVideoBitrate;
extern const int kMaxVideoBitrate;

extern const int kCpuMonitorPeriodMs;

}  // namespace cricket

#endif  // TALK_MEDIA_WEBRTC_CONSTANTS_H_


text:
using System.Collections.Generic;

namespace Azure.Management.Resources.Models
{
    /// <summary> List of managed applications. </summary>
    public partial class ApplicationListResult
    {
        /// <summary> Initializes a new instance of ApplicationListResult. </summary>
        internal ApplicationListResult()
        {
        }

        /// <summary> Initializes a new instance of ApplicationListResult. </summary>
        /// <param name="value"> The array of managed applications. </param>
        /// <param name="nextLink"> The URL to use for getting the next set of results. </param>
        internal ApplicationListResult(IReadOnlyList<Application> value, string nextLink)
        {
            Value = value;
            NextLink = nextLink;
        }

        /// <summary> The array of managed applications. </summary>
        public IReadOnlyList<Application> Value { get; }
        /// <summary> The URL to use for getting the next set of results. </summary>
        public string NextLink { get; }
    }
}


text:
jdbUnit is a library for database integration testing. It is as simple as [dbUnit](http://dbunit.sourceforge.net/)
 with [unitils-dbunit](http://www.unitils.org/tutorial-database.html), but it:
* supports validation of foreign references in expected data
* is implemented with pure JDBC, no special database handler is required
* loads data from [markdown tables](http://fletcher.github.io/MultiMarkdown-5/tables.html)
* allows to add [custom type](https://github.com/kokorin/jdbUnit/blob/master/src/main/java/com/github/kokorin/jdbunit/table/Type.java)
 if [standard ones](https://github.com/kokorin/jdbUnit/blob/master/src/main/java/com/github/kokorin/jdbunit/table/StandardType.java) aren't sufficient
* obeys [KISS principle](https://people.apache.org/~fhanik/kiss.html), so you won't spend hours in debugging your tests

jdbUnit can be plugged-in via maven central repository:
```xml
<dependency>
    <groupId>com.github.kokorin.jdbunit</groupId>
    <artifactId>jdbunit</artifactId>
    <version>1.1.1</version>
    <scope>test</scope>
</dependency>
```

#Usage

##Table declaration

To declare a table we use markdown header with markdown table. Here is an example of *.md file:

```
Tablename
==================================================================================================
| columnName:ColumnType | tInt:Integer | tLong:Long | tFloat:Float | tDouble:Double | tDate:Date |
|:---------------------:|:------------:|:----------:|:------------:|:--------------:|:----------:|
|     columnValue1      |      42      |    123     |   3.14159    |   2.71         | 2008-12-31 |
|     columnValue2      |      24      |    321     |    12.85     |   451.1        | 2018-11-3  |
```

Table can occur more than once in md-file with different columns:

```
Tablename
========================================
| columnName:ColumnType | tInt:Integer |
|:---------------------:|:------------:|
|     columnValue1      |      42      |
|     columnValue2      |      24      |

Tablename
===========================================================
| tLong:Long | tFloat:Float | tDouble:Double | tDate:Date |
|:----------:|:------------:|:--------------:|:----------:|
|    123     |   3.14159    |   2.71         | 2008-12-31 |
|    321     |    12.85     |   451.1        | 2018-11-30  |
```

It's possible to specify empty table:
```
Tablename
==========
```

##Data sets

Testing is done with special jUnit4 Rule (`JdbUnitRule`) and two annotations (`@DataSet` and `@ExpectedDataSet`).
Annotations work the same as in [unitils-dbunit](http://www.unitils.org/tutorial-database.html#Loading_test_data_sets):
`@DataSet` can be put on Class-level or Method-level, and it specifies data to load *before* test. `@ExpectedDataSet`
 can be put only on Method-level.

 Default annotation values are the next:
 * Class-level `@DataSet` defaults to ClassName.md
 * Method-level `@DataSet` defaults to ClassName.methodName.md
 * `@ExpectedDataSet` defaults to ClassName.methodName.result.md

##Handling references

jdbUnit allows to check that a reference from one new record (SUser_SRole)  was correctly set to another new record (SUser or SRole).
For that you have to specify value Captor in the form of `:name:` and value Reference in the form of `=name=`.

Here is an example of reference usage:

Before.md
```
SUser
===============================================
| id:Integer | login:String | password:String |
|:----------:|:------------:|:---------------:|
|     1      |   admin      |      admin      |

SRole
============================
| id:Integer | name:String |
|:----------:|:-----------:|
|     1      | ROLE_ADMIN  |

SUser_SRole
=====================================
| user_id:Integer | role_id:Integer |
|:---------------:|:---------------:|
|        1        |       1         |
```

Expected.md
```
SUser
===============================================
| id:Integer | login:String | password:String |
|:----------:|:------------:|:---------------:|
|     1      |   admin      |      admin      |
|    :X:     |    test      |       test      |

SRole
============================
| id:Integer | name:String |
|:----------:|:-----------:|
|     1      | ROLE_ADMIN  |
|    :Z:     | ROLE_TEST   |

SUser_SRole
=====================================
| user_id:Integer | role_id:Integer |
|:---------------:|:---------------:|
|        1        |       1         |
|       =X=       |      =Z=        |
```

##Test example

Here is an example of UserDao test class:
```java
@DataSet("Before.md")
public class UserDaoIT {
    private static Connection connection;
    private static EntityManager em;
    private final UserDao userDao = new UserDao();
    @Rule
    public final JdbUnitRule rule = new JdbUnitRule(connection);

    @BeforeClass
    public static void setUpClass() throws Exception {
        connection = DriverManager.getConnection("jdbc:h2:mem:test");
        em = Persistence.createEntityManagerFactory("PersistenceUnitName").createEntityManager();
    }

    @Before
    public static void setUp() throws Exception {
        userDao.entityManager = em;
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
        connection.close();
    }

    @Test
    public void read() throws Exception {
        User actual = userDao.read(1);

        User expected = new User();
        expected.setId(1);
        expected.setUsername("admin");
        expected.setPassword("admin");
        //fill properties of expected user

        ReflectionAssert.assertReflectionEquals(expected, actual);
    }

    @Test
    @ExpectedDataSet
    public void create() throws Exception {
        User user = new User();
        user.setUsername("test");
        user.setPassword("test");
        Role role = new Role();
        role.setId(1);

        EntityTransaction et = em.getTransaction();
        et.begin();
        user = userDao.create(user);
        assertNotEquals(user.getId(), 0);
        et.commit();
    }
}

```


text:
using namespace std;

enum game_states
{
	GAME_STOP,
	GAME_RUNNING,
	GAME_PAUSED,
	GAME_NEXT_FRAME
};

class Application
{
public:

	Application();
	~Application();

	bool Init();
	update_status Update();
	bool CleanUp();
	void SaveBeforeClosing();

	void OpenURL(const char* url);
	void SetMaxFPS(int max_fps);
	int GetFPS();

	bool ChangeGameState(game_states new_state);
	bool IsGameRunning()const;
	bool IsGamePaused()const;
private:

	void AddModule(Module* mod);
	void PrepareUpdate();
	void FinishUpdate();

	//Game States
	void StopGame();
	void RunGame();
	void PauseGame();

public:
	ModuleWindow* window;
	ModuleInput* input;
	ModuleAudio* audio;
	ModuleSceneIntro* scene_intro;
	ModuleRenderer3D* renderer3D;
	ModuleCamera3D* camera;
	ModulePhysics3D* physics;
	ModuleFileSystem* file_system;
	ModuleGOManager* go_manager;
	ModuleResourceManager* resource_manager;
	ModuleLighting* lighting;
	Editor* editor;
	Random* rnd = nullptr;
private:

	list<Module*> list_modules;
	int fps = 60;
	int capped_ms = -1;

	game_states game_state = GAME_STOP;
};

extern Application* App;

#endif


text:
Pattern: Possible variable misspelling

Issue: -

## Description

You reference a variable that is not assigned in the script, which has a name remarkably similar to one that is explicitly assigned. You should verify that the variable name is spelled correctly.

Note: This error only triggers for environment variables (all uppercase variables), and only when they have names similar to something assigned in the script. If the variable is script-local, it should by convention have a lowercase name.

Example of **incorrect** code:

```sh
MY_VARIABLE="hello world"
echo "$SOMEVARIABLE"
```

Example of **correct** code:

```sh
MY_VARIABLE="hello world"
echo "$MY_VARIABLE"
```

## Exceptions

If you've double checked and ensured that you did not intend to reference the specified variable, you can disable this message with a directive. The message will also not appear for guarded references like `${ENVVAR:-default}` or `${ENVVAR:?Unset error message here}`.

## Further Reading

* [ShellCheck - SC2153](https://github.com/koalaman/shellcheck/wiki/SC2153)