Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

declare function testFeature() { let $actual := feature:doFeature() (: assert feature condition :) }; declare function doFeature() { () (: todo: impl :) };

Slide 26

Slide 26 text

declare function doFeature() { let $output := lotsOfLogic() return $output };

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

declare namespace its = “http://www.w3.org/2005/11/its”; declare function buildXmlWithTranslateFlags() { element data { attribute its:translate { “yes” }, businessLogicToBuildXml(); } };

Slide 37

Slide 37 text

declare function buildXml() { element data { businessLogicToBuildXml(); } }; declare namespace its = “http://www.w3.org/2005/11/its”; declare function addTranslateFlags($xml) { element {$xml/fn:name()} { attribute its:translate { “yes” }, $xml/@*, $xml/* } };

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

import module namespace build = “b” at “/build.xqy”; declare function testBuildXml() { let $actual := b:buildXml() (: assert only xml is well-built :) }; import module namespace translate = “t” at “/transl8.xqy”; declare function testAddTranslateFlags() { let $actual := t:addTranslateFlags() (: assert only that translation flags added correctly :) };

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

import module namespace build = “b” at “/build.xqy”; declare function buildXml_condition1() { (: ... :) }; declare function buildXml_condition2() { (: ... :) }; (: etc. :)

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

declare function bizLogic($input as element()*) { (: ... :) }; import module namespace logic = “logic” at “/logic.xqy”; declare function bizLogic_emptyInput() { (: ... :) }; declare function bizLogic_oneInput() { (: ... :) }; declare function bizLogic_manyInput() { (: ... :) };

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

declare function bizLogic($input as element()*) { (: ... :) }; import module namespace logic = “logic” at “/logic.xqy”; declare function bizLogic_insufficientInput() { (: ... :) }; declare function bizLogic_malformedInput() { (: ... :) };

Slide 46

Slide 46 text

declare function bizLogic($input as element()*) { if (isInsufficientInput($input)) then fn:error(xs:Qname(“ASSERT”), “Insufficient msg”) else (: normal process... :) }; import module namespace logic = “logic” at “/logic.xqy”; declare function bizLogic_insufficientInput() { try { (: call w/ insufficient input :) } catch ($e) { if ($e/error:name eq “ASSERT”) then () else xdmp:rethrow() } };

Slide 47

Slide 47 text

declare function businessLogic($input) { let $moreInput := /more-input[@attr eq $input] let $returnVal := for $item in $moreInput let $details := /detail[@id eq $item/id] return if ($details/thing eq xdmp:get-request-field(“thing-id”)) then $details else () return if (fn:exists($returnVal)) then let $audit := xdmp:document-insert(“/latest.xml”, element ok {}) return $returnVal else xdmp:redirect-response(“/empty.xqy”); };

Slide 48

Slide 48 text

declare function businessLogic($input) { let $moreInput := /more-input[@attr eq $input] let $returnVal := for $item in $moreInput let $details := /detail[@id eq $item/id] return if ($details/thing eq xdmp:get-request-field(“thing-id”)) then $details else () return if (fn:exists($returnVal)) then let $audit := xdmp:document-insert(“/latest.xml”, element ok {}) return $returnVal else xdmp:redirect-response(“/empty.xqy”); };

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

xdmp:get-request-field(“var”) xdmp:redirect-response(“/page.xqy”)

Slide 53

Slide 53 text

xdmp:document-insert(“/trades.xml”, element beads {}) fn:collection()/dances/rain

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

declare function feature() { let $filter := xdmp:get-request-field(“filter”) let $input := fn:collection()/data[@attr eq $filter] let $result := businessLogic($input) let $persist := xdmp:document-insert(“/doc.xml”, $result) return xdmp:redirect-response(“complete.xqy”) };

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

declare function feature() { let $filter := xdmp:get-request-field(“filter”) let $input := fn:collection()/data[@attr eq $filter] let $result := businessLogic($input) let $persist := xdmp:document-insert(“/doc.xml”, $result) return xdmp:redirect-response(“complete.xqy”) };

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

