Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: FEST-Assert 1.4
    • Fix Version/s: None
    • Component/s: Assert
    • Labels:
      None
    • Environment:
      All
    • Number of attachments :
      0

      Description

      Currently it is not possible to use FEST Assertions with GWTTestCase. Repackaging jar and sources to GWT module structure is not sufficient because of usage of some classes not translatable in GWT (java.io.File or some methods from Class). The change doesn't seem to be big, it requires only removing some of the assertions and repackaging as a GWT module.

        Activity

        Hide
        Joel Costigliola added a comment -

        Hi Darek,

        This is a legitimate request, we will look into it.
        A potential solution would be to maintain a fest-assert-gwt branch that removes not GWT compatible classes. Is there a way to validate that a project is GWT compatible automatically ?

        Regards,

        Joel

        Show
        Joel Costigliola added a comment - Hi Darek, This is a legitimate request, we will look into it. A potential solution would be to maintain a fest-assert-gwt branch that removes not GWT compatible classes. Is there a way to validate that a project is GWT compatible automatically ? Regards, Joel
        Hide
        Nicolas FRANCOIS added a comment - - edited

        Hi

        GWT needed sources to compile, so it mean, dependencies requiered also a gwt port. But maybe, this dependencies can be evict with less functionnality in "fest-assert-gwt"
        There is not way to validate automatically code from "normal" version, guava-gwt got the same problem : they are not sure all compile well in gwt.

        The idea is great, but not it required to check lot a thing and a lot of time to report test.

        Show
        Nicolas FRANCOIS added a comment - - edited Hi GWT needed sources to compile, so it mean, dependencies requiered also a gwt port. But maybe, this dependencies can be evict with less functionnality in "fest-assert-gwt" There is not way to validate automatically code from "normal" version, guava-gwt got the same problem : they are not sure all compile well in gwt. The idea is great, but not it required to check lot a thing and a lot of time to report test.
        Hide
        Tobias Gesellchen added a comment -

        Hi,

        I started to extract incompatible assertions from fest-assert-core (see FEST-485). Until now only java.awt.* dependent classes have been extracted, but I would also like to help making fest-assert compatible with GWT. Could you try to create a list of incompatible assertions and list them here?

        Thanks!

        Show
        Tobias Gesellchen added a comment - Hi, I started to extract incompatible assertions from fest-assert-core (see FEST-485 ). Until now only java.awt.* dependent classes have been extracted, but I would also like to help making fest-assert compatible with GWT. Could you try to create a list of incompatible assertions and list them here? Thanks!
        Hide
        Nicolas FRANCOIS added a comment - - edited

        Hi Tobias

        The main problem with GWT is not only the incompatible classes, some classes like String are not completely compatible
        Imagine that code :

        String.format("excepted: %s", object);

        There is not warning in the ide, but when GWT compile to javascript, it throw a NoSuchMethodException. String exists and can be use in GWT but not String.format(...). Unfortunately, all *Error class use this.
        Reflexion is neither possible, so "java.lang.reflect.Array" cannot be used.

        Another need to port fest-assert in GWT, is be to port fest-util to GWT :

        • When it compile to js, GWT works with source code and not compiled code
        • GWT define its dependencies in module (*.gwt.xml), and a dependencies must by the same way a module.

        Maybe some GWT hack, to port that is missing by using Deferred Binding (I found some projects but on reflection they seem abandoned)
        Google I/O is coming soon, GWT is coming with some improvements for GWT developers maybe somehing could help for this issue.

        Show
        Nicolas FRANCOIS added a comment - - edited Hi Tobias The main problem with GWT is not only the incompatible classes, some classes like String are not completely compatible Imagine that code : String.format("excepted: %s", object); There is not warning in the ide, but when GWT compile to javascript, it throw a NoSuchMethodException. String exists and can be use in GWT but not String.format(...). Unfortunately, all *Error class use this. Reflexion is neither possible, so "java.lang.reflect.Array" cannot be used. Another need to port fest-assert in GWT, is be to port fest-util to GWT : When it compile to js, GWT works with source code and not compiled code GWT define its dependencies in module (*.gwt.xml), and a dependencies must by the same way a module. Maybe some GWT hack, to port that is missing by using Deferred Binding (I found some projects but on reflection they seem abandoned) Google I/O is coming soon, GWT is coming with some improvements for GWT developers maybe somehing could help for this issue.
        Hide
        Tobias Gesellchen added a comment -

        Nicolas,

        do we only have a chance to find incompatible classes/methods by compiling them or do you know where to find a list? I didn't find any complete list or documentation of incompatible methods yet.

        Just some thoughts on how to tackle our problems:

        • It seems we need some kind of adapter or proxy between FEST modules and GWT-incompatible classes. I wouldn't like to reimplement String.format(), so I suggest finding a GWT-compatible method to replace the existing calls without making the existing code less readable or usable.
        • Another idea would be to make the GWT compiler handle some cases in a special way - do we have a chance to add extensions to the GWT compiler?

        Is this ticket the right place to discuss?

        Show
        Tobias Gesellchen added a comment - Nicolas, do we only have a chance to find incompatible classes/methods by compiling them or do you know where to find a list? I didn't find any complete list or documentation of incompatible methods yet. Just some thoughts on how to tackle our problems: It seems we need some kind of adapter or proxy between FEST modules and GWT-incompatible classes. I wouldn't like to reimplement String.format(), so I suggest finding a GWT-compatible method to replace the existing calls without making the existing code less readable or usable. Another idea would be to make the GWT compiler handle some cases in a special way - do we have a chance to add extensions to the GWT compiler? Is this ticket the right place to discuss?

          People

          • Assignee:
            Unassigned
            Reporter:
            Darek Biskup
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: