Social Software powered by Instant Communities
Springe direkt: zur Navigationzum Inhaltzur Sidebar

Archive für 08 2010

Data Provider in PHPUnit

28.08.2010

Ein sehr praktisches Feature in PHPUnit ist der Data Provider. Data Provider sind dann hilfreich, wenn ein immergleicher Test auf verschiedene Daten ausgeführt werden soll. So benötigt man lediglich eine Funktion, die den Test enthält sowie eine Funktion, die die Daten bereitstellt (und nicht jeweils eine Funktion pro Daten-Test). Das Beispiel in der Doku von PHPUnit zeigt die Verknüpfung der beiden Funktionen: http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers

PHPTMAPI CXTM writer

23.08.2010

Some days ago, I have committed a CXTM writer to QuaaxTM’s SVN. This writer is part of the QuaaxTMIO library. What is Canonical XTM, or CXTM for short?

“[...] The format is an XML format, and has the property that it guarantees that two equivalent Topic Maps Data Model instances [ISO/IEC 13250-2] will always produce byte-by-byte identical serializations [...] CXTM thus enables direct comparison of two topic maps to determine equality by comparison of their canonical serializations.” [1]

The CXTM-tests project provides a test suite based upon the various Topic Maps syntaxes which allows easy verification of Topic Maps software’s standards compliance.

The purpose (and advantage) of using CXTM tests in the context of deserialization and serialization of topic maps is obvious. It is possible to test the readers and writers for spec./standards conformity while, at the same time, the Topic Maps engine the readers and writers are working against is tested for Topic Maps Data Model (TMDM) compliance. Engines using CXTM tests are more reliable (from the standards perspective) than engines which are not using CXTM tests. This is the USP of CXTM.

QuaaxTM now passes all tests via reading the valid XTM 2.0 sources from the CXTM test suite and writing the respective CXTM using the XTM 2.0 parser and the CXTM writer. Both components are not yet officially released but committed to the SVN and ready to be checked out. Version 0.51 can be simply replaced by the SVN content.

As QuaaxTMIO only depends on PHPTMAPI the CXTM writer can be used by any PHPTMAPI implementation. The API is trivial:

$writer = new PHPTMAPICXTMWriter($tmLocator);
$cxtm = $writer->write($topicMap);

$tmLocator is the topic map’s locator as defined in http://phptmapi.sourceforge.net/2.0/docs/core/TopicMapSystem.html#createTopicMap; $topicMap is an implementation of PHPTMAPI TopicMap.

Two prerequisites have to be considered: The writer as well as the XTM 2.0 parser use PEAR’s Net_URL2 and, the writer exclusively, uses PHP’s Normalizer.

Happy CXTMing!

[1] http://www.isotopicmaps.org/cxtm/cxtm.html

QuaaxTMIO

03.08.2010

Some days ago there has been some traffic in QuaaxTM‘s SVN repo. The initial version of the QuaaxTM Topic Maps syntaxes readers/writers library QuaaxTMIO has been committed (located in the lib directory and inherent part of QuaaxTM from now on). QuaaxTMIO is designed to work against PHPTMAPI. Therefore, it is possible to connect this library which is licensed under LGPL with any PHPTMAPI compatible engine.

Initial version comes with an XTM 2.0 reader. This reader uses a PHP port of Lars Heuer‘s Streaming Topic Maps API. Extended QuaaxTM is ready to be checked out (have a look at the lib’s README file e.g. for prerequisites). More readers and writers e.g. for JTM will follow.

More than two months ago the project has released version 0.51 of QuaaxTM. It is recommended to replace 0.5 by 0.51.

P.S. Some of the readers might wonder why the Topic Maps related posts are in English while others (and this Blog in general) are in German. Well, the answer is simple: The TM community is rather small and international. (Do we suffer from inferiority complex? Definitely not :) )

Comments-Tabelle repariert

03.08.2010

Evtl. haben einige von euch die Fehlermeldung WordPress database error: [Table 'wp_comments' is marked as crashed and last (automatic?) repair failed] im Kommentarbereich registriert. Falls bei anderen/euch auch einmal dieses Problem mit WordPress auftauchen sollte: Hier hat ein simples REPAIR TABLE wp_comments geholfen. (Mehr Infos und Optionen unter http://dev.mysql.com/doc/refman/5.1/de/repair-table.html.)

You are currently browsing the t8d blog weblog archives for August, 2010.

Creative Commons License
This work is licensed under a
Creative Commons Attribution-Share Alike 2.5 License.
t8d blogged mit WordPress