├── LICENSE ├── README.md ├── bootstrap ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.css.map │ └── bootstrap.min.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff └── js │ ├── bootstrap.js │ └── bootstrap.min.js ├── doc ├── Capture_IE_preserve-3d.PNG ├── Capture_IE_preserve-3d_SVG.PNG ├── Capture_chrome_preserve-3d.PNG ├── Capture_chrome_preserve-3d_SVG.PNG ├── Capture_firefox_preserve-3d.PNG └── Capture_firefox_preserve-3d_SVG.PNG ├── examples ├── Box_clip_art.svg ├── ball_3d.svg ├── barrel_translating_and_scaling_in_place.svg ├── bottle.svg ├── circle_3d.svg ├── cube_3d_construction.svg ├── cube_text_images.svg ├── cube_yellow_animating.svg ├── declarative_cube_kierGroup.svg ├── declarative_cube_yellow.svg ├── declarative_cube_yellow_bug_face_order.svg ├── delicious.svg ├── ebay.svg ├── half_pipe_3d_declared.svg ├── image_rotating_scaling.svg ├── image_simple_cloning.svg ├── img │ ├── 223px-Pig_icon_05.svg.png │ ├── Pig_icon_05.svg │ ├── automn.jpg │ ├── day.jpg │ ├── logo_visual_tools.png │ ├── night.jpg │ ├── spring.jpg │ ├── summer.jpg │ └── winter.jpg ├── js │ ├── Box_clip_art.js │ ├── barrel.js │ ├── cube_yellow.js │ ├── declarative_cube_kierGroup.js │ ├── declarative_cube_modify_svg_parameters.js │ ├── lightbulb_simple.js │ ├── man.js │ ├── pieceOfCoal.js │ ├── rg1024_metal_barrel.js │ └── rg1024_metal_barrel_symbolize.js ├── lightbulb_simple_cloning_300.svg ├── logo_60.svg ├── logo_60_3d_declared.svg ├── logo_60_3d_declared_text.svg ├── logo_60_without_scripts.svg ├── logo_60_without_scripts_normals.svg ├── logo_cube_3d.svg ├── man_with_shadow.svg ├── picasa.svg ├── pieceOfCoal_translate_only.svg ├── polyline_3d.svg ├── pyramide_3faces.svg ├── pyramide_4faces_rotating.svg ├── rg1024_metal_barrel.svg ├── rg1024_metal_barrel_symbolize.svg ├── rotating_spiral.svg ├── rss.svg ├── text_rotating.svg ├── wikio.svg ├── youtube.svg └── ziki.svg ├── jquery └── jquery-2.0.3.js ├── jsunit ├── app │ ├── css │ │ ├── jsUnitStyle.css │ │ └── readme │ ├── emptyPage.html │ ├── jsUnitCore.js │ ├── jsUnitTestManager.js │ ├── jsUnitTestSuite.js │ ├── jsUnitTracer.js │ ├── main-counts-errors.html │ ├── main-counts-failures.html │ ├── main-counts-runs.html │ ├── main-counts.html │ ├── main-data.html │ ├── main-errors.html │ ├── main-frame.html │ ├── main-loader.html │ ├── main-progress.html │ ├── main-results.html │ ├── main-status.html │ ├── testContainer.html │ ├── testContainerController.html │ └── xbDebug.js ├── build.xml ├── changelist.txt ├── css │ └── jsUnitStyle.css ├── images │ ├── green.gif │ ├── logo_jsunit.gif │ └── red.gif ├── intellij │ ├── .cvsignore │ ├── JsUnit.iml │ └── JsUnit.ipr ├── java │ ├── bin │ │ ├── .cvsignore │ │ └── jsunit.jar │ ├── lib │ │ ├── javax.servlet.jar │ │ ├── jdom.jar │ │ ├── jetty.jar │ │ ├── junit.jar │ │ └── xerces.jar │ └── src │ │ ├── .cvsignore │ │ └── net │ │ └── jsunit │ │ ├── ArgumentsConfiguration.java │ │ ├── Configuration.java │ │ ├── ConfigurationException.java │ │ ├── DistributedTest.java │ │ ├── EnvironmentVariablesConfiguration.java │ │ ├── JsUnitServer.java │ │ ├── PropertiesFileConfiguration.java │ │ ├── StandaloneTest.java │ │ ├── TestCaseResult.java │ │ ├── TestCaseResultBuilder.java │ │ ├── TestCaseResultWriter.java │ │ ├── TestSuiteResult.java │ │ ├── TestSuiteResultBuilder.java │ │ ├── TestSuiteResultWriter.java │ │ ├── Utility.java │ │ ├── servlet │ │ ├── JsUnitServlet.java │ │ ├── ResultAcceptorServlet.java │ │ ├── ResultDisplayerServlet.java │ │ └── TestRunnerServlet.java │ │ └── test │ │ ├── ArgumentsConfigurationTest.java │ │ ├── ConfigurationTest.java │ │ ├── DistributedTestTest.java │ │ ├── DummyHttpRequest.java │ │ ├── EndToEndTestSuite.java │ │ ├── EnvironmentVariablesConfigurationTest.java │ │ ├── PropertiesConfigurationTest.java │ │ ├── ResultAcceptorTest.java │ │ ├── StandaloneTestTest.java │ │ ├── Suite.java │ │ ├── TestCaseResultTest.java │ │ └── TestSuiteResultTest.java ├── jsunit.properties.sample ├── licenses │ ├── JDOM_license.txt │ ├── Jetty_license.html │ ├── MPL-1.1.txt │ ├── gpl-2.txt │ ├── index.html │ ├── lgpl-2.1.txt │ ├── mpl-tri-license-c.txt │ └── mpl-tri-license-html.txt ├── logs │ └── .cvsignore ├── readme.txt ├── testRunner.html └── tests │ ├── data │ ├── data.html │ ├── staff.css │ ├── staff.dtd │ └── staff.xml │ ├── index.html │ ├── jsUnitAssertionTests.html │ ├── jsUnitDeclAssertionTests.html │ ├── jsUnitDeclFrameworkUtilityTests.html │ ├── jsUnitDeclOnLoadTests.html │ ├── jsUnitDeclSetUpTearDownTests.html │ ├── jsUnitDeclTestFailures.html │ ├── jsUnitDeclTestLoadData.html │ ├── jsUnitDeclTestSetUpPages.html │ ├── jsUnitDeclTestSetUpPagesSuite.html │ ├── jsUnitDeclTestSuite.html │ ├── jsUnitDeclUtilityTests.html │ ├── jsUnitDeclarationTests.html │ ├── jsUnitFrameworkUtilityTests.html │ ├── jsUnitOnLoadTests.html │ ├── jsUnitSetUpTearDownTests.html │ ├── jsUnitTestFailures.html │ ├── jsUnitTestLoadData.html │ ├── jsUnitTestLoadStaff.html │ ├── jsUnitTestSetUpPages.html │ ├── jsUnitTestSetUpPagesSuite.html │ ├── jsUnitTestSuite.html │ └── jsUnitUtilityTests.html ├── protovis_integration ├── antibiotics_animated │ ├── antibiotics-scatter.html │ ├── antibiotics.html │ ├── antibiotics.js │ └── svg3d │ │ ├── dom_utils.js │ │ ├── svg3d.js │ │ └── svg3d_parsing.js ├── ex.css └── protovis-r3.3.js ├── schemas ├── svg3d.rng └── svg3d_main.rng ├── svg3d ├── dom_utils.js ├── jquery_svg3d.js ├── svg3d.js └── svg3d_parsing.js ├── tests ├── axes_3d_declared.svg ├── ball_3d_normals.svg ├── circle.svg ├── css_3d_transform.svg ├── normal_tests.svg ├── perspective_tests.svg ├── perspective_tests_2.svg ├── perspective_tests_3.svg ├── perspective_tests_4.svg ├── perspective_tests_4_darkorange_rotating.svg ├── perspective_tests_rotating.svg ├── perspective_tests_translating.svg ├── polyline.svg ├── rect01.svg └── rounded_rect01.svg └── ui_interact ├── Meuble_heraldique_Engrenage.html └── js └── Meuble_heraldique_Engrenage.js /bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /doc/Capture_IE_preserve-3d.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/doc/Capture_IE_preserve-3d.PNG -------------------------------------------------------------------------------- /doc/Capture_IE_preserve-3d_SVG.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/doc/Capture_IE_preserve-3d_SVG.PNG -------------------------------------------------------------------------------- /doc/Capture_chrome_preserve-3d.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/doc/Capture_chrome_preserve-3d.PNG -------------------------------------------------------------------------------- /doc/Capture_chrome_preserve-3d_SVG.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/doc/Capture_chrome_preserve-3d_SVG.PNG -------------------------------------------------------------------------------- /doc/Capture_firefox_preserve-3d.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/doc/Capture_firefox_preserve-3d.PNG -------------------------------------------------------------------------------- /doc/Capture_firefox_preserve-3d_SVG.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/doc/Capture_firefox_preserve-3d_SVG.PNG -------------------------------------------------------------------------------- /examples/ball_3d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | SVG animation - Ball 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/circle_3d.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/cube_yellow_animating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/declarative_cube_yellow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG animation - half pipe 3d 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/declarative_cube_yellow_bug_face_order.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | SVG animation - half pipe 3d 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /examples/half_pipe_3d_declared.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG animation - half pipe 3d 11 | 12 | 14 | 15 | 16 | 18 | 19 | 20 | 22 | 23 | 24 | 26 | 27 | 28 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/img/223px-Pig_icon_05.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/223px-Pig_icon_05.svg.png -------------------------------------------------------------------------------- /examples/img/automn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/automn.jpg -------------------------------------------------------------------------------- /examples/img/day.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/day.jpg -------------------------------------------------------------------------------- /examples/img/logo_visual_tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/logo_visual_tools.png -------------------------------------------------------------------------------- /examples/img/night.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/night.jpg -------------------------------------------------------------------------------- /examples/img/spring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/spring.jpg -------------------------------------------------------------------------------- /examples/img/summer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/summer.jpg -------------------------------------------------------------------------------- /examples/img/winter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/examples/img/winter.jpg -------------------------------------------------------------------------------- /examples/js/Box_clip_art.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 1000; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 1000; 4 | svg3d.yOrigin = 10; 5 | svg3d.sortAlgo = svg3d.AVERAGE_Z; 6 | 7 | $( document ).ready(function() { 8 | var shapeAxex = svg3d.shapeFactory(document.getElementById("axex")); 9 | shapeAxex.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 10 | var shapeAxey = svg3d.shapeFactory(document.getElementById("axey")); 11 | shapeAxey.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 12 | var shapeAxez = svg3d.shapeFactory(document.getElementById("axez")); 13 | shapeAxez.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 14 | $("#layer1").each(function( index, elm ) { 15 | elm.svg3dCloneGeographicDistribution = function(cloneIndex, clone3drow, clone3dlayer, clone3dx, clone3dy, clone3dz) { 16 | var layer = Math.floor( cloneIndex / clone3dlayer ); 17 | var row = Math.floor( ( cloneIndex % clone3dlayer ) / clone3drow); 18 | var z = Math.floor( ( ( cloneIndex % clone3dlayer ) % clone3drow ) ); 19 | return {incx: clone3dx * row, 20 | incy: clone3dy * layer, 21 | incz: clone3dz * z}; 22 | }; 23 | }); 24 | $("#layer1").animate({ 25 | svg3d: { 26 | translate3d : {x: 200, y: 300, z: 0}, 27 | clone3d: { 28 | row: 10, 29 | x: 200, 30 | layer: 100, 31 | y: -50, 32 | z: 200, 33 | nb: 20 34 | }, 35 | }, 36 | scaleInPlace: { 37 | scale: 1, 38 | xOrigin: 20, 39 | yOrigin: 15 40 | } 41 | }, { 42 | duration: 3000, 43 | easing: "easeInOutCubic" 44 | }); 45 | 46 | }); 47 | -------------------------------------------------------------------------------- /examples/js/barrel.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 600; 4 | svg3d.yOrigin = 10; 5 | //zRatio = 20; 6 | svg3d.sortAlgo = svg3d.AVERAGE_Z; 7 | 8 | $( document ).ready(function() { 9 | $("#barrel").animate({ 10 | scaleInPlace: { 11 | scale: 10, 12 | xOrigin: 530, 13 | yOrigin: 415 14 | }, 15 | translate: { 16 | x: -10, 17 | y: -10 18 | } 19 | }, { 20 | duration: 3000, 21 | easing: "easeInCubic" 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /examples/js/cube_yellow.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 150; 2 | svg3d.yInfinite = 150; 3 | svg3d.xOrigin = 0; 4 | svg3d.yOrigin = 0; 5 | svg3d.sortAlgo = svg3d.ONE_TO_ALL; 6 | 7 | $( document ).ready(function() { 8 | var svgClonableG = $("#g1"); 9 | svgClonableG.animate( 10 | { "svg3d": 11 | {"clone3d": 12 | { 13 | layer: 100, 14 | nb: 10, 15 | row: 1, 16 | x: 150, 17 | y: -90, 18 | z: 220 19 | } 20 | } 21 | }, 22 | { "duration" : 0, 23 | "easing" : "easeInCubic", 24 | "complete" : function() 25 | { svgClonableG.animate( 26 | { "svg3d": 27 | {"translate3d": 28 | { 29 | x: 200, 30 | y: 200, 31 | z: 0 32 | } 33 | } 34 | }, 35 | { 36 | duration: 1000, 37 | easing: "easeInCubic" 38 | }); 39 | $("#svgTranslatableG_ad530959e0d04d6d9d2b83028be85eaf").animate( 40 | { "svg3d":{"translate3d": 41 | { 42 | x: 200, 43 | y: 200, 44 | z: 0 45 | } 46 | } 47 | }, 48 | { queue: this.id, 49 | duration: 1000, 50 | easing: "easeInCubic" 51 | }); 52 | } 53 | } 54 | ); 55 | }); 56 | 57 | 58 | -------------------------------------------------------------------------------- /examples/js/declarative_cube_kierGroup.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 300; 3 | svg3d.xOrigin = 500; 4 | svg3d.yOrigin = 100; 5 | //zRatio = 20; 6 | svg3d.sortAlgo = svg3d.ALL_TO_ALL; 7 | 8 | $( document ).ready(function() { 9 | $("#g1").animate({ 10 | svg3d: { 11 | clone3d: { 12 | row: 2, 13 | x: 200, 14 | layer: 4, 15 | y: -50, 16 | z: 200, 17 | nb: 4 18 | }, 19 | matrix3ds: [svg3d.setTranslationMatrix(-100, -100, -100), svg3d.setAnglesRotationMatrix(Math.PI/10, Math.PI/10, Math.PI/10), svg3d.setTranslationMatrix(100, 100, 100)] 20 | } 21 | }, { 22 | duration: 3000, 23 | easing: "easeInOutCubic", 24 | specialEasing: { 25 | yInfinite: "easeInCubic", 26 | yOrigin: "easeInCubic" 27 | } 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /examples/js/declarative_cube_modify_svg_parameters.js: -------------------------------------------------------------------------------- 1 | var updateOriginAndInfinite = function() { 2 | var origin = document.getElementById("origin"); 3 | origin.setAttribute("cx", svg3d.xOrigin); 4 | origin.setAttribute("cy", svg3d.yOrigin); 5 | var infinite = document.getElementById("infinite"); 6 | infinite.setAttribute("cx", svg3d.xInfinite); 7 | infinite.setAttribute("cy", svg3d.yInfinite); 8 | } 9 | 10 | var rotate = function() { 11 | var t = new Date(); 12 | var max = 4500; 13 | var ms = (t.getSeconds() % 10 * 1000 + t.getMilliseconds()) - max; 14 | //ms is contained between max - 1 and - max 15 | // a revolution is done in 10 secs 16 | //svg3d.xInfinite = 0; 17 | //svg3d.yInfinite = 0; 18 | svg3d.xInfinite = Math.sin(ms * 2 * Math.PI / max) * 100 + 600; 19 | svg3d.yInfinite = Math.cos(ms * 2 * Math.PI / max) * 100 + 400; 20 | svg3d.xOrigin = Math.sin(ms * 2 * Math.PI / max) * -200 + 150; 21 | svg3d.yOrigin = Math.cos(ms * 2 * Math.PI / max) * -100 + 150; 22 | //svg3d.xOrigin = Math.sin(ms * 2 * Math.PI / max) * 120 - 200; 23 | //svg3d.yOrigin = Math.cos(ms * 2 * Math.PI / max) * 120 - 200; 24 | updateOriginAndInfinite(); 25 | } 26 | 27 | var rotateInterval; 28 | 29 | var toggleRotate = function() { 30 | if (rotateInterval === undefined) { 31 | rotateInterval = window.setInterval(rotate, 50); 32 | } else { 33 | window.clearInterval(rotateInterval); 34 | rotateInterval = undefined; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/js/lightbulb_simple.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 600; 4 | svg3d.yOrigin = 10; 5 | //zRatio = 20; 6 | svg3d.sortAlgo = svg3d.AVERAGE_Z; 7 | 8 | $( document ).ready(function() { 9 | $("#g3038").animate({ 10 | svg3d: { 11 | clone3d: { 12 | row: 10, 13 | x: 50, 14 | layer: 100, 15 | y: 50, 16 | z: 50, 17 | nb: 300 18 | } 19 | }, 20 | yInfinite: 300, 21 | yOrigin: 200, 22 | xInfinite: 0, 23 | xOrigin: -600 24 | }, { 25 | duration: 4000, 26 | easing: "easeInOutCubic", 27 | specialEasing: { 28 | yInfinite: "easeInCubic", 29 | yOrigin: "easeInCubic" 30 | } 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /examples/js/man.js: -------------------------------------------------------------------------------- 1 | 2 | svg3d.xOrigin = 0; 3 | svg3d.yOrigin = 0; 4 | svg3d.xInfinite = 0; 5 | svg3d.yInfinite = 0; 6 | 7 | var path = ""; 8 | 9 | function rotate(id) { 10 | var shapeCloned = svg3d.shapeFactory(document.getElementById(id)); 11 | var yTranslate = 3100; 12 | shapeCloned.transform([svg3d.setScaleMatrix(1, 1, 0.2), svg3d.setTranslationMatrix(0, yTranslate, 0), 13 | svg3d.setAnglesRotationMatrix(-Math.PI/2, 0, 0), svg3d.setTranslationMatrix(0, -yTranslate, 0)]); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples/js/pieceOfCoal.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 600; 4 | svg3d.yOrigin = 10; 5 | //zRatio = 20; 6 | svg3d.sortAlgo = svg3d.AVERAGE_Z; 7 | 8 | $( document ).ready(function() { 9 | $("#g3172").animate({ 10 | svg3d: { 11 | translate3d : {x: 400, y: 300, z: 1000} 12 | } 13 | }, { 14 | duration: 1000, 15 | easing: "easeInCubic" 16 | }); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /examples/js/rg1024_metal_barrel.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 600; 4 | svg3d.yOrigin = 10; 5 | //zRatio = 20; 6 | 7 | $( document ).ready(function() { 8 | var shapeAxex = svg3d.shapeFactory(document.getElementById("axex")); 9 | shapeAxex.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 10 | var shapeAxey = svg3d.shapeFactory(document.getElementById("axey")); 11 | shapeAxey.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 12 | var shapeAxez = svg3d.shapeFactory(document.getElementById("axez")); 13 | shapeAxez.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 14 | $("#layer1").animate({ 15 | svg3d: { 16 | translate3d : {x: 400, y: 300, z: 0}, 17 | clone3d: { 18 | row: 10, 19 | x: 50, 20 | layer: 100, 21 | y: -50, 22 | z: 50, 23 | nb: 40 24 | }, 25 | }, 26 | scaleInPlace: { 27 | scale: 1, 28 | xOrigin: 20, 29 | yOrigin: 15 30 | }, 31 | yInfinite: -400, 32 | yOrigin: -400 33 | }, { 34 | duration: 3000, 35 | easing: "easeInOutCubic", 36 | specialEasing: { 37 | yInfinite: "easeInCubic", 38 | yOrigin: "easeInCubic" 39 | }, 40 | done : function(animation, jumpedToEnd) { 41 | var htmlAxes = ''; 42 | htmlAxes += ''; 43 | htmlAxes += ''; 44 | htmlAxes += ''; 45 | htmlAxes += ''; 46 | document.getElementById("svg2").innerHTML += htmlAxes; 47 | var axeXAdded = svg3d.shapeFactory(document.getElementById("axeXAdded")); 48 | var axeZAdded = svg3d.shapeFactory(document.getElementById("axeZAdded")); 49 | var axeYAdded = svg3d.shapeFactory(document.getElementById("axeYAdded")); 50 | var matrixArray = [svg3d.setTranslationMatrix(520, 275, 0)]; 51 | axeXAdded.transform(matrixArray); 52 | axeYAdded.transform(matrixArray); 53 | axeZAdded.transform(matrixArray); 54 | document.getElementById("axesAdded").innerHTML += 'X axes text'; 55 | document.getElementById("axesAdded").innerHTML += 'Y text'; 56 | document.getElementById("axesAdded").innerHTML += 'Z axes text'; 57 | } 58 | }); 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /examples/js/rg1024_metal_barrel_symbolize.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 600; 4 | svg3d.yOrigin = 10; 5 | //zRatio = 20; 6 | 7 | $( document ).ready(function() { 8 | var shapeAxex = svg3d.shapeFactory(document.getElementById("axex")); 9 | shapeAxex.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 10 | var shapeAxey = svg3d.shapeFactory(document.getElementById("axey")); 11 | shapeAxey.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 12 | var shapeAxez = svg3d.shapeFactory(document.getElementById("axez")); 13 | shapeAxez.transform([svg3d.setTranslationMatrix(0, 0, 0)]); 14 | $("#layer1").animate({ 15 | svg3d: { 16 | translate3d : {x: 400, y: 300, z: 0}, 17 | clone3d: { 18 | row: 10, 19 | x: 50, 20 | layer: 100, 21 | y: -50, 22 | z: 50, 23 | nb: 40, 24 | symbolize: 1 25 | } 26 | }, 27 | scaleInPlace: { 28 | scale: 1, 29 | xOrigin: 20, 30 | yOrigin: 15 31 | }, 32 | yInfinite: -400, 33 | yOrigin: -400 34 | }, { 35 | duration: 3000, 36 | easing: "easeInOutCubic", 37 | specialEasing: { 38 | yInfinite: "easeInCubic", 39 | yOrigin: "easeInCubic" 40 | }, 41 | done : function(animation, jumpedToEnd) { 42 | var htmlAxes = ''; 43 | htmlAxes += ''; 44 | htmlAxes += ''; 45 | htmlAxes += ''; 46 | htmlAxes += ''; 47 | document.getElementById("svg2").innerHTML += htmlAxes; 48 | var axeXAdded = svg3d.shapeFactory(document.getElementById("axeXAdded")); 49 | var axeZAdded = svg3d.shapeFactory(document.getElementById("axeZAdded")); 50 | var axeYAdded = svg3d.shapeFactory(document.getElementById("axeYAdded")); 51 | var matrixArray = [svg3d.setTranslationMatrix(520, 275, 0)]; 52 | axeXAdded.transform(matrixArray); 53 | axeYAdded.transform(matrixArray); 54 | axeZAdded.transform(matrixArray); 55 | document.getElementById("axesAdded").innerHTML += 'X axes text'; 56 | document.getElementById("axesAdded").innerHTML += 'Y text'; 57 | document.getElementById("axesAdded").innerHTML += 'Z axes text'; 58 | } 59 | }); 60 | 61 | }); 62 | -------------------------------------------------------------------------------- /examples/logo_60_3d_declared.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/logo_60_without_scripts.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /examples/polyline_3d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/pyramide_3faces.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG animation - pyramide 3 faces 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/pyramide_4faces_rotating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | SVG animation - pyramide 4 faces 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/rotating_spiral.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG animation - spiral 11 | 12 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/text_rotating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 34 | 35 | 36 | 37 | text rotating x 38 | 39 | 40 | 41 | text rotating y 42 | 43 | 44 | 45 | text rotating z 46 | 47 | 48 | 49 | text translating z 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /jsunit/app/css/jsUnitStyle.css: -------------------------------------------------------------------------------- 1 | /* jsUnit */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Edward Hieatt code. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Edward Hieatt, edward@jsunit.net. 19 | * Portions created by the Initial Developer are Copyright (C) 2001 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Edward Hieatt, edward@jsunit.net (original author) 24 | * Bob Clary, bc@bclary.com 25 | * 26 | * Alternatively, the contents of this file may be used under the terms of 27 | * either the GNU General Public License Version 2 or later (the "GPL"), or 28 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 | * in which case the provisions of the GPL or the LGPL are applicable instead 30 | * of those above. If you wish to allow use of your version of this file only 31 | * under the terms of either the GPL or the LGPL, and not to allow others to 32 | * use your version of this file under the terms of the MPL, indicate your 33 | * decision by deleting the provisions above and replace them with the notice 34 | * and other provisions required by the GPL or the LGPL. If you do not delete 35 | * the provisions above, a recipient may use your version of this file under 36 | * the terms of any one of the MPL, the GPL or the LGPL. 37 | * 38 | * ***** END LICENSE BLOCK ***** */ 39 | 40 | body 41 | { 42 | margin-top: 0; 43 | margin-bottom: 0; 44 | font-family: Verdana, Arial, Helvetica, sans-serif; 45 | color: #000; 46 | font-size: 0.8em; 47 | background-color: #fff; 48 | } 49 | 50 | td 51 | { 52 | padding: 0; 53 | margin: 0; 54 | } 55 | 56 | td img 57 | { 58 | padding: 0; 59 | margin: 0; 60 | vertical-align: baseline; 61 | display: block; 62 | } 63 | 64 | input 65 | { 66 | } 67 | 68 | select 69 | { 70 | } 71 | 72 | a:link, a:visited 73 | { 74 | color : #00F; 75 | } 76 | 77 | a:hover 78 | { 79 | color : #F00; 80 | } 81 | 82 | .jsUnitDefault 83 | { 84 | } 85 | 86 | h1, th 87 | { 88 | font-size: 1.3em; 89 | font-weight: bold; 90 | color: #039; 91 | } 92 | 93 | h2 94 | { 95 | font-weight: bold; 96 | color: #039; 97 | } 98 | 99 | h3 100 | { 101 | font-weight: bold; 102 | color: #039; 103 | text-decoration: underline; 104 | } 105 | 106 | h4 107 | { 108 | font-weight: bold; 109 | color: #039; 110 | } 111 | 112 | .jsUnitTestResultSuccess 113 | { 114 | color: #000; 115 | } 116 | 117 | .jsUnitTestResultNotSuccess 118 | { 119 | color: #F00; 120 | } 121 | -------------------------------------------------------------------------------- /jsunit/app/css/readme: -------------------------------------------------------------------------------- 1 | this file is required due to differences in behavior between Mozilla/Opera 2 | and Internet Explorer. 3 | 4 | main-data.html calls kickOffTests() which calls top.testManager.start() 5 | in the top most frame. top.testManager.start() initializes the output 6 | frames using document.write and HTML containing a relative to the 7 | jsUnitStyle.css file. In MSIE, the base href used to find the CSS file is 8 | that of the top level frame however in Mozilla/Opera the base href is 9 | that of main-data.html. This leads to not-found for the jsUnitStyle.css 10 | in Mozilla/Opera. Creating app/css/jsUnitStyle.css works around this problem. 11 | -------------------------------------------------------------------------------- /jsunit/app/emptyPage.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | emptyPage 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /jsunit/app/jsUnitTestSuite.js: -------------------------------------------------------------------------------- 1 | /* @author Edward Hieatt, edward@jsunit.net */ 2 | 3 | function jsUnitTestSuite() { 4 | this.isjsUnitTestSuite = true; 5 | this.testPages = Array(); 6 | this.pageIndex = 0; 7 | } 8 | 9 | jsUnitTestSuite.prototype.addTestPage = function (pageName) 10 | { 11 | this.testPages[this.testPages.length] = pageName; 12 | } 13 | 14 | jsUnitTestSuite.prototype.addTestSuite = function (suite) 15 | { 16 | for (var i = 0; i < suite.testPages.length; i++) 17 | this.addTestPage(suite.testPages[i]); 18 | } 19 | 20 | jsUnitTestSuite.prototype.containsTestPages = function () 21 | { 22 | return this.testPages.length > 0; 23 | } 24 | 25 | jsUnitTestSuite.prototype.nextPage = function () 26 | { 27 | return this.testPages[this.pageIndex++]; 28 | } 29 | 30 | jsUnitTestSuite.prototype.hasMorePages = function () 31 | { 32 | return this.pageIndex < this.testPages.length; 33 | } 34 | 35 | jsUnitTestSuite.prototype.clone = function () 36 | { 37 | var clone = new jsUnitTestSuite(); 38 | clone.testPages = this.testPages; 39 | return clone; 40 | } 41 | 42 | if (xbDEBUG.on) 43 | { 44 | xbDebugTraceObject('window', 'jsUnitTestSuite'); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /jsunit/app/jsUnitTracer.js: -------------------------------------------------------------------------------- 1 | /* @author Edward Hieatt, edward@jsunit.net */ 2 | 3 | function jsUnitTracer() { 4 | this._traceWindow = null; 5 | this.TRACE_LEVEL_WARNING = 1; 6 | this.TRACE_LEVEL_INFO = 2; 7 | this.TRACE_LEVEL_DEBUG = 3; 8 | this.popupWindowsBlocked = false; 9 | } 10 | 11 | jsUnitTracer.prototype.initialize = function () 12 | { 13 | if (this._traceWindow != null && top.testManager.closeTraceWindowOnNewRun.checked) 14 | this._traceWindow.close(); 15 | 16 | this._traceWindow = null; 17 | } 18 | 19 | jsUnitTracer.prototype.finalize = function () 20 | { 21 | if (this._traceWindow!=null) { 22 | this._traceWindow.document.write('<\/body>\n<\/html>'); 23 | this._traceWindow.document.close(); 24 | } 25 | } 26 | 27 | jsUnitTracer.prototype.warn = function () 28 | { 29 | this._trace(arguments[0], arguments[1], this.TRACE_LEVEL_WARNING); 30 | } 31 | 32 | jsUnitTracer.prototype.inform = function () 33 | { 34 | this._trace(arguments[0], arguments[1], this.TRACE_LEVEL_INFO); 35 | } 36 | 37 | jsUnitTracer.prototype.debug = function () 38 | { 39 | this._trace(arguments[0], arguments[1], this.TRACE_LEVEL_DEBUG); 40 | } 41 | 42 | jsUnitTracer.prototype._trace = function (message, value, traceLevel) 43 | { 44 | if (this._getChosenTraceLevel() >= traceLevel) { 45 | var traceString = message; 46 | if (value) 47 | traceString += ': ' + value; 48 | this._writeToTraceWindow(traceString, traceLevel); 49 | } 50 | } 51 | 52 | jsUnitTracer.prototype._getChosenTraceLevel = function () 53 | { 54 | return eval(top.testManager.traceLevel.value); 55 | } 56 | 57 | jsUnitTracer.prototype._writeToTraceWindow = function (traceString, traceLevel) 58 | { 59 | var htmlToAppend = '

' + traceString + '<\/p>\n'; 60 | this._getTraceWindow().document.write(htmlToAppend); 61 | } 62 | 63 | jsUnitTracer.prototype._getTraceWindow = function () 64 | { 65 | if (this._traceWindow == null && !this.popupWindowsBlocked) { 66 | this._traceWindow = window.open('','','width=600, height=350,status=no,resizable=yes,scrollbars=yes'); 67 | if (!this._traceWindow) { 68 | this.popupWindowsBlocked = true; 69 | } 70 | else { 71 | var resDoc = this._traceWindow.document; 72 | resDoc.write('\n\n\nTracing - JsUnit<\/title>\n<head>\n<body>'); 73 | resDoc.write('<h2>Tracing - JsUnit<\/h2>\n'); 74 | } 75 | } 76 | return this._traceWindow; 77 | } 78 | 79 | if (xbDEBUG.on) 80 | { 81 | xbDebugTraceObject('window', 'jsUnitTracer'); 82 | } 83 | 84 | -------------------------------------------------------------------------------- /jsunit/app/main-counts-errors.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 2 | "http://www.w3.org/TR/html4/loose.dtd"> 3 | <html> 4 | <!-- @author Edward Hieatt, edward@jsunit.net --> 5 | <head> 6 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7 | <title> 8 | 9 | 10 | 11 | 12 |

Errors: 0
13 | 14 | -------------------------------------------------------------------------------- /jsunit/app/main-counts-failures.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
Failures: 0
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /jsunit/app/main-counts-runs.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
Runs: 0
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /jsunit/app/main-counts.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <body> 17 | <p>jsUnit has been modified to use frames in order to remove 18 | dependencies upon a browser's implementation of document.getElementById 19 | and HTMLElement.innerHTML.</p> 20 | </body> 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /jsunit/app/main-errors.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsUnit main-errors.html 8 | 9 | 10 | 11 |
12 |
13 |

Errors and failures: 

14 | 17 |
18 | 19 |     20 | 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /jsunit/app/main-frame.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | jsUnit Main Frame 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <body> 17 | <p>Sorry, JsUnit requires frames.</p> 18 | </body> 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /jsunit/app/main-loader.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | jsUnit External Data Document loader 8 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /jsunit/app/main-progress.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsUnit main-progress.html 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 22 | 23 |
Progress: 16 | 17 | 18 | 19 | 20 |
progress image
21 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /jsunit/app/main-results.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsUnit main-results.html 8 | 9 | 10 | 11 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /jsunit/app/main-status.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsUnit main-status.html 8 | 9 | 10 | 11 |
Status: (Idle)
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /jsunit/app/testContainer.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsUnit Test Container 8 | 9 | 10 | 11 | 12 | 13 | <body> 14 | <p>Sorry, JsUnit requires frames.</p> 15 | </body> 16 | 17 | 18 | -------------------------------------------------------------------------------- /jsunit/app/testContainerController.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsUnit Test Container Controller 8 | 69 | 70 | 71 | 72 | Test Container Controller 73 | 74 | -------------------------------------------------------------------------------- /jsunit/changelist.txt: -------------------------------------------------------------------------------- 1 | - Ant script does everything now - compile, create jar, run self-tests, start/stop server, standalone test, distributed test 2 | - Removed all shell scripts 3 | - Upgraded Jetty 4 | - Distributed test run is no longer part of the JsUnitServer - it's just a test to which you pass the remoteURLs 5 | - Preferred way to specify properties is no longer using jsunit.properties -------------------------------------------------------------------------------- /jsunit/css/jsUnitStyle.css: -------------------------------------------------------------------------------- 1 | /* @author Edward Hieatt, edward@jsunit.net */ 2 | 3 | body 4 | { 5 | margin-top: 0; 6 | margin-bottom: 0; 7 | font-family: Verdana, Arial, Helvetica, sans-serif; 8 | color: #000; 9 | font-size: 0.8em; 10 | background-color: #fff; 11 | } 12 | 13 | td 14 | { 15 | padding: 0; 16 | margin: 0; 17 | } 18 | 19 | td img 20 | { 21 | padding: 0; 22 | margin: 0; 23 | vertical-align: baseline; 24 | display: block; 25 | } 26 | 27 | input 28 | { 29 | } 30 | 31 | select 32 | { 33 | } 34 | 35 | a:link, a:visited 36 | { 37 | color : #00F; 38 | } 39 | 40 | a:hover 41 | { 42 | color : #F00; 43 | } 44 | 45 | .jsUnitDefault 46 | { 47 | } 48 | 49 | h1, th 50 | { 51 | font-size: 1.3em; 52 | font-weight: bold; 53 | color: #039; 54 | } 55 | 56 | h2 57 | { 58 | font-weight: bold; 59 | color: #039; 60 | } 61 | 62 | h3 63 | { 64 | font-weight: bold; 65 | color: #039; 66 | text-decoration: underline; 67 | } 68 | 69 | h4 70 | { 71 | font-weight: bold; 72 | color: #039; 73 | } 74 | 75 | .jsUnitTestResultSuccess 76 | { 77 | color: #000; 78 | } 79 | 80 | .jsUnitTestResultNotSuccess 81 | { 82 | color: #F00; 83 | } -------------------------------------------------------------------------------- /jsunit/images/green.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/images/green.gif -------------------------------------------------------------------------------- /jsunit/images/logo_jsunit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/images/logo_jsunit.gif -------------------------------------------------------------------------------- /jsunit/images/red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/images/red.gif -------------------------------------------------------------------------------- /jsunit/intellij/.cvsignore: -------------------------------------------------------------------------------- 1 | JsUnit.iws -------------------------------------------------------------------------------- /jsunit/intellij/JsUnit.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /jsunit/java/bin/.cvsignore: -------------------------------------------------------------------------------- 1 | net -------------------------------------------------------------------------------- /jsunit/java/bin/jsunit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/java/bin/jsunit.jar -------------------------------------------------------------------------------- /jsunit/java/lib/javax.servlet.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/java/lib/javax.servlet.jar -------------------------------------------------------------------------------- /jsunit/java/lib/jdom.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/java/lib/jdom.jar -------------------------------------------------------------------------------- /jsunit/java/lib/jetty.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/java/lib/jetty.jar -------------------------------------------------------------------------------- /jsunit/java/lib/junit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/java/lib/junit.jar -------------------------------------------------------------------------------- /jsunit/java/lib/xerces.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/jsunit/java/lib/xerces.jar -------------------------------------------------------------------------------- /jsunit/java/src/.cvsignore: -------------------------------------------------------------------------------- 1 | net -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/ArgumentsConfiguration.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import java.util.Iterator; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Edward Hieatt, edward@jsunit.net 8 | */ 9 | 10 | public class ArgumentsConfiguration extends Configuration { 11 | private String port; 12 | private String resourceBase; 13 | private String logsDirectory; 14 | private String url; 15 | private String browserFileNames; 16 | 17 | public ArgumentsConfiguration(List args) { 18 | init(args); 19 | } 20 | 21 | private void init(List args) { 22 | for (Iterator it = args.iterator(); it.hasNext();) { 23 | String argument = (String) it.next(); 24 | if (argument.equals("-" + PORT)) 25 | this.port = (String) it.next(); 26 | if (argument.equals("-" + RESOURCE_BASE)) 27 | this.resourceBase = (String) it.next(); 28 | if (argument.equals("-" + LOGS_DIRECTORY)) 29 | this.logsDirectory = (String) it.next(); 30 | if (argument.equals("-" + URL)) 31 | this.url = (String) it.next(); 32 | if (argument.equals("-" + BROWSER_FILE_NAMES)) 33 | this.browserFileNames = (String) it.next(); 34 | } 35 | } 36 | 37 | public String resourceBase() { 38 | return resourceBase; 39 | } 40 | 41 | public String port() { 42 | return port; 43 | } 44 | 45 | public String logsDirectory() { 46 | return logsDirectory; 47 | } 48 | 49 | public String browserFileNames() { 50 | return browserFileNames; 51 | } 52 | 53 | public String url() { 54 | return url; 55 | } 56 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | public class ConfigurationException extends Exception { 4 | private String propertyInError; 5 | private String invalidValue; 6 | 7 | public ConfigurationException(String property, String invalidValue, Exception exception) { 8 | super(exception); 9 | this.propertyInError = property; 10 | this.invalidValue = invalidValue; 11 | } 12 | 13 | public String getPropertyInError() { 14 | return propertyInError; 15 | } 16 | 17 | public String getInvalidValue() { 18 | return invalidValue; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/DistributedTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import junit.framework.TestCase; 4 | import org.jdom.Document; 5 | import org.jdom.Element; 6 | import org.jdom.input.SAXBuilder; 7 | import sun.net.www.protocol.http.HttpURLConnection; 8 | 9 | import java.io.InputStream; 10 | import java.io.StringReader; 11 | import java.net.URL; 12 | import java.util.Iterator; 13 | import java.util.List; 14 | 15 | /** 16 | * @author Edward Hieatt, edward@jsunit.net 17 | */ 18 | 19 | public class DistributedTest extends TestCase { 20 | public static final String REMOTE_MACHINE_URLS = "remoteMachineURLs"; 21 | 22 | private List remoteMachineURLs; 23 | 24 | public DistributedTest(String name) { 25 | super(name); 26 | String urlsString = System.getProperty(REMOTE_MACHINE_URLS); 27 | remoteMachineURLs = Utility.listFromCommaDelimitedString(urlsString); 28 | } 29 | 30 | public void testCollectResults() { 31 | Iterator it = remoteMachineURLs.iterator(); 32 | while (it.hasNext()) { 33 | String next = (String) it.next(); 34 | String result = submitRequestTo(next); 35 | Element resultElement = null; 36 | try { 37 | Document document = new SAXBuilder().build(new StringReader(result)); 38 | resultElement = document.getRootElement(); 39 | if (!"result".equals(resultElement.getName())) 40 | fail("Unrecognized response from " + next + ": " + result); 41 | } catch (Exception e) { 42 | e.printStackTrace(); 43 | fail("Could not parse XML response from " + next + ": " + result); 44 | } 45 | assertEquals(next + " failed", "success", resultElement.getText()); 46 | } 47 | } 48 | 49 | private String submitRequestTo(String remoteMachineName) { 50 | HttpURLConnection connection = null; 51 | try { 52 | URL url = new URL(remoteMachineName + "/jsunit/runner"); 53 | connection = new HttpURLConnection(url, "", 0); 54 | InputStream in = connection.getInputStream(); 55 | byte[] buffer = new byte[in.available()]; 56 | in.read(buffer); 57 | in.close(); 58 | return new String(buffer); 59 | } catch (Exception e) { 60 | e.printStackTrace(); 61 | fail("Could not submit request to " + remoteMachineName); 62 | return null; 63 | } finally { 64 | if (connection != null) 65 | connection.disconnect(); 66 | } 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/EnvironmentVariablesConfiguration.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | public class EnvironmentVariablesConfiguration extends Configuration { 4 | 5 | public String resourceBase() { 6 | return System.getProperty(RESOURCE_BASE); 7 | } 8 | 9 | public String port() { 10 | return System.getProperty(PORT); 11 | } 12 | 13 | public String logsDirectory() { 14 | return System.getProperty(LOGS_DIRECTORY); 15 | } 16 | 17 | public String browserFileNames() { 18 | return System.getProperty(BROWSER_FILE_NAMES); 19 | } 20 | 21 | public String url() { 22 | return System.getProperty(URL); 23 | } 24 | 25 | public boolean isAppropriate() { 26 | return url() != null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/PropertiesFileConfiguration.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import java.io.FileInputStream; 4 | import java.util.Properties; 5 | 6 | /** 7 | * @author Edward Hieatt, edward@jsunit.net 8 | */ 9 | 10 | public class PropertiesFileConfiguration extends Configuration { 11 | 12 | public static final String PROPERTIES_FILE_NAME = "jsunit.properties"; 13 | 14 | private Properties properties; 15 | private String propertiesFileName; 16 | 17 | public PropertiesFileConfiguration(String propertiesFileName) { 18 | this.propertiesFileName = propertiesFileName; 19 | } 20 | 21 | public PropertiesFileConfiguration() { 22 | this(PROPERTIES_FILE_NAME); 23 | } 24 | 25 | public void initialize() { 26 | properties = new Properties(); 27 | try { 28 | FileInputStream fileInputStream = new FileInputStream(propertiesFileName); 29 | properties.load(fileInputStream); 30 | fileInputStream.close(); 31 | } catch (Exception e) { 32 | throw new RuntimeException("Could not load " + propertiesFileName); 33 | } 34 | } 35 | 36 | public String resourceBase() { 37 | return properties.getProperty(RESOURCE_BASE); 38 | } 39 | 40 | public String logsDirectory() { 41 | return properties.getProperty(LOGS_DIRECTORY); 42 | } 43 | 44 | public String port() { 45 | return properties.getProperty(PORT); 46 | } 47 | 48 | public String url() { 49 | return properties.getProperty(URL); 50 | } 51 | 52 | public String browserFileNames() { 53 | return properties.getProperty(BROWSER_FILE_NAMES); 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/StandaloneTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import junit.framework.TestCase; 4 | 5 | import java.util.Iterator; 6 | 7 | /** 8 | * @author Edward Hieatt, edward@jsunit.net 9 | */ 10 | 11 | public class StandaloneTest extends TestCase { 12 | private boolean needToStopServer = false; 13 | public static final int MAX_SECONDS_TO_WAIT = 2 * 60; 14 | private JsUnitServer server; 15 | private Process process; 16 | 17 | public StandaloneTest(String name) { 18 | super(name); 19 | } 20 | 21 | public void setServer(JsUnitServer server) { 22 | this.server = server; 23 | } 24 | 25 | public void setUp() throws Exception { 26 | super.setUp(); 27 | if (server == null) { 28 | server = new JsUnitServer(); 29 | server.initialize(); 30 | server.start(); 31 | needToStopServer = true; 32 | } 33 | } 34 | 35 | public void tearDown() throws Exception { 36 | if (needToStopServer) 37 | server.stop(); 38 | if (process != null) 39 | process.destroy(); 40 | super.tearDown(); 41 | } 42 | 43 | public void testStandaloneRun() throws Exception { 44 | Iterator it = server.getLocalBrowserFileNames().iterator(); 45 | while (it.hasNext()) { 46 | String next = (String) it.next(); 47 | int currentResultCount = server.resultsCount(); 48 | launchBrowser(next); 49 | waitForResultToBeSubmitted(next, currentResultCount); 50 | process.destroy(); 51 | verifyLastResult(); 52 | } 53 | } 54 | 55 | private void launchBrowser(String browser) { 56 | Utility.log("StandaloneTest: launching " + browser); 57 | try { 58 | process = Runtime.getRuntime().exec(new String[] {browser, server.getTestURL().toString()}); 59 | } catch (Throwable t) { 60 | t.printStackTrace(); 61 | fail("All browser processes should start, but the following did not: " + browser); 62 | } 63 | } 64 | 65 | private void waitForResultToBeSubmitted(String browser, int initialResultCount) throws Exception { 66 | Utility.log("StandaloneTest: waiting for " + browser + " to submit result"); 67 | long secondsWaited = 0; 68 | while (server.getResults().size() == initialResultCount) { 69 | Thread.sleep(1000); 70 | secondsWaited ++; 71 | if (secondsWaited > MAX_SECONDS_TO_WAIT) 72 | fail("Waited more than " + MAX_SECONDS_TO_WAIT + " seconds for browser " + browser); 73 | } 74 | } 75 | 76 | private void verifyLastResult() { 77 | TestSuiteResult result = server.lastResult(); 78 | if (!result.hadSuccess()) { 79 | StringBuffer buffer = new StringBuffer(); 80 | buffer.append("Result with ID "); 81 | buffer.append(result.getId()); 82 | buffer.append(" had problems: "); 83 | buffer.append(result.errorCount() + " errors, "); 84 | buffer.append(result.failureCount() + " failures "); 85 | fail(buffer.toString()); 86 | } 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/TestCaseResult.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import org.jdom.Element; 4 | 5 | import java.util.StringTokenizer; 6 | 7 | /** 8 | * @author Edward Hieatt, edward@jsunit.net 9 | */ 10 | 11 | public class TestCaseResult { 12 | public static final String DELIMITER = "|", ERROR_INDICATOR = "E", FAILURE_INDICATOR = "F"; 13 | private String name; 14 | private double time; 15 | private String failure, error; 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public String getError() { 26 | return error; 27 | } 28 | 29 | public void setError(String error) { 30 | this.error = error; 31 | } 32 | 33 | public String getFailure() { 34 | return failure; 35 | } 36 | 37 | public void setFailure(String failure) { 38 | this.failure = failure; 39 | } 40 | 41 | public double getTime() { 42 | return time; 43 | } 44 | 45 | public void setTime(double time) { 46 | this.time = time; 47 | } 48 | 49 | public boolean hadError() { 50 | return error != null; 51 | } 52 | 53 | public boolean hadFailure() { 54 | return failure != null; 55 | } 56 | 57 | public boolean hadSuccess() { 58 | return !hadError() && !hadFailure(); 59 | } 60 | 61 | public static TestCaseResult fromString(String string) { 62 | TestCaseResult result = new TestCaseResult(); 63 | StringTokenizer toker = new StringTokenizer(string, DELIMITER); 64 | try { 65 | result.setName(toker.nextToken()); 66 | result.setTime(Double.parseDouble(toker.nextToken())); 67 | String successString = toker.nextToken(); 68 | if (successString.equals(ERROR_INDICATOR)) 69 | result.setError(toker.nextToken()); 70 | else if (successString.equals(FAILURE_INDICATOR)) 71 | result.setFailure(toker.nextToken()); 72 | } catch (java.util.NoSuchElementException ex) { 73 | result.setError("Incomplete test result: '" + string + "'."); 74 | } 75 | return result; 76 | } 77 | 78 | public static TestCaseResult fromXmlElement(Element testCaseElement) { 79 | return new TestCaseResultBuilder().build(testCaseElement); 80 | } 81 | 82 | public String writeXmlFragment() { 83 | return new TestCaseResultWriter(this).writeXmlFragment(); 84 | } 85 | 86 | public String writeProblemSummary() { 87 | return new TestCaseResultWriter(this).writeProblemSummary(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/TestCaseResultBuilder.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import org.jdom.Element; 4 | 5 | import java.util.Iterator; 6 | 7 | /** 8 | * @author Edward Hieatt, edward@jsunit.net 9 | */ 10 | 11 | public class TestCaseResultBuilder { 12 | public TestCaseResult build(Element element) { 13 | TestCaseResult result = new TestCaseResult(); 14 | updateWithHeaders(result, element); 15 | updateWithMessage(result, element); 16 | return result; 17 | } 18 | 19 | private void updateWithHeaders(TestCaseResult result, Element element) { 20 | result.setName(element.getAttributeValue(TestCaseResultWriter.NAME)); 21 | result.setTime(Double.parseDouble(element.getAttributeValue(TestCaseResultWriter.TIME))); 22 | } 23 | 24 | private void updateWithMessage(TestCaseResult result, Element element) { 25 | Iterator it = element.getChildren().iterator(); 26 | while (it.hasNext()) { 27 | Element next = (Element) it.next(); 28 | String type = next.getName(); 29 | String message = next.getAttributeValue(TestCaseResultWriter.MESSAGE); 30 | if (TestCaseResultWriter.FAILURE.equals(type)) 31 | result.setFailure(message); 32 | else if (TestCaseResultWriter.ERROR.equals(type)) 33 | result.setError(message); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/TestCaseResultWriter.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import org.jdom.Element; 4 | import org.jdom.output.XMLOutputter; 5 | 6 | /** 7 | * @author Edward Hieatt, edward@jsunit.net 8 | */ 9 | 10 | public class TestCaseResultWriter { 11 | public static final String TEST_CASE = "testcase", NAME = "name", TIME = "time", FAILURE = "failure", ERROR = "error", MESSAGE = "message"; 12 | 13 | private TestCaseResult result; 14 | 15 | public TestCaseResultWriter(TestCaseResult result) { 16 | this.result = result; 17 | } 18 | 19 | public void addXmlTo(Element element) { 20 | element.addContent(createTestCaseElement()); 21 | } 22 | 23 | public Element createTestCaseElement() { 24 | Element testCaseElement = new Element(TEST_CASE); 25 | try { 26 | testCaseElement.setAttribute(NAME, result.getName().replace('\u0000', ' ')); 27 | } catch (Exception ex) { 28 | ex.printStackTrace(); 29 | } 30 | testCaseElement.setAttribute(TIME, String.valueOf(result.getTime())); 31 | if (result.hadFailure()) { 32 | Element failureElement = new Element(FAILURE); 33 | try { 34 | failureElement.setAttribute(MESSAGE, result.getFailure().replace('\u0000', ' ')); 35 | } catch (Exception ex) { 36 | ex.printStackTrace(); 37 | } 38 | testCaseElement.addContent(failureElement); 39 | } else if (result.hadError()) { 40 | Element errorElement = new Element(ERROR); 41 | try { 42 | errorElement.setAttribute(MESSAGE, result.getError().replace('\u0000', ' ')); 43 | } catch (Exception ex) { 44 | ex.printStackTrace(); 45 | } 46 | testCaseElement.addContent(errorElement); 47 | } 48 | return testCaseElement; 49 | } 50 | 51 | public String writeProblemSummary() { 52 | if (result.hadFailure()) 53 | return result.getName() + " failed:\n" + result.getFailure(); 54 | else if (result.hadError()) 55 | return result.getName() + " had an error:\n" + result.getError(); 56 | return null; 57 | } 58 | 59 | public String writeXmlFragment() { 60 | return new XMLOutputter().outputString(createTestCaseElement()); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/TestSuiteResultBuilder.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import org.jdom.Document; 4 | import org.jdom.Element; 5 | import org.jdom.input.SAXBuilder; 6 | 7 | import java.io.File; 8 | import java.util.Iterator; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Edward Hieatt, edward@jsunit.net 13 | */ 14 | 15 | public class TestSuiteResultBuilder { 16 | private File logsDirectory; 17 | 18 | public TestSuiteResultBuilder(File logsDirectory) { 19 | this.logsDirectory = logsDirectory; 20 | } 21 | 22 | public TestSuiteResult build(File file) { 23 | try { 24 | Document document = new SAXBuilder().build(file); 25 | return build(document); 26 | } catch (Exception e) { 27 | System.err.println("Failed to read file " + file + ": " + e.getMessage()); 28 | e.printStackTrace(); 29 | return null; 30 | } 31 | } 32 | 33 | public TestSuiteResult build(Document document) { 34 | TestSuiteResult result = new TestSuiteResult(logsDirectory); 35 | Element root = document.getRootElement(); 36 | updateWithHeaders(result, root); 37 | updateWithProperties(root.getChild(TestSuiteResultWriter.PROPERTIES), result); 38 | updateWithTestCaseResults(root.getChildren(TestCaseResultWriter.TEST_CASE), result); 39 | return result; 40 | } 41 | 42 | private void updateWithHeaders(TestSuiteResult result, Element element) { 43 | String id = element.getAttributeValue(TestSuiteResultWriter.ID); 44 | double time = Double.parseDouble(element.getAttributeValue(TestSuiteResultWriter.TIME)); 45 | result.setId(id); 46 | result.setTime(time); 47 | } 48 | 49 | private void updateWithProperties(Element element, TestSuiteResult result) { 50 | Iterator it = element.getChildren().iterator(); 51 | while (it.hasNext()) { 52 | Element next = (Element) it.next(); 53 | if (TestSuiteResultWriter.JSUNIT_VERSION.equals(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_KEY))) 54 | result.setJsUnitVersion(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_VALUE)); 55 | else if (TestSuiteResultWriter.USER_AGENT.equals(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_KEY))) 56 | result.setUserAgent(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_VALUE)); 57 | else if (TestSuiteResultWriter.REMOTE_ADDRESS.equals(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_KEY))) 58 | result.setRemoteAddress(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_VALUE)); 59 | else if (TestSuiteResultWriter.BASE_URL.equals(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_KEY))) 60 | result.setBaseURL(next.getAttributeValue(TestSuiteResultWriter.PROPERTY_VALUE)); 61 | } 62 | } 63 | 64 | private void updateWithTestCaseResults(List testCaseElements, TestSuiteResult result) { 65 | TestCaseResultBuilder testCaseBuilder = new TestCaseResultBuilder(); 66 | Iterator it = testCaseElements.iterator(); 67 | while (it.hasNext()) { 68 | Element next = (Element) it.next(); 69 | result.addTestCaseResult(testCaseBuilder.build(next)); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/TestSuiteResultWriter.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import org.jdom.Document; 4 | import org.jdom.Element; 5 | import org.jdom.output.XMLOutputter; 6 | 7 | import java.util.Iterator; 8 | 9 | /** 10 | * @author Edward Hieatt, edward@jsunit.net 11 | */ 12 | 13 | public class TestSuiteResultWriter { 14 | public static final String ID = "id", 15 | USER_AGENT = "userAgent", 16 | TIME = "time", 17 | TEST_CASES = "testCases", 18 | JSUNIT_VERSION = "JsUnitVersion", 19 | TEST_COUNT = "tests", 20 | REMOTE_ADDRESS = "remoteAddress", 21 | PROPERTIES = "properties", 22 | PROPERTY = "property", 23 | PROPERTY_KEY = "name", 24 | PROPERTY_VALUE = "value", 25 | BASE_URL = "baseURL"; 26 | 27 | TestSuiteResult result; 28 | 29 | public TestSuiteResultWriter(TestSuiteResult result) { 30 | this.result = result; 31 | } 32 | 33 | public String writeXml() { 34 | Element root = createRootElement(); 35 | Document document = new Document(root); 36 | return new XMLOutputter().outputString(document); 37 | } 38 | 39 | public String writeXmlFragment() { 40 | return new XMLOutputter().outputString(createRootElement()); 41 | } 42 | 43 | private Element createRootElement() { 44 | Element root = new Element("testsuite"); 45 | root.setAttribute(ID, result.getId()); 46 | root.setAttribute("errors", "" + result.errorCount()); 47 | root.setAttribute("failures", "" + result.failureCount()); 48 | root.setAttribute("name", "JsUnitTestCase"); 49 | root.setAttribute(TEST_COUNT, "" + result.count()); 50 | root.setAttribute(TIME, String.valueOf(result.getTime())); 51 | addPropertiesElementTo(root); 52 | addTestResultElementsTo(root); 53 | return root; 54 | } 55 | 56 | private void addPropertiesElementTo(Element element) { 57 | Element properties = new Element(PROPERTIES); 58 | element.addContent(properties); 59 | addProperty(properties, JSUNIT_VERSION, result.getJsUnitVersion()); 60 | addProperty(properties, USER_AGENT, result.getUserAgent()); 61 | addProperty(properties, REMOTE_ADDRESS, result.getRemoteAddress()); 62 | addProperty(properties, BASE_URL, result.getBaseURL()); 63 | } 64 | 65 | private void addProperty(Element parent, String name, String value) { 66 | Element property = new Element(PROPERTY); 67 | property.setAttribute(PROPERTY_KEY, name); 68 | property.setAttribute(PROPERTY_VALUE, value == null ? "" : value); 69 | parent.addContent(property); 70 | } 71 | 72 | private void addTestResultElementsTo(Element element) { 73 | Iterator it = result.getTestCaseResults().iterator(); 74 | while (it.hasNext()) { 75 | TestCaseResult next = (TestCaseResult) it.next(); 76 | new TestCaseResultWriter(next).addXmlTo(element); 77 | } 78 | } 79 | 80 | public String writeProblems() { 81 | StringBuffer buffer = new StringBuffer(); 82 | Iterator it = result.getTestCaseResults().iterator(); 83 | while (it.hasNext()) { 84 | TestCaseResult next = (TestCaseResult) it.next(); 85 | if (!next.hadSuccess()) { 86 | if (buffer.length() > 0) 87 | buffer.append("\n"); 88 | String problemMessage = next.writeProblemSummary(); 89 | buffer.append(problemMessage); 90 | } 91 | } 92 | return buffer.toString(); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/Utility.java: -------------------------------------------------------------------------------- 1 | package net.jsunit; 2 | 3 | import java.io.BufferedOutputStream; 4 | import java.io.File; 5 | import java.io.FileOutputStream; 6 | import java.util.*; 7 | 8 | /** 9 | * @author Edward Hieatt, edward@jsunit.net 10 | */ 11 | 12 | public class Utility { 13 | private static boolean logToStandardOut = true; 14 | 15 | public static boolean isEmpty(String s) { 16 | return s == null || s.trim().equals(""); 17 | } 18 | 19 | public static void writeFile(String contents, String fileName) { 20 | writeFile(contents, new File(".", fileName)); 21 | } 22 | 23 | public static void writeFile(String contents, File file) { 24 | try { 25 | if (file.exists()) 26 | file.delete(); 27 | BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file)); 28 | out.write(contents.getBytes()); 29 | out.close(); 30 | } catch (Exception e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | 35 | public static List listFromCommaDelimitedString(String string) { 36 | List result = new ArrayList(); 37 | if (isEmpty(string)) 38 | return result; 39 | StringTokenizer toker = new StringTokenizer(string, ","); 40 | while (toker.hasMoreTokens()) 41 | result.add(toker.nextToken()); 42 | return result; 43 | } 44 | 45 | public static void log(String message, boolean includeDate) { 46 | if (logToStandardOut) { 47 | StringBuffer buffer = new StringBuffer(); 48 | if (includeDate) { 49 | buffer.append(new Date()); 50 | buffer.append(": "); 51 | } 52 | buffer.append(message); 53 | System.out.println(buffer.toString()); 54 | } 55 | } 56 | 57 | public static void log(String message) { 58 | log(message, true); 59 | } 60 | 61 | public static void setLogToStandardOut(boolean b) { 62 | logToStandardOut = b; 63 | } 64 | 65 | public static List listWith(Object object1, Object object2) { 66 | return Arrays.asList(new Object[]{object1, object2}); 67 | } 68 | 69 | public static void deleteFile(String fileName) { 70 | File file = new File(".", fileName); 71 | file.delete(); 72 | } 73 | 74 | public static void deleteDirectory(String directoryName) { 75 | File file = new File(directoryName); 76 | file.delete(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/servlet/JsUnitServlet.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.servlet; 2 | 3 | import net.jsunit.JsUnitServer; 4 | 5 | import javax.servlet.http.HttpServlet; 6 | 7 | public class JsUnitServlet extends HttpServlet { 8 | protected static JsUnitServer server; 9 | 10 | public static void setServer(JsUnitServer aServer) { 11 | server = aServer; 12 | } 13 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/servlet/ResultAcceptorServlet.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.servlet; 2 | 3 | import net.jsunit.TestSuiteResult; 4 | import net.jsunit.Utility; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import java.io.IOException; 10 | import java.io.OutputStream; 11 | 12 | /** 13 | * @author Edward Hieatt, edward@jsunit.net 14 | */ 15 | 16 | public class ResultAcceptorServlet extends JsUnitServlet { 17 | 18 | protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 19 | Utility.log("ResultAcceptorServlet: Received request"); 20 | TestSuiteResult result = server.accept(request); 21 | String xml = result.writeXml(); 22 | response.setContentType("text/xml"); 23 | OutputStream out = response.getOutputStream(); 24 | out.write(xml.getBytes()); 25 | out.close(); 26 | Utility.log("ResultAcceptorServlet: Done"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/servlet/ResultDisplayerServlet.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.servlet; 2 | 3 | import net.jsunit.TestSuiteResult; 4 | import net.jsunit.TestSuiteResultWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import java.io.IOException; 10 | import java.io.OutputStream; 11 | 12 | public class ResultDisplayerServlet extends JsUnitServlet { 13 | 14 | protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 15 | String id = request.getParameter(TestSuiteResultWriter.ID); 16 | String xml = null; 17 | if (id == null) { 18 | xml = "No id specified"; 19 | } else { 20 | TestSuiteResult result = server.findResultWithId(id); 21 | if (result != null) 22 | xml = result.writeXml(); 23 | else 24 | xml = "No Test Result has been submitted with id " + id + ""; 25 | } 26 | response.setContentType("text/xml"); 27 | OutputStream out = response.getOutputStream(); 28 | out.write(xml.getBytes()); 29 | out.close(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/servlet/TestRunnerServlet.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.servlet; 2 | 3 | import junit.framework.TestResult; 4 | import junit.textui.TestRunner; 5 | import net.jsunit.StandaloneTest; 6 | import net.jsunit.Utility; 7 | 8 | import javax.servlet.ServletException; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import java.io.IOException; 12 | import java.io.OutputStream; 13 | 14 | /** 15 | * @author Edward Hieatt, edward@jsunit.net 16 | */ 17 | 18 | public class TestRunnerServlet extends JsUnitServlet { 19 | 20 | protected synchronized void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 21 | Utility.log("TestRunnerServlet: Received request to run standalone test..."); 22 | StandaloneTest test = createTest(); 23 | TestResult result = TestRunner.run(test); 24 | writeResponse(response, result); 25 | Utility.log("TestRunnerServlet: ...Done"); 26 | } 27 | 28 | protected void writeResponse(HttpServletResponse response, TestResult result) throws IOException { 29 | response.setContentType("text/xml"); 30 | OutputStream out = response.getOutputStream(); 31 | String resultString = result.wasSuccessful() ? "success" : "failure"; 32 | out.write(("" + resultString + "").getBytes()); 33 | out.close(); 34 | } 35 | 36 | protected StandaloneTest createTest() { 37 | StandaloneTest standaloneTest = new StandaloneTest("testStandaloneRun"); 38 | standaloneTest.setServer(server); 39 | return standaloneTest; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/ArgumentsConfigurationTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import net.jsunit.ArgumentsConfiguration; 4 | import net.jsunit.Utility; 5 | import net.jsunit.JsUnitServer; 6 | 7 | import java.io.File; 8 | import java.util.Arrays; 9 | import java.util.List; 10 | 11 | import junit.framework.TestCase; 12 | 13 | public class ArgumentsConfigurationTest extends TestCase { 14 | public ArgumentsConfigurationTest(String name) { 15 | super(name); 16 | } 17 | 18 | public void testSimple() throws Exception { 19 | List args = Arrays.asList(new String[] { 20 | "-port", "12345", 21 | "-url", "http://www.jsunit.net/", 22 | "-resourceBase", "foo", 23 | "-logsDirectory", "bar", 24 | "-remoteMachineNames", "foo,bar", 25 | "-browserFileNames", "fu,bar" 26 | }); 27 | JsUnitServer server = new JsUnitServer(); 28 | ArgumentsConfiguration configuration = new ArgumentsConfiguration(args); 29 | configuration.configure(server); 30 | assertEquals(12345, server.getPort()); 31 | assertEquals(new File("foo"), server.getResourceBase()); 32 | assertEquals(new File("bar"), server.getLogsDirectory()); 33 | assertEquals(Utility.listWith("fu", "bar"), server.getLocalBrowserFileNames()); 34 | assertEquals("http://www.jsunit.net/", server.getTestURL().toString()); 35 | } 36 | 37 | public void tearDown() throws Exception { 38 | File createdLogsDirectory = new File("bar"); 39 | if (createdLogsDirectory.exists()) 40 | createdLogsDirectory.delete(); 41 | super.tearDown(); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/ConfigurationTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import net.jsunit.*; 5 | 6 | public class ConfigurationTest extends TestCase { 7 | 8 | public void testResolveArgumentsConfiguration() { 9 | Configuration configuration = Configuration.resolve(new String[] {"foo"}); 10 | assertTrue(configuration instanceof ArgumentsConfiguration); 11 | } 12 | 13 | public void testResolveEnvironmentVariablesConfiguration() { 14 | System.setProperty(Configuration.URL, "foo"); 15 | Configuration configuration = Configuration.resolve(new String[] {}); 16 | assertTrue(configuration instanceof EnvironmentVariablesConfiguration); 17 | } 18 | 19 | public void testResolvePropertiesConfiguration() { 20 | Configuration configuration = Configuration.resolve(new String[] {}); 21 | assertTrue(configuration instanceof PropertiesFileConfiguration); 22 | } 23 | 24 | protected void tearDown() throws Exception { 25 | System.getProperties().clear(); 26 | super.tearDown(); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/DistributedTestTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | 4 | import junit.framework.TestResult; 5 | import junit.framework.TestCase; 6 | import junit.textui.TestRunner; 7 | import net.jsunit.DistributedTest; 8 | import net.jsunit.JsUnitServer; 9 | import net.jsunit.Configuration; 10 | 11 | public class DistributedTestTest extends TestCase { 12 | private JsUnitServer server; 13 | 14 | public DistributedTestTest(String name) { 15 | super(name); 16 | } 17 | 18 | public void setUp() throws Exception { 19 | super.setUp(); 20 | System.setProperty(Configuration.BROWSER_FILE_NAMES, "c:\\program files\\internet explorer\\iexplore.exe"); 21 | System.setProperty(Configuration.URL, "file:///c:/dev/jsunit/testRunner.html?testPage=c:\\dev\\jsunit\\tests\\jsUnitTestSuite.html&autoRun=true&submitresults=true"); 22 | server = new JsUnitServer(); 23 | server.initialize(); 24 | server.start(); 25 | } 26 | 27 | public void tearDown() throws Exception { 28 | server.stop(); 29 | System.getProperties().remove(Configuration.BROWSER_FILE_NAMES); 30 | System.getProperties().remove(Configuration.URL); 31 | super.tearDown(); 32 | } 33 | 34 | public void testDistributedRunWithTwoLocalhosts() { 35 | System.setProperty(DistributedTest.REMOTE_MACHINE_URLS, "http://localhost:8080, http://localhost:8080"); 36 | TestResult result = TestRunner.run(new DistributedTest("testCollectResults")); 37 | assertEquals(1, result.runCount()); 38 | assertTrue(result.wasSuccessful()); 39 | } 40 | 41 | public void testDistributedRunWithInvalidHosts() { 42 | System.setProperty(DistributedTest.REMOTE_MACHINE_URLS, "http://fooXXX:1234, http://barXXX:5678"); 43 | TestResult result = TestRunner.run(new DistributedTest("testCollectResults")); 44 | assertEquals(1, result.runCount()); 45 | assertFalse(result.wasSuccessful()); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/EndToEndTestSuite.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import junit.framework.TestSuite; 5 | import net.jsunit.StandaloneTest; 6 | 7 | /** 8 | * @author Edward Hieatt, edward@jsunit.net 9 | */ 10 | 11 | public class EndToEndTestSuite extends TestCase { 12 | public static TestSuite suite() { 13 | TestSuite result = new TestSuite(); 14 | result.addTestSuite(StandaloneTestTest.class); 15 | result.addTestSuite(DistributedTestTest.class); 16 | return result; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/EnvironmentVariablesConfigurationTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import net.jsunit.EnvironmentVariablesConfiguration; 5 | import net.jsunit.Configuration; 6 | 7 | public class EnvironmentVariablesConfigurationTest extends TestCase { 8 | private EnvironmentVariablesConfiguration config; 9 | 10 | protected void setUp() throws Exception { 11 | super.setUp(); 12 | config = new EnvironmentVariablesConfiguration(); 13 | } 14 | 15 | public void testSimple() { 16 | System.setProperty(Configuration.BROWSER_FILE_NAMES, "aaa"); 17 | System.setProperty(Configuration.LOGS_DIRECTORY, "bbb"); 18 | System.setProperty(Configuration.PORT, "1234"); 19 | System.setProperty(Configuration.RESOURCE_BASE, "ccc"); 20 | System.setProperty(Configuration.URL, "ddd"); 21 | assertTrue(config.isAppropriate()); 22 | assertEquals("aaa", config.browserFileNames()); 23 | assertEquals("bbb", config.logsDirectory()); 24 | assertEquals("1234", config.port()); 25 | assertEquals("ccc", config.resourceBase()); 26 | assertEquals("ddd", config.url()); 27 | } 28 | 29 | public void testIsAppropriate() { 30 | assertFalse(config.isAppropriate()); 31 | } 32 | 33 | public void tearDown() throws Exception { 34 | System.getProperties().remove(Configuration.BROWSER_FILE_NAMES); 35 | System.getProperties().remove(Configuration.LOGS_DIRECTORY); 36 | System.getProperties().remove(Configuration.PORT); 37 | System.getProperties().remove(Configuration.RESOURCE_BASE); 38 | System.getProperties().remove(Configuration.URL); 39 | super.tearDown(); 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/PropertiesConfigurationTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import net.jsunit.Configuration; 5 | import net.jsunit.JsUnitServer; 6 | import net.jsunit.PropertiesFileConfiguration; 7 | import net.jsunit.Utility; 8 | 9 | public class PropertiesConfigurationTest extends TestCase { 10 | 11 | public void testNoFile() throws Exception { 12 | PropertiesFileConfiguration configuration = new PropertiesFileConfiguration("nosuch.file"); 13 | try { 14 | configuration.configure(new JsUnitServer()); 15 | fail("Should have through a Runtime because no properties file exists"); 16 | } catch (RuntimeException e) { 17 | } 18 | } 19 | 20 | public void testSimple() throws Exception { 21 | writePropertiesFile("temp.file"); 22 | PropertiesFileConfiguration configuration = new PropertiesFileConfiguration("temp.file"); 23 | configuration.initialize(); 24 | assertEquals("aaa", configuration.browserFileNames()); 25 | assertEquals("bbb", configuration.logsDirectory()); 26 | assertEquals("1234", configuration.port()); 27 | assertEquals("ccc", configuration.resourceBase()); 28 | assertEquals("ddd", configuration.url()); 29 | } 30 | 31 | public void tearDown() throws Exception { 32 | Utility.deleteFile("temp.file"); 33 | // Utility.deleteDirectory("bbb"); 34 | super.tearDown(); 35 | } 36 | 37 | private void writePropertiesFile(String fileName) { 38 | String contents = 39 | Configuration.BROWSER_FILE_NAMES + "=aaa\n" + 40 | Configuration.LOGS_DIRECTORY + "=bbb\n" + 41 | Configuration.PORT + "=1234\n" + 42 | Configuration.RESOURCE_BASE + "=ccc\n" + 43 | Configuration.URL + "=ddd"; 44 | Utility.writeFile(contents, fileName); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/StandaloneTestTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import net.jsunit.StandaloneTest; 4 | import net.jsunit.Configuration; 5 | 6 | public class StandaloneTestTest extends StandaloneTest { 7 | public StandaloneTestTest(String name) { 8 | super(name); 9 | } 10 | 11 | public void setUp() throws Exception { 12 | System.setProperty(Configuration.BROWSER_FILE_NAMES, "c:\\program files\\internet explorer\\iexplore.exe,c:\\program files\\Mozilla Firefox\\firefox.exe"); 13 | System.setProperty(Configuration.URL, "file:///c:/dev/jsunit/testRunner.html?testPage=c:\\dev\\jsunit\\tests\\jsUnitTestSuite.html&autoRun=true&submitresults=true"); 14 | super.setUp(); 15 | } 16 | 17 | public void tearDown() throws Exception { 18 | System.getProperties().remove(Configuration.BROWSER_FILE_NAMES); 19 | System.getProperties().remove(Configuration.URL); 20 | super.tearDown(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/Suite.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import junit.framework.TestSuite; 5 | 6 | /** 7 | * @author Edward Hieatt, edward@jsunit.net 8 | */ 9 | 10 | public class Suite extends TestCase { 11 | public static TestSuite suite() { 12 | TestSuite result = new TestSuite(); 13 | result.addTestSuite(TestCaseResultTest.class); 14 | result.addTestSuite(TestSuiteResultTest.class); 15 | result.addTestSuite(ResultAcceptorTest.class); 16 | result.addTestSuite(ConfigurationTest.class); 17 | result.addTestSuite(ArgumentsConfigurationTest.class); 18 | result.addTestSuite(PropertiesConfigurationTest.class); 19 | result.addTestSuite(EnvironmentVariablesConfigurationTest.class); 20 | return result; 21 | } 22 | } -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/TestCaseResultTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import net.jsunit.TestCaseResult; 5 | import net.jsunit.TestCaseResultWriter; 6 | import org.jdom.Element; 7 | 8 | /** 9 | * @author Edward Hieatt, edward@jsunit.net 10 | */ 11 | 12 | public class TestCaseResultTest extends TestCase { 13 | public TestCaseResultTest(String name) { 14 | super(name); 15 | } 16 | 17 | public void testBuildSuccessfulResultFromString() { 18 | TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|S||"); 19 | assertEquals("file:///dummy/path/dummyPage.html:testFoo", result.getName()); 20 | assertEquals(1.3d, result.getTime(), .001d); 21 | assertFalse(result.hadError()); 22 | assertFalse(result.hadFailure()); 23 | assertTrue(result.hadSuccess()); 24 | assertNull(result.getError()); 25 | assertNull(result.getFailure()); 26 | assertEquals("", result.writeXmlFragment()); 27 | } 28 | 29 | public void testProblemSummary() { 30 | TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|E|Test Error Message|"); 31 | assertEquals("file:///dummy/path/dummyPage.html:testFoo had an error:\nTest Error Message", result.writeProblemSummary()); 32 | } 33 | 34 | public void testBuildErrorResultFromString() { 35 | TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|E|Test Error Message|"); 36 | assertEquals("file:///dummy/path/dummyPage.html:testFoo", result.getName()); 37 | assertEquals(1.3d, result.getTime(), .001d); 38 | assertTrue(result.hadError()); 39 | assertFalse(result.hadFailure()); 40 | assertFalse(result.hadSuccess()); 41 | assertEquals("Test Error Message", result.getError()); 42 | assertNull(result.getFailure()); 43 | assertEquals("", result.writeXmlFragment()); 44 | } 45 | 46 | public void testBuildFailureResultFromString() { 47 | TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|F|Test Failure Message|"); 48 | assertEquals("file:///dummy/path/dummyPage.html:testFoo", result.getName()); 49 | assertEquals(1.3d, result.getTime(), .001d); 50 | assertFalse(result.hadError()); 51 | assertTrue(result.hadFailure()); 52 | assertFalse(result.hadSuccess()); 53 | assertNull(result.getError()); 54 | assertEquals("Test Failure Message", result.getFailure()); 55 | assertEquals("", result.writeXmlFragment()); 56 | } 57 | 58 | public void testBuildFromXmlFragment() { 59 | TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|F|Test Failure Message|"); 60 | Element element = new TestCaseResultWriter(result).createTestCaseElement(); 61 | TestCaseResult reconstitutedResult = TestCaseResult.fromXmlElement(element); 62 | assertEquals("file:///dummy/path/dummyPage.html:testFoo", reconstitutedResult.getName()); 63 | assertEquals(1.3d, reconstitutedResult.getTime(), .001d); 64 | assertFalse(reconstitutedResult.hadError()); 65 | assertTrue(reconstitutedResult.hadFailure()); 66 | assertFalse(reconstitutedResult.hadSuccess()); 67 | assertNull(reconstitutedResult.getError()); 68 | assertEquals("Test Failure Message", reconstitutedResult.getFailure()); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /jsunit/java/src/net/jsunit/test/TestSuiteResultTest.java: -------------------------------------------------------------------------------- 1 | package net.jsunit.test; 2 | 3 | import junit.framework.TestCase; 4 | import net.jsunit.TestCaseResult; 5 | import net.jsunit.TestSuiteResult; 6 | import net.jsunit.Utility; 7 | 8 | import java.io.File; 9 | import java.util.Iterator; 10 | 11 | /** 12 | * @author Edward Hieatt, edward@jsunit.net 13 | */ 14 | 15 | public class TestSuiteResultTest extends TestCase { 16 | private TestSuiteResult result; 17 | private String expectedXmlFragment = 18 | "" 19 | + "" 20 | + "" 21 | + "" 22 | + "" 23 | + "" 24 | + "" 25 | + "" 26 | + "" 27 | + "" 28 | + "" 29 | + "" 30 | + "" 31 | + "" 32 | + ""; 33 | 34 | public TestSuiteResultTest(String name) { 35 | super(name); 36 | } 37 | 38 | public void setUp() throws Exception { 39 | super.setUp(); 40 | result = new TestSuiteResult(null); 41 | result.setJsUnitVersion("2.5"); 42 | result.setId("An ID"); 43 | result.setUserAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); 44 | result.setRemoteAddress("Dummy Remote Address"); 45 | result.setBaseURL("about:mozilla"); 46 | result.setTime(4.3); 47 | result.setTestCaseStrings(new String[]{"testFoo|1.3|S||", "testFoo|1.3|E|Test Error Message|", "testFoo|1.3|F|Test Failure Message|"}); 48 | } 49 | 50 | public void testId() { 51 | assertNotNull(result.getId()); 52 | result = new TestSuiteResult(null); 53 | result.setId("foo"); 54 | assertEquals("foo", result.getId()); 55 | } 56 | 57 | public void testFields() { 58 | assertFields(result); 59 | } 60 | 61 | private void assertFields(TestSuiteResult aResult) { 62 | assertEquals("2.5", aResult.getJsUnitVersion()); 63 | assertEquals("An ID", aResult.getId()); 64 | assertEquals("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", aResult.getUserAgent()); 65 | assertEquals("Dummy Remote Address", aResult.getRemoteAddress()); 66 | assertEquals(4.3d, aResult.getTime(), 0.001d); 67 | assertEquals(3, aResult.getTestCaseResults().size()); 68 | Iterator it = aResult.getTestCaseResults().iterator(); 69 | while (it.hasNext()) { 70 | TestCaseResult next = (TestCaseResult) it.next(); 71 | assertNotNull(next); 72 | } 73 | } 74 | 75 | public void testXml() { 76 | assertEquals(expectedXmlFragment, result.writeXmlFragment()); 77 | } 78 | 79 | public void testSuccess() { 80 | assertFalse(result.hadSuccess()); 81 | } 82 | 83 | public void testBuildFromXml() { 84 | Utility.writeFile(result.writeXml(), "resultXml.xml"); 85 | File file = new File("resultXml.xml"); 86 | TestSuiteResult reconstitutedResult = TestSuiteResult.fromXmlFile(file); 87 | assertFields(reconstitutedResult); 88 | file.delete(); 89 | } 90 | } -------------------------------------------------------------------------------- /jsunit/jsunit.properties.sample: -------------------------------------------------------------------------------- 1 | #jsunit.properties is one way to specify the various properties used by the JsUnitServer 2 | #Its use is discouraged. 3 | #If you are running tests using the ant script build.xml, the properties are set in its targets. 4 | #If you are running JsUnit programmatically, use System.setProperty(String, String) to specify properties. 5 | 6 | #To use this file, rename it to jsunit.properties 7 | 8 | #browserFileNames is the list of browsers in which to run tests when StandaloneTest is invoked on this machine. This is a mandatory property. 9 | #For example: browserFileNames=c:\\program files\\internet explorer\\iexplore.exe,c:\\program files\\netscape\\netscape7.1\\netscp.exe,C:\\Program Files\\Netscape\\Netscape7.01\\netscp.exe,C:\\Program Files\\Netscape\\Netscape6.2.3\\netscp6.exe,browserFileNames=c:\\MozillaFirebird\\MozillaFirebird.exe 10 | browserFileNames=c:\\program files\\internet explorer\\iexplore.exe,c:\\program files\\Mozilla Firefox\\firefox.exe 11 | 12 | #url is the URL (HTTP or file protocol) to open in the browser. This is a mandatory property. 13 | #For example: url=file:///c:/jsunit/testRunner.html?testPage=c:\\jsunit\\tests\\jsUnitTestSuite.html&autoRun=true&submitresults=true 14 | url=file:///c:/jsunit/testRunner.html?testPage=c:\\jsunit\\tests\\jsUnitTestSuite.html&autoRun=true&submitresults=true 15 | 16 | #resourceBase is the directory that the JsUnitServer considers to be its document root. It can be specified relative to the working directory. If not specified, the working directory is assumed. This is not a mandatory property. 17 | #For example, resourceBase=c:\\jsunit 18 | resourceBase= 19 | 20 | #logsDirectory is the directory in which the JsUnitServer stores the XML logs produced from a test run. It can be specified relative to the working directory. If not specified, the directory called "logs" inside resourceBase is assumed. This is not a mandatory property. 21 | #For example, logsDirectory=c:\\jsunit\\java\logs 22 | logsDirectory= 23 | 24 | #port is the port on which the JsUnitServer runs. If not specified, 8080 is assumed. This is not a mandatory property. 25 | #For example, port=8080 26 | port= -------------------------------------------------------------------------------- /jsunit/licenses/JDOM_license.txt: -------------------------------------------------------------------------------- 1 | /*-- 2 | 3 | $Id: JDOM_license.txt,v 1.1 2003/07/24 04:31:23 edwardhieatt Exp $ 4 | 5 | Copyright (C) 2000-2003 Jason Hunter & Brett McLaughlin. 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions, and the following disclaimer. 14 | 15 | 2. Redistributions in binary form must reproduce the above copyright 16 | notice, this list of conditions, and the disclaimer that follows 17 | these conditions in the documentation and/or other materials 18 | provided with the distribution. 19 | 20 | 3. The name "JDOM" must not be used to endorse or promote products 21 | derived from this software without prior written permission. For 22 | written permission, please contact . 23 | 24 | 4. Products derived from this software may not be called "JDOM", nor 25 | may "JDOM" appear in their name, without prior written permission 26 | from the JDOM Project Management . 27 | 28 | In addition, we request (but do not require) that you include in the 29 | end-user documentation provided with the redistribution and/or in the 30 | software itself an acknowledgement equivalent to the following: 31 | "This product includes software developed by the 32 | JDOM Project (http://www.jdom.org/)." 33 | Alternatively, the acknowledgment may be graphical using the logos 34 | available at http://www.jdom.org/images/logos. 35 | 36 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 37 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 38 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 39 | DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT 40 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 42 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 43 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 45 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 46 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 47 | SUCH DAMAGE. 48 | 49 | This software consists of voluntary contributions made by many 50 | individuals on behalf of the JDOM Project and was originally 51 | created by Jason Hunter and 52 | Brett McLaughlin . For more information on 53 | the JDOM Project, please see . 54 | 55 | */ 56 | 57 | -------------------------------------------------------------------------------- /jsunit/licenses/mpl-tri-license-c.txt: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is __________________________________________. 15 | * 16 | * The Initial Developer of the Original Code is 17 | * ____________________________________________. 18 | * Portions created by the Initial Developer are Copyright (C) 2___ 19 | * the Initial Developer. All Rights Reserved. 20 | * 21 | * Contributor(s): 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of 24 | * either the GNU General Public License Version 2 or later (the "GPL"), or 25 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 26 | * in which case the provisions of the GPL or the LGPL are applicable instead 27 | * of those above. If you wish to allow use of your version of this file only 28 | * under the terms of either the GPL or the LGPL, and not to allow others to 29 | * use your version of this file under the terms of the MPL, indicate your 30 | * decision by deleting the provisions above and replace them with the notice 31 | * and other provisions required by the GPL or the LGPL. If you do not delete 32 | * the provisions above, a recipient may use your version of this file under 33 | * the terms of any one of the MPL, the GPL or the LGPL. 34 | * 35 | * ***** END LICENSE BLOCK ***** */ 36 | -------------------------------------------------------------------------------- /jsunit/licenses/mpl-tri-license-html.txt: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /jsunit/logs/.cvsignore: -------------------------------------------------------------------------------- 1 | * -------------------------------------------------------------------------------- /jsunit/readme.txt: -------------------------------------------------------------------------------- 1 | JsUnit 2 | Copyright (C) 2001-4 Edward Hieatt, edward@jsunit.net 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | Please see http://www.jsunit.net/ for JsUnit documentation and 19 | the "licenses" directory for license information. -------------------------------------------------------------------------------- /jsunit/tests/data/data.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | test 7 | 8 | 9 |

foo

10 |

foo

11 |

foo

12 |

foo

13 |

foo

14 |

foo

15 |

foo

16 |

foo

17 |

foo

18 |

foo

19 |

foo

20 |

foo

21 |

foo

22 |

foo

23 |

foo

24 |

foo

25 |

foo

26 |

foo

27 |

foo

28 |

foo

29 |

foo

30 |

foo

31 |

foo

32 |

foo

33 |

foo

34 |

foo

35 |

foo

36 |

foo

37 |

foo

38 |

foo

39 |

foo

40 |

foo

41 |

foo

42 |

foo

43 |

foo

44 |

foo

45 |

foo

46 |

foo

47 |

foo

48 |

foo

49 |

foo

50 |

foo

51 |

foo

52 |

foo

53 |

foo

54 |

foo

55 |

foo

56 |

foo

57 |

foo

58 |

foo

59 |

foo

60 |

foo

61 |

foo

62 |

foo

63 |

foo

64 |

foo

65 |

foo

66 |

foo

67 |

foo

68 |

foo

69 |

foo

70 |

foo

71 |

foo

72 |

foo

73 |

foo

74 |

foo

75 |

foo

76 |

foo

77 |

foo

78 |

foo

79 |

foo

80 |

foo

81 |

foo

82 |

foo

83 |

foo

84 |

foo

85 |

foo

86 |

foo

87 |

foo

88 |

foo

89 |

foo

90 |

foo

91 |

foo

92 |

foo

93 |

foo

94 |

foo

95 |

foo

96 |

foo

97 |

foo

98 |

foo

99 |

foo

100 |

foo

101 |

foo

102 |

foo

103 |

foo

104 |

foo

105 |

foo

106 |

foo

107 |

foo

108 |

foo

109 |

foo

110 |

foo

111 |

foo

112 |

foo

113 | 114 | 115 | -------------------------------------------------------------------------------- /jsunit/tests/data/staff.css: -------------------------------------------------------------------------------- 1 | staff 2 | { 3 | display: table; 4 | color: black; 5 | background-color: white; 6 | border: solid 1px black; 7 | } 8 | 9 | employee 10 | { 11 | display: table-row; 12 | border: solid 1px black; 13 | padding: 1px; 14 | } 15 | 16 | employeeId, name, position, salary, gender, address 17 | { 18 | display: table-cell; 19 | border: solid 1px black; 20 | padding: 1px; 21 | } 22 | 23 | address[domestic="Yes"] 24 | { 25 | background-color: silver; 26 | } 27 | 28 | address[street="Yes"] 29 | { 30 | color: green; 31 | } 32 | 33 | address[street="No"] 34 | { 35 | color: red; 36 | } 37 | -------------------------------------------------------------------------------- /jsunit/tests/data/staff.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 15 | 17 | 18 | -------------------------------------------------------------------------------- /jsunit/tests/data/staff.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Element data"> 7 | 8 | 9 | 10 | 11 | ]> 12 | 13 | 14 | 15 | EMP0001 16 | Margaret Martin 17 | Accountant 18 | 56,000 19 | Female 20 |
1230 North Ave. Dallas, Texas 98551
21 |
22 | 23 | EMP0002 24 | Martha Raynolds 25 | 26 | Secretary 27 | 35,000 28 | Female 29 |
&ent2; Dallas, &ent3; 30 | 98554
31 |
32 | 33 | EMP0003 34 | Roger 35 | Jones 36 | Department Manager 37 | 100,000 38 | &ent4; 39 | 40 |
PO Box 27 Irving, texas 98553
41 |
42 | 43 | EMP0004 44 | Jeny Oconnor 45 | Personnel Director 46 | 95,000 47 | Female 48 |
27 South Road. Dallas, Texas 98556
49 |
50 | 51 | EMP0005 52 | Robert Myers 53 | Computer Specialist 54 | 90,000 55 | male 56 |
1821 Nordic. Road, Irving Texas 98558
57 |
58 |
59 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclOnLoadTests.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit OnLoad Tests 47 | 48 | 49 | 66 | 67 | 68 | 69 |

JsUnit OnLoad Tests

70 | 71 |

This page contains tests for the JsUnit Framework. 72 | To see them, take a look at the source.

73 | 74 | 75 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclSetUpTearDownTests.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit Framework tests 47 | 48 | 49 | 80 | 81 | 82 | 83 |

JsUnit Framework tests

84 | 85 |

This page contains tests for the JsUnit setUp and 86 | tearDown framework, including testing the order of the tests. To see them, 87 | take a look at the source.

88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclTestLoadData.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 42 | 43 | 44 | 45 | Test loading a local HTML Document 46 | 47 | 48 | 81 | 82 | 83 |

JsUnit Asynchronous Load Tests

84 |

This page tests loading data documents asynchronously. To see them, take a look at the source.

85 | 86 | 87 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclTestSetUpPages.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 42 | 43 | 44 | 45 | Test loading a local HTML Document 46 | 47 | 48 | 77 | 78 | 79 |

JsUnit Asynchronous setUpPages

80 |

This page tests asynchronoush pre tests. To see them, take a look at the source.

81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclTestSetUpPagesSuite.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit Test Suite 47 | 48 | 49 | 63 | 64 | 65 | 66 |

JsUnit Test Suite

67 | 68 |

This page contains a suite of tests for testing 69 | JsUnit's setUpPages functionality.

