@@ -689,4 +689,113 @@ YW_TEST_SET
689
689
Assert::AreEqual (dataBlock1.id , flow4.dataBlockId );
690
690
}
691
691
692
+ YW_TEST (ModelEntityListener, WhenOutPortHasFileAnnotationWithSimpleFileNameArgumentFlowTemplateAnnotationContainsFileNameAsPath)
693
+ {
694
+ this ->storeAndParse (R"(
695
+
696
+ @begin b
697
+ @out d @file foo.txt
698
+ @end b
699
+
700
+ @begin c
701
+ @in d
702
+ @end c
703
+
704
+ )" );
705
+ Expect::EmptyString (stderrRecorder.str ());
706
+
707
+ Expect::AreEqual (2 , ywdb.getRowCount (" flow" ));
708
+ Expect::AreEqual (1 , ywdb.getRowCount (" flow_template" ));
709
+
710
+ auto flow = ywdb.selectFlowById (1 );
711
+ auto flowTemplate = ywdb.selectFlowTemplateById (1 );
712
+
713
+ Expect::AreEqual (Flow{ 1 , 1 , 1 , Direction::OUT, 1 , 1 }, flow);
714
+ Expect::AreEqual (FlowTemplate{ 1 , 1 , null_string, " foo.txt" }, flowTemplate);
715
+
716
+ Assert::AreEqual (flow.id , flowTemplate.flow );
717
+ }
718
+
719
+ YW_TEST (ModelEntityListener, WhenOutPortHasUriAnnotationWithSimpleFileNameArgumentFlowTemplateAnnotationContainsFileNameAsPath)
720
+ {
721
+ this ->storeAndParse (R"(
722
+
723
+ @begin b
724
+ @out d @uri foo.txt
725
+ @end b
726
+
727
+ @begin c
728
+ @in d
729
+ @end c
730
+
731
+ )" );
732
+ Expect::EmptyString (stderrRecorder.str ());
733
+
734
+ Expect::AreEqual (2 , ywdb.getRowCount (" flow" ));
735
+ Expect::AreEqual (1 , ywdb.getRowCount (" flow_template" ));
736
+
737
+ auto flow = ywdb.selectFlowById (1 );
738
+ auto flowTemplate = ywdb.selectFlowTemplateById (1 );
739
+
740
+ Expect::AreEqual (Flow{ 1 , 1 , 1 , Direction::OUT, 1 , 1 }, flow);
741
+ Expect::AreEqual (FlowTemplate{ 1 , 1 , null_string, " foo.txt" }, flowTemplate);
742
+
743
+ Assert::AreEqual (flow.id , flowTemplate.flow );
744
+ }
745
+
746
+ YW_TEST (ModelEntityListener, WhenOutPortHasUriAnnotationWithSchemAndSimpleFileNameArgumentFlowTemplateAnnotationContainsSchemeAndFileNameAsPath)
747
+ {
748
+ this ->storeAndParse (R"(
749
+
750
+ @begin b
751
+ @out d @uri file:foo.txt
752
+ @end b
753
+
754
+ @begin c
755
+ @in d
756
+ @end c
757
+
758
+ )" );
759
+ Expect::EmptyString (stderrRecorder.str ());
760
+
761
+ Expect::AreEqual (2 , ywdb.getRowCount (" flow" ));
762
+ Expect::AreEqual (1 , ywdb.getRowCount (" flow_template" ));
763
+
764
+ auto flow = ywdb.selectFlowById (1 );
765
+ auto flowTemplate = ywdb.selectFlowTemplateById (1 );
766
+
767
+ Expect::AreEqual (Flow{ 1 , 1 , 1 , Direction::OUT, 1 , 1 }, flow);
768
+ Expect::AreEqual (FlowTemplate{ 1 , 1 , " file" , " foo.txt" }, flowTemplate);
769
+
770
+ Assert::AreEqual (flow.id , flowTemplate.flow );
771
+ }
772
+
773
+ YW_TEST (ModelEntityListener, WhenOutPortHasUriAnnotationWithGeneralUrlArgumentFlowTemplateAnnotationContainsSchemeAndPath)
774
+ {
775
+ this ->storeAndParse (R"(
776
+
777
+ @begin b
778
+ @out d @uri http://foo.org/a.dir/general.dir/url/bar.txt
779
+ @end b
780
+
781
+ @begin c
782
+ @in d
783
+ @end c
784
+
785
+ )" );
786
+ Expect::EmptyString (stderrRecorder.str ());
787
+
788
+ Expect::AreEqual (2 , ywdb.getRowCount (" flow" ));
789
+ Expect::AreEqual (1 , ywdb.getRowCount (" flow_template" ));
790
+
791
+ auto flow = ywdb.selectFlowById (1 );
792
+ auto flowTemplate = ywdb.selectFlowTemplateById (1 );
793
+
794
+ Expect::AreEqual (Flow{ 1 , 1 , 1 , Direction::OUT, 1 , 1 }, flow);
795
+ Expect::AreEqual (FlowTemplate{ 1 , 1 , " http" , " //foo.org/a.dir/general.dir/url/bar.txt" }, flowTemplate);
796
+
797
+ Assert::AreEqual (flow.id , flowTemplate.flow );
798
+ }
799
+
800
+
692
801
YW_TEST_END
0 commit comments