Sha256: 5322b6ce8aed5aaf076dfc96d2f9354023b595a169756c176f5159d95bec217e

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

#
# Testing OpenWFEru
#
# John Mettraux at openwfe.org
# Pat at geobliki.com
#

require 'flowtestbase'
require 'openwfe/def'

include OpenWFE


class FlowTest50 < Test::Unit::TestCase
    include FlowTestBase

    #def setup
    #end

    #def teardown
    #end

    #
    # A Test by Pat Cappelaere
    #

    PAT_XML = <<END
<?xml version="1.0" encoding="UTF-8"?>
<sps:GetFeasibilityRequestResponse xmlns:gml="http://www.opengis.net/gml"
xmlns:sps="http://www.opengis.net/sps" xmlns="">
  <sps:Feasibility status="feasible" id="106">
    <DOY>106</DOY>
    <UTC>2007-04-16 09:20:00</UTC>
    <SZA>27.41</SZA>
    <TYPE>NADIR</TYPE>
    <PATH>52</PATH>
    <ROW>186</ROW>
    <COST>2600.85</COST>
    <sps:LatestResponseTime>
      <gml:TimeInstant>
        <gml:timePosition>2007-04-16T09:20:00Z</gml:timePosition>
      </gml:TimeInstant>
    </sps:LatestResponseTime>
  </sps:Feasibility>
</sps:GetFeasibilityRequestResponse>
END

    class TestXmlAttribute50a0 < ProcessDefinition
        sequence do
            geo_0
            geo_1
        end
    end

    #def xxxx_0
    def test_0

        doc0 = nil
        doc1 = nil
    
        @engine.register_participant :geo_0 do |fei, workitem|
            doc0 = REXML::Document.new(PAT_XML)
            workitem.attributes['xml'] = doc0
            @tracer << "0\n"
        end
    
        @engine.register_participant :geo_1 do |fei, workitem|
            doc1 = workitem.attributes['xml']
            @tracer << "1\n"
        end

        dotest(TestXmlAttribute50a0, "0\n1")

        assert_equal doc0.to_s, doc1.to_s
    end

    def test_1

        doc0 = REXML::Document.new PAT_XML
        doc1 = OpenWFE::fulldup(doc0)

        assert_not_equal doc0.object_id, doc1.object_id

        assert_equal doc0.to_s, doc1.to_s
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openwferu-0.9.9 test/ft_50_xml_attribute.rb