Sha256: 3959ef18e5de861ed888d264697c2793debd1e551e43e952e294d03e8410af00

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 Bytes

Contents

# -*- coding: utf-8 -*-
require 'norikra/udf_spec_helper'

include Norikra::UDFSpecHelper

require 'norikra/udf/anomaly'

describe Norikra::UDF::Anomaly do
  f = udf_function(
    Norikra::UDF::Anomaly,
    :valueType => java.lang.Integer,
    :parameters => [[java.lang.Integer]]
  )

  it 'returns Integer values' do
    expect(f.getValueType).to eql(java.lang.Integer.java_class)
  end

  it 'returns 1 value as mean' do
    (0...100).each do |i|
      f._call(:enter, i.to_java())
    end

    r = f.getValue
    expect(r).to eql(49)

    (0...100).each do |i|
      f._call(:leave, i.to_java())
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
norikra-udf-anomaly-0.0.1-java spec/anomaly_spec.rb