declare function (:TEST:) isolate_noUrlNoChannels() { (: ... :) };

Slide 71

Slide 71 text

org.lds.marklogic.shared xqtest 1.0-SNAPSHOT xar

Slide 72

Slide 72 text

import module namespace unit = "http://lds.org/code/shared/xqtest/html" at "/shared/xqtest/html.xqy"; html:test()

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

import module namespace unit = "http://lds.org/code/shared/xqtest/testng" at "/shared/xqtest/testng.xqy"; testng:test()

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

Dress & Grooming /dress-grooming/

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

... test - show only active subchannels - green test - show only active subchannels - red test - 1 child level all children - green test - 1 child level, 2 exist - green test - 1 child level, 2 exist - red test - 1 child level - green test - child level - red test - get closest url - green test - get closest url - red test - match level 2 - green test - match level 2 - red test - active chg - match whole tree & match lvl1 partial tree - green test - active chg - match whole tree & match lvl1 partial tree - red test - match lvl1 partial tree - red test - match whole tree - green test - match whole tree – red ...

Slide 83

Slide 83 text

Demo'able parameters style adjustment added stylesheet for sidebar added demo page, adjusted reverse tree builder to handle queried docs testng runner added xqtest ver .5 - update to work with new api test - limit shallow non-hierarchical url - green test - shallow limit 1 level, 2 exist - green test - adjust test (only work with hierarchical urls) - shallow … test - shallow limit 1 level, 2 exist - red test - deep limit 1 level, 2 exist - green test - adjust test - deep limit 1 level, 2 exist - red test - limit 1 level, 2 exist - red test - level 3 active link - green test - level 3 active link - red test - level 3 list none active (and fixed level 2 test data) - green test - level 3 list none active - red cleanup - privatize fn's test - level 2 list none active - green test - level 2 list none active - red test - header only multiple level 1 channel - green test - header only multiple level 1 channel - red test - header only - green test - header only - red test - no channels data - green test - no channels data - red test - no channels - green added sidebar renderer - no channels test - red renamed build->render fn added build fn test - build max child levels of set to more - green test - no match 3 levels, 2 exist, 2 shown (fixed bug) - green test - no match 3 levels, 2 exist, 2 shown - red test - no match level 1, 2 exist - fix - green test - no match level 1, 2 exist - green test - no match levels more than exists - green test - no match level 1 - green test - no match level 1 - red cleanup long fn signatures test - show only active subchannels - green test - show only active subchannels - red test - 1 child level all children - green test - 1 child level, 2 exist - green test - 1 child level, 2 exist - red test - 1 child level - green test - child level - red test - get closest url - green test - get closest url - red test - match level 2 - green test - match level 2 - red test - active chg - match whole tree & match lvl1 partial tree - green test - active chg - match whole tree & match lvl1 partial tree - red test - match lvl1 partial tree - red test - match whole tree - green test - match whole tree - red Rename isolateChannels -> isolate Rename nav -> channel Rename nav2 -> nav Added gitignore Initial import - base test cases (no input)

Slide 84

Slide 84 text

