# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. # License: Apache License, Version 2.0 require File.dirname(__FILE__) + '/../spec_helper' module RTM class MaJorToM describe self do before(:each) do @connection = get_used_tm_sys end after(:each) do @connection.close end it "should have certain properties" do @connection.property("de.topicmapslab.majortom.topicmapstore.class").should == "de.topicmapslab.majortom.database.store.JdbcTopicMapStore" #@connection.property("de.topicmapslab.majortom.jdbc.database").should == "testdb" #@connection.property("de.topicmapslab.majortom.jdbc.host").should == "nemo.tm.informatik.uni-leipzig.de" #@connection.property("de.topicmapslab.majortom.jdbc.user").should == "tester" #@connection.property("de.topicmapslab.majortom.jdbc.password").should == "_test!er$" @connection.property("de.topicmapslab.majortom.jdbc.dialect").should == "POSTGRESQL99" end it "should connect to the test database" do @connection.should be_a_kind_of RTM::Engine @connection.should be_a_kind_of RTM::MaJorToM end it "should let us create a topic map" do begin tm = get_used_tm_sys_tm rescue Exception => e puts e.message puts e.cause.message puts e.cause.cause.message end tm.should be_a_kind_of RTM::TopicMap tm.close end it "should let us create a topic map with topics" do tm = get_used_tm_sys_tm t = tm.get!("Hannes") t.should be_a_kind_of RTM::Topic t.should_not be_nil t.reference.should == "http://www.topicmapslab.de/Hannes" tm.close tm = get_used_tm_sys.create("http://www.topicmapslab.de/") t = tm.get("Hannes") t.should be_a_kind_of RTM::Topic t.should_not be_nil t.reference.should == "http://www.topicmapslab.de/Hannes" tm.remove end end end end