[commits-cosmo] (travis) [6004] Fix and regression test for bug 11091.

Travis Vachon travis at osafoundation.org
Fri Oct 19 16:12:33 PDT 2007


Whoops, this revision also merged 6004 from 0.8 to trunk.

-Travis

On Oct 19, 2007, at 4:06 PM, svncheckin at osafoundation.org wrote:

> Revision
> 6004
> Author
> travis
> Date
> 2007-10-19 16:06:58 -0700 (Fri, 19 Oct 2007)
> Log Message
>
> Fix and regression test for bug 11091.
> Modified Paths
>
> cosmo/branches/0.8/cosmo/src/main/webapp/js/cosmo/service/transport/ 
> Atom.js
> cosmo/branches/0.8/cosmo/src/test/unit/js/cosmo/service/conduits/ 
> test_conduits.js
> Diff
>
> Modified: cosmo/branches/0.8/cosmo/src/main/webapp/js/cosmo/service/ 
> transport/Atom.js (6003 => 6004)
>
> --- cosmo/branches/0.8/cosmo/src/main/webapp/js/cosmo/service/ 
> transport/Atom.js	2007-10-19 20:55:05 UTC (rev 6003)
> +++ cosmo/branches/0.8/cosmo/src/main/webapp/js/cosmo/service/ 
> transport/Atom.js	2007-10-19 23:06:58 UTC (rev 6004)
> @@ -170,16 +170,9 @@
>          var r = {};
>
>          var expandedLink = item.getUrls()['expanded'];
> -
> -        var defaultProjection = "/full/eim-json";
> -        var projectionIndex = expandedLink.indexOf 
> (defaultProjection);
> -        if (projectionIndex > 0) {
> -            expandedLink = expandedLink.substring(0,  
> projectionIndex) +
> -                           expandedLink.substring(projectionIndex   
> + defaultProjection.length);
> -        }
>
>          r.url = this.generateUri(cosmo.env.getBaseUrl() +
> -          "/atom/" + expandedLink, "/" + projection, query);
> +          "/atom/" + expandedLink, "", query);
>
>          r.method = this.METHOD_GET;
>
> Modified: cosmo/branches/0.8/cosmo/src/test/unit/js/cosmo/service/ 
> conduits/test_conduits.js (6003 => 6004)
>
> --- cosmo/branches/0.8/cosmo/src/test/unit/js/cosmo/service/ 
> conduits/test_conduits.js	2007-10-19 20:55:05 UTC (rev 6003)
> +++ cosmo/branches/0.8/cosmo/src/test/unit/js/cosmo/service/ 
> conduits/test_conduits.js	2007-10-19 23:06:58 UTC (rev 6004)
> @@ -19,6 +19,7 @@
>  dojo.require("cosmo.service.conduits.common");
>  dojo.require("cosmo.cmp");
>  dojo.require("cosmo.util.auth");
> +dojo.require("dojo.lang.*");
>
>  cosmotest.service.conduits.test_conduits = {
>      test_Note: function(){
> @@ -245,13 +246,6 @@
>              });
>
>
> -			// Test dashboard projection for single
> -			// recurring events
> -            var item0DashboardOccurrences =  
> conduit.getDashboardItems(item0,
> -               {sync: true}
> -            ).results[0];
> -            jum.assertEquals("wrong number of occurrences", 2,  
> item0DashboardOccurrences.length);
> -
>              var item4 = item0Occurrences[3];
>              var item4Rid = item4.recurrenceId;
>              var newDisplayName = "Ze New Name"
> @@ -322,13 +316,13 @@
>              var masterItem = conduit.getItem(masterUid, {sync:  
> true}).results[0];
>
>              jum.assertTrue("Removing stamp didn't work", ! 
> masterItem.getStamp('event'));
> -
> +
>          } finally {
>             cosmotest.service.conduits.test_conduits.cleanup(user);
>          }
>      },
>
> -    test_ThisAndFuture: function(){
> +    test_ThisAndFutureCal: function(){
>          try {
>              var user =  
> cosmotest.service.conduits.test_conduits.createTestAccount();
>
> @@ -390,11 +384,63 @@
>                 {sync: true}
>              ).results[0];
>              jum.assertEquals("wrong number of old item  
> occurrences", 3, item0Occurrences.length);
> -
> +
>          } finally {
>             cosmotest.service.conduits.test_conduits.cleanup(user);
>          }
>      },
> +
> +    test_ThisAndFutureDash: function(){
> +        try {
> +            var user =  
> cosmotest.service.conduits.test_conduits.createTestAccount();
> +
> +            var conduit =  
> cosmo.service.conduits.getAtomPlusEimConduit();
> +            var collections = conduit.getCollections({sync:  
> true}).results[0];
> +
> +            var c0 = collections[0];
> +
> +            var newItem = new cosmo.model.Note(
> +            {
> +                displayName: "Blah blah blah"
> +            }
> +            );
> +
> +            var startDate = new cosmo.datetime.Date(2007, 5, 10,  
> 12, 30, 45);
> +            startDate.setMilliseconds(0);
> +
> +            var duration = new cosmo.model.Duration({hour: 1});
> +            var loc = "Wherever";
> +            var stat = "CONFIRMED";
> +            newItem.getEventStamp(true, {
> +                startDate: startDate,
> +                duration: duration,
> +                location: loc,
> +                status: stat,
> +                rrule: new cosmo.model.RecurrenceRule({frequency:  
> cosmo.model.RRULE_FREQUENCIES.FREQUENCY_DAILY})
> +            });
> +
> +            conduit.createItem(newItem, c0, {sync: true});
> +
> +            console.log("futz");
> +            var c0Occurrences = conduit.getDashboardItems(c0,
> +               {sync: true}
> +            ).results[0];
> +            var items = dojo.lang.filter(c0Occurrences, function 
> (item){return item.getUid() == newItem.getUid()});
> +            var item = dojo.lang.filter(items, function(item) 
> {return item.getTriageStatus() == 200})[0];
> +            var newMaster = item.getMaster().clone();
> +            newMaster.setDisplayName("Bop bop a lee bop");
> +            newMaster.getEventStamp().setStartDate 
> (item.getEventStamp().getStartDate());
> +            dojo.require("cosmo.util.uuid");
> +            var gen = new cosmo.util.uuid.RandomGenerator()
> +            var newUid = gen.generate();
> +            newMaster.setUid(newUid);
> +            conduit.saveThisAndFuture(item, newMaster, {sync: true});
> +            conduit.getDashboardItems(newMaster);
> +
> +        } finally {
> +           cosmotest.service.conduits.test_conduits.cleanup(user);
> +        }
> +    },
>
>      test_Mail: function(){
>          try {
>
> _______________________________________________
> Commits-Cosmo mailing list
> Commits-Cosmo at osafoundation.org
> http://lists.osafoundation.org/cgi-bin/mailman/listinfo/commits-cosmo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/commits-cosmo/attachments/20071019/85952550/attachment-0001.htm


More information about the Commits-Cosmo mailing list