70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclTestSuite.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit Test Suite 47 | 48 | 49 | 72 | 73 | 74 | 75 |

JsUnit Test Suite

76 | 77 |

This page contains a suite of tests for testing 78 | JsUnit.

79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitDeclarationTests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 42 | 43 | 44 | 45 | JsUnit Declaration Tests 46 | 47 | 48 | 65 | 66 | 67 | 68 |

JsUnit Declaration Tests

69 | 70 |

This page tests the Declaration of Test Functions as opposed to reflecting for them.

71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitOnLoadTests.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit OnLoad Tests 47 | 48 | 49 | 60 | 61 | 62 | 63 |

JsUnit OnLoad Tests

64 | 65 |

This page contains tests for the JsUnit Framework. 66 | To see them, take a look at the source.

67 | 68 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitSetUpTearDownTests.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit Framework tests 47 | 48 | 49 | 74 | 75 | 76 | 77 |

JsUnit Framework tests

78 | 79 |

This page contains tests for the JsUnit setUp and 80 | tearDown framework, including testing the order of the tests. To see them, 81 | take a look at the source.

82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitTestLoadData.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 42 | 43 | 44 | 45 | Test loading a local HTML Document 46 | 47 | 48 | 75 | 76 | 77 |

JsUnit Asynchronous Load Tests

78 |

This page tests loading data documents asynchronously. To see them, take a look at the source.

79 | 80 | 81 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitTestSetUpPages.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 42 | 43 | 44 | 45 | Test loading a local HTML Document 46 | 47 | 48 | 71 | 72 | 73 |

JsUnit Asynchronous setUpPages

74 |

This page tests asynchronoush pre tests. To see them, take a look at the source.

75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitTestSetUpPagesSuite.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit Test Suite 47 | 48 | 49 | 63 | 64 | 65 | 66 |

JsUnit Test Suite

67 | 68 |

This page contains a suite of tests for testing 69 | JsUnit's setUpPages functionality.

70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /jsunit/tests/jsUnitTestSuite.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 43 | 44 | 45 | 46 | JsUnit Test Suite 47 | 48 | 49 | 72 | 73 | 74 | 75 |

JsUnit Test Suite

76 | 77 |

This page contains a suite of tests for testing 78 | JsUnit.

79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /protovis_integration/antibiotics_animated/antibiotics-scatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Antibiotic Effectiveness 4 | 5 | 6 | 7 | 15 | 16 |
17 | 112 |
113 | 114 | -------------------------------------------------------------------------------- /protovis_integration/antibiotics_animated/antibiotics.js: -------------------------------------------------------------------------------- 1 | var antibiotics = ["penicillin", "streptomycin", "neomycin"]; 2 | 3 | var bacteria = [ 4 | {name: "Mycobacterium tuberculosis", penicillin: 800, streptomycin: 5, neomycin: 2, gram: "negative"}, 5 | {name: "Salmonella schottmuelleri", penicillin: 10, streptomycin: 0.8, neomycin: 0.09, gram: "negative"}, 6 | {name: "Proteus vulgaris", penicillin: 3, streptomycin: 0.1, neomycin: 0.1, gram: "negative"}, 7 | {name: "Klebsiella pneumoniae", penicillin: 850, streptomycin: 1.2, neomycin: 1, gram: "negative"}, 8 | {name: "Brucella abortus", penicillin: 1, streptomycin: 2, neomycin: 0.02, gram: "negative"}, 9 | {name: "Pseudomonas aeruginosa", penicillin: 850, streptomycin: 2, neomycin: 0.4, gram: "negative"}, 10 | {name: "Escherichia coli", penicillin: 100, streptomycin: 0.4, neomycin: 0.1, gram: "negative"}, 11 | {name: "Salmonella (Eberthella) typhosa", penicillin: 1, streptomycin: 0.4, neomycin: 0.008, gram: "negative"}, 12 | {name: "Aerobacter aerogenes", penicillin: 870, streptomycin: 1, neomycin: 1.6, gram: "negative"}, 13 | {name: "Brucella antracis", penicillin: 0.001, streptomycin: 0.01, neomycin: 0.007, gram: "positive"}, 14 | {name: "Streptococcus fecalis", penicillin: 1, streptomycin: 1, neomycin: 0.1, gram: "positive"}, 15 | {name: "Staphylococcus aureus", penicillin: 0.03, streptomycin: 0.03, neomycin: 0.001, gram: "positive"}, 16 | {name: "Staphylococcus albus", penicillin: 0.007, streptomycin: 0.1, neomycin: 0.001, gram: "positive"}, 17 | {name: "Streptococcus hemolyticus", penicillin: 0.001, streptomycin: 14, neomycin: 10, gram: "positive"}, 18 | {name: "Streptococcus viridans", penicillin: 0.005, streptomycin: 10, neomycin: 40, gram: "positive"}, 19 | {name: "Diplococcus pneumoniae", penicillin: 0.005, streptomycin: 11, neomycin: 10, gram: "positive"} 20 | ]; 21 | -------------------------------------------------------------------------------- /protovis_integration/antibiotics_animated/svg3d/dom_utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/protovis_integration/antibiotics_animated/svg3d/dom_utils.js -------------------------------------------------------------------------------- /protovis_integration/antibiotics_animated/svg3d/svg3d.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/protovis_integration/antibiotics_animated/svg3d/svg3d.js -------------------------------------------------------------------------------- /protovis_integration/antibiotics_animated/svg3d/svg3d_parsing.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndebeiss/svg3d/e620e04db3401af57ab848c600966ef710bf9252/protovis_integration/antibiotics_animated/svg3d/svg3d_parsing.js -------------------------------------------------------------------------------- /protovis_integration/ex.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | display: table; 4 | height: 100%; 5 | width: 100%; 6 | font: 14px/134% Helvetica Neue, sans-serif; 7 | } 8 | 9 | #center { 10 | display: table-cell; 11 | vertical-align: middle; 12 | } 13 | 14 | #fig { 15 | position: relative; 16 | margin: auto; 17 | } 18 | -------------------------------------------------------------------------------- /schemas/svg3d.rng: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /tests/axes_3d_declared.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG animation - axes 3d 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /tests/ball_3d_normals.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | SVG animation - Ball 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /tests/circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/css_3d_transform.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | 24 | 26 | 27 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tests/normal_tests.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/perspective_tests.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | SVG Animation - Cube Demonstration 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/perspective_tests_2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | SVG Animation - Cube Demonstration 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/perspective_tests_3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/perspective_tests_4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/perspective_tests_4_darkorange_rotating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/perspective_tests_rotating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/perspective_tests_translating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | SVG Animation - Cube Demonstration 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/polyline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/rect01.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | Example rect01 - rectangle with sharp corners 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/rounded_rect01.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | Example rect01 - rectangle with sharp corners 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ui_interact/js/Meuble_heraldique_Engrenage.js: -------------------------------------------------------------------------------- 1 | svg3d.xInfinite = 600; 2 | svg3d.yInfinite = 10; 3 | svg3d.xOrigin = 167; 4 | svg3d.yOrigin = 491; 5 | 6 | 7 | 8 | --------------------------------------------------------------------------------