text:
require 'thrift'
require 'tim_types'

module ITim
  class Client
    include ::Thrift::Client

    def timStream(param)
      send_timStream(param)
    end

    def send_timStream(param)
      send_oneway_message('timStream', TimStream_args, :param => param)
    end
    def timStarttls()
      send_timStarttls()
    end

    def send_timStarttls()
      send_oneway_message('timStarttls', TimStarttls_args)
    end
    def timLogin(tid, pwd)
      send_timLogin(tid, pwd)
    end

    def send_timLogin(tid, pwd)
      send_oneway_message('timLogin', TimLogin_args, :tid => tid, :pwd => pwd)
    end
    def timAck(ab)
      send_timAck(ab)
    end

    def send_timAck(ab)
      send_oneway_message('timAck', TimAck_args, :ab => ab)
    end
    def timPresence(pbean)
      send_timPresence(pbean)
    end

    def send_timPresence(pbean)
      send_oneway_message('timPresence', TimPresence_args, :pbean => pbean)
    end
    def timMessage(mbean)
      send_timMessage(mbean)
    end

    def send_timMessage(mbean)
      send_oneway_message('timMessage', TimMessage_args, :mbean => mbean)
    end
    def timPing(threadId)
      send_timPing(threadId)
    end

    def send_timPing(threadId)
      send_oneway_message('timPing', TimPing_args, :threadId => threadId)
    end
    def timError(e)
      send_timError(e)
    end

    def send_timError(e)
      send_oneway_message('timError', TimError_args, :e => e)
    end
    def timLogout()
      send_timLogout()
    end

    def send_timLogout()
      send_oneway_message('timLogout', TimLogout_args)
    end
    def timRegist(tid, auth)
      send_timRegist(tid, auth)
    end

    def send_timRegist(tid, auth)
      send_oneway_message('timRegist', TimRegist_args, :tid => tid, :auth => auth)
    end
    def timRoser(roster)
      send_timRoser(roster)
    end

    def send_timRoser(roster)
      send_oneway_message('timRoser', TimRoser_args, :roster => roster)
    end
    def timMessageList(mbeanList)
      send_timMessageList(mbeanList)
    end

    def send_timMessageList(mbeanList)
      send_oneway_message('timMessageList', TimMessageList_args, :mbeanList => mbeanList)
    end
    def timPresenceList(pbeanList)
      send_timPresenceList(pbeanList)
    end

    def send_timPresenceList(pbeanList)
      send_oneway_message('timPresenceList', TimPresenceList_args, :pbeanList => pbeanList)
    end
    def timMessageIq(timMsgIq, iqType)
      send_timMessageIq(timMsgIq, iqType)
    end

    def send_timMessageIq(timMsgIq, iqType)
      send_oneway_message('timMessageIq', TimMessageIq_args, :timMsgIq => timMsgIq, :iqType => iqType)
    end
    def timMessageResult(mbean)
      send_timMessageResult(mbean)
    end

    def send_timMessageResult(mbean)
      send_oneway_message('timMessageResult', TimMessageResult_args, :mbean => mbean)
    end
    def timProperty(tpb)
      send_timProperty(tpb)
    end

    def send_timProperty(tpb)
      send_oneway_message('timProperty', TimProperty_args, :tpb => tpb)
    end
    def timRemoteUserAuth(tid, pwd, auth)
      send_timRemoteUserAuth(tid, pwd, auth)
      return recv_timRemoteUserAuth()
    end

    def send_timRemoteUserAuth(tid, pwd, auth)
      send_message('timRemoteUserAuth', TimRemoteUserAuth_args, :tid => tid, :pwd => pwd, :auth => auth)
    end

    def recv_timRemoteUserAuth()
      result = receive_message(TimRemoteUserAuth_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timRemoteUserAuth failed: unknown result')
    end

    def timRemoteUserGet(tid, auth)
      send_timRemoteUserGet(tid, auth)
      return recv_timRemoteUserGet()
    end

    def send_timRemoteUserGet(tid, auth)
      send_message('timRemoteUserGet', TimRemoteUserGet_args, :tid => tid, :auth => auth)
    end

    def recv_timRemoteUserGet()
      result = receive_message(TimRemoteUserGet_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timRemoteUserGet failed: unknown result')
    end

    def timRemoteUserEdit(tid, ub, auth)
      send_timRemoteUserEdit(tid, ub, auth)
      return recv_timRemoteUserEdit()
    end

    def send_timRemoteUserEdit(tid, ub, auth)
      send_message('timRemoteUserEdit', TimRemoteUserEdit_args, :tid => tid, :ub => ub, :auth => auth)
    end

    def recv_timRemoteUserEdit()
      result = receive_message(TimRemoteUserEdit_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timRemoteUserEdit failed: unknown result')
    end

    def timResponsePresence(pbean, auth)
      send_timResponsePresence(pbean, auth)
      return recv_timResponsePresence()
    end

    def send_timResponsePresence(pbean, auth)
      send_message('timResponsePresence', TimResponsePresence_args, :pbean => pbean, :auth => auth)
    end

    def recv_timResponsePresence()
      result = receive_message(TimResponsePresence_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timResponsePresence failed: unknown result')
    end

    def timResponseMessage(mbean, auth)
      send_timResponseMessage(mbean, auth)
      return recv_timResponseMessage()
    end

    def send_timResponseMessage(mbean, auth)
      send_message('timResponseMessage', TimResponseMessage_args, :mbean => mbean, :auth => auth)
    end

    def recv_timResponseMessage()
      result = receive_message(TimResponseMessage_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timResponseMessage failed: unknown result')
    end

    def timResponseMessageIq(timMsgIq, iqType, auth)
      send_timResponseMessageIq(timMsgIq, iqType, auth)
      return recv_timResponseMessageIq()
    end

    def send_timResponseMessageIq(timMsgIq, iqType, auth)
      send_message('timResponseMessageIq', TimResponseMessageIq_args, :timMsgIq => timMsgIq, :iqType => iqType, :auth => auth)
    end

    def recv_timResponseMessageIq()
      result = receive_message(TimResponseMessageIq_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timResponseMessageIq failed: unknown result')
    end

    def timResponsePresenceList(pbeanList, auth)
      send_timResponsePresenceList(pbeanList, auth)
      return recv_timResponsePresenceList()
    end

    def send_timResponsePresenceList(pbeanList, auth)
      send_message('timResponsePresenceList', TimResponsePresenceList_args, :pbeanList => pbeanList, :auth => auth)
    end

    def recv_timResponsePresenceList()
      result = receive_message(TimResponsePresenceList_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timResponsePresenceList failed: unknown result')
    end

    def timResponseMessageList(mbeanList, auth)
      send_timResponseMessageList(mbeanList, auth)
      return recv_timResponseMessageList()
    end

    def send_timResponseMessageList(mbeanList, auth)
      send_message('timResponseMessageList', TimResponseMessageList_args, :mbeanList => mbeanList, :auth => auth)
    end

    def recv_timResponseMessageList()
      result = receive_message(TimResponseMessageList_result)
      return result.success unless result.success.nil?
      raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'timResponseMessageList failed: unknown result')
    end

  end

  class Processor
    include ::Thrift::Processor

    def process_timStream(seqid, iprot, oprot)
      args = read_args(iprot, TimStream_args)
      @handler.timStream(args.param)
      return
    end

    def process_timStarttls(seqid, iprot, oprot)
      args = read_args(iprot, TimStarttls_args)
      @handler.timStarttls()
      return
    end

    def process_timLogin(seqid, iprot, oprot)
      args = read_args(iprot, TimLogin_args)
      @handler.timLogin(args.tid, args.pwd)
      return
    end

    def process_timAck(seqid, iprot, oprot)
      args = read_args(iprot, TimAck_args)
      @handler.timAck(args.ab)
      return
    end

    def process_timPresence(seqid, iprot, oprot)
      args = read_args(iprot, TimPresence_args)
      @handler.timPresence(args.pbean)
      return
    end

    def process_timMessage(seqid, iprot, oprot)
      args = read_args(iprot, TimMessage_args)
      @handler.timMessage(args.mbean)
      return
    end

    def process_timPing(seqid, iprot, oprot)
      args = read_args(iprot, TimPing_args)
      @handler.timPing(args.threadId)
      return
    end

    def process_timError(seqid, iprot, oprot)
      args = read_args(iprot, TimError_args)
      @handler.timError(args.e)
      return
    end

    def process_timLogout(seqid, iprot, oprot)
      args = read_args(iprot, TimLogout_args)
      @handler.timLogout()
      return
    end

    def process_timRegist(seqid, iprot, oprot)
      args = read_args(iprot, TimRegist_args)
      @handler.timRegist(args.tid, args.auth)
      return
    end

    def process_timRoser(seqid, iprot, oprot)
      args = read_args(iprot, TimRoser_args)
      @handler.timRoser(args.roster)
      return
    end

    def process_timMessageList(seqid, iprot, oprot)
      args = read_args(iprot, TimMessageList_args)
      @handler.timMessageList(args.mbeanList)
      return
    end

    def process_timPresenceList(seqid, iprot, oprot)
      args = read_args(iprot, TimPresenceList_args)
      @handler.timPresenceList(args.pbeanList)
      return
    end

    def process_timMessageIq(seqid, iprot, oprot)
      args = read_args(iprot, TimMessageIq_args)
      @handler.timMessageIq(args.timMsgIq, args.iqType)
      return
    end

    def process_timMessageResult(seqid, iprot, oprot)
      args = read_args(iprot, TimMessageResult_args)
      @handler.timMessageResult(args.mbean)
      return
    end

    def process_timProperty(seqid, iprot, oprot)
      args = read_args(iprot, TimProperty_args)
      @handler.timProperty(args.tpb)
      return
    end

    def process_timRemoteUserAuth(seqid, iprot, oprot)
      args = read_args(iprot, TimRemoteUserAuth_args)
      result = TimRemoteUserAuth_result.new()
      result.success = @handler.timRemoteUserAuth(args.tid, args.pwd, args.auth)
      write_result(result, oprot, 'timRemoteUserAuth', seqid)
    end

    def process_timRemoteUserGet(seqid, iprot, oprot)
      args = read_args(iprot, TimRemoteUserGet_args)
      result = TimRemoteUserGet_result.new()
      result.success = @handler.timRemoteUserGet(args.tid, args.auth)
      write_result(result, oprot, 'timRemoteUserGet', seqid)
    end

    def process_timRemoteUserEdit(seqid, iprot, oprot)
      args = read_args(iprot, TimRemoteUserEdit_args)
      result = TimRemoteUserEdit_result.new()
      result.success = @handler.timRemoteUserEdit(args.tid, args.ub, args.auth)
      write_result(result, oprot, 'timRemoteUserEdit', seqid)
    end

    def process_timResponsePresence(seqid, iprot, oprot)
      args = read_args(iprot, TimResponsePresence_args)
      result = TimResponsePresence_result.new()
      result.success = @handler.timResponsePresence(args.pbean, args.auth)
      write_result(result, oprot, 'timResponsePresence', seqid)
    end

    def process_timResponseMessage(seqid, iprot, oprot)
      args = read_args(iprot, TimResponseMessage_args)
      result = TimResponseMessage_result.new()
      result.success = @handler.timResponseMessage(args.mbean, args.auth)
      write_result(result, oprot, 'timResponseMessage', seqid)
    end

    def process_timResponseMessageIq(seqid, iprot, oprot)
      args = read_args(iprot, TimResponseMessageIq_args)
      result = TimResponseMessageIq_result.new()
      result.success = @handler.timResponseMessageIq(args.timMsgIq, args.iqType, args.auth)
      write_result(result, oprot, 'timResponseMessageIq', seqid)
    end

    def process_timResponsePresenceList(seqid, iprot, oprot)
      args = read_args(iprot, TimResponsePresenceList_args)
      result = TimResponsePresenceList_result.new()
      result.success = @handler.timResponsePresenceList(args.pbeanList, args.auth)
      write_result(result, oprot, 'timResponsePresenceList', seqid)
    end

    def process_timResponseMessageList(seqid, iprot, oprot)
      args = read_args(iprot, TimResponseMessageList_args)
      result = TimResponseMessageList_result.new()
      result.success = @handler.timResponseMessageList(args.mbeanList, args.auth)
      write_result(result, oprot, 'timResponseMessageList', seqid)
    end

  end

  # HELPER FUNCTIONS AND STRUCTURES

  class TimStream_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    PARAM = 1

    FIELDS = {
      PARAM => {:type => ::Thrift::Types::STRUCT, :name => 'param', :class => ::TimParam}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimStream_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimStarttls_args
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimStarttls_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimLogin_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TID = 1
    PWD = 2

    FIELDS = {
      TID => {:type => ::Thrift::Types::STRUCT, :name => 'tid', :class => ::Tid},
      PWD => {:type => ::Thrift::Types::STRING, :name => 'pwd'}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimLogin_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimAck_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    AB = 1

    FIELDS = {
      AB => {:type => ::Thrift::Types::STRUCT, :name => 'ab', :class => ::TimAckBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimAck_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimPresence_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    PBEAN = 1

    FIELDS = {
      PBEAN => {:type => ::Thrift::Types::STRUCT, :name => 'pbean', :class => ::TimPBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimPresence_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessage_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    MBEAN = 1

    FIELDS = {
      MBEAN => {:type => ::Thrift::Types::STRUCT, :name => 'mbean', :class => ::TimMBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessage_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimPing_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    THREADID = 1

    FIELDS = {
      THREADID => {:type => ::Thrift::Types::STRING, :name => 'threadId'}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimPing_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimError_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    E = 1

    FIELDS = {
      E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::TimError}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimError_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimLogout_args
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimLogout_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRegist_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TID = 1
    AUTH = 2

    FIELDS = {
      TID => {:type => ::Thrift::Types::STRUCT, :name => 'tid', :class => ::Tid},
      AUTH => {:type => ::Thrift::Types::STRING, :name => 'auth'}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRegist_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRoser_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    ROSTER = 1

    FIELDS = {
      ROSTER => {:type => ::Thrift::Types::STRUCT, :name => 'roster', :class => ::TimRoster}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRoser_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessageList_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    MBEANLIST = 1

    FIELDS = {
      MBEANLIST => {:type => ::Thrift::Types::STRUCT, :name => 'mbeanList', :class => ::TimMBeanList}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessageList_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimPresenceList_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    PBEANLIST = 1

    FIELDS = {
      PBEANLIST => {:type => ::Thrift::Types::STRUCT, :name => 'pbeanList', :class => ::TimPBeanList}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimPresenceList_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessageIq_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TIMMSGIQ = 1
    IQTYPE = 2

    FIELDS = {
      TIMMSGIQ => {:type => ::Thrift::Types::STRUCT, :name => 'timMsgIq', :class => ::TimMessageIq},
      IQTYPE => {:type => ::Thrift::Types::STRING, :name => 'iqType'}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessageIq_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessageResult_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    MBEAN = 1

    FIELDS = {
      MBEAN => {:type => ::Thrift::Types::STRUCT, :name => 'mbean', :class => ::TimMBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimMessageResult_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimProperty_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TPB = 1

    FIELDS = {
      TPB => {:type => ::Thrift::Types::STRUCT, :name => 'tpb', :class => ::TimPropertyBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimProperty_result
    include ::Thrift::Struct, ::Thrift::Struct_Union

    FIELDS = {

    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRemoteUserAuth_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TID = 1
    PWD = 2
    AUTH = 3

    FIELDS = {
      TID => {:type => ::Thrift::Types::STRUCT, :name => 'tid', :class => ::Tid},
      PWD => {:type => ::Thrift::Types::STRING, :name => 'pwd'},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRemoteUserAuth_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimRemoteUserBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRemoteUserGet_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TID = 1
    AUTH = 2

    FIELDS = {
      TID => {:type => ::Thrift::Types::STRUCT, :name => 'tid', :class => ::Tid},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRemoteUserGet_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimRemoteUserBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRemoteUserEdit_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TID = 1
    UB = 2
    AUTH = 3

    FIELDS = {
      TID => {:type => ::Thrift::Types::STRUCT, :name => 'tid', :class => ::Tid},
      UB => {:type => ::Thrift::Types::STRUCT, :name => 'ub', :class => ::TimUserBean},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimRemoteUserEdit_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimRemoteUserBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponsePresence_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    PBEAN = 1
    AUTH = 2

    FIELDS = {
      PBEAN => {:type => ::Thrift::Types::STRUCT, :name => 'pbean', :class => ::TimPBean},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponsePresence_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimResponseBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponseMessage_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    MBEAN = 1
    AUTH = 2

    FIELDS = {
      MBEAN => {:type => ::Thrift::Types::STRUCT, :name => 'mbean', :class => ::TimMBean},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponseMessage_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimResponseBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponseMessageIq_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    TIMMSGIQ = 1
    IQTYPE = 2
    AUTH = 3

    FIELDS = {
      TIMMSGIQ => {:type => ::Thrift::Types::STRUCT, :name => 'timMsgIq', :class => ::TimMessageIq},
      IQTYPE => {:type => ::Thrift::Types::STRING, :name => 'iqType'},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponseMessageIq_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimMBeanList}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponsePresenceList_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    PBEANLIST = 1
    AUTH = 2

    FIELDS = {
      PBEANLIST => {:type => ::Thrift::Types::STRUCT, :name => 'pbeanList', :class => ::TimPBeanList},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponsePresenceList_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimResponseBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponseMessageList_args
    include ::Thrift::Struct, ::Thrift::Struct_Union
    MBEANLIST = 1
    AUTH = 2

    FIELDS = {
      MBEANLIST => {:type => ::Thrift::Types::STRUCT, :name => 'mbeanList', :class => ::TimMBeanList},
      AUTH => {:type => ::Thrift::Types::STRUCT, :name => 'auth', :class => ::TimAuth}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

  class TimResponseMessageList_result
    include ::Thrift::Struct, ::Thrift::Struct_Union
    SUCCESS = 0

    FIELDS = {
      SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TimResponseBean}
    }

    def struct_fields; FIELDS; end

    def validate
    end

    ::Thrift::Struct.generate_accessors self
  end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>Qt 4.8: Q3Cache Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />

  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />

      Home

    Qt Reference Documentation

Qt HOME

DEV

          DOC

BLOG

Qt 4.8

ALL VERSIONS

API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

Examples

Examples

Tutorials

Demos

QML Examples

          Search index:

          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />

 Close

All | API | Articles | Examples

 results:

            </fieldset>
          </form>

            API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

            Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

            Examples

Examples

Tutorials

Demos

QML Examples

Home

Modules

Qt3SupportLight

Q3Cache

A

A

A

                Print

Contents

Public Functions

Detailed Description

Q3Cache Class Reference

The Q3Cache class is a template class that provides a cache based on QString keys. More...

 #include <Q3Cache>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherits: Q3PtrCollection.

List of all members, including inherited members

Public Functions

 	Q3Cache ( int maxCost = 100, int size = 17, bool caseSensitive = true )

 	~Q3Cache ()

 type * 	find ( const QString & k, bool ref = true ) const

 bool 	insert ( const QString & k, const type * d, int c = 1, int p = 0 )

 bool 	isEmpty () const

 int 	maxCost () const

 bool 	remove ( const QString & k )

 void 	setMaxCost ( int m )

 uint 	size () const

 void 	statistics () const

 type * 	take ( const QString & k )

 int 	totalCost () const

 type * 	operator[] ( const QString & k ) const

Reimplemented Public Functions

 virtual void 	clear ()

 virtual uint 	count () const

4 public functions inherited from Q3PtrCollection

Additional Inherited Members

2 protected functions inherited from Q3PtrCollection

Detailed Description

The Q3Cache class is a template class that provides a cache based on QString keys.

A cache is a least recently used (LRU) list of cache items. Each cache item has a key and a certain cost. The sum of item costs, totalCost(), never exceeds the maximum cache cost, maxCost(). If inserting a new item would cause the total cost to exceed the maximum cost, the least recently used items in the cache are removed.

Q3Cache is a template class. Q3Cache<X> defines a cache that operates on pointers to X, or X*.

Apart from insert(), by far the most important function is find() (which also exists as operator[]()). This function looks up an item, returns it, and by default marks it as being the most recently used item.

There are also methods to remove() or take() an object from the cache. Calling setAutoDelete(TRUE) for a cache tells it to delete items that are removed. The default is to not delete items when they are removed (i.e., remove() and take() are equivalent).

When inserting an item into the cache, only the pointer is copied, not the item itself. This is called a shallow copy. It is possible to make the cache copy all of the item's data (known as a deep copy) when an item is inserted. insert() calls the virtual function Q3PtrCollection::newItem() for the item to be inserted. Inherit a cache and reimplement newItem() if you want deep copies.

When removing a cache item, the virtual function Q3PtrCollection::deleteItem() is called. The default implementation deletes the item if auto-deletion is enabled, and does nothing otherwise.

There is a Q3CacheIterator that can be used to traverse the items in the cache in arbitrary order.

In Q3Cache, the cache items are accessed via QString keys, which are Unicode strings. If you want to use non-Unicode, plain 8-bit <tt>char*</tt> keys, use the Q3AsciiCache template. A Q3Cache has the same performance as a Q3AsciiCache.

See also Q3CacheIterator, Q3AsciiCache, and Q3IntCache.

Member Function Documentation

Q3Cache::Q3Cache ( int maxCost = 100, int size = 17, bool caseSensitive = true )

Constructs a cache whose contents will never have a total cost greater than maxCost and which is expected to contain less than size items.

size is actually the size of an internal hash array; it's usually best to make it a prime number and at least 50% bigger than the largest expected number of items in the cache.

Each inserted item has an associated cost. When inserting a new item, if the total cost of all items in the cache will exceed maxCost, the cache will start throwing out the older (least recently used) items until there is enough room for the new item to be inserted.

If caseSensitive is TRUE (the default), the cache keys are case sensitive; if it is FALSE, they are case-insensitive. Case-insensitive comparison considers all Unicode letters.

Q3Cache::~Q3Cache ()

Removes all items from the cache and destroys it. All iterators that access this cache will be reset.

void Q3Cache::clear ()<tt> [virtual]</tt>

Reimplemented from Q3PtrCollection::clear().

Removes all items from the cache and deletes them if auto-deletion has been enabled.

All cache iterators that operate this on cache are reset.

See also remove() and take().

uint Q3Cache::count () const<tt> [virtual]</tt>

Reimplemented from Q3PtrCollection::count().

Returns the number of items in the cache.

See also totalCost().

type * Q3Cache::find ( const QString & k, bool ref = true ) const

Returns the item associated with key k, or 0 if the key does not exist in the cache. If ref is TRUE (the default), the item is moved to the front of the least recently used list.

If there are two or more items with equal keys, the one that was inserted last is returned.

bool Q3Cache::insert ( const QString & k, const type * d, int c = 1, int p = 0 )

Inserts the item d into the cache with key k and associated cost, c. Returns TRUE if it is successfully inserted; otherwise returns FALSE.

The cache's size is limited, and if the total cost is too high, Q3Cache will remove old, least recently used items until there is room for this new item.

The parameter p is internal and should be left at the default value (0).

Warning: If this function returns FALSE (which could happen, e.g. if the cost of this item alone exceeds maxCost()) you must delete d yourself. Additionally, be very careful about using d after calling this function because any other insertions into the cache, from anywhere in the application or within Qt itself, could cause the object to be discarded from the cache and the pointer to become invalid.

bool Q3Cache::isEmpty () const

Returns TRUE if the cache is empty; otherwise returns FALSE.

int Q3Cache::maxCost () const

Returns the maximum allowed total cost of the cache.

See also setMaxCost() and totalCost().

bool Q3Cache::remove ( const QString & k )

Removes the item associated with k, and returns TRUE if the item was present in the cache; otherwise returns FALSE.

The item is deleted if auto-deletion has been enabled, i.e., if you have called setAutoDelete(TRUE).

If there are two or more items with equal keys, the one that was inserted last is removed.

All iterators that refer to the removed item are set to point to the next item in the cache's traversal order.

See also take() and clear().

void Q3Cache::setMaxCost ( int m )

Sets the maximum allowed total cost of the cache to m. If the current total cost is greater than m, some items are deleted immediately.

See also maxCost() and totalCost().

uint Q3Cache::size () const

Returns the size of the hash array used to implement the cache. This should be a bit bigger than count() is likely to be.

void Q3Cache::statistics () const

A debug-only utility function. Prints out cache usage, hit/miss, and distribution information using qDebug(). This function does nothing in the release library.

type * Q3Cache::take ( const QString & k )

Takes the item associated with k out of the cache without deleting it, and returns a pointer to the item taken out, or 0 if the key does not exist in the cache.

If there are two or more items with equal keys, the one that was inserted last is taken.

All iterators that refer to the taken item are set to point to the next item in the cache's traversal order.

See also remove() and clear().

int Q3Cache::totalCost () const

Returns the total cost of the items in the cache. This is an integer in the range 0 to maxCost().

See also setMaxCost().

type * Q3Cache::operator[] ( const QString & k ) const

Returns the item associated with key k, or 0 if k does not exist in the cache, and moves the item to the front of the least recently used list.

If there are two or more items with equal keys, the one that was inserted last is returned.

This is the same as find( k, TRUE ).

See also find().

      <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.

      The documentation provided herein is licensed under the terms of the
      GNU Free Documentation
      License version 1.3 as published by the Free Software Foundation.

      Documentation sources may be obtained from
      www.qt-project.org.

      Digia, Qt and their respective logos are trademarks of Digia Plc
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. Privacy Policy

redpajama_set_name: RedPajamaGithub


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v11/enums/offline_user_data_job_failure_reason.proto

namespace Google\Ads\GoogleAds\V11\Enums;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Container for enum describing reasons why an offline user data job
 * failed to be processed.
 *
 * Generated from protobuf message google.ads.googleads.v11.enums.OfflineUserDataJobFailureReasonEnum
 */
class OfflineUserDataJobFailureReasonEnum extends \Google\Protobuf\Internal\Message
{

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V11\Enums\OfflineUserDataJobFailureReason::initOnce();
        parent::__construct($data);
    }

}


text:
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const Cc = Components.classes;
const Ci = Components.interfaces;

var XPCOMCoreCommandLineHandler = function() {
  if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
  this.wrappedJSObject = this;
  arguments.callee.__singletonInstance__ = this;
};

XPCOMCoreCommandLineHandler.prototype = {
  args: [],
  classDescription: "XPCOMCore Command Line Handler",
  contractID: "@conflagrationjs.org/xpcomcore/generic-command-line-handler-clh;1",
  classID: Components.ID("{b5730df0-b859-11de-8a39-0800200c9a66}"),
  helpInfo: "",
  QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsICommandLineHandler]),
  _xpcom_categories: [{category: "command-line-handler", entry: "a-xpcomcore"}],

  handle: function(cmdLine) {
    for (var i = 0; i < cmdLine.length; i++) { this.args.push(cmdLine.getArgument(i)); }
  }

};

NSGetModule = function(compMgr, fileSpec) {
  return XPCOMUtils.generateModule([XPCOMCoreCommandLineHandler]);
};


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using RemindMe.Other_classes;

namespace RemindMe
{
    public partial class RunningTimer : UserControl
    {
        //The usercontrol TimerItem
        TimerItem tmr;
        //The time of the running TimerItem
        int seconds, minutes, hours;
        //The time we will display, seperated with : and numbers below 10 will become 2 digits, example: 00:04:33
        string secondText, minuteText, hourText;

        private void btnAddMinute_Click(object sender, EventArgs e)
        {
            tmrTickDownTime.Stop();

            tmr.SecondsRemaining += 60;
            SetTimeRemainingTextLabel();

            tmrTickDownTime.Start();
        }
        private void btnSubtractMinute_Click(object sender, EventArgs e)
        {
            tmrTickDownTime.Stop();

            if (tmr.SecondsRemaining >= 60)
                tmr.SecondsRemaining -= 60;
            else
                tmr.SecondsRemaining = 0;

            SetTimeRemainingTextLabel();

            tmrTickDownTime.Start();
        }
        private void SetTimeRemainingTextLabel()
        {
            TimeSpan time = TimeSpan.FromSeconds((double)tmr.SecondsRemaining);
            seconds = time.Seconds;
            minutes = time.Minutes;
            hours = time.Hours;

            secondText = "" + seconds;
            minuteText = "" + minutes;
            hourText = "" + hours;

            lblTimerTime.Text = TimerText;
        }

        /// <summary>
        /// Creates a new RunningTimer usercontrol displaying a currently running timer
        /// </summary>
        /// <param name="tmr">The Timer that will be displayed</param>
        public RunningTimer(TimerItem tmr)
        {
            InitializeComponent();
            this.tmr = tmr;
            lblTimerName.MaximumSize = new Size(162, lblTimerName.Height);
        }

        private void RunningTimer_Load(object sender, EventArgs e)
        {
            lblTimerName.Text = tmr.TimerText;
            if (string.IsNullOrEmpty(lblTimerName.Text))
                lblTimerName.Text = "( No name set )";

            TimeSpan time = TimeSpan.FromSeconds((double)tmr.SecondsRemaining);

            seconds = time.Seconds;
            minutes = time.Minutes;
            hours = time.Hours;

            //Text that will show, example: 00:04:33
            secondText = "" + seconds;
            minuteText = "" + minutes;
            hourText = "" + hours;

            lblTimerTime.Text = TimerText;
            tmrTickDownTime.Start();
        }

        private void tmrTickDownTime_Tick(object sender, EventArgs e)
        {
            if (seconds > 0)
                seconds--;
            else
            {
                if (minutes > 0)
                {
                    minutes--;
                    minutes = 59;
                }
                else
                {
                    if (hours > 0)
                    {
                        hours--;
                        hours = 59;
                        hours = 59;
                    }//Else probably no time left.

                }
            }

            lblTimerTime.Text = TimerText;

            if (seconds == 0 && minutes == 0 && hours == 0)
            {
                tmrTickDownTime.Stop();
                TimerCheck.Instance.PlaceTimers(); //Re-position
            }
        }

        private string TimerText
        {
            get
            {
                if (seconds < 10)
                    secondText = "0" + seconds;
                else
                    secondText = "" + seconds;

                if (minutes < 10)
                    minuteText = "0" + minutes;
                else
                    minuteText = "" + minutes;

                if (hours < 10)
                    hourText = "0" + hours;
                else
                    hourText = "" + hours;

                return hourText + ":" + minuteText + ":" + secondText; ;
            }
        }
    }
}


text:
<?php

/**
 * @author     Artur Rozek
 * @version    1.0.0
 */
class sfWidgetFormDateJQueryUI extends sfWidgetForm
{
  /**
   * Configures the current widget.
   *
   * Available options:
   *
   * @param string   culture           Sets culture for the widget
   * @param boolean  change_month      If date chooser attached to widget has month select dropdown, defaults to false
   * @param boolean  change_year       If date chooser attached to widget has year select dropdown, defaults to false
   * @param integer  number_of_months  Number of months visible in date chooser, defaults to 1
   * @param boolean  show_button_panel If date chooser shows panel with 'today' and 'done' buttons, defaults to false
   * @param string   theme             css theme for jquery ui interface, defaults to '/sfJQueryUIPlugin/css/ui-lightness/jquery-ui.css'
   *
   * @see sfWidgetForm
   */
  protected function configure($options = array(), $attributes = array())
  {

    if(sfContext::hasInstance())
     $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture());
    else
     $this->addOption('culture', "en");
    $this->addOption('change_month',  false);
    $this->addOption('format',  'Y-m-d H:m:s');
    $this->addOption('change_year',  false);
    $this->addOption('number_of_months', 1);
    $this->addOption('show_button_panel',  false);
    $this->addOption('theme', '/sfJQueryUIPlugin/css/ui-lightness/jquery-ui.css');

    parent::configure($options, $attributes);
  }

  /**
   * @param  string $name        The element name
   * @param  string $value       The date displayed in this widget
   * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
   * @param  array  $errors      An array of errors for the field
   *
   * @return string An HTML tag string
   *
   * @see sfWidgetForm
   */
  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
    $attributes = $this->getAttributes();

    $input = new sfWidgetFormInput(array(), $attributes);
    $html = $input->render($name,  date($this->getOption('format'),strtotime($value)));

    $id = $input->generateId($name);
    $culture = $this->getOption('culture');
    $cm = $this->getOption("change_month") ? "true" : "false";
    $cy = $this->getOption("change_year") ? "true" : "false";
    $nom = $this->getOption("number_of_months");
    $sbp = $this->getOption("show_button_panel") ? "true" : "false";

    if ($culture!='en')
    {
    $html .= <<<EOHTML
<script type="text/javascript">
	$(function() {
    var params = $.datepicker.regional['$culture'];
    params.changeMonth = $cm;
    params.changeYear = $cy;
    params.numberOfMonths = $nom;
    params.showButtonPanel = $sbp;
    $("#$id").datepicker(params);
	});
</script>
EOHTML;
    }
    else
    {
    $html .= <<<EOHTML
<script type="text/javascript">
	$(function() {
    var params = {
    changeMonth : $cm,
    changeYear : $cy,
    numberOfMonths : $nom,
    showButtonPanel : $sbp };
    $("#$id").datepicker(params);
	});
</script>
EOHTML;
    }

    return $html;
  }

  /*
   *
   * Gets the stylesheet paths associated with the widget.
   *
   * @return array An array of stylesheet paths
   */
  public function getStylesheets()
  {
    $theme = $this->getOption('theme');
    return array($theme => 'screen');
  }

  /**
   * Gets the JavaScript paths associated with the widget.
   *
   * @return array An array of JavaScript paths
   */
  public function getJavaScripts()
  {
    //check if jquery is loaded
    $js = array();
    if (sfConfig::has('sf_jquery_web_dir') && sfConfig::has('sf_jquery_core'))
      $js[] = sfConfig::get('sf_jquery_web_dir').'/js/'.sfConfig::get('sf_jquery_core');
    else
      $js[] = '/sfJQueryUIPlugin/js/jquery-1.3.1.min.js';

    $js[] = '/sfJQueryUIPlugin/js/jquery-ui.js';

    $culture = $this->getOption('culture');
    if ($culture!='en')
      $js[] = '/sfJQueryUIPlugin/js/i18n/ui.datepicker-'.$culture.".js";

    return $js;
  }

}


text:
"use strict";

var path = require("path"),
    expect = require("expect.js"),
    request = require("supertest");

var runTestServer = require("../setup/testServerEmbeddable.js");
var createFakePackageJSON = require("../helpers/createFakePackageJSON.js"),
    removeFakePackageJSON = require("../helpers/removeFakePackageJSON.js");

describe("httpTransport", function () {

    before(function (done) {
        createFakePackageJSON(done);
    });

    after(function (done) {
        removeFakePackageJSON(done);
    });

    describe("#Basic Requesting", function () {

        var app;

        before(function () {
            app = runTestServer({
                "server:appDir" : path.resolve(__dirname, "../setup/testApp")
            });
        });

        describe("## INDEX.html, Landing-Request", function () {

            it("should return the index-page on '/' request", function (done) {
                this.timeout(100000);
                request(app)
                    .get('/')
                    .expect(200, /<!-- index.html -->/, done);
            });

            it("should deliver the index-page on a different init-page request", function (done) {
                this.timeout(100000);
                request(app)
                    .get('/blog')
                    .expect(200, /<!-- index.html -->/, done);
            });

            it("should return 'not found' if a non existent file was requested under /assets", function (done) {
                this.timeout(100000);
                request(app)
                    .get('/assets/doesNotExist')
                    .expect(404, done);
            });

            it("should return 'not found' if a non existent file was requested under /", function (done) {
                this.timeout(100000);
                request(app)
                    .get('/assets/doesNotExist.png')
                    .expect(404, done);
            });
        });

        describe("## /app.js", function () {
            it("should return the bootstrap-file", function (done) {
                this.timeout(100000);
                request(app)
                    .get('/app.js')
                    .expect(200, done);
            });
        });

        describe("#onServiceRequest", function () {
            it("should return an error if no schema was defined for routes (sanitize)", function (done) {
                this.timeout(100000);
                request(app)
                    .post("/services/myNonExistentService/")
                    .type("application/json")
                    .send({ da : "ta" })
                    .expect(500, /No shared-schema defined/, done);
            });

            it("should return an error if no service is defined for service-route", function (done) {
                this.timeout(100000);
                request(app)
                    .post("/services/user/")
                    .type("application/json")
                    .send({ title : "test" })
                    .expect(404, /No service found/, done);
            });

            it("should return a service-response for a defined service", function (done) {
                this.timeout(100000);
                request(app)
                    .post("/services/blog/")
                    .type("application/json")
                    .send({ title : "test" })
                    .expect(200, /"status":"success"/, done);
            });

            it("should block the request if the content-type is wrong", function (done) {
                this.timeout(100000);
                request(app)
                    .post("/services/myNonExistentService/")
                    .set('Content-Type', 'text/plain')
                    .expect(415, done);
            });
        });

        describe("#onValidatorRequest", function () {
            it("should hand the request on to the validator-route with POST request", function (done) {
                this.timeout(100000);
                request(app)
                    .post("/validators/myNonExistentValidator/")
                    .set('Content-Type', 'application/json')
                    .send({ da : "ta" })
                    .expect(500, /No shared-schema defined/, done);
            });

            it("should block validator-routes with wrong content-type request", function (done) {
                this.timeout(100000);
                request(app)
                    .post("/validators/myNonExistentValidator/")
                    .set('Content-Type', 'text/plain')
                    .expect(415, done);
            });

            it("should accept validator requests only via POST", function (done) {
                this.timeout(100000);
                request(app)
                    .put("/validators/myNonExistentValidator/")
                    .set('Content-Type', 'application/json')
                    .send({ da : "ta" })
                    .expect(500, /Validator Requests have to called with method/, done);
            });
        });

        describe("#middleware passing/throwing/ending", function () {

            it("should be able to end a request", function (done) {
                this.timeout(100000);
                request(app)
                    .get("/services/requestender")
                    .expect(200, /\{\"requestEnder\":true\}/, done);
            });

            it("should end a request if next was called with an error", function (done) {
                this.timeout(100000);
                request(app)
                    .get("/services/errorpasser")
                    .expect(500, /Error passed by errorPasser/, done);
            });

            it("should print the stacktrace if an error was thrown", function (done) {
                this.timeout(100000);
                request(app)
                    .get("/services/errorthrower")
                    .expect(500, /Error thrown by errorThrower/, done);
            });
        });
    });
});


text:
/* eslint-env mocha */
import { render, renderDOM } from './render';
import expect from 'expect';
import React from 'react';
import ReactDOM from 'react-dom';
import Textfield from '../Textfield';

describe('Textfield', () => {
    it('should render an div with the textfield css classes', () => {
        const output = render(<Textfield label="label" />);

        expect(output.type).toBe('div');
        expect(output.props.className)
            .toInclude('mdl-textfield')
            .toInclude('mdl-js-textfield');
    });

    it('should allow custom css classes', () => {
        const output = render(<Textfield className="my-textfield" label="label" />);

        expect(output.props.className).toInclude('my-textfield');
    });

    it('should render an input by default', () => {
        const output = render(<Textfield label="label" />);

        const input = output.props.children[1][0];
        expect(input.type).toBe('input');
    });

    describe('should render a textarea', () => {
        it('when rows is specified', () => {
            const output = render(<Textfield label="label" rows={3} />);

            const input = output.props.children[1][0];
            expect(input.type).toBe('textarea');
        });

        it('when maxRows is specified', () => {
            const output = render(<Textfield label="label" maxRows={5} />);

            const input = output.props.children[1][0];
            expect(input.type).toBe('textarea');
        });
    });

    it('should render with a floating label', () => {
        const output = render(<Textfield label="label" floatingLabel />);

        expect(output.props.className)
            .toInclude('mdl-textfield--floating-label');
    });

    it('should not render any error message by default', () => {
        const output = render(<Textfield label="label" />);

        expect(output.props.children[1][2]).toBe(null);
    });

    it('should render with an error message if specified', () => {
        const output = render(<Textfield label="label" error="error..." />);

        expect(output.props.children[1][2].props.className)
            .toInclude('mdl-textfield__error');
        expect(output.props.children[1][2].props.children).toBe('error...');
    });

    it('should render an expandable textfield if specified', () => {
        const output = render(<Textfield label="label" expandable expandableIcon="search" />);

        expect(output.props.className)
            .toInclude('mdl-textfield--expandable');

        const expandableLabel = output.props.children[0];
        expect(expandableLabel.props.className)
            .toInclude('mdl-button')
            .toInclude('mdl-js-button ')
            .toInclude('mdl-button--icon');
        const expandableIcon = expandableLabel.props.children;
        expect(expandableIcon.props.className).toInclude('material-icons');
        expect(expandableIcon.props.children).toBe('search');

        const inputContainer = output.props.children[1];
        expect(inputContainer.type).toBe('div');
        expect(inputContainer.props.className)
            .toInclude('mdl-textfield__expandable-holder');
        expect(inputContainer.props.children[0].type).toBe('input');
    });

    describe('should update the textfield after the first render', () => {
        it('when it receives an error', () => {
            const el = renderDOM(<Textfield label="label" />);

            ReactDOM.render(<Textfield label="label" error="is now invalid!" />, el.parentNode);

            expect(el.className).toInclude('is-invalid');
        });

        it('when it clears an error', () => {
            const el = renderDOM(<Textfield label="label"/>);

            ReactDOM.render(<Textfield label="label" error="is now invalid!" />, el.parentNode);
            expect(el.className).toInclude('is-invalid');

            ReactDOM.render(<Textfield label="label" error={null}/>, el.parentNode);
            expect(el.className).toExclude('is-invalid');
        });

        it('when it receives a new value', () => {
            const el = renderDOM(<Textfield label="label" />);

            ReactDOM.render(<Textfield label="label" value="my value" />, el.parentNode);

            expect(el.querySelector('.mdl-textfield__input').value).toBe('my value');
        });

        it('when it gets disabled', () => {
            const el = renderDOM(<Textfield label="label" />);

            ReactDOM.render(<Textfield label="label" disabled />, el.parentNode);

            expect(el.className).toInclude('is-disabled');
            expect(el.querySelector('.mdl-textfield__input').disabled).toBe(true);
        });

        it('when it gets required w/o value', () => {
            const el = renderDOM(<Textfield label="label" />);

            ReactDOM.render(<Textfield label="label" required />, el.parentNode);

            expect(el.className).toInclude('is-invalid');
            expect(el.querySelector('.mdl-textfield__input').required).toBe(true);
        });

        it('when it gets required with value', () => {
            const el = renderDOM(<Textfield label="label" value="my value" onChange={() => null} />);

            ReactDOM.render(<Textfield label="label" value="my value" onChange={() => null} required />, el.parentNode);

            expect(el.className).toExclude('is-invalid');
            expect(el.querySelector('.mdl-textfield__input').required).toBe(true);
        });

        it('when it receives a pattern with an incorrect value', () => {
            const el = renderDOM(<Textfield label="label" value="value" onChange={() => null} />);

            ReactDOM.render(<Textfield label="label" value="value" onChange={() => null} pattern="[0-9]+" />, el.parentNode);

            expect(el.className).toInclude('is-invalid');
        });

        it('when it receives a pattern with correct value', () => {
            const el = renderDOM(<Textfield label="label" value="17" onChange={() => null} />);

            ReactDOM.render(<Textfield label="label" value="17" onChange={() => null} pattern="[0-9]+" />, el.parentNode);

            expect(el.className).toExclude('is-invalid');
        });
    });
});


text:
package io.redlink.smarti.webservice.pojo;

public enum Projection {
    idOnly
    ;

}