Seit einiger Zeit entwickle ich Tapestry 5 in Eclipse und es ist an der Zeit nach guten Plugins zur Unterstützung zu schauen. Bisher hat es nicht viel gegeben, aber heute starte ich eine neue Recherche.
Basis-Setup:
Borut Bolčina schreibt einen Blog über Tapestry 5. Dort hat er sehr ausführlich beschrieben, wie man das Basis-Setup seiner Entwicklungsumgebung macht.
Dort ist auch die Einrichtung von Eclipse Tidy beschrieben. Eclipse Tidy ist super, um HTML-Dateien zu formatieren, aber mit Tapestry gibt es das Problem, dass man ständig neue Komponenten entwickelt und diese mit t:myComponent in den TMLs referenziert. Jede neue Komponente muss man dann in den Eclipse Tiny-Einstellungen hinzufügen. Das kann - insbesondere bei vielen Entwicklern an einem Projekt - sehr nervig werden. Andererseits: Wenn man es gleich von vornherein durchzieht geht es vielleicht.
Code-Completion:
Einen immensen Umfang an Code-Templates findet man im Tapestry Wiki: Tapestry5HowToEclipseCodeTemplates
Im Wiki findet man auch einen Beitrag über Code-Completion in TMLs. Das ist großartig!
Pugins:
Nun aber endlich zu den Plugins. Bisher habe ich loom-t5 von Chris Scheid und tapestry4e von Juan M. Salamanca gekannt und dabei wird es leider auch bleiben, da ich keine weiteren Plugins gefunden habe. In wie weit sich diese Plugins lohnen, schreibe ich im kommenden Blogpost.
Fazit:
Auch wenn ich leider keine neuen Plugins gefunden habe, welches mir eine Verbindung zwischen den TMLs und den Java-Klassen schafft - so dass zum Beispiel die in einer Klasse eingebundenen Komponenten, Properties, etc. im TML mit Code-Completion verfügbar sind: Es lohnt sich immer mal zu schauen, was es Neues gibt.
2010-10-04
2010-09-30
Kalender App fürs iPhone
Vor einigen Wochen habe ich endlich eine vernünftige Kalender App für das iPhone gefunden: Week Cal - iCal for your iPhone.
Man hat eine gesamte Woche im Überblick und dank des hochauflösenden Displays des iPhone 4 kann man - wenn man die Schriftgröße auf minimal setzt - sogar bei parallelen Terminen alles lesen.
Man hat eine gesamte Woche im Überblick und dank des hochauflösenden Displays des iPhone 4 kann man - wenn man die Schriftgröße auf minimal setzt - sogar bei parallelen Terminen alles lesen.
2010-09-28
ctrl-z und Eclipse auf dem Mac
Ich verwende Eclipse 3.4 auf dem Mac, habe meine Sprache in OSX auf Deutsch eingestellt und habe eine US-Tastatur im Notebook.
Als Keyboard-Layout habe ich das USGerman Keyboard Layout von http://hci.rwth-aachen.de/USGermanKeyboard. Das ist großartig, da man so einfach mit option+a, etc. die deutschen Umlaute 'zur Hand' hat.
Woran es genau liegt, weiß ich nicht, aber mein Eclipse (US Version) reagiert nicht auf cmd+z, um einen Schritt rückgängig zu machen, sondern auf cmd-y. Man gewöhnt sich da zwar dran, aber heute stelle ich das mal um.
Unter Eclipse -> Preferences... -> General -> Editors -> Keys finde ich die richtige Einstellung: Undo: cmd-z, Redo: cmd-y. Wenn ich diese Werte ändere, erkennt die Kiste erstaunlicherweise y als Z und z als Y. Warum auch immer, denn an allen anderen Stellen in Eclipse (zumindest habe ich noch keine gefunden) bleibt mein y ein y und mein z ein z.
Ich habe nun also Undo auf cmd-Y gelegt, indem ich cmd-z gedrückt habe und Redo auf shift+cmd+Y, indem ich shift+cmd+z gedrückt habe. -> Jetzt muss ich nicht mehr umdenken, aber mal sehen wie lange ich brauche, nicht mehr wie bisher cmd+y als Workaround zu benutzen.
Als Keyboard-Layout habe ich das USGerman Keyboard Layout von http://hci.rwth-aachen.de/USGermanKeyboard. Das ist großartig, da man so einfach mit option+a, etc. die deutschen Umlaute 'zur Hand' hat.
Woran es genau liegt, weiß ich nicht, aber mein Eclipse (US Version) reagiert nicht auf cmd+z, um einen Schritt rückgängig zu machen, sondern auf cmd-y. Man gewöhnt sich da zwar dran, aber heute stelle ich das mal um.
Unter Eclipse -> Preferences... -> General -> Editors -> Keys finde ich die richtige Einstellung: Undo: cmd-z, Redo: cmd-y. Wenn ich diese Werte ändere, erkennt die Kiste erstaunlicherweise y als Z und z als Y. Warum auch immer, denn an allen anderen Stellen in Eclipse (zumindest habe ich noch keine gefunden) bleibt mein y ein y und mein z ein z.
Ich habe nun also Undo auf cmd-Y gelegt, indem ich cmd-z gedrückt habe und Redo auf shift+cmd+Y, indem ich shift+cmd+z gedrückt habe. -> Jetzt muss ich nicht mehr umdenken, aber mal sehen wie lange ich brauche, nicht mehr wie bisher cmd+y als Workaround zu benutzen.
2010-08-12
Selenium web application testing system
Selenium is a testing framework for Web Applications. With a Selenium test environment, you can programmatically create tests and run them as often as you need. This will ensure that you do not accidentally destroys any previously developed feature during later on development.
Last year, I set up such a Selenium test environment at work. During the preparation for installing such an environment for a customer, I created a "have-to-read" documentation. It summarizes important issues for the use of Selenium. It is for developers who want to use a Selenium installation, to write their own tests. The information comes--largely--from the selenium-site http://seleniumhq.org/ and is represented here as a "short documentary"--the essentials at a glance with links to the source Selenium Documentation.
If you want to start with selenium, and the framework is set up already, then check this out.
Troubleshooting Common Problems
Last year, I set up such a Selenium test environment at work. During the preparation for installing such an environment for a customer, I created a "have-to-read" documentation. It summarizes important issues for the use of Selenium. It is for developers who want to use a Selenium installation, to write their own tests. The information comes--largely--from the selenium-site http://seleniumhq.org/ and is represented here as a "short documentary"--the essentials at a glance with links to the source Selenium Documentation.
If you want to start with selenium, and the framework is set up already, then check this out.
Commonly Used Selenium Commands
- seleniumhq.org > Docs > 02 selenium basics: <http://seleniumhq.org/docs/02_selenium_basics.html#commonly-used-selenium-commands>
Selenium Commands
- seleniumhq.org > Docs > 04 selenese commands: <http://seleniumhq.org/docs/04_selenese_commands.html>
Selenium Server
Selenium Server receives Selenium commands from your test program, interprets them, and reports back to your program the results of running those tests.
The RC server bundles Selenium Core and automatically injects it into the browser. This occurs when your test program opens the browser (using a client library API function). Selenium-Core is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browser’s built-in JavaScript interpreter.
The Server receives the Selenese commands from your test program using simple HTTP GET/POST requests. This means you can use any programming language that can send HTTP requests to automate Selenium tests on the browser.
The RC server bundles Selenium Core and automatically injects it into the browser. This occurs when your test program opens the browser (using a client library API function). Selenium-Core is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browser’s built-in JavaScript interpreter.
The Server receives the Selenese commands from your test program using simple HTTP GET/POST requests. This means you can use any programming language that can send HTTP requests to automate Selenium tests on the browser.
Client Libraries
A Selenium client library provides a programming interface (API), i.e., a set of functions, which run Selenium commands from your own program. Within each interface, there is a programming function that supports each Selenese command.
The client library takes a Selenese command and passes it to the Selenium Server for processing a specific action or test against the application under test (AUT). The client library also receives the result of that command and passes it back to your program. Your program can receive the result and store it into a program variable and report it as a success or failure, or possibly take corrective action if it was an unexpected error.
The client library takes a Selenese command and passes it to the Selenium Server for processing a specific action or test against the application under test (AUT). The client library also receives the result of that command and passes it back to your program. Your program can receive the result and store it into a program variable and report it as a success or failure, or possibly take corrective action if it was an unexpected error.
Learning the API
Starting the Browser
$this->setBrowser("*firefox");$this->setBrowserUrl("http://www.google.com/");This example opens the browser and represents that browser by assigning a “browser instance” to a program variable. This program variable is then used to call methods from the browser. These methods execute the Selenium commands, i.e. like open or type or the verify commands.
parameters
host: Specifies the IP address of the computer where the server is located. Usually, this is the same machine as where the client is running, so in this case localhost is passed. In some clients this is an optional parameter.port: Specifies the TCP/IP socket where the server is listening waiting for the client to establish a connection. This also is optional in some client drivers.browser: The browser in which you want to run the tests. This is a required parameter.url: The base url of the application under test. This is required by all the client libs and is integral information for starting up the browser-proxy-AUT communication.
Running Commands
Once you have the browser initialized and assigned to a variable (generally named “selenium”) you can make it run Selenese commands by calling the respective methods from the browser variable. For example, to call the type method of the selenium object:
selenium.type("field-id","string to type")In the background the browser will actually perform a type operation, essentially identical to a user typing input into the browser, by using the locator and the string you specified during the method call.
Adding Some Spice to Your Tests
- seleniumhq.org > Docs > 05 selenium rc: <http://seleniumhq.org/docs/05_selenium_rc.html#adding-some-spice-to-your-tests>
Troubleshooting Common Problems
- seleniumhq.org > Docs > 05 selenium rc: <http://seleniumhq.org/docs/05_selenium_rc.html#troubleshooting-common-problems>
Test Design Considerations
verify/assertTextis the most specific test.- With Xpath and DOM you can locate an object with respect to another object on the page.
- Locate dynamic ID: You need programming logic like:
String[] checkboxIds = selenium.getAllFields();
if (!GenericValidator.isBlankOrNull(checkboxIds[i])) {
if (checkboxIds[i].indexOF("addFOrm") > 1) {
selenium.click(checkboxIds[i]);
}
} - Waiting for AJAX Element:
// Loop
initialization.for (int second = 0;; second++) {
// If loop is reached 60 seconds then break the loop.
if (second >= 60) break;
// Search for element "link=ajaxLink" and if available then break loop. try {
if (selenium.isElementPresent("link=ajaxLink")) break;
} catch (Exception e) {
// log
}
// Pause for 1 second.
Thread.sleep(1000);
} This certainly isn’t the only solution. AJAX is a common topic in the user group and we suggest searching previous discussions to see what others have done along with the questions they have posted.
- UI Mapping: What makes a UI map heplful? Its primary purpose for making test script management much easier. When a locator needs to be edited, there is a central location for easily finding that object.
public void testNew() throws Exception {
selenium.open("http://www.test.com");
selenium.type(admin.username, "xxxxxxxx");
selenium.click(admin.loginbutton);
selenium.click(admin.events.createnewevent);
selenium.waitForPageToLoad("30000");
selenium.click(admin.events.cancel);
selenium.waitForPageToLoad("30000");
selenium.click(admin.events.viewoldevents);
selenium.waitForPageToLoad("30000");
}
admin.username = loginForm:tbUsername;
admin.loginbutton = loginForm:btnLogin;
admin.events.createnewevent = adminHomeForm:_activitynew;
admin.events.cancel = addEditEventForm:_IDcancel;
admin.events.viewoldevents = adminHomeForm:_activityold; - Data Driven Testing: Refer to the RC wiki for examples of reading data from spread sheet or using data provider capabilities of TestNG with java client driver.
2009-06-30
Google's OpenSocial
OpenSocial ist eine Menge von Programmierschnittstellen für Anwendungen in webbasierten sozialen Netzwerken. OpenSocial wird von Google entwickelt und wurde am 1. November 2007 veröffentlicht. (Quelle: Wikipedia-OpenSocial)
Stichworte zum Bauen von Social Applications
- Gadgets bestehen hauptsächlich aus HTML und JavaScript.
- API Namensräume (Javascript) sind opensocial.* und gadgets.*
- Als Views gibt es in der Klasse gadgets.views.ViewType: Profile View, Canvas View und Home View.
- Datenhandling/Persistenz findet über opensocial.DataRequest statt. Hierzu zählt auch der Zugriff auf Personen, Beziehungen, Aktivitäten und Nachrichten.
- Der soziale Graph ist über opensocial.Person erreichbar. Rollen werden in VIEWER und OWNER unterschieden.
- Aktivitäten: opensocial.Activity. Activity Templates können hierbei häufige Updates kumulieren.
- Nachrichtenversand: opensocial.Message
- Internationalisierung über Message Bundles in der XML-Spezifikation des Gadgets möglich.
- Backend Requests, die über die Möglichkeiten von JavaScript und HTML hinausgehen sollen, können mit gadgets.io.makeRequest() abgesetzt werden. Somit ist der Transfer von HTML-, XML-, JSON- und ATOM-Files möglich. -> JSON, XML und AtomPub können auch über die RESTful API genutzt werden, die neben der JavaScript API existiert.
Weitere Infos
Host OpenSocial Apps basierend auf Java oder PHP: Apache Shindig
Let's get this Shindig started
XING und OpenSocial:
XING and OpenSocial
Labels:
Google,
JavaScript,
OpenSocial,
shindig,
Web APIs,
webdevelopment
Abonnieren
Posts (Atom)