Demo'able parameters style adjustment added stylesheet for sidebar added demo page, adjusted reverse tree builder to handle queried docs testng runner added xqtest ver .5 - update to work with new api test - limit shallow non-hierarchical url - green test - shallow limit 1 level, 2 exist - green test - adjust test (only work with hierarchical urls) - shallow … test - shallow limit 1 level, 2 exist - red test - deep limit 1 level, 2 exist - green test - adjust test - deep limit 1 level, 2 exist - red test - limit 1 level, 2 exist - red test - level 3 active link - green test - level 3 active link - red test - level 3 list none active (and fixed level 2 test data) - green test - level 3 list none active - red cleanup - privatize fn's test - level 2 list none active - green test - level 2 list none active - red test - header only multiple level 1 channel - green test - header only multiple level 1 channel - red test - header only - green test - header only - red test - no channels data - green test - no channels data - red test - no channels - green added sidebar renderer - no channels test - red renamed build->render fn added build fn test - build max child levels of set to more - green test - no match 3 levels, 2 exist, 2 shown (fixed bug) - green test - no match 3 levels, 2 exist, 2 shown - red test - no match level 1, 2 exist - fix - green test - no match level 1, 2 exist - green test - no match levels more than exists - green test - no match level 1 - green test - no match level 1 - red cleanup long fn signatures test - show only active subchannels - green test - show only active subchannels - red test - 1 child level all children - green test - 1 child level, 2 exist - green test - 1 child level, 2 exist - red test - 1 child level - green test - child level - red test - get closest url - green test - get closest url - red test - match level 2 - green test - match level 2 - red test - active chg - match whole tree & match lvl1 partial tree - green test - active chg - match whole tree & match lvl1 partial tree - red test - match lvl1 partial tree - red test - match whole tree - green test - match whole tree - red Rename isolateChannels -> isolate Rename nav -> channel Rename nav2 -> nav Added gitignore Initial import - base test cases (no input)

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

Green Apple (modified) http://www.flickr.com/photos/_fxr/2335186114/ _FXR's photostream Salt Lake Temple http://www.flickr.com/photos/midiman/2503776540/ midiman's photostream Belay http://www.flickr.com/photos/picsbycam/5173647461/ Cameron Cassan's photostream Thinker http://www.flickr.com/photos/garysoup/2705102139/ Gary Soup's photostream Multipurpose Tool http://www.flickr.com/photos/paalb/11772559/ Pål Berge's photostream Clean Up http://www.flickr.com/photos/emilyrides/5188289325/lightbox/ emilydickinsonridesabmx's photostream Cliff http://www.flickr.com/photos/elsie/144702426/ Elsie esq.'s photostream Paper Pile http://www.flickr.com/photos/loty/326761635/ lotyloty's photostream Candles http://www.flickr.com/photos/picsbycam/4023646774/in/photostream/ Cameron Cassan's photostream Elephant http://www.flickr.com/photos/greenboots76/2924276160/ Henry Brett's photostream Assembly Line http://www.flickr.com/photos/jurvetson/5201796697/ jurvetson's photostream Chihuahua http://www.flickr.com/photos/62337512@N00/3727104807/ apdk's photostream Angry Dog http://www.flickr.com/photos/javiercito/2083111412/lightbox/ Javiercit0's photostream Clean up Pet http://www.flickr.com/photos/pointshoot/1144799868/ Eddie~S' photostream Hugging Fingers http://www.flickr.com/photos/ganesha_isis/4439563089/ ganesha.isis' photostream Fail Whale http://www.flickr.com/photos/coletivomambembe/3882172324/ Coletivo Mambembe's photostream Lego Death Star http://www.flickr.com/photos/dudeoflego/5104751355/ Dude of Lego's photostream Road Runner http://www.flickr.com/photos/snowpeak/4815685925/ snowpeak's photostream Keyboard Sleep http://www.flickr.com/photos/ytruly/1718468702/ YTruly's photostream Lotus http://www.flickr.com/photos/thecarspy/2571799871/in/photostream/ The Car Spy's photostream Neon Pipes http://www.flickr.com/photos/krossbow/3619931451/ krossbow's photostream - CC Attribution license Calculator http://www.flickr.com/photos/scoobay/2463236523/ Scoobay's photostream Dragon Boat http://www.flickr.com/photos/wiifm69/3410782558/ wiifm's photostream Ping Pong http://www.flickr.com/photos/ncc_badiey/4932760753/ Nima Badiey's photostream Solitary Confinement http://www.flickr.com/photos/59195512@N00/143521274/ dospaz's photostream Flags http://www.flickr.com/photos/markchapmanphoto/5138832677/ ::: Radar Communication :::'s photostream Pointing Caterpillar http://www.flickr.com/photos/pinkstockphotos/5266977224/ PinkStock Photos!'s photostream Multiplication http://www.flickr.com/photos/somegeekintn/4048155967/ somegeekintn's photostream All Creative Co mmons 2.0 At tribution License unless otherwise noted Decoupled http://www.flickr.com/photos/daquellamanera/2213902727/ Daquella manera's photostream Water Droplet http://www.flickr.com/photos/shannonkringen/4680455907/ shannonkringen's photostream

