On Mon, Sep 7, 2009 at 16:41, <[email protected]> wrote:

> Hi.
>
> > I quess you are looking for something like a classname attribute?
> > If that's what you are looking for, qooxdoo has attached its classname to
> > every object. You can access it via <>.classname. That should do the job.
>
> Right, this is what I needed. How come it isn't in the documentation? I
> just had a look, Object has no properties at all documented in the API
> reference.
>
> Actually, it's not a part of Object. Instead, there are a few special,
magic properties added to any class created with qx.Class.define(). You
already discovered 'classname'. There's also 'basename' which is the last
component of the class name. There are a few that start with "$$" which I
generally take as an indication that if I touch it I may get burned. :-)

>
> > If you want assert an exception, take a look at the assertException
> method
> > you could use.
> >
> http://demo.qooxdoo.org/current/apiviewer/#qx.core.Assert~assertException<http://demo.qooxdoo.org/current/apiviewer/#qx.core.Assert%7EassertException>
>
> Interesting, but only almost what I need :-D - however, I already solved
> the problem, so there's no open issue here for me. How do I pass args to the
> callback? (Besides, I must confess, I'm no regexp wizzard.)
>
> If you look at assertException(), you'll see that with this implementation
of assertException() it's not possible, but that it would be very easy to
write one's own function to do something similar. (If you do write your own,
it's may be best to write it as a Mixin that can be included (or patched)
into qx.core.Assert... then again, I seem to recall that statics from Mixins
don't get applied, but maybe I'm mis-remembering.

    /**
     * Asserts that the callback raises a matching exception.
     *
     * @param callback {Function} function to check
     * @param exception {Error?Error} Expected constructor of the exception.
     *   The assertion fails if the raised exception is not an instance of
the
     *   parameter.
     * @param re {String|RegExp} The assertion fails if the error message
does
     *   not match this parameter
     * @param msg {String} Message to be shown if the assertion fails.
     */
    assertException : function(callback, exception, re, msg)
    {
      var exception = exception || Error;
      var error;

      try {
        this.__logError = false;
        callback();
      } catch(ex) {
        error = ex;
      } finally {
        this.__logError = true;
      }

      if (error == null) {
        this.__assert(false, msg || "", "The function did not raise an
exception!");
      }

      this.__assert(error instanceof exception, msg || "",
        "The raised exception does not have the expected type! " +
exception);

      if (re) {
        this.assertMatch(error.toString(), re, msg);
      }
    },

Side note/off topic: this mailing list is really responsive, a marvel of a
> support system for beginners like me - ppl are answering faster than I can
> ask.
>

See, if every little detail was documented, you'd never have known that. :-)

Derrell
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to