[commits-cosmo] (travis) [6005] Fix and regression test for bug
11091.
Travis Vachon
travis at osafoundation.org
Fri Oct 19 16:54:59 PDT 2007
Oy, one more try:
_This_ revision also merged r6004 from 0.8 to trunk.
-Travis
On Oct 19, 2007, at 4:08 PM, svncheckin at osafoundation.org wrote:
> Revision
> 6005
> Author
> travis
> Date
> 2007-10-19 16:08:37 -0700 (Fri, 19 Oct 2007)
> Log Message
>
> Fix and regression test for bug 11091.
> Modified Paths
>
> cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/transport/Atom.js
> cosmo/trunk/cosmo/src/test/unit/js/cosmo/service/conduits/
> test_conduits.js
> Diff
>
> Modified: cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/
> transport/Atom.js (6004 => 6005)
>
> --- cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/transport/
> Atom.js 2007-10-19 23:06:58 UTC (rev 6004)
> +++ cosmo/trunk/cosmo/src/main/webapp/js/cosmo/service/transport/
> Atom.js 2007-10-19 23:08:37 UTC (rev 6005)
> @@ -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/trunk/cosmo/src/test/unit/js/cosmo/service/conduits/
> test_conduits.js (6004 => 6005)
>
> --- cosmo/trunk/cosmo/src/test/unit/js/cosmo/service/conduits/
> test_conduits.js 2007-10-19 23:06:58 UTC (rev 6004)
> +++ cosmo/trunk/cosmo/src/test/unit/js/cosmo/service/conduits/
> test_conduits.js 2007-10-19 23:08:37 UTC (rev 6005)
> @@ -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(){
> @@ -261,13 +262,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"
> @@ -338,13 +332,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();
>
> @@ -406,11 +400,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/d5d3e4b4/attachment.html
More information about the Commits-Cosmo
mailing list