Slide 90

Slide 90 text

Pig Egg http://www.flickr.com/photos/katerha/5423107783/ katerha's photostream Spaghetti Noodle http://www.flickr.com/photos/pinksherbet/2201247567/ Pink Sherbet Photography's photostream Girl Eating Spaghetti http://www.flickr.com/photos/pinksherbet/5008273559/ Pink Sherbet Photography's photostream Salute Flag http://www.flickr.com/photos/soldiersmediacenter/3920702814/ The U.S. Army's photostream Camoflauge Lizard http://www.flickr.com/photos/lofink/4453281926/ dlofink's photostream Call on Beach http://www.flickr.com/photos/zitona/2268296925/ » Zitona «'s photostream Indian Chief http://www.flickr.com/photos/boston_public_library/4100786887/in/photo stream/ Boston Public Library's photostream Ninja Turtle http://www.flickr.com/photos/86805724@N00/1581833575/ ianmalcm's photostream Phone Booth http://www.flickr.com/photos/bexwalton/4204409348/ Bex.Walton's photostream Suit http://www.flickr.com/photos/pss/4830803189/ Paul Stevenson's photostream Underwater http://www.flickr.com/photos/andreweick/4000567498/in/photostream/ AndrewEick's photostream Picasso http://www.flickr.com/photos/oddsock/101164507/ oddsock's photostream Spider Tunnel http://www.flickr.com/photos/b1gw1ght/900924265/ b1gw1ght's photostream Safety Net http://www.flickr.com/photos/iamchadhearmesnore/3629410556/ iamchad's photostream Black Box http://www.flickr.com/photos/amagill/34762677/ AMagill's photostream Tool Belt http://www.flickr.com/photos/blue_diamond/3995257652/ Blue Diamond Photography's photostream The Swede By David Quinn, used with permission Garden Gnome http://www.flickr.com/photos/mukluk/196177233/ Dano's photostream Blueprint http://www.flickr.com/photos/wscullin/3770016707/ Will Scullin's photostream Flux Capacitor http://www.flickr.com/photos/popculturegeek/4533455371/ popculturegeek.com's photostream Power Plug http://www.flickr.com/photos/randomurl/438112948/ Zevotron's photostream Runner http://www.flickr.com/photos/lululemonathletica/5197327623/lightbox/ lululemon athletica's photostream Yoga Man http://www.flickr.com/photos/lululemonathletica/4774517755/ lululemon athletica's photostream Lego City Men http://www.flickr.com/photos/mac_filko/5491561002/ mac_filko's photostream Port Said http://www.flickr.com/photos/48722974@N07/5036484008/ eutrophication&hypoxia's photostream Vote for Pedro http://www.flickr.com/photos/emdot/79863648/ emdot's photostream Dusty Road http://www.flickr.com/photos/generated/5554654197/ jared's photostream Mexican Hat Rock Formation http://www.flickr.com/photos/wolfgangstaudt/4879456199/in/set- 72157624891093384 Wolfgang Staudt's photostream Red Apple (modified) http://www.flickr.com/photos/emzee/273289101/ *Micky's photostream Kodak Roll http://www.flickr.com/photos/picsbycam/4550970565/in/photostream/ Cameron Cassan's photostream Gnuolane Free font http://typodermicfonts.com Free for personal and commercial use