You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(121) |
Aug
(343) |
Sep
(98) |
Oct
(55) |
Nov
(158) |
Dec
(219) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(278) |
Feb
(170) |
Mar
(286) |
Apr
(32) |
May
(83) |
Jun
(140) |
Jul
(212) |
Aug
(242) |
Sep
(52) |
Oct
(29) |
Nov
(132) |
Dec
(259) |
| 2010 |
Jan
(251) |
Feb
(147) |
Mar
(76) |
Apr
(140) |
May
(43) |
Jun
(66) |
Jul
(273) |
Aug
(205) |
Sep
(260) |
Oct
(100) |
Nov
(58) |
Dec
(264) |
| 2011 |
Jan
(219) |
Feb
(344) |
Mar
(320) |
Apr
(334) |
May
(125) |
Jun
(131) |
Jul
(195) |
Aug
(155) |
Sep
(55) |
Oct
(261) |
Nov
(286) |
Dec
(216) |
| 2012 |
Jan
(188) |
Feb
(177) |
Mar
(39) |
Apr
(179) |
May
(148) |
Jun
(43) |
Jul
(229) |
Aug
(104) |
Sep
(76) |
Oct
(82) |
Nov
(93) |
Dec
(180) |
| 2013 |
Jan
(323) |
Feb
(335) |
Mar
(35) |
Apr
(220) |
May
(238) |
Jun
(122) |
Jul
(316) |
Aug
(73) |
Sep
(135) |
Oct
(515) |
Nov
(320) |
Dec
(185) |
| 2014 |
Jan
(81) |
Feb
(146) |
Mar
(337) |
Apr
(234) |
May
(112) |
Jun
(239) |
Jul
(323) |
Aug
(123) |
Sep
(83) |
Oct
(285) |
Nov
(321) |
Dec
(96) |
| 2015 |
Jan
(77) |
Feb
(79) |
Mar
(124) |
Apr
(71) |
May
(35) |
Jun
(45) |
Jul
(77) |
Aug
(44) |
Sep
(22) |
Oct
(84) |
Nov
(120) |
Dec
(37) |
| 2016 |
Jan
(38) |
Feb
(74) |
Mar
(242) |
Apr
(153) |
May
(59) |
Jun
(44) |
Jul
(67) |
Aug
(74) |
Sep
(150) |
Oct
(35) |
Nov
(69) |
Dec
(43) |
| 2017 |
Jan
(43) |
Feb
(9) |
Mar
(274) |
Apr
(40) |
May
(81) |
Jun
(81) |
Jul
(87) |
Aug
(46) |
Sep
(98) |
Oct
(50) |
Nov
(220) |
Dec
(66) |
| 2018 |
Jan
(110) |
Feb
(22) |
Mar
(20) |
Apr
(147) |
May
(148) |
Jun
(30) |
Jul
(83) |
Aug
(63) |
Sep
(40) |
Oct
(53) |
Nov
(51) |
Dec
(104) |
| 2019 |
Jan
(14) |
Feb
(81) |
Mar
(80) |
Apr
(102) |
May
(16) |
Jun
(5) |
Jul
(34) |
Aug
(24) |
Sep
(9) |
Oct
(12) |
Nov
(42) |
Dec
(76) |
| 2020 |
Jan
(15) |
Feb
(11) |
Mar
(12) |
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
(2) |
|
2
|
3
(1) |
4
(2) |
5
(10) |
6
(13) |
7
(10) |
8
(21) |
|
9
(5) |
10
(4) |
11
(16) |
12
(7) |
13
(7) |
14
(23) |
15
(7) |
|
16
|
17
(5) |
18
(2) |
19
(7) |
20
(14) |
21
(7) |
22
(5) |
|
23
|
24
(9) |
25
(11) |
26
(17) |
27
(6) |
28
|
29
(5) |
|
30
(2) |
31
(1) |
|
|
|
|
|
|
From: <luc...@us...> - 2011-01-31 21:19:15
|
Revision: 12725
http://sbml.svn.sourceforge.net/sbml/?rev=12725&view=rev
Author: luciansmith
Date: 2011-01-31 21:19:08 +0000 (Mon, 31 Jan 2011)
Log Message:
-----------
After some tests, I decided that '2' was too large--it would fail in ~7% of the time. With .2, it only fails <0.00001% of the time.
Modified Paths:
--------------
trunk/test-suite/cases/semantic/00962/00962-antimony.txt
trunk/test-suite/cases/semantic/00962/00962-sbml-l3v1.xml
Modified: trunk/test-suite/cases/semantic/00962/00962-antimony.txt
===================================================================
--- trunk/test-suite/cases/semantic/00962/00962-antimony.txt 2011-01-30 12:39:01 UTC (rev 12724)
+++ trunk/test-suite/cases/semantic/00962/00962-antimony.txt 2011-01-31 21:19:08 UTC (rev 12725)
@@ -8,7 +8,7 @@
Qinc: at time - reset >= 0.01: Q = Q + 0.01, reset = time;
Rinc: at time - reset >= 0.01: R = R + 0.01, reset = time;
maxcheck: at(abs(Q-R)>maxdiff): maxdiff = abs(Q-R);
- error_check: at (time>=99) && (maxdiff < 2) : error = 1;
+ error_check: at (time>=99) && (maxdiff < .2) : error = 1;
// Variable initializations:
reset = 0;
Modified: trunk/test-suite/cases/semantic/00962/00962-sbml-l3v1.xml
===================================================================
--- trunk/test-suite/cases/semantic/00962/00962-sbml-l3v1.xml 2011-01-30 12:39:01 UTC (rev 12724)
+++ trunk/test-suite/cases/semantic/00962/00962-sbml-l3v1.xml 2011-01-31 21:19:08 UTC (rev 12725)
@@ -158,7 +158,7 @@
<apply>
<lt/>
<ci> maxdiff </ci>
- <cn type="integer"> 2 </cn>
+ <cn> .2 </cn>
</apply>
</apply>
</math>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-30 12:39:07
|
Revision: 12724
http://sbml.svn.sourceforge.net/sbml/?rev=12724&view=rev
Author: sarahkeating
Date: 2011-01-30 12:39:01 +0000 (Sun, 30 Jan 2011)
Log Message:
-----------
applied same fix for linux
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/install.m
Modified: trunk/libsbml/src/bindings/matlab/install.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/install.m 2011-01-30 12:32:20 UTC (rev 12723)
+++ trunk/libsbml/src/bindings/matlab/install.m 2011-01-30 12:39:01 UTC (rev 12724)
@@ -297,7 +297,7 @@
error('libsbml.so could not be found');
else
lib{1} = lib{2};
- addDir(lib{1});
+ bin_dir = new_bin_dir;
end;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-30 12:32:27
|
Revision: 12723
http://sbml.svn.sourceforge.net/sbml/?rev=12723&view=rev
Author: sarahkeating
Date: 2011-01-30 12:32:20 +0000 (Sun, 30 Jan 2011)
Log Message:
-----------
Second try for installing
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/install.m
Modified: trunk/libsbml/src/bindings/matlab/install.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 13:25:26 UTC (rev 12722)
+++ trunk/libsbml/src/bindings/matlab/install.m 2011-01-30 12:32:20 UTC (rev 12723)
@@ -111,7 +111,8 @@
disp('checking for TranslateSBML');
M = TranslateSBML('test.xml');
catch
- disp('Installation failed - need to build TranslateSBML');
+ disp(sprintf('Installation failed - MATLAB cannot find all the libraries\n%s', ...
+ 'Add the path to the libraries to your matlab path'));
success = 0;
end;
@@ -121,7 +122,8 @@
disp('checking OutputSBML');
OutputSBML(M, outFile);
catch
- disp('Installation failed - need to build OutputSBML');
+ disp(sprintf('Installation failed - MATLAB cannot find all the libraries\n%s', ...
+ 'Add the path to the libraries to your matlab path'));
success = 0;
end;
end;
@@ -189,7 +191,7 @@
error('libsbml.dylib could not be found');
else
lib{1} = lib{2};
- addDir(lib{1});
+ bin_dir = new_bin_dir;
end;
end;
@@ -216,7 +218,8 @@
disp('checking for TranslateSBML');
M = TranslateSBML('test.xml');
catch
- disp('Installation failed - need to build TranslateSBML');
+ disp(sprintf('Installation failed - MATLAB cannot find all the libraries\n%s', ...
+ 'Add the path to the libraries to your matlab path'));
success = 0;
end;
@@ -226,7 +229,8 @@
disp('checking OutputSBML');
OutputSBML(M, outFile);
catch
- disp('Installation failed - need to build OutputSBML');
+ disp(sprintf('Installation failed - MATLAB cannot find all the libraries\n%s', ...
+ 'Add the path to the libraries to your matlab path'));
success = 0;
end;
end;
@@ -319,7 +323,8 @@
disp('checking for TranslateSBML');
M = TranslateSBML('test.xml');
catch
- disp('Installation failed - need to build TranslateSBML');
+ disp(sprintf('Installation failed - MATLAB cannot find all the libraries\n%s', ...
+ 'Add the path to the libraries to your matlab path'));
success = 0;
end;
@@ -329,7 +334,8 @@
disp('checking OutputSBML');
OutputSBML(M, outFile);
catch
- disp('Installation failed - need to build OutputSBML');
+ disp(sprintf('Installation failed - MATLAB cannot find all the libraries\n%s', ...
+ 'Add the path to the libraries to your matlab path'));
success = 0;
end;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-29 13:25:32
|
Revision: 12722
http://sbml.svn.sourceforge.net/sbml/?rev=12722&view=rev
Author: sarahkeating
Date: 2011-01-29 13:25:26 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
if libsbml not installed in usr/local probably need to add the path to matlab
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/install.m
Modified: trunk/libsbml/src/bindings/matlab/install.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 13:18:00 UTC (rev 12721)
+++ trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 13:25:26 UTC (rev 12722)
@@ -189,6 +189,7 @@
error('libsbml.dylib could not be found');
else
lib{1} = lib{2};
+ addDir(lib{1});
end;
end;
@@ -292,6 +293,7 @@
error('libsbml.so could not be found');
else
lib{1} = lib{2};
+ addDir(lib{1});
end;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-29 13:18:06
|
Revision: 12721
http://sbml.svn.sourceforge.net/sbml/?rev=12721&view=rev
Author: sarahkeating
Date: 2011-01-29 13:18:00 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
updated for linux
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/install.m
Modified: trunk/libsbml/src/bindings/matlab/install.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 13:04:15 UTC (rev 12720)
+++ trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 13:18:00 UTC (rev 12721)
@@ -295,44 +295,76 @@
end;
end;
- % check that the include directory exists
- include_dir = [root, filesep, 'include'];
- disp(sprintf('Checking for the %s directory ...', include_dir));
- if (exist(include_dir, 'dir') ~= 7)
- error (sprintf('%s not found\n%s', include_dir, ...
- 'the libSBML source tree expects this directory to exist'));
- end;
-
+ addDir(pwd);
+
if (ismatlab)
+ this_dir = pwd;
% install the files
- inc_flag = ['-I', include_dir];
- installMexFiles(inc_flag, lib{1});
+ try
+ M = TranslateSBML('test.xml');
+ catch
+ cd(bin_dir);
+ try
+ M = TranslateSBML('test.xml');
+ cd(this_dir);
+ catch
+ cd(this_dir);
+ end;
+ end;
+
+ success = 1;
+ try
+ disp('checking for TranslateSBML');
+ M = TranslateSBML('test.xml');
+ catch
+ disp('Installation failed - need to build TranslateSBML');
+ success = 0;
+ end;
- else
- disp('install on octave');
- end;
+ outFile = [tempdir, filesep, 'test-out.xml'];
+ if (success == 1)
+ try
+ disp('checking OutputSBML');
+ OutputSBML(M, outFile);
+ catch
+ disp('Installation failed - need to build OutputSBML');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp ('running tests for TranslateSBML');
+ cd test;
+ pass = testBinding(1);
+ cd ..;
+ if (pass == 0)
+ disp('TranslateSBML successful');
+ else
+ disp('Binding present but problem detected. Seek help.');
+ success = 0;
+ end;
+ end;
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% runs the mex command for windows and matlab
-% the messy file handle stuff is because this seems to be the best way to
-% be able to pass arguments to the function
-function installMexFiles(include, library)
+ if (success == 1)
+ disp('running tests for OutputSBML');
+ cd test;
+ pass = testOutput(tempdir);
+ cd ..;
+ if (pass == 0)
+ disp('OutputSBML successful');
+ else
+ disp('Output function present but problem detected. Seek help.');
+ success = 0;
+ end;
+ end;
- fhandle = @mex;
- disp('Building TranslateSBML ...');
- feval(fhandle, 'TranslateSBML.c', include, library);
- disp('Building OutputSBML ...');
- feval(fhandle, 'OutputSBML.c', include, library);
+ if (success == 1)
+ disp ('Installation completed');
+ end;
+
- transFile = strcat('TranslateSBML.', mexext());
- outFile = strcat('OutputSBML.', mexext());
-
- if ((exist(transFile) == 3 && ...
- exist(outFile) == 3))
- disp(sprintf('%s\n%s', 'Build successful', ...
- 'Now run the install script which will install and test the files'));
else
- disp('Build failed');
+ disp('install on octave');
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-29 13:04:22
|
Revision: 12720
http://sbml.svn.sourceforge.net/sbml/?rev=12720&view=rev
Author: sarahkeating
Date: 2011-01-29 13:04:15 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
added code that runs on MacOS
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/install.m
Modified: trunk/libsbml/src/bindings/matlab/install.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 11:44:25 UTC (rev 12719)
+++ trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 13:04:15 UTC (rev 12720)
@@ -1,7 +1,11 @@
function install
+
[detected_os, matlab, root] = determine_system();
+ % check to see whether the executable exist
+ checkForExecutables();
+
switch detected_os
case 0
install_win(matlab, root);
@@ -188,19 +192,75 @@
end;
end;
- % check that the include directory exists
- include_dir = [root, filesep, 'include'];
- disp(sprintf('Checking for the %s directory ...', include_dir));
- if (exist(include_dir, 'dir') ~= 7)
- error (sprintf('%s not found\n%s', include_dir, ...
- 'the libSBML source tree expects this directory to exist'));
- end;
+ addDir(pwd);
+
if (ismatlab)
+ this_dir = pwd;
% install the files
- inc_flag = ['-I', include_dir];
- installMexFiles(inc_flag, lib{1});
+ try
+ M = TranslateSBML('test.xml');
+ catch
+ cd(bin_dir);
+ try
+ M = TranslateSBML('test.xml');
+ cd(this_dir);
+ catch
+ cd(this_dir);
+ end;
+ end;
+
+ success = 1;
+ try
+ disp('checking for TranslateSBML');
+ M = TranslateSBML('test.xml');
+ catch
+ disp('Installation failed - need to build TranslateSBML');
+ success = 0;
+ end;
+ outFile = [tempdir, filesep, 'test-out.xml'];
+ if (success == 1)
+ try
+ disp('checking OutputSBML');
+ OutputSBML(M, outFile);
+ catch
+ disp('Installation failed - need to build OutputSBML');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp ('running tests for TranslateSBML');
+ cd test;
+ pass = testBinding(1);
+ cd ..;
+ if (pass == 0)
+ disp('TranslateSBML successful');
+ else
+ disp('Binding present but problem detected. Seek help.');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp('running tests for OutputSBML');
+ cd test;
+ pass = testOutput(tempdir);
+ cd ..;
+ if (pass == 0)
+ disp('OutputSBML successful');
+ else
+ disp('Output function present but problem detected. Seek help.');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp ('Installation completed');
+ end;
+
+
else
disp('install on octave');
end;
@@ -274,7 +334,9 @@
else
disp('Build failed');
end;
-
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% add directory to the matlab path
function addDir(name)
disp(sprintf('adding %s to the path', name));
@@ -282,4 +344,23 @@
if (savepath ~= 0)
error(sprintf('adding %s failed', name));
end;
-
\ No newline at end of file
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% check for executables and that they are right ones
+function checkForExecutables()
+ transFile = strcat('TranslateSBML.', mexext());
+ outFile = strcat('OutputSBML.', mexext());
+
+ if (~(exist(transFile) == 3 && ...
+ exist(outFile) == 3))
+ error(sprintf('%s\n%s', 'Executables not found', ...
+ 'Run the buid script to build the relevant files'));
+ else
+ % they exist are the the right ones
+ if (~((strcmp(which(transFile), [pwd, filesep, transFile])) && ...
+ (strcmp(which(outFile), [pwd, filesep, outFile]))))
+ error(sprintf('%s\n%s', 'Other executables from other installations found', ...
+ 'Run the buid script to build the relevant files for this installation'));
+ end;
+ end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-29 11:44:32
|
Revision: 12719
http://sbml.svn.sourceforge.net/sbml/?rev=12719&view=rev
Author: sarahkeating
Date: 2011-01-29 11:44:25 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
minor tweaks for new build/install process
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/OutputSBML.c
trunk/libsbml/src/bindings/matlab/test/testBinding.m
trunk/libsbml/src/bindings/matlab/test/testOutput.m
Added Paths:
-----------
trunk/libsbml/src/bindings/matlab/build.m
trunk/libsbml/src/bindings/matlab/install.m
Modified: trunk/libsbml/src/bindings/matlab/OutputSBML.c
===================================================================
--- trunk/libsbml/src/bindings/matlab/OutputSBML.c 2011-01-29 00:18:57 UTC (rev 12718)
+++ trunk/libsbml/src/bindings/matlab/OutputSBML.c 2011-01-29 11:44:25 UTC (rev 12719)
@@ -540,12 +540,15 @@
/* write the SBML document to the filename specified */
nStatus = writeSBML(sbmlDocument, pacFilename);
- mexPrintf("Document written\n");
if (nStatus != 1)
{
mexErrMsgTxt("Failed to write file");
}
+ else
+ {
+ mexPrintf("Document written\n");
+ }
/* free any memory allocated */
mxFree(pacNotes);
Added: trunk/libsbml/src/bindings/matlab/build.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/build.m (rev 0)
+++ trunk/libsbml/src/bindings/matlab/build.m 2011-01-29 11:44:25 UTC (rev 12719)
@@ -0,0 +1,252 @@
+function build
+
+ [detected_os, matlab, root] = determine_system();
+
+ switch detected_os
+ case 0
+ build_win(matlab, root);
+ case 1
+ build_mac(matlab, root);
+ case 2
+ build_linux(matlab, root);
+ otherwise
+ error('OS not recognised');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% check what we are using
+function [detected_os, matlab, root] = determine_system
+
+ disp('Checking system ...');
+ disp('Looking at software ...');
+ % matlab = [0, 1]
+ % 0 - octave
+ % 1 - matlab
+ if (strcmp(isoctave(), '0'))
+ matlab = 1;
+ disp('MATLAB detected');
+ else
+ matlab = 0;
+ disp('Octave detected');
+ end;
+
+ disp('Looking at OS ...');
+ % detected_os = [0, 1, 2]
+ % 0 - windows
+ % 1 - mac
+ % 2 - unix
+ if (ispc())
+ detected_os = 0;
+ disp('Windows OS detected');
+ elseif(ismac())
+ detected_os = 1;
+ disp('Mac OS detected');
+ elseif(isunix())
+ detected_os = 2;
+ disp('Linux OS detected');
+ else
+ error('Unable to establish operating system');
+ end;
+
+ disp('Checking directory structure ...');
+ % need to check which directory we are in
+ % if we are in the src directory we should
+ % be in directory ../src/bindings/matlab
+ [remain, first] = fileparts(pwd);
+ [remain1, second] = fileparts(remain);
+ [remain2, third] = fileparts(remain1);
+
+ if (~strcmp(first, 'matlab'))
+ report_incorrect_dir(pwd, '/src/bindings/matlab');
+ elseif (~strcmp(second, 'bindings'))
+ report_incorrect_dir(pwd, '/src/bindings/matlab');
+ elseif (~strcmp(third, 'src'))
+ report_incorrect_dir(pwd, '/src/bindings/matlab');
+ else
+ root = remain2;
+ disp('Expected directory structure found');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% tell user we are in the wrong location
+function report_incorrect_dir(this_dir, expected)
+
+ message = sprintf('You are in directory %s \nbut should be in %s', this_dir, expected);
+ error(message);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% build on windows
+function build_win(ismatlab, root)
+
+ % check that the win/bin directory exists
+ bin_dir = [root, filesep, 'win', filesep, 'bin'];
+ disp(sprintf('Checking for the %s directory ...', bin_dir));
+ if (exist(bin_dir, 'dir') ~= 7)
+ error (sprintf('%s not found\n%s', bin_dir, ...
+ 'the libSBML source tree expects this directory to exist'));
+ else
+ disp('Checking for libraries ...');
+ % check that the library files are all there
+ lib{1} = [bin_dir, filesep, 'libsbml.lib'];
+ lib{2} = [bin_dir, filesep, 'libsbml.dll'];
+ lib{3} = [bin_dir, filesep, 'libxml2.lib'];
+ lib{4} = [bin_dir, filesep, 'libxml2.dll'];
+ lib{5} = [bin_dir, filesep, 'iconv.lib'];
+ lib{6} = [bin_dir, filesep, 'iconv.dll'];
+ lib{7} = [bin_dir, filesep, 'bzip2.lib'];
+ lib{8} = [bin_dir, filesep, 'bzip2.dll'];
+
+ found = 1;
+ for i = 1:8
+ if (exist(lib{i}) ~= 0)
+ disp(sprintf('%s found', lib{i}));
+ else
+ disp(sprintf('%s not found', lib{i}));
+ found = 0;
+ end;
+ end;
+
+ if (found == 0)
+ error (sprintf('Not all dependencies could be found\n%s%s', ...
+ 'the libSBML source tree expects the dependencies to be in ', bin_dir));
+ else
+ disp('All dependencies found');
+ end;
+ end;
+
+ % check that the include directory exists
+ include_dir = [root, filesep, 'include'];
+ disp(sprintf('Checking for the %s directory ...', include_dir));
+ if (exist(include_dir, 'dir') ~= 7)
+ error (sprintf('%s not found\n%s', include_dir, ...
+ 'the libSBML source tree expects this directory to exist'));
+ end;
+
+ if (ismatlab)
+ % build the files
+ inc_flag = ['-I', include_dir];
+ buildMexFiles(inc_flag, lib{1});
+
+ else
+ % TO DO
+ disp('Build on octave');
+ end;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% build on mac
+function build_mac(ismatlab, root)
+
+ % check that libsbml is in usr/local/lib directory
+ bin_dir = [];
+
+ for i=1:length(strfind(pwd, filesep))
+ bin_dir = [bin_dir, '..', filesep];
+ end;
+ bin_dir = [bin_dir, 'usr', filesep, 'local', filesep, 'lib'];
+ disp('Checking for libraries ...');
+ % check that the library files are all there
+ lib{1} = [bin_dir, filesep, 'libsbml.dylib'];
+ if (exist(lib{1}) == 0)
+ disp('libsbml.dylib could not be found');
+ new_bin_dir = input(sprintf('\n\n%s\n%s\n%s\n%s', ...
+ 'The build process assumes that libsbml', ...
+ 'has been installed at usr/local', ...
+ 'if libsbml.dylib is in another directory please enter the ', ...
+ 'full path to reach the directory from this directory: '), 's');
+ lib{2} = [new_bin_dir, filesep, 'libsbml.dylib'];
+
+ if (exist(lib{2}) == 0)
+ error('libsbml.dylib could not be found');
+ else
+ lib{1} = lib{2};
+ end;
+ end;
+
+ % check that the include directory exists
+ include_dir = [root, filesep, 'include'];
+ disp(sprintf('Checking for the %s directory ...', include_dir));
+ if (exist(include_dir, 'dir') ~= 7)
+ error (sprintf('%s not found\n%s', include_dir, ...
+ 'the libSBML source tree expects this directory to exist'));
+ end;
+
+ if (ismatlab)
+ % build the files
+ inc_flag = ['-I', include_dir];
+ buildMexFiles(inc_flag, lib{1});
+
+ else
+ disp('Build on octave');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% build on linux
+function build_linux(ismatlab, root)
+
+ % check that libsbml is in usr/local/lib directory
+ bin_dir = [];
+
+ for i=1:length(strfind(pwd, filesep))
+ bin_dir = [bin_dir, '..', filesep];
+ end;
+ bin_dir = [bin_dir, 'usr', filesep, 'local', filesep, 'lib'];
+ disp('Checking for libraries ...');
+ % check that the library files are all there
+ lib{1} = [bin_dir, filesep, 'libsbml.so'];
+ if (exist(lib{1}) == 0)
+ disp('libsbml.so could not be found');
+ new_bin_dir = input(sprintf('\n\n%s\n%s\n%s\n%s', ...
+ 'The build process assumes that libsbml', ...
+ 'has been installed at usr/local', ...
+ 'if libsbml.so is in another directory please enter the ', ...
+ 'full path to reach the directory from this directory: '), 's');
+ lib{2} = [new_bin_dir, filesep, 'libsbml.so'];
+
+ if (exist(lib{2}) == 0)
+ error('libsbml.so could not be found');
+ else
+ lib{1} = lib{2};
+ end;
+ end;
+
+ % check that the include directory exists
+ include_dir = [root, filesep, 'include'];
+ disp(sprintf('Checking for the %s directory ...', include_dir));
+ if (exist(include_dir, 'dir') ~= 7)
+ error (sprintf('%s not found\n%s', include_dir, ...
+ 'the libSBML source tree expects this directory to exist'));
+ end;
+
+ if (ismatlab)
+ % build the files
+ inc_flag = ['-I', include_dir];
+ buildMexFiles(inc_flag, lib{1});
+
+ else
+ disp('Build on octave');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% runs the mex command for windows and matlab
+% the messy file handle stuff is because this seems to be the best way to
+% be able to pass arguments to the function
+function buildMexFiles(include, library)
+
+ fhandle = @mex;
+ disp('Building TranslateSBML ...');
+ feval(fhandle, 'TranslateSBML.c', include, library);
+ disp('Building OutputSBML ...');
+ feval(fhandle, 'OutputSBML.c', include, library);
+
+ transFile = strcat('TranslateSBML.', mexext());
+ outFile = strcat('OutputSBML.', mexext());
+
+ if ((exist(transFile) == 3 && ...
+ exist(outFile) == 3))
+ disp(sprintf('%s\n%s', 'Build successful', ...
+ 'Now run the install script which will install and test the files'));
+ else
+ disp('Build failed');
+ end;
+
Added: trunk/libsbml/src/bindings/matlab/install.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/install.m (rev 0)
+++ trunk/libsbml/src/bindings/matlab/install.m 2011-01-29 11:44:25 UTC (rev 12719)
@@ -0,0 +1,285 @@
+function install
+
+ [detected_os, matlab, root] = determine_system();
+
+ switch detected_os
+ case 0
+ install_win(matlab, root);
+ case 1
+ install_mac(matlab, root);
+ case 2
+ install_linux(matlab, root);
+ otherwise
+ error('OS not recognised');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% check what we are using
+function [detected_os, matlab, root] = determine_system
+
+ disp('Checking system ...');
+ disp('Looking at software ...');
+ % matlab = [0, 1]
+ % 0 - octave
+ % 1 - matlab
+ if (strcmp(isoctave(), '0'))
+ matlab = 1;
+ disp('MATLAB detected');
+ else
+ matlab = 0;
+ disp('Octave detected');
+ end;
+
+ disp('Looking at OS ...');
+ % detected_os = [0, 1, 2]
+ % 0 - windows
+ % 1 - mac
+ % 2 - unix
+ if (ispc())
+ detected_os = 0;
+ disp('Windows OS detected');
+ elseif(ismac())
+ detected_os = 1;
+ disp('Mac OS detected');
+ elseif(isunix())
+ detected_os = 2;
+ disp('Linux OS detected');
+ else
+ error('Unable to establish operating system');
+ end;
+
+ disp('Checking directory structure ...');
+ % need to check which directory we are in
+ % if we are in the src directory we should
+ % be in directory ../src/bindings/matlab
+ [remain, first] = fileparts(pwd);
+ [remain1, second] = fileparts(remain);
+ [remain2, third] = fileparts(remain1);
+
+ if (~strcmp(first, 'matlab'))
+ report_incorrect_dir(pwd, '/src/bindings/matlab');
+ elseif (~strcmp(second, 'bindings'))
+ report_incorrect_dir(pwd, '/src/bindings/matlab');
+ elseif (~strcmp(third, 'src'))
+ report_incorrect_dir(pwd, '/src/bindings/matlab');
+ else
+ root = remain2;
+ disp('Expected directory structure found');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% tell user we are in the wrong location
+function report_incorrect_dir(this_dir, expected)
+
+ message = sprintf('You are in directory %s \nbut should be in %s', this_dir, expected);
+ error(message);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% install on windows
+function install_win(ismatlab, root)
+
+ bin_dir = [root, filesep, 'win', filesep, 'bin'];
+ if (exist(bin_dir, 'dir') ~= 7)
+ %dir doesnot exist prompt
+ error('should not be here');
+ else
+ addDir(pwd);
+ addDir(bin_dir);
+ end;
+
+ if (ismatlab)
+ this_dir = pwd;
+ % install the files
+ try
+ M = TranslateSBML('test.xml');
+ catch
+ cd(bin_dir);
+ try
+ M = TranslateSBML('test.xml');
+ cd(this_dir);
+ catch
+ cd(this_dir);
+ end;
+ end;
+
+ success = 1;
+ try
+ disp('checking for TranslateSBML');
+ M = TranslateSBML('test.xml');
+ catch
+ disp('Installation failed - need to build TranslateSBML');
+ success = 0;
+ end;
+
+ outFile = [tempdir, filesep, 'test-out.xml'];
+ if (success == 1)
+ try
+ disp('checking OutputSBML');
+ OutputSBML(M, outFile);
+ catch
+ disp('Installation failed - need to build OutputSBML');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp ('running tests for TranslateSBML');
+ cd test;
+ pass = testBinding(1);
+ cd ..;
+ if (pass == 0)
+ disp('TranslateSBML successful');
+ else
+ disp('Binding present but problem detected. Seek help.');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp('running tests for OutputSBML');
+ cd test;
+ pass = testOutput(tempdir);
+ cd ..;
+ if (pass == 0)
+ disp('OutputSBML successful');
+ else
+ disp('Output function present but problem detected. Seek help.');
+ success = 0;
+ end;
+ end;
+
+ if (success == 1)
+ disp ('Installation completed');
+ end;
+
+ else
+ % TO DO
+ disp('install on octave');
+ end;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% install on mac
+function install_mac(ismatlab, root)
+
+ % check that libsbml is in usr/local/lib directory
+ bin_dir = [];
+
+ for i=1:length(strfind(pwd, filesep))
+ bin_dir = [bin_dir, '..', filesep];
+ end;
+ bin_dir = [bin_dir, 'usr', filesep, 'local', filesep, 'lib'];
+ disp('Checking for libraries ...');
+ % check that the library files are all there
+ lib{1} = [bin_dir, filesep, 'libsbml.dylib'];
+ if (exist(lib{1}) == 0)
+ disp('libsbml.dylib could not be found');
+ new_bin_dir = input(sprintf('\n\n%s\n%s\n%s\n%s', ...
+ 'The install process assumes that libsbml', ...
+ 'has been installed at usr/local', ...
+ 'if libsbml.dylib is in another directory please enter the ', ...
+ 'full path to reach the directory from this directory: '), 's');
+ lib{2} = [new_bin_dir, filesep, 'libsbml.dylib'];
+
+ if (exist(lib{2}) == 0)
+ error('libsbml.dylib could not be found');
+ else
+ lib{1} = lib{2};
+ end;
+ end;
+
+ % check that the include directory exists
+ include_dir = [root, filesep, 'include'];
+ disp(sprintf('Checking for the %s directory ...', include_dir));
+ if (exist(include_dir, 'dir') ~= 7)
+ error (sprintf('%s not found\n%s', include_dir, ...
+ 'the libSBML source tree expects this directory to exist'));
+ end;
+
+ if (ismatlab)
+ % install the files
+ inc_flag = ['-I', include_dir];
+ installMexFiles(inc_flag, lib{1});
+
+ else
+ disp('install on octave');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% install on linux
+function install_linux(ismatlab, root)
+
+ % check that libsbml is in usr/local/lib directory
+ bin_dir = [];
+
+ for i=1:length(strfind(pwd, filesep))
+ bin_dir = [bin_dir, '..', filesep];
+ end;
+ bin_dir = [bin_dir, 'usr', filesep, 'local', filesep, 'lib'];
+ disp('Checking for libraries ...');
+ % check that the library files are all there
+ lib{1} = [bin_dir, filesep, 'libsbml.so'];
+ if (exist(lib{1}) == 0)
+ disp('libsbml.so could not be found');
+ new_bin_dir = input(sprintf('\n\n%s\n%s\n%s\n%s', ...
+ 'The install process assumes that libsbml', ...
+ 'has been installed at usr/local', ...
+ 'if libsbml.so is in another directory please enter the ', ...
+ 'full path to reach the directory from this directory: '), 's');
+ lib{2} = [new_bin_dir, filesep, 'libsbml.so'];
+
+ if (exist(lib{2}) == 0)
+ error('libsbml.so could not be found');
+ else
+ lib{1} = lib{2};
+ end;
+ end;
+
+ % check that the include directory exists
+ include_dir = [root, filesep, 'include'];
+ disp(sprintf('Checking for the %s directory ...', include_dir));
+ if (exist(include_dir, 'dir') ~= 7)
+ error (sprintf('%s not found\n%s', include_dir, ...
+ 'the libSBML source tree expects this directory to exist'));
+ end;
+
+ if (ismatlab)
+ % install the files
+ inc_flag = ['-I', include_dir];
+ installMexFiles(inc_flag, lib{1});
+
+ else
+ disp('install on octave');
+ end;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% runs the mex command for windows and matlab
+% the messy file handle stuff is because this seems to be the best way to
+% be able to pass arguments to the function
+function installMexFiles(include, library)
+
+ fhandle = @mex;
+ disp('Building TranslateSBML ...');
+ feval(fhandle, 'TranslateSBML.c', include, library);
+ disp('Building OutputSBML ...');
+ feval(fhandle, 'OutputSBML.c', include, library);
+
+ transFile = strcat('TranslateSBML.', mexext());
+ outFile = strcat('OutputSBML.', mexext());
+
+ if ((exist(transFile) == 3 && ...
+ exist(outFile) == 3))
+ disp(sprintf('%s\n%s', 'Build successful', ...
+ 'Now run the install script which will install and test the files'));
+ else
+ disp('Build failed');
+ end;
+
+function addDir(name)
+
+ disp(sprintf('adding %s to the path', name));
+ addpath(name);
+ if (savepath ~= 0)
+ error(sprintf('adding %s failed', name));
+ end;
+
\ No newline at end of file
Modified: trunk/libsbml/src/bindings/matlab/test/testBinding.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/test/testBinding.m 2011-01-29 00:18:57 UTC (rev 12718)
+++ trunk/libsbml/src/bindings/matlab/test/testBinding.m 2011-01-29 11:44:25 UTC (rev 12719)
@@ -31,7 +31,7 @@
Totalfail = Totalfail + testReadFlags;
end;
if (install == 0)
- Totalfail = Totalfail + testOutput;
+ Totalfail = Totalfail + testOutput('Out-test1');
end;
disp ('************************************');
disp('Overall tests:');
Modified: trunk/libsbml/src/bindings/matlab/test/testOutput.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/test/testOutput.m 2011-01-29 00:18:57 UTC (rev 12718)
+++ trunk/libsbml/src/bindings/matlab/test/testOutput.m 2011-01-29 11:44:25 UTC (rev 12719)
@@ -1,4 +1,4 @@
-function fail = testOutput
+function fail = testOutput(outdir)
% Filename : TestOutput.m
% Description :
@@ -21,8 +21,8 @@
% and also available online as http://sbml.org/software/sbmltoolbox/license.html
%----------------------------------------------------------------------- -->
-if (~isdir('Out-test'))
-mkdir ('Out-test');
+if (~isdir(outdir))
+mkdir (outdir);
end;
if exist('OCTAVE_VERSION')
@@ -35,7 +35,7 @@
end;
end;
else
- files = dir('test-data/*.xml');
+ files = dir(['test-data', filesep, '*.xml']);
end;
fail = 0;
@@ -52,10 +52,10 @@
elseif (strcmp(files(i).name, 'convertedFormulasL2.xml') && exist('OCTAVE_VERSION'))
%do nothing
else
- model = TranslateSBML(sprintf('test-data/%s', files(i).name));
+ model = TranslateSBML(['test-data', filesep, files(i).name]);
if (~isempty(model))
- OutputSBML(model, sprintf('Out-test/%s', files(i).name));
- if (compareFiles(sprintf('test-data/%s', files(i).name), sprintf('Out-test/%s', files(i).name)))
+ OutputSBML(model, [outdir, filesep, files(i).name]);
+ if (compareFiles(['test-data', filesep, files(i).name], [outdir, filesep, files(i).name]))
disp(sprintf('Output of %s failed', files(i).name));
fail = fail + 1;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fbe...@us...> - 2011-01-29 00:19:04
|
Revision: 12718
http://sbml.svn.sourceforge.net/sbml/?rev=12718&view=rev
Author: fbergmann
Date: 2011-01-29 00:18:57 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
- modified to generate some rudimentary C# documentation. See also the mail to the team.
Modified Paths:
--------------
branches/libsbml-5/src/bindings/swig/swigdoc.py
Modified: branches/libsbml-5/src/bindings/swig/swigdoc.py
===================================================================
--- branches/libsbml-5/src/bindings/swig/swigdoc.py 2011-01-27 13:53:44 UTC (rev 12717)
+++ branches/libsbml-5/src/bindings/swig/swigdoc.py 2011-01-29 00:18:57 UTC (rev 12718)
@@ -1,11 +1,12 @@
#!/usr/bin/env python
#
# @file swigdoc.py
-# @brief Creates documentation for Java, Python, and Perl.
+# @brief Creates documentation for C#, Java, Python, and Perl.
# @author Ben Bornstein
# @author Christoph Flamm
# @author Akiya Jouraku
# @author Michael Hucka
+# @author Frank Bergmann
#
# $Id: swigdoc.py 10124 2009-08-28 12:04:51Z sarahkeating $
# $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/swig/swigdoc.py $
@@ -459,6 +460,8 @@
if language == 'java':
target = 'libsbmlConstants#'
+ elif language == 'csharp':
+ target = 'libsbml.libsbml.#'
elif language == 'python':
target = 'libsbml.'
else:
@@ -554,6 +557,14 @@
+def translateCSharpCrossRef (match):
+ prior = match.group(1)
+ classname = match.group(2)
+ method = match.group(3)
+ return prior + '<see cref="' + classname + '.' + method + '"/>'
+
+
+
def translatePythonCrossRef (match):
prior = match.group(1)
classname = match.group(2)
@@ -587,12 +598,24 @@
trailing = match.group(3)
if leading != '%' and leading != '(':
- return leading + '{@link ' + classname + '}' + trailing
+ return leading + '{@link ' + classname + '}' + trailing
else:
return leading + classname + trailing
+def translateClassRefCSharp (match):
+ leading = match.group(1)
+ classname = match.group(2)
+ trailing = match.group(3)
+
+ if leading != '%' and leading != '(':
+ return leading + '<see cref="' + classname + '"/>' + trailing
+ else:
+ return leading + classname + trailing
+
+
+
def sanitizeForHTML (docstring, language):
"""sanitizeForHTML (docstring, language) -> docstring
@@ -605,6 +628,8 @@
p = re.compile('@if\s+(java|python|perl|clike|notcpp)\s+(.+?)@endif', re.DOTALL)
if language == 'java':
docstring = p.sub(translateIfJava, docstring)
+ elif language == 'csharp':
+ docstring = p.sub(translateIfJava, docstring)
elif language == 'perl':
docstring = p.sub(translateIfPerl, docstring)
elif language == 'python':
@@ -688,12 +713,18 @@
# done better (e.g., by not hard-wiring the class names).
p = re.compile(r'(\W)(' + '|'.join(libsbmlclasses) + r')\b([^:])', re.DOTALL)
- docstring = p.sub(translateClassRef, docstring)
+ if language == 'csharp':
+ docstring = p.sub(translateClassRefCSharp, docstring)
+ else:
+ docstring = p.sub(translateClassRef, docstring)
# Massage Java method cross-references.
p = re.compile('(\s+)(\S+?)::(\w+\s*\([^)]*?\))', re.MULTILINE)
- docstring = p.sub(translateJavaCrossRef, docstring)
+ if language == 'csharp':
+ docstring = p.sub(translateCSharpCrossRef, docstring)
+ else:
+ docstring = p.sub(translateJavaCrossRef, docstring)
# Take out any left-over quotes, because Javadoc doesn't have the %foo
# quoting mechanism.
@@ -787,6 +818,196 @@
+def rewriteDocstringForCSharp (docstring):
+ """rewriteDocstringForCSharp (docstring) -> docstring
+
+ Performs some mimimal C#-specific sanitizations on the
+ C++/Doxygen docstring.
+ """
+
+ docstring = rewriteCommonReferences(docstring, 'java')
+
+ # Get rid of the /** ... */ and leading *'s.
+ docstring = docstring.replace('/**', '').replace('*/', '').replace('*', ' ')
+
+ # Get rid of indentation
+ p = re.compile('^\s+(\S*\s*)', re.MULTILINE)
+ docstring = p.sub(r'\1', docstring)
+
+ # Get rid of paragraph indentation not caught by the code above.
+ p = re.compile('^[ \t]+(\S)', re.MULTILINE)
+ docstring = p.sub(r'\1', docstring)
+
+ # Preliminary: rewrite some of the data type references to equivalent
+ # C# types. (Note: this rewriting affects only the documentation
+ # comments inside classes & methods, not the method signatures.)
+
+ docstring = docstring.replace(r'const char *', 'string ')
+ docstring = docstring.replace(r'const char* ', 'string ')
+ docstring = docstring.replace(r'an unsigned int', 'a long integer')
+ docstring = docstring.replace(r'unsigned int', 'long')
+ docstring = docstring.replace(r'const std::string&', 'string')
+ docstring = docstring.replace(r'const std::string', 'string')
+ docstring = docstring.replace(r'std::string', 'string')
+ docstring = docstring.replace(r'const ', '')
+ docstring = docstring.replace(r'NULL', 'null')
+
+ # Also use Java syntax instead of "const XMLNode*" etc.
+
+ p = re.compile(r'const (%?)(' + '|'.join(libsbmlclasses) + r') ?(\*|&)', re.DOTALL)
+ docstring = p.sub(javafyClassRef, docstring)
+ p = re.compile(r'(%?)(' + '|'.join(libsbmlclasses) + r') ?(\*|&)', re.DOTALL)
+ docstring = p.sub(javafyClassRef, docstring)
+
+ # Do the big work.
+
+ docstring = sanitizeForHTML(docstring, 'csharp')
+
+ # Fix up for a problem introduced by sanitizeForHTML -- should fix
+ # properly some day.
+
+ p = re.compile('(@see\s+[\w ,(]*){@link\s+([^}]+?)}')
+ docstring = p.sub(r'\1\2', docstring)
+
+ # Inside of @see, change double colons to pound signs.
+
+ docstring = re.sub('(@see\s+\w+)::', r'\1#', docstring)
+
+ # The syntax for @see is slightly different: method names need to have a
+ # leading pound sign character. This particular bit of code only handles
+ # a single @see foo(), which means the docs have to be written that way.
+ # Maybe someday in the future it should be expanded to handle
+ # @see foo(), bar(), etc., but I don't have time right now to do it.
+
+ docstring = re.sub('(@see\s+)([\w:.]+)\(', r'\1#\2(', docstring)
+
+ # Remove the '*' character that Javadoc doesn't want to see in @see's.
+ # (This doesn't make a difference; javadoc still can't match up the refs.)
+
+ # p = re.compile('@see[\s\w.:,()#]+[*][\s\w.:,()*#]')
+ # docstring = p.sub(removeStar, docstring)
+
+ # The syntax for @link is vastly different.
+
+ p = re.compile('@link([\s/*]+[\w\s,.:#()*]+[\s/*]+[\w():#]+[\s/*]*)@endlink', re.DOTALL)
+ docstring = p.sub(r'<see cref="\1"/>', docstring)
+
+ p = re.compile('{@link\s(\w+)}', re.DOTALL)
+ docstring = p.sub(r'<see cref="\1"/>', docstring)
+
+ # this is too broad unfortunately ...
+ # p = re.compile('@see\s[#](\w+\(.*\))', re.MULTILINE)
+ #docstring = p.sub(r'<see cref="\1"/>', docstring)
+ p = re.compile('@see\s[#](\w+\(\))', re.MULTILINE)
+ docstring = p.sub(r'<see cref="\1"/>', docstring)
+ p = re.compile('@see\s[#](\w+\(\w+\s+\w+\))', re.MULTILINE)
+ docstring = p.sub(r'<see cref="\1"/>', docstring)
+
+ p = re.compile('@see\s+(\w+)', re.MULTILINE)
+ docstring = p.sub(r'<see cref="\1"/>', docstring)
+
+
+
+ #cleanup
+ p = re.compile('@see\s(<see.*/>)', re.MULTILINE)
+ docstring = p.sub(r'\1', docstring)
+
+
+ # mark parameters (TODO: figure out correct boundaries!)
+ p = re.compile('@param\s+(\w+)\s(.+?)$', re.MULTILINE)
+ docstring = p.sub(r'<param name="\1">\2</param>', docstring)
+
+ # mark return statements (TODO: figure out correct boundaries!)
+ p = re.compile('@return\s+(.+?)$', re.MULTILINE)
+ docstring = p.sub(r'<returns>\1</returns>', docstring)
+
+ # mark all notes
+ p = re.compile('@note\s+(.+?)$', re.DOTALL)
+ docstring = p.sub(r'<remarks>\1</remarks>', docstring)
+ p = re.compile('@docnote\s+(.+?)$', re.DOTALL)
+ docstring = p.sub(r'<remarks>\1</remarks>', docstring)
+
+ # some things are marked as 'code' but are not code samples
+ p = re.compile('<code>("*\.*\w+\,*"*)</code>', re.DOTALL)
+ docstring = p.sub(r'<c>\1</c>', docstring)
+
+
+ # replace libsbmlConstants# by libsbml.libsbml.
+ p = re.compile('\s*libsbmlConstants#', re.DOTALL)
+ docstring = p.sub(r'F:libsbml.libsbml.', docstring)
+ p = re.compile('(libsbml.\w+\_\w+)\s\w+\_\w+', re.DOTALL)
+ docstring = p.sub(r'\1', docstring)
+
+ p = re.compile('\s*libsbmlConstants.', re.DOTALL)
+ docstring = p.sub(r'libsbml.libsbml.', docstring)
+
+ #delete variable names (one argument)
+ p = re.compile('\((\w+)\s+\w+\)', re.DOTALL)
+ docstring = p.sub(r'(\1)', docstring)
+
+ #delete variable names (two arguments)
+ p = re.compile('\((\w+\s*)\w+(,\s*\w+)\s*\w+\)', re.DOTALL)
+ docstring = p.sub(r'(\1\2)', docstring)
+
+ #delete variable names (three arguments)
+ p = re.compile('\((\w+\s*)\w+(,\s*\w+)\s*\w+(,\s*\w+)\s*\w+\)', re.DOTALL)
+ docstring = p.sub(r'(\1\2\3)', docstring)
+
+ # fix issues
+ docstring = docstring.replace('<see cref="libsbml"/>', "libsbml")
+ docstring = docstring.replace('<see cref="libsbml.libsbml./>', '<see cref="libsbml.libsbml"/>')
+ docstring = docstring.replace('<a href="#<see cref="SBasePlugin"/>', '<a href="#SBasePlugin')
+ docstring = docstring.replace('<!---------------------------------------------------------------------- -->', '')
+ docstring = docstring.replace('<!-- leave this next break as-is to work around some doxygen bug -->', '')
+ docstring = docstring.replace('(string &uri)"/>', '(string)"/>')
+ docstring = docstring.replace('/sub> < t<sub>', '/sub> < t<sub>')
+ docstring = docstring.replace('</sub> <\n', '</sub> <\n')
+
+ # fix spaces in link s
+ p = re.compile('\s+"/>', re.DOTALL)
+ docstring = p.sub(r'"/>', docstring)
+
+ # Outside of @see and other constructs, dot is used to reference members
+ # instead of C++'s double colon.
+
+ docstring = docstring.replace(r'::', '.')
+
+ # Need to escape the quotation marks:
+
+ docstring = docstring.replace('"', "'")
+ docstring = docstring.replace(r"'", r"\'")
+
+ # XMLDocs are confused by some of the HTML tags
+ # pre should be marked as code
+ docstring = docstring.replace('<pre>', '<code>')
+ docstring = docstring.replace('</pre>', '</code>')
+
+ # HACK: XMLDoc needs XHTML ... however many tags are not closed currently
+ # so lets replace them for now ...
+ docstring = docstring.replace('<p>', '<br/><br/>')
+ docstring = docstring.replace('</p>', '')
+ docstring = docstring.replace('<li>', '<br/>* ')
+ docstring = docstring.replace('</li>', '')
+ docstring = docstring.replace('<br>', '<br/>')
+
+ # some tags are not valid to be used in XML doc.
+ docstring = docstring.replace('–', '-')
+ docstring = docstring.replace('—', '-')
+ docstring = docstring.replace(' ', ' ')
+
+
+ docstring = docstring.replace('boolean', 'bool')
+
+
+ # prefix lines by C# XML Comment mark
+ docstring = docstring.replace('\n', '\n\t/// ')
+ # surround document in a summary tag
+ docstring = '\n\t///<summary>' + docstring + '\n\t///</summary>\n'
+
+ return docstring
+
+
+
def indentVerbatimForPython (match):
text = match.group()
@@ -954,6 +1175,8 @@
continue
if language == 'java':
docstring = rewriteDocstringForJava(m.docstring)
+ elif language == 'csharp':
+ docstring = rewriteDocstringForCSharp(m.docstring)
elif language == 'perl':
docstring = rewriteDocstringForPerl(m.docstring)
ostream.write(formatMethodDocString(language, m.name, cclass.name, docstring, m.args))
@@ -966,6 +1189,9 @@
if language == 'java':
pre = '%javamethodmodifiers'
post = ' public'
+ if language == 'csharp':
+ pre = '%csmethodmodifiers'
+ post = ' public'
elif language == 'perl':
pre = '=item'
post = ''
@@ -993,6 +1219,8 @@
if language == 'java':
doc = rewriteDocstringForJava(docstring)
+ elif language == 'csharp':
+ doc = rewriteDocstringForCSharp(docstring)
elif language == 'python':
doc = rewriteDocstringForPython(docstring)
elif language == 'perl':
@@ -1006,7 +1234,10 @@
pre = '%typemap(javaimports) '
docstring = rewriteDocstringForJava(docstring)
output = pre + classname + ' "\n' + docstring + '"\n\n'
-
+ elif language == 'csharp':
+ pre = '%typemap(csimports) '
+ docstring = rewriteDocstringForCSharp(docstring)
+ output = pre + classname + ' "\n using System;\n using System.Runtime.InteropServices;\n\n' + docstring + '"\n\n'
elif language == 'python':
pre = '%feature("docstring") '
docstring = rewriteDocstringForPython(docstring)
@@ -1059,12 +1290,12 @@
def main (args):
- """usage: swigdoc.py [java | python | perl] -Ipath -Dpath libsbml.i output.i
+ """usage: swigdoc.py [csharp | java | python | perl] -Ipath -Dpath libsbml.i output.i
- java | python | perl generate docstrings for this language module.
- path is the path to the libsbml src/ directory.
- libsbml.i is the master libsbml SWIG interface file.
- output.i is the file to output the SWIG docstrings.
+ csharp |java | python | perl generate docstrings for this language module.
+ path is the path to the libsbml src/ directory.
+ libsbml.i is the master libsbml SWIG interface file.
+ output.i is the file to output the SWIG docstrings.
"""
if len(args) != 6:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-27 13:53:51
|
Revision: 12717
http://sbml.svn.sourceforge.net/sbml/?rev=12717&view=rev
Author: sarahkeating
Date: 2011-01-27 13:53:44 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
added further ignore functions
Modified Paths:
--------------
trunk/libsbml/dev/utilities/translateTests/translateTests.pl
Modified: trunk/libsbml/dev/utilities/translateTests/translateTests.pl
===================================================================
--- trunk/libsbml/dev/utilities/translateTests/translateTests.pl 2011-01-27 04:19:51 UTC (rev 12716)
+++ trunk/libsbml/dev/utilities/translateTests/translateTests.pl 2011-01-27 13:53:44 UTC (rev 12717)
@@ -177,6 +177,7 @@
test_MathMLFormatter_semantics_url => 0,
test_MathMLFormatter_ci_definitionURL => 0,
test_ASTNode_replaceArgument => 0,
+ test_ASTNode_accessWithNULL => 0,
test_SBase_addCVTerms_newBag => 0,
test_Date_setHoursOffset_neg_arg => 0,
test_Date_setOffsetSign => 0,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-27 04:19:58
|
Revision: 12716
http://sbml.svn.sourceforge.net/sbml/?rev=12716&view=rev
Author: mhucka
Date: 2011-01-27 04:19:51 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Minor fixes for doxygen.
Modified Paths:
--------------
trunk/libsbml/src/annotation/ModelHistory.h
trunk/libsbml/src/sbml/SBMLError.h
trunk/libsbml/src/sbml/SBMLVisitor.h
Modified: trunk/libsbml/src/annotation/ModelHistory.h
===================================================================
--- trunk/libsbml/src/annotation/ModelHistory.h 2011-01-27 04:10:01 UTC (rev 12715)
+++ trunk/libsbml/src/annotation/ModelHistory.h 2011-01-27 04:19:51 UTC (rev 12716)
@@ -288,11 +288,11 @@
* below for further explanations. (Default value used if this argument
* is not given: @c 0.)
*
- * @param hours offset an unsigned integer representing the time zone's
+ * @param hoursOffset an unsigned integer representing the time zone's
* hour offset from GMT. (Default value used if this argument is not
* given: @c 0.)
*
- * @param minute offset an unsigned integer representing the time zone's
+ * @param minutesOffset an unsigned integer representing the time zone's
* minute offset from GMT. (Default value used if this argument is not
* given: @c 0.)
*
Modified: trunk/libsbml/src/sbml/SBMLError.h
===================================================================
--- trunk/libsbml/src/sbml/SBMLError.h 2011-01-27 04:10:01 UTC (rev 12715)
+++ trunk/libsbml/src/sbml/SBMLError.h 2011-01-27 04:19:51 UTC (rev 12716)
@@ -584,9 +584,9 @@
, /*!< No units for 1D Compartment */
, TwoDimensionalCompartmentUnits = 20512 /*!< No units for 2D Compartment */
, ThreeDimensionalCompartmentUnits = 20513 /*!< No units for 3D Compartment */
- , AllowedAttributesOnCompartment = 20517 /*!< Invalid attribute on <compartment> */
- , NoUnitsOnCompartment = 20518 /*!< No units for <compartment> */
- , InvalidSpeciesCompartmentRef = 20601 /*!< Invalid <code>compartment</code> reference */
+ , AllowedAttributesOnCompartment = 20517 /*!< Invalid attribute on <code><compartment></code> */
+ , NoUnitsOnCompartment = 20518 /*!< No units for <code><compartment></code> */
+ , InvalidSpeciesCompartmentRef = 20601 /*!< Invalid <code><compartment></code> reference */
, HasOnlySubsNoSpatialUnits = 20602 /*!< No <code>spatialSizeUnits</code> permitted if <code>hasOnlySubstanceUnits</code>=<code>true</code> */
, NoSpatialUnitsInZeroD = 20603 /*!< No <code>spatialSizeUnits</code> permitted if compartment is zero-dimensional */
, NoConcentrationInZeroD = 20604 /*!< No <code>initialConcentration</code> permitted if compartment is zero-dimensional */
@@ -603,7 +603,7 @@
, SpatialSizeUnitsRemoved = 20615 /*!< Attribute <code>spatialSizeUnits</code> not supported in this Level+Version of SBML */
, SubstanceUnitsOnSpecies = 20616 /*!< No substance units for Species */
, ConversionFactorOnSpecies = 20617 /*!< Invalid conversionFactor attribute */
- , AllowedAttributesOnSpecies = 20623 /*!< Invalid attribute on <species></code> */
+ , AllowedAttributesOnSpecies = 20623 /*!< Invalid attribute on <code><species></code> */
, InvalidParameterUnits = 20701 /*!< Invalid value for <code>units</code> in parameter definition */
, ParameterUnits = 20702 /*!< No units for parameter */
, ConversionFactorMustConstant = 20705 /*!< ConversionFactor must be constant parameter */
@@ -620,46 +620,46 @@
, RepeatedRule10304 = 20905 /*!< */
, CircularRuleDependency = 20906 /*!< Circular dependency involving rules and reactions */
, /*!< Rule must contain one math element */
- , AllowedAttributesOnAssignRule = 20908 /*!< Invalid attribute on <assignmentRule> */
- , AllowedAttributesOnRateRule = 20909 /*!< Invalid attribute on <rateRule> */
- , AllowedAttributesOnAlgRule = 20910 /*!< Invalid attribute on <algebraicRule> */
+ , AllowedAttributesOnAssignRule = 20908 /*!< Invalid attribute on <code><assignmentRule></code> */
+ , AllowedAttributesOnRateRule = 20909 /*!< Invalid attribute on <code><rateRule></code> */
+ , AllowedAttributesOnAlgRule = 20910 /*!< Invalid attribute on <code><algebraicRule></code> */
, ConstraintMathNotBoolean = 21001 /*!< Non-boolean math expression in constraint definition */
, IncorrectOrderInConstraint = 21002 /*!< Incorrect order of elements in constraint definition */
, ConstraintNotInXHTMLNamespace = 21003 /*!< Constraint message is not in XHTML XML namespace */
, ConstraintContainsXMLDecl = 21004 /*!< XML declarations not permitted in constraint messages */
, ConstraintContainsDOCTYPE = 21005 /*!< XML <code>DOCTYPE</code> not permitted in constraint messages */
, InvalidConstraintContent = 21006 /*!< Invalid content for constraint message */
- , /*!< Only one math element on <constraint> */
- , /*!< Only one message element on <constraint> */
- , AllowedAttributesOnConstraint = 21009 /*!< Invalid attribute on <constraint> */
+ , /*!< Only one math element on <code><constraint></code> */
+ , /*!< Only one message element on <code><constraint></code> */
+ , AllowedAttributesOnConstraint = 21009 /*!< Invalid attribute on <code><constraint></code> */
, NoReactantsOrProducts = 21101 /*!< Cannot have a reaction with neither reactants nor products */
, IncorrectOrderInReaction = 21102 /*!< Incorrect ordering of components in reaction definition */
, EmptyListInReaction = 21103 /*!< Reaction components, if present, cannot be empty */
, InvalidReactantsProductsList = 21104 /*!< Invalid element in list of reactants or products */
, InvalidModifiersList = 21105 /*!< Invalid element in list of modifiers */
- , /*!< Only one of subelement on <reaction> */
- , CompartmentOnReaction = 21107 /*!< Invalid compartment attribute on <reaction> */
- , AllowedAttributesOnReaction = 21110 /*!< Invalid attribute on <reaction> */
+ , /*!< Only one of subelement on <code><reaction></code> */
+ , CompartmentOnReaction = 21107 /*!< Invalid compartment attribute on <code><reaction></code> */
+ , AllowedAttributesOnReaction = 21110 /*!< Invalid attribute on <code><reaction></code> */
, InvalidSpeciesReference = 21111 /*!< Invalid <code>species</code> value in species reference */
, RepeatedRule20611 = 21112 /*!< */
, BothStoichiometryAndMath = 21113 /*!< Cannot use both <code>stoichiometry</code> and <code><stoichiometryMath></code> simultaneously */
- , AllowedAttributesOnSpeciesReference = 21116 /*!< Invalid attribute on <speciesReference> */
- , AllowedAttributesOnModifier = 21117 /*!< Invalid attribute on <modifierSpeciesReference> */
+ , AllowedAttributesOnSpeciesReference = 21116 /*!< Invalid attribute on <code><speciesReference></code> */
+ , AllowedAttributesOnModifier = 21117 /*!< Invalid attribute on <code><modifierSpeciesReference></code> */
, UndeclaredSpeciesRef = 21121 /*!< Undeclared species referenced in kinetic law formula */
, IncorrectOrderInKineticLaw = 21122 /*!< Incorrect ordering of components in kinetic law definition */
, EmptyListInKineticLaw = 21123 /*!< The list of parameters component, if present, cannot be empty */
, NonConstantLocalParameter = 21124 /*!< Parameters local to a kinetic law must have <code>constant</code>=<code>true</code> */
, SubsUnitsNoLongerValid = 21125 /*!< <code>substanceUnits</code> not supported in this Level+Version of SBML */
, TimeUnitsNoLongerValid = 21126 /*!< <code>timeUnits</code> not supported in this Level+Version of SBML */
- , /*!< Only one listOfLocalParameters permitted on <kineticLaw> */
+ , /*!< Only one listOfLocalParameters permitted on <code><kineticLaw></code> */
, /*!< Only LocalParameters allowed in ListOfLocalParameters */
, AllowedAttributesOnListOfLocalParam = 21129 /*!< Invalid attribute on <code><listOfLocalParameters></code> */
- , /*!< Only one math element on <kineticLaw> */
+ , /*!< Only one math element on <code><kineticLaw></code> */
, UndeclaredSpeciesInStoichMath = 21131 /*!< Undeclared species referenced in <code><stoichiometryMath></code> formula */
- , AllowedAttributesOnKineticLaw = 21132 /*!< Invalid attribute on <kineticLaw> */
+ , AllowedAttributesOnKineticLaw = 21132 /*!< Invalid attribute on <code><kineticLaw></code> */
, AllowedAttributesOnListOfSpeciesRef = 21150 /*!< Invalid attribute on <code><listOfSpeciesReferences></code> */
, AllowedAttributesOnListOfMods = 21151 /*!< Invalid attribute on <code><listofModifiers></code> */
- , AllowedAttributesOnLocalParameter = 21172 /*!< Invalid attribute on <localParameter> */
+ , AllowedAttributesOnLocalParameter = 21172 /*!< Invalid attribute on <code><localParameter></code> */
, MissingTriggerInEvent = 21201 /*!< Missing trigger in event definition */
, TriggerMathNotBoolean = 21202 /*!< Non-boolean math expression in trigger definition */
, MissingEventAssignment = 21203 /*!< Missing event assignment in event definition */
@@ -672,19 +672,19 @@
, InvalidEventAssignmentVariable = 21211 /*!< Invalid value for <code>variable</code> in event assignment */
, EventAssignmentForConstantEntity = 21212 /*!< Cannot assign to a constant component in an event assignment */
, /*!< EventAssignment must have one math element */
- , AllowedAttributesOnEventAssignment = 21214 /*!< Invalid attribute on <eventAssignment> */
- , /*!< Event can only have one <delay> */
+ , AllowedAttributesOnEventAssignment = 21214 /*!< Invalid attribute on <code><eventAssignment></code> */
+ , /*!< Event can only have one <code><delay></code> */
, /*!< Event can only have one <code><listOfEventAssignments></code> */
- , /*!< <code><listOfEventAssignments></code> can only have <eventAssignment> */
+ , /*!< <code><listOfEventAssignments></code> can only have <code><eventAssignment></code> */
, AllowedAttributesOnListOfEventAssign = 21224 /*!< Invalid attribute on <code><listOfEventAssignments></code> */
- , AllowedAttributesOnEvent = 21225 /*!< Invalid attribute on <event> */
- , AllowedAttributesOnTrigger = 21226 /*!< Invalid attribute on <trigger> */
- , AllowedAttributesOnDelay = 21227 /*!< Invalid attribute on <delay> */
- , PersistentNotBoolean = 21228 /*!< Persistent attribute on <trigger> must be boolean */
- , InitialValueNotBoolean = 21229 /*!< InitialValue attribute on <trigger> must be boolean */
- , /*!< Event can only have one <priority> */
+ , AllowedAttributesOnEvent = 21225 /*!< Invalid attribute on <code><event></code> */
+ , AllowedAttributesOnTrigger = 21226 /*!< Invalid attribute on <code><trigger></code> */
+ , AllowedAttributesOnDelay = 21227 /*!< Invalid attribute on <code><delay></code> */
+ , PersistentNotBoolean = 21228 /*!< Persistent attribute on <code><trigger></code> must be boolean */
+ , InitialValueNotBoolean = 21229 /*!< InitialValue attribute on <code><trigger></code> must be boolean */
+ , /*!< Event can only have one <code><priority></code> */
, /*!< Priority must have one math element */
- , AllowedAttributesOnPriority = 21232 /*!< Invalid attribute on <priority> */
+ , AllowedAttributesOnPriority = 21232 /*!< Invalid attribute on <code><priority></code> */
, GeneralWarningNotSpecified = 29999 /*!< Unknown error */
@@ -719,7 +719,7 @@
, NoSBOTermsInL1 = 91013 /*!< SBML Level 1 does not support the <code>sboTerm</code> attribute */
, StrictUnitsRequiredInL1 = 91014 /*!< SBML Level 1 requires strict unit consistency */
, ConversionFactorNotInL1 = 91015 /*!< SBML Level 1 does not support the <code>conversionFactor</code> attribute */
- , CompartmentNotOnL1Reaction = 91016 /*!< SBML Level 1 does not support the <code>compartment</code> attribute on a <Reaction> */
+ , CompartmentNotOnL1Reaction = 91016 /*!< SBML Level 1 does not support the <code>compartment</code> attribute on a <code><reaction></code> */
, ExtentUnitsNotSubstance = 91017 /*!< Conversion to SBML Level 1 requires that <code>extent</code> units be a variant of substance */
/* L2v1 compatability */
@@ -736,7 +736,7 @@
, StoichiometryMathNotYetSupported = 92010 /*!< Conversion to StoichiometryMath not yet supported */
, PrioirtyLostFromL3 = 92011 /*!< SBML Level 2 Version 1 does not support priority */
, NonPersistentNotSupported = 92012 /*!< SBML Level 2 Version 1 does not support the <code>persistent</code> attribute */
- , InitialValueFalseEventNotSupported = 92013 /*!< SBML Level 2 Version 1 does not support an <code>initialValue</code> of <code>false</code> for a <Trigger> */
+ , InitialValueFalseEventNotSupported = 92013 /*!< SBML Level 2 Version 1 does not support an <code>initialValue</code> of <code>false</code> for a <code><trigger></code> */
/*!< SBML Level 2 Version 1 requires strict unit consistency */
@@ -812,7 +812,7 @@
, NoTimeSymbolInFunctionDef = 99301 /*!< <code><csymbol></code> for <code>time</code> used within the <code><math></code> of a function definition */
- , NoBodyInFunctionDef = 99302 /*!< There must be a body within the <math> of a function definition */
+ , NoBodyInFunctionDef = 99302 /*!< There must be a body within the <code><math></code> of a function definition */
/* These are internal errors that reverts to 10501. */
Modified: trunk/libsbml/src/sbml/SBMLVisitor.h
===================================================================
--- trunk/libsbml/src/sbml/SBMLVisitor.h 2011-01-27 04:10:01 UTC (rev 12715)
+++ trunk/libsbml/src/sbml/SBMLVisitor.h 2011-01-27 04:19:51 UTC (rev 12716)
@@ -138,11 +138,12 @@
* Pattern</i></a> to perform operations on ListOf objects.
*
* @param x the ListOf object to visit.
+ *
+ * @param type the object type code.
*/
virtual void visit (const ListOf &x, SBMLTypeCode_t type);
-
/**
* Interface method for using the <a target="_blank"
* href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)"><i>Visitor
@@ -440,6 +441,9 @@
* Pattern</i></a> to perform operations on ListOf objects.
*
* @param x the ListOf object to visit.
+ *
+ * @param type the object type code.
+ *
*/
virtual void leave (const ListOf &x, SBMLTypeCode_t type);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-27 04:10:10
|
Revision: 12715
http://sbml.svn.sourceforge.net/sbml/?rev=12715&view=rev
Author: mhucka
Date: 2011-01-27 04:10:01 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Futzing to make doxygen happy.
Modified Paths:
--------------
trunk/libsbml/src/annotation/CVTerm.h
Modified: trunk/libsbml/src/annotation/CVTerm.h
===================================================================
--- trunk/libsbml/src/annotation/CVTerm.h 2011-01-27 03:49:59 UTC (rev 12714)
+++ trunk/libsbml/src/annotation/CVTerm.h 2011-01-27 04:10:01 UTC (rev 12715)
@@ -245,8 +245,9 @@
* QualifierType_t#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER@endlink. If
* an explicit value for @p type is not given, this method defaults to
* using @link QualifierType_t#UNKNOWN_QUALIFIER
- * UNKNOWN_QUALIFIER@endlink. The @if clike #QualifierType_t@endif@if
- * java qualifier type code@endif type value can be set later using the
+ * UNKNOWN_QUALIFIER@endlink. The
+ * @if clike #QualifierType_t@endif@if java qualifier type code@endif
+ * type value can be set later using the
* CVTerm::setQualifierType(@if java int type@endif) method.
*
* Different BioModels.net qualifier elements encode different types of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-27 03:50:05
|
Revision: 12714
http://sbml.svn.sourceforge.net/sbml/?rev=12714&view=rev
Author: mhucka
Date: 2011-01-27 03:49:59 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Added a note about blank namespaces.
Modified Paths:
--------------
trunk/libsbml/docs/src/libsbml-issues.html
Modified: trunk/libsbml/docs/src/libsbml-issues.html
===================================================================
--- trunk/libsbml/docs/src/libsbml-issues.html 2011-01-27 02:52:06 UTC (rev 12713)
+++ trunk/libsbml/docs/src/libsbml-issues.html 2011-01-27 03:49:59 UTC (rev 12714)
@@ -107,6 +107,14 @@
XML constructs inside <code><notes></code> and
<code><annotation></code> elements).</li>
+<li style="margin-bottom: 1em">Some versions of libxml2 behave incorrectly
+when given a blank namespace (e.g., the use of <code>xmlns=" "</code>, with
+a space character). Versions of libxml prior 2.7.7 will report this as an
+invalid or undefined XML namespace, but in fact a namespace URI containing
+a single space is valid (albeit not a very useful one). This highlights
+another issue: different versions of the underlying XML parsers may behave
+differently in the face of unusual (though not necessarily illegal) inputs.
+
</ol>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-27 02:52:13
|
Revision: 12713
http://sbml.svn.sourceforge.net/sbml/?rev=12713&view=rev
Author: mhucka
Date: 2011-01-27 02:52:06 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Use the new HTML table.
Modified Paths:
--------------
trunk/libsbml/docs/src/libsbml-math.txt
Modified: trunk/libsbml/docs/src/libsbml-math.txt
===================================================================
--- trunk/libsbml/docs/src/libsbml-math.txt 2011-01-27 02:41:54 UTC (rev 12712)
+++ trunk/libsbml/docs/src/libsbml-math.txt 2011-01-27 02:52:06 UTC (rev 12713)
@@ -21,8 +21,7 @@
The figure also shows the corresponding MathML 2.0 "content"
representation:
-@image html astnode-illustration.jpg "Example AST representation of a mathematical expression."
-@image latex astnode-illustration.jpg "Example AST representation of a mathematical expression."
+@htmlinclude astnode-illustration.html
The following are noteworthy about the AST representation in libSBML:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-27 02:42:00
|
Revision: 12712
http://sbml.svn.sourceforge.net/sbml/?rev=12712&view=rev
Author: mhucka
Date: 2011-01-27 02:41:54 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Made the bug report statement more concise.
Modified Paths:
--------------
trunk/libsbml/docs/src/libsbml-communications.html
Modified: trunk/libsbml/docs/src/libsbml-communications.html
===================================================================
--- trunk/libsbml/docs/src/libsbml-communications.html 2011-01-26 22:43:40 UTC (rev 12711)
+++ trunk/libsbml/docs/src/libsbml-communications.html 2011-01-27 02:41:54 UTC (rev 12712)
@@ -4,19 +4,18 @@
<h2>Reporting bugs and other problems</h2>
-<p> We invite you to report bugs and other problems using the issue
-tracker for libSBML on SourceForge. The following URL will take you
-there directly: <a target="_blank"
+<p> Please report problems and other issues using the issue tracker for
+libSBML on SourceForge: <a target="_blank"
href="http://sbml.org/Software/libSBML/issue-tracker">http://sbml.org/Software/libSBML/issue-tracker</a>.
<p> You can also report problems on the <a target="_blank"
href="http://www.sbml.org/Forums">sbml-interoperability</a> mailing list
-(see next section). This may even have advantages, such as that other
-people may also have experienced the issue and offer a workaround more
+(see next section). This may have advantages, such as that other people
+may also have experienced the same issue and offer a workaround more
quickly than the libSBML developers can respond.
-<p> Finally, if you want to contact the libSBML developers, you can email
-them at <a
+<p> Finally, if you want to contact the libSBML developers directly, you
+can email them at <a
href="mailto:lib...@ca...">lib...@ca...</a>.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-26 22:43:46
|
Revision: 12711
http://sbml.svn.sourceforge.net/sbml/?rev=12711&view=rev
Author: mhucka
Date: 2011-01-26 22:43:40 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Fixed a doc formatting glitch.
Modified Paths:
--------------
trunk/libsbml/src/xml/XMLNode.h
Modified: trunk/libsbml/src/xml/XMLNode.h
===================================================================
--- trunk/libsbml/src/xml/XMLNode.h 2011-01-26 18:43:35 UTC (rev 12710)
+++ trunk/libsbml/src/xml/XMLNode.h 2011-01-26 22:43:40 UTC (rev 12711)
@@ -32,10 +32,10 @@
*
* An XMLNode can contain any number of children. Each child is another
* XMLNode, thereby forming a tree. The methods XMLNode::getNumChildren()
- * and @if clike XMLNode::getChild() can be used to access the
- * tree structure starting from a given node. @endif@if java XMLNode::getChild(long n)
- * can be used to access the tree structure starting from a given node.
- * @endif
+ * and @if clike XMLNode::getChild() can be used to access the tree
+ * structure starting from a given node. @endif@if java
+ * XMLNode::getChild(long n) can be used to access the tree structure
+ * starting from a given node. @endif
*
* Each XMLNode is subclassed from XMLToken, and thus has the same methods
* available as XMLToken. These methods include XMLToken::getNamespaces(),
@@ -62,7 +62,7 @@
* The returned XMLNode object by XMLNode::convertStringToXMLNode(@if java String xml@endif)
* is a dummy root (container) XMLNode if the given XML string has two or
* more top-level elements (e.g.,
- * "<code><p>...</p><p>...</p></code>"). In the
+ * "<code><p>...</p><p>...</p></code>"). In the
* dummy root node, each top-level element in the given XML string is
* contained as a child XMLNode. XMLToken::isEOF() can be used to identify
* if the returned XMLNode object is a dummy node or not. Here is an
@@ -72,7 +72,7 @@
std::string str = "...";
XMLNode* xn = XMLNode::convertStringToXMLNode(str);
-if (xn == NULL)
+if ( xn == NULL )
{
// returned value is null (error)
...
@@ -80,7 +80,7 @@
else if ( xn->isEOF() )
{
// root node is a dummy node
- for (int i=0; i < xn->getNumChildren(); i++)
+ for ( int i = 0; i < xn->getNumChildren(); i++ )
{
// access to each child node of the dummy node.
XMLNode& xnChild = xn->getChild(i);
@@ -97,7 +97,7 @@
String str = "...";
XMLNode xn = XMLNode.convertStringToXMLNode(str);
-if (xn == null)
+if ( xn == null )
{
// returned value is null (error)
...
@@ -105,7 +105,7 @@
else if ( xn.isEOF() )
{
// root node is a dummy node
- for (int i=0; i < xn.getNumChildren(); i++)
+ for ( int i = 0; i < xn.getNumChildren(); i++ )
{
// access to each child node of the dummy node.
XMLNode xnChild = xn.getChild(i);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-26 22:37:43
|
Revision: 12705
http://sbml.svn.sourceforge.net/sbml/?rev=12705&view=rev
Author: sarahkeating
Date: 2011-01-26 16:38:13 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
updated for new test in annotation/test directory
Modified Paths:
--------------
trunk/libsbml/src/bindings/python/test/annotation/TestRDFAnnotationC.py
trunk/libsbml/src/bindings/python/test/annotation/TestValidation.py
trunk/libsbml/src/bindings/ruby/test/annotation/TestRDFAnnotationC.rb
trunk/libsbml/src/bindings/ruby/test/annotation/TestValidation.rb
Modified: trunk/libsbml/src/bindings/python/test/annotation/TestRDFAnnotationC.py
===================================================================
--- trunk/libsbml/src/bindings/python/test/annotation/TestRDFAnnotationC.py 2011-01-26 16:10:23 UTC (rev 12704)
+++ trunk/libsbml/src/bindings/python/test/annotation/TestRDFAnnotationC.py 2011-01-26 16:38:13 UTC (rev 12705)
@@ -1,236 +1,245 @@
-#
-# @file TestRDFAnnotationC.py
-# @brief RDFAnnotation parser unit tests
-#
-# @author Akiya Jouraku (Python conversion)
-# @author Sarah Keating
-#
-# $Id$
-# $HeadURL$
-#
-# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
-#
-# DO NOT EDIT THIS FILE.
-#
-# This file was generated automatically by converting the file located at
-# src/annotation/test/TestRDFAnnotationC.c
-# using the conversion program dev/utilities/translateTests/translateTests.pl.
-# Any changes made here will be lost the next time the file is regenerated.
-#
-# -----------------------------------------------------------------------------
-# This file is part of libSBML. Please visit http://sbml.org for more
-# information about SBML, and the latest version of libSBML.
-#
-# Copyright 2005-2010 California Institute of Technology.
-# Copyright 2002-2005 California Institute of Technology and
-# Japan Science and Technology Corporation.
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation. A copy of the license agreement is provided
-# in the file named "LICENSE.txt" included with this software distribution
-# and also available online as http://sbml.org/software/libsbml/license.html
-# -----------------------------------------------------------------------------
-
-import sys
-import unittest
-import libsbml
-
-
-class TestRDFAnnotationC(unittest.TestCase):
-
- global d
- d = None
- global m
- m = None
-
- def setUp(self):
- filename = "../../annotation/test/test-data/annotation.xml"
- self.d = libsbml.readSBML(filename)
- self.m = self.d.getModel()
- pass
-
- def tearDown(self):
- _dummyList = [ self.d ]; _dummyList[:] = []; del _dummyList
- pass
-
- def test_RDFAnnotation_C_delete(self):
- obj = self.m.getCompartment(0)
- node = libsbml.RDFAnnotationParser.parseCVTerms(obj)
- n1 = libsbml.RDFAnnotationParser.deleteRDFAnnotation(node)
- self.assert_( n1.getNumChildren() == 0 )
- self.assert_(( "annotation" == n1.getName() ))
- _dummyList = [ node ]; _dummyList[:] = []; del _dummyList
- pass
-
- def test_RDFAnnotation_C_getModelHistory(self):
- self.assert_( (self.m == None) == False )
- history = self.m.getModelHistory()
- self.assert_( history != None )
- mc = history.getCreator(0)
- self.assert_(( "Le Novere" == mc.getFamilyName() ))
- self.assert_(( "Nicolas" == mc.getGivenName() ))
- self.assert_(( "le...@eb..." == mc.getEmail() ))
- self.assert_(( "EMBL-EBI" == mc.getOrganisation() ))
- date = history.getCreatedDate()
- self.assert_( date.getYear() == 2005 )
- self.assert_( date.getMonth() == 2 )
- self.assert_( date.getDay() == 2 )
- self.assert_( date.getHour() == 14 )
- self.assert_( date.getMinute() == 56 )
- self.assert_( date.getSecond() == 11 )
- self.assert_( date.getSignOffset() == 0 )
- self.assert_( date.getHoursOffset() == 0 )
- self.assert_( date.getMinutesOffset() == 0 )
- self.assert_(( "2005-02-02T14:56:11Z" == date.getDateAsString() ))
- date = history.getModifiedDate()
- self.assert_( date.getYear() == 2006 )
- self.assert_( date.getMonth() == 5 )
- self.assert_( date.getDay() == 30 )
- self.assert_( date.getHour() == 10 )
- self.assert_( date.getMinute() == 46 )
- self.assert_( date.getSecond() == 2 )
- self.assert_( date.getSignOffset() == 0 )
- self.assert_( date.getHoursOffset() == 0 )
- self.assert_( date.getMinutesOffset() == 0 )
- self.assert_(( "2006-05-30T10:46:02Z" == date.getDateAsString() ))
- pass
-
- def test_RDFAnnotation_C_parseCVTerms(self):
- obj = self.m.getCompartment(0)
- node = libsbml.RDFAnnotationParser.parseCVTerms(obj)
- self.assert_( node.getNumChildren() == 1 )
- rdf = node.getChild(0)
- self.assert_(( "RDF" == rdf.getName() ))
- self.assert_(( "rdf" == rdf.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
- self.assert_( rdf.getNumChildren() == 1 )
- desc = rdf.getChild(0)
- self.assert_(( "Description" == desc.getName() ))
- self.assert_(( "rdf" == desc.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
- self.assert_( desc.getNumChildren() == 1 )
- is1 = desc.getChild(0)
- self.assert_(( "is" == is1.getName() ))
- self.assert_(( "bqbiol" == is1.getPrefix() ))
- self.assert_( is1.getNumChildren() == 1 )
- Bag = is1.getChild(0)
- self.assert_(( "Bag" == Bag.getName() ))
- self.assert_(( "rdf" == Bag.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ))
- self.assert_( Bag.getNumChildren() == 4 )
- li = Bag.getChild(0)
- self.assert_(( "li" == li.getName() ))
- self.assert_(( "rdf" == li.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
- self.assert_( li.getNumChildren() == 0 )
- li1 = Bag.getChild(1)
- self.assert_(( "li" == li1.getName() ))
- self.assert_(( "rdf" == li1.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ))
- self.assert_( li1.getNumChildren() == 0 )
- li2 = Bag.getChild(2)
- self.assert_(( "li" == li2.getName() ))
- self.assert_(( "rdf" == li2.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ))
- self.assert_( li2.getNumChildren() == 0 )
- li3 = Bag.getChild(3)
- self.assert_(( "li" == li3.getName() ))
- self.assert_(( "rdf" == li3.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ))
- self.assert_( li3.getNumChildren() == 0 )
- _dummyList = [ node ]; _dummyList[:] = []; del _dummyList
- pass
-
- def test_RDFAnnotation_C_parseModelHistory(self):
- node = libsbml.RDFAnnotationParser.parseModelHistory(self.m)
- self.assert_( node.getNumChildren() == 1 )
- rdf = node.getChild(0)
- self.assert_(( "RDF" == rdf.getName() ))
- self.assert_(( "rdf" == rdf.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
- self.assert_( rdf.getNumChildren() == 1 )
- desc = rdf.getChild(0)
- self.assert_(( "Description" == desc.getName() ))
- self.assert_(( "rdf" == desc.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
- self.assert_( desc.getNumChildren() == 3 )
- creator = desc.getChild(0)
- self.assert_(( "creator" == creator.getName() ))
- self.assert_(( "dc" == creator.getPrefix() ))
- self.assert_(( "http://purl.org/dc/elements/1.1/" == creator.getURI() ))
- self.assert_( creator.getNumChildren() == 1 )
- Bag = creator.getChild(0)
- self.assert_(( "Bag" == Bag.getName() ))
- self.assert_(( "rdf" == Bag.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ))
- self.assert_( Bag.getNumChildren() == 1 )
- li = Bag.getChild(0)
- self.assert_(( "li" == li.getName() ))
- self.assert_(( "rdf" == li.getPrefix() ))
- self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
- self.assert_( li.getNumChildren() == 3 )
- N = li.getChild(0)
- self.assert_(( "N" == N.getName() ))
- self.assert_(( "vCard" == N.getPrefix() ))
- self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == N.getURI() ))
- self.assert_( N.getNumChildren() == 2 )
- Family = N.getChild(0)
- self.assert_(( "Family" == Family.getName() ))
- self.assert_(( "vCard" == Family.getPrefix() ))
- self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Family.getURI() ))
- self.assert_( Family.getNumChildren() == 1 )
- Given = N.getChild(1)
- self.assert_(( "Given" == Given.getName() ))
- self.assert_(( "vCard" == Given.getPrefix() ))
- self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Given.getURI() ))
- self.assert_( Given.getNumChildren() == 1 )
- EMAIL = li.getChild(1)
- self.assert_(( "EMAIL" == EMAIL.getName() ))
- self.assert_(( "vCard" == EMAIL.getPrefix() ))
- self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == EMAIL.getURI() ))
- self.assert_( EMAIL.getNumChildren() == 1 )
- ORG = li.getChild(2)
- self.assert_(( "ORG" == ORG.getName() ))
- self.assert_(( "vCard" == ORG.getPrefix() ))
- self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == ORG.getURI() ))
- self.assert_( ORG.getNumChildren() == 1 )
- Orgname = ORG.getChild(0)
- self.assert_(( "Orgname" == Orgname.getName() ))
- self.assert_(( "vCard" == Orgname.getPrefix() ))
- self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Orgname.getURI() ))
- self.assert_( Orgname.getNumChildren() == 1 )
- created = desc.getChild(1)
- self.assert_(( "created" == created.getName() ))
- self.assert_(( "dcterms" == created.getPrefix() ))
- self.assert_(( "http://purl.org/dc/terms/" == created.getURI() ))
- self.assert_( created.getNumChildren() == 1 )
- cr_date = created.getChild(0)
- self.assert_(( "W3CDTF" == cr_date.getName() ))
- self.assert_(( "dcterms" == cr_date.getPrefix() ))
- self.assert_(( "http://purl.org/dc/terms/" == cr_date.getURI() ))
- self.assert_( cr_date.getNumChildren() == 1 )
- modified = desc.getChild(2)
- self.assert_(( "modified" == modified.getName() ))
- self.assert_(( "dcterms" == modified.getPrefix() ))
- self.assert_(( "http://purl.org/dc/terms/" == modified.getURI() ))
- self.assert_( modified.getNumChildren() == 1 )
- mo_date = created.getChild(0)
- self.assert_(( "W3CDTF" == mo_date.getName() ))
- self.assert_(( "dcterms" == mo_date.getPrefix() ))
- self.assert_(( "http://purl.org/dc/terms/" == mo_date.getURI() ))
- self.assert_( mo_date.getNumChildren() == 1 )
- _dummyList = [ node ]; _dummyList[:] = []; del _dummyList
- pass
-
-def suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestRDFAnnotationC))
-
- return suite
-
-if __name__ == "__main__":
- if unittest.TextTestRunner(verbosity=1).run(suite()).wasSuccessful() :
- sys.exit(0)
- else:
- sys.exit(1)
+#
+# @file TestRDFAnnotationC.py
+# @brief RDFAnnotation parser unit tests
+#
+# @author Akiya Jouraku (Python conversion)
+# @author Sarah Keating
+#
+# $Id$
+# $HeadURL$
+#
+# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+#
+# DO NOT EDIT THIS FILE.
+#
+# This file was generated automatically by converting the file located at
+# src/annotation/test/TestRDFAnnotationC.c
+# using the conversion program dev/utilities/translateTests/translateTests.pl.
+# Any changes made here will be lost the next time the file is regenerated.
+#
+# -----------------------------------------------------------------------------
+# This file is part of libSBML. Please visit http://sbml.org for more
+# information about SBML, and the latest version of libSBML.
+#
+# Copyright 2005-2010 California Institute of Technology.
+# Copyright 2002-2005 California Institute of Technology and
+# Japan Science and Technology Corporation.
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation. A copy of the license agreement is provided
+# in the file named "LICENSE.txt" included with this software distribution
+# and also available online as http://sbml.org/software/libsbml/license.html
+# -----------------------------------------------------------------------------
+
+import sys
+import unittest
+import libsbml
+
+
+class TestRDFAnnotationC(unittest.TestCase):
+
+ global d
+ d = None
+ global m
+ m = None
+
+ def setUp(self):
+ filename = "../../annotation/test/test-data/annotation.xml"
+ self.d = libsbml.readSBML(filename)
+ self.m = self.d.getModel()
+ pass
+
+ def tearDown(self):
+ _dummyList = [ self.d ]; _dummyList[:] = []; del _dummyList
+ pass
+
+ def test_RDFAnnotation_C_accessWithNULL(self):
+ self.assert_( libsbml.RDFAnnotationParser.createCVTerms(None) == None )
+ self.assert_( libsbml.RDFAnnotationParser.createRDFDescription(None) == None )
+ self.assert_( libsbml.RDFAnnotationParser.deleteRDFAnnotation(None) == None )
+ self.assert_( libsbml.RDFAnnotationParser.parseCVTerms(None) == None )
+ self.assert_( libsbml.RDFAnnotationParser.parseModelHistory(None) == None )
+ libsbml.RDFAnnotationParser.parseRDFAnnotation(None,None)
+ pass
+
+ def test_RDFAnnotation_C_delete(self):
+ obj = self.m.getCompartment(0)
+ node = libsbml.RDFAnnotationParser.parseCVTerms(obj)
+ n1 = libsbml.RDFAnnotationParser.deleteRDFAnnotation(node)
+ self.assert_( n1.getNumChildren() == 0 )
+ self.assert_(( "annotation" == n1.getName() ))
+ _dummyList = [ node ]; _dummyList[:] = []; del _dummyList
+ pass
+
+ def test_RDFAnnotation_C_getModelHistory(self):
+ self.assert_( (self.m == None) == False )
+ history = self.m.getModelHistory()
+ self.assert_( history != None )
+ mc = history.getCreator(0)
+ self.assert_(( "Le Novere" == mc.getFamilyName() ))
+ self.assert_(( "Nicolas" == mc.getGivenName() ))
+ self.assert_(( "le...@eb..." == mc.getEmail() ))
+ self.assert_(( "EMBL-EBI" == mc.getOrganisation() ))
+ date = history.getCreatedDate()
+ self.assert_( date.getYear() == 2005 )
+ self.assert_( date.getMonth() == 2 )
+ self.assert_( date.getDay() == 2 )
+ self.assert_( date.getHour() == 14 )
+ self.assert_( date.getMinute() == 56 )
+ self.assert_( date.getSecond() == 11 )
+ self.assert_( date.getSignOffset() == 0 )
+ self.assert_( date.getHoursOffset() == 0 )
+ self.assert_( date.getMinutesOffset() == 0 )
+ self.assert_(( "2005-02-02T14:56:11Z" == date.getDateAsString() ))
+ date = history.getModifiedDate()
+ self.assert_( date.getYear() == 2006 )
+ self.assert_( date.getMonth() == 5 )
+ self.assert_( date.getDay() == 30 )
+ self.assert_( date.getHour() == 10 )
+ self.assert_( date.getMinute() == 46 )
+ self.assert_( date.getSecond() == 2 )
+ self.assert_( date.getSignOffset() == 0 )
+ self.assert_( date.getHoursOffset() == 0 )
+ self.assert_( date.getMinutesOffset() == 0 )
+ self.assert_(( "2006-05-30T10:46:02Z" == date.getDateAsString() ))
+ pass
+
+ def test_RDFAnnotation_C_parseCVTerms(self):
+ obj = self.m.getCompartment(0)
+ node = libsbml.RDFAnnotationParser.parseCVTerms(obj)
+ self.assert_( node.getNumChildren() == 1 )
+ rdf = node.getChild(0)
+ self.assert_(( "RDF" == rdf.getName() ))
+ self.assert_(( "rdf" == rdf.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
+ self.assert_( rdf.getNumChildren() == 1 )
+ desc = rdf.getChild(0)
+ self.assert_(( "Description" == desc.getName() ))
+ self.assert_(( "rdf" == desc.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
+ self.assert_( desc.getNumChildren() == 1 )
+ is1 = desc.getChild(0)
+ self.assert_(( "is" == is1.getName() ))
+ self.assert_(( "bqbiol" == is1.getPrefix() ))
+ self.assert_( is1.getNumChildren() == 1 )
+ Bag = is1.getChild(0)
+ self.assert_(( "Bag" == Bag.getName() ))
+ self.assert_(( "rdf" == Bag.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ))
+ self.assert_( Bag.getNumChildren() == 4 )
+ li = Bag.getChild(0)
+ self.assert_(( "li" == li.getName() ))
+ self.assert_(( "rdf" == li.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
+ self.assert_( li.getNumChildren() == 0 )
+ li1 = Bag.getChild(1)
+ self.assert_(( "li" == li1.getName() ))
+ self.assert_(( "rdf" == li1.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ))
+ self.assert_( li1.getNumChildren() == 0 )
+ li2 = Bag.getChild(2)
+ self.assert_(( "li" == li2.getName() ))
+ self.assert_(( "rdf" == li2.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ))
+ self.assert_( li2.getNumChildren() == 0 )
+ li3 = Bag.getChild(3)
+ self.assert_(( "li" == li3.getName() ))
+ self.assert_(( "rdf" == li3.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ))
+ self.assert_( li3.getNumChildren() == 0 )
+ _dummyList = [ node ]; _dummyList[:] = []; del _dummyList
+ pass
+
+ def test_RDFAnnotation_C_parseModelHistory(self):
+ node = libsbml.RDFAnnotationParser.parseModelHistory(self.m)
+ self.assert_( node.getNumChildren() == 1 )
+ rdf = node.getChild(0)
+ self.assert_(( "RDF" == rdf.getName() ))
+ self.assert_(( "rdf" == rdf.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
+ self.assert_( rdf.getNumChildren() == 1 )
+ desc = rdf.getChild(0)
+ self.assert_(( "Description" == desc.getName() ))
+ self.assert_(( "rdf" == desc.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
+ self.assert_( desc.getNumChildren() == 3 )
+ creator = desc.getChild(0)
+ self.assert_(( "creator" == creator.getName() ))
+ self.assert_(( "dc" == creator.getPrefix() ))
+ self.assert_(( "http://purl.org/dc/elements/1.1/" == creator.getURI() ))
+ self.assert_( creator.getNumChildren() == 1 )
+ Bag = creator.getChild(0)
+ self.assert_(( "Bag" == Bag.getName() ))
+ self.assert_(( "rdf" == Bag.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ))
+ self.assert_( Bag.getNumChildren() == 1 )
+ li = Bag.getChild(0)
+ self.assert_(( "li" == li.getName() ))
+ self.assert_(( "rdf" == li.getPrefix() ))
+ self.assert_(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
+ self.assert_( li.getNumChildren() == 3 )
+ N = li.getChild(0)
+ self.assert_(( "N" == N.getName() ))
+ self.assert_(( "vCard" == N.getPrefix() ))
+ self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == N.getURI() ))
+ self.assert_( N.getNumChildren() == 2 )
+ Family = N.getChild(0)
+ self.assert_(( "Family" == Family.getName() ))
+ self.assert_(( "vCard" == Family.getPrefix() ))
+ self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Family.getURI() ))
+ self.assert_( Family.getNumChildren() == 1 )
+ Given = N.getChild(1)
+ self.assert_(( "Given" == Given.getName() ))
+ self.assert_(( "vCard" == Given.getPrefix() ))
+ self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Given.getURI() ))
+ self.assert_( Given.getNumChildren() == 1 )
+ EMAIL = li.getChild(1)
+ self.assert_(( "EMAIL" == EMAIL.getName() ))
+ self.assert_(( "vCard" == EMAIL.getPrefix() ))
+ self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == EMAIL.getURI() ))
+ self.assert_( EMAIL.getNumChildren() == 1 )
+ ORG = li.getChild(2)
+ self.assert_(( "ORG" == ORG.getName() ))
+ self.assert_(( "vCard" == ORG.getPrefix() ))
+ self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == ORG.getURI() ))
+ self.assert_( ORG.getNumChildren() == 1 )
+ Orgname = ORG.getChild(0)
+ self.assert_(( "Orgname" == Orgname.getName() ))
+ self.assert_(( "vCard" == Orgname.getPrefix() ))
+ self.assert_(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Orgname.getURI() ))
+ self.assert_( Orgname.getNumChildren() == 1 )
+ created = desc.getChild(1)
+ self.assert_(( "created" == created.getName() ))
+ self.assert_(( "dcterms" == created.getPrefix() ))
+ self.assert_(( "http://purl.org/dc/terms/" == created.getURI() ))
+ self.assert_( created.getNumChildren() == 1 )
+ cr_date = created.getChild(0)
+ self.assert_(( "W3CDTF" == cr_date.getName() ))
+ self.assert_(( "dcterms" == cr_date.getPrefix() ))
+ self.assert_(( "http://purl.org/dc/terms/" == cr_date.getURI() ))
+ self.assert_( cr_date.getNumChildren() == 1 )
+ modified = desc.getChild(2)
+ self.assert_(( "modified" == modified.getName() ))
+ self.assert_(( "dcterms" == modified.getPrefix() ))
+ self.assert_(( "http://purl.org/dc/terms/" == modified.getURI() ))
+ self.assert_( modified.getNumChildren() == 1 )
+ mo_date = created.getChild(0)
+ self.assert_(( "W3CDTF" == mo_date.getName() ))
+ self.assert_(( "dcterms" == mo_date.getPrefix() ))
+ self.assert_(( "http://purl.org/dc/terms/" == mo_date.getURI() ))
+ self.assert_( mo_date.getNumChildren() == 1 )
+ _dummyList = [ node ]; _dummyList[:] = []; del _dummyList
+ pass
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(TestRDFAnnotationC))
+
+ return suite
+
+if __name__ == "__main__":
+ if unittest.TextTestRunner(verbosity=1).run(suite()).wasSuccessful() :
+ sys.exit(0)
+ else:
+ sys.exit(1)
Modified: trunk/libsbml/src/bindings/python/test/annotation/TestValidation.py
===================================================================
--- trunk/libsbml/src/bindings/python/test/annotation/TestValidation.py 2011-01-26 16:10:23 UTC (rev 12704)
+++ trunk/libsbml/src/bindings/python/test/annotation/TestValidation.py 2011-01-26 16:38:13 UTC (rev 12705)
@@ -1,170 +1,186 @@
-#
-# @file TestValidation.py
-# @brief Validation of Date ModelCreator and ModelHistory unit tests
-#
-# @author Akiya Jouraku (Python conversion)
-# @author Sarah Keating
-#
-# $Id$
-# $HeadURL$
-#
-# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
-#
-# DO NOT EDIT THIS FILE.
-#
-# This file was generated automatically by converting the file located at
-# src/annotation/test/TestValidation.cpp
-# using the conversion program dev/utilities/translateTests/translateTests.pl.
-# Any changes made here will be lost the next time the file is regenerated.
-#
-# -----------------------------------------------------------------------------
-# This file is part of libSBML. Please visit http://sbml.org for more
-# information about SBML, and the latest version of libSBML.
-#
-# Copyright 2005-2010 California Institute of Technology.
-# Copyright 2002-2005 California Institute of Technology and
-# Japan Science and Technology Corporation.
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation. A copy of the license agreement is provided
-# in the file named "LICENSE.txt" included with this software distribution
-# and also available online as http://sbml.org/software/libsbml/license.html
-# -----------------------------------------------------------------------------
-
-import sys
-import unittest
-import libsbml
-
-
-class TestValidation(unittest.TestCase):
-
-
- def test_Validation_CVTerm1(self):
- cv = libsbml.CVTerm()
- self.assert_( cv != None )
- self.assertEqual( False, (cv.hasRequiredAttributes()) )
- cv.setQualifierType(libsbml.MODEL_QUALIFIER)
- self.assertEqual( False, (cv.hasRequiredAttributes()) )
- cv.setModelQualifierType(libsbml.BQM_IS)
- self.assertEqual( False, (cv.hasRequiredAttributes()) )
- cv.addResource("ggg")
- self.assertEqual( True, (cv.hasRequiredAttributes()) )
- cv = None
- pass
-
- def test_Validation_CVTerm2(self):
- cv = libsbml.CVTerm()
- self.assert_( cv != None )
- self.assertEqual( False, (cv.hasRequiredAttributes()) )
- cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER)
- self.assertEqual( False, (cv.hasRequiredAttributes()) )
- cv.setBiologicalQualifierType(libsbml.BQB_IS)
- self.assertEqual( False, (cv.hasRequiredAttributes()) )
- cv.addResource("ggg")
- self.assertEqual( True, (cv.hasRequiredAttributes()) )
- cv = None
- pass
-
- def test_Validation_Date1(self):
- date = libsbml.Date(200,12,30,12,15,45,1,2,0)
- self.assert_( date != None )
- self.assertEqual( False, (date.representsValidDate()) )
- date = None
- pass
-
- def test_Validation_Date2(self):
- date = libsbml.Date(2007,14,30,12,15,45,1,2,0)
- self.assert_( date != None )
- self.assertEqual( False, (date.representsValidDate()) )
- date = None
- pass
-
- def test_Validation_Date3(self):
- date = libsbml.Date("Jan 12")
- self.assert_( date != None )
- self.assertEqual( False, (date.representsValidDate()) )
- date = None
- pass
-
- def test_Validation_Date4(self):
- date = libsbml.Date(2007,12,30,12,15,45,1,2,0)
- self.assert_( date != None )
- self.assertEqual( True, date.representsValidDate() )
- date = None
- pass
-
- def test_Validation_ModelCreator(self):
- mc = libsbml.ModelCreator()
- self.assert_( mc != None )
- self.assertEqual( False, (mc.hasRequiredAttributes()) )
- mc.setEmail("k123")
- self.assertEqual( False, (mc.hasRequiredAttributes()) )
- mc.setFamilyName("Keating")
- self.assertEqual( False, (mc.hasRequiredAttributes()) )
- mc.setGivenName("Sarah")
- self.assertEqual( True, mc.hasRequiredAttributes() )
- mc = None
- pass
-
- def test_Validation_ModelHistory1(self):
- mh = libsbml.ModelHistory()
- self.assert_( mh != None )
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- date = libsbml.Date(2007,12,30,12,15,45,1,2,0)
- mh.setCreatedDate(date)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mh.setModifiedDate(date)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mc = libsbml.ModelCreator()
- mc.setFamilyName("Keating")
- mc.setGivenName("Sarah")
- mh.addCreator(mc)
- self.assertEqual( True, mh.hasRequiredAttributes() )
- mh = None
- pass
-
- def test_Validation_ModelHistory2(self):
- mh = libsbml.ModelHistory()
- self.assert_( mh != None )
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- date = libsbml.Date(200,12,30,12,15,45,1,2,0)
- mh.setCreatedDate(date)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mh.setModifiedDate(date)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mc = libsbml.ModelCreator()
- mc.setFamilyName("Keating")
- mc.setGivenName("Sarah")
- mh.addCreator(mc)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mh = None
- pass
-
- def test_Validation_ModelHistory3(self):
- mh = libsbml.ModelHistory()
- self.assert_( mh != None )
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- date = libsbml.Date(2007,12,30,12,15,45,1,2,0)
- mh.setCreatedDate(date)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mh.setModifiedDate(date)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mc = libsbml.ModelCreator()
- mc.setFamilyName("Keating")
- mh.addCreator(mc)
- self.assertEqual( False, (mh.hasRequiredAttributes()) )
- mh = None
- pass
-
-def suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestValidation))
-
- return suite
-
-if __name__ == "__main__":
- if unittest.TextTestRunner(verbosity=1).run(suite()).wasSuccessful() :
- sys.exit(0)
- else:
- sys.exit(1)
+#
+# @file TestValidation.py
+# @brief Validation of Date ModelCreator and ModelHistory unit tests
+#
+# @author Akiya Jouraku (Python conversion)
+# @author Sarah Keating
+#
+# $Id$
+# $HeadURL$
+#
+# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+#
+# DO NOT EDIT THIS FILE.
+#
+# This file was generated automatically by converting the file located at
+# src/annotation/test/TestValidation.cpp
+# using the conversion program dev/utilities/translateTests/translateTests.pl.
+# Any changes made here will be lost the next time the file is regenerated.
+#
+# -----------------------------------------------------------------------------
+# This file is part of libSBML. Please visit http://sbml.org for more
+# information about SBML, and the latest version of libSBML.
+#
+# Copyright 2005-2010 California Institute of Technology.
+# Copyright 2002-2005 California Institute of Technology and
+# Japan Science and Technology Corporation.
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation. A copy of the license agreement is provided
+# in the file named "LICENSE.txt" included with this software distribution
+# and also available online as http://sbml.org/software/libsbml/license.html
+# -----------------------------------------------------------------------------
+
+import sys
+import unittest
+import libsbml
+
+
+class TestValidation(unittest.TestCase):
+
+
+ def test_Validation_CVTerm1(self):
+ cv = libsbml.CVTerm()
+ self.assert_( cv != None )
+ self.assertEqual( False, (cv.hasRequiredAttributes()) )
+ cv.setQualifierType(libsbml.MODEL_QUALIFIER)
+ self.assertEqual( False, (cv.hasRequiredAttributes()) )
+ cv.setModelQualifierType(libsbml.BQM_IS)
+ self.assertEqual( False, (cv.hasRequiredAttributes()) )
+ cv.addResource("ggg")
+ self.assertEqual( True, (cv.hasRequiredAttributes()) )
+ cv = None
+ pass
+
+ def test_Validation_CVTerm2(self):
+ cv = libsbml.CVTerm()
+ self.assert_( cv != None )
+ self.assertEqual( False, (cv.hasRequiredAttributes()) )
+ cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER)
+ self.assertEqual( False, (cv.hasRequiredAttributes()) )
+ cv.setBiologicalQualifierType(libsbml.BQB_IS)
+ self.assertEqual( False, (cv.hasRequiredAttributes()) )
+ cv.addResource("ggg")
+ self.assertEqual( True, (cv.hasRequiredAttributes()) )
+ cv = None
+ pass
+
+ def test_Validation_Date1(self):
+ date = libsbml.Date(200,12,30,12,15,45,1,2,0)
+ self.assert_( date != None )
+ self.assertEqual( False, (date.representsValidDate()) )
+ date = None
+ pass
+
+ def test_Validation_Date2(self):
+ date = libsbml.Date(2007,14,30,12,15,45,1,2,0)
+ self.assert_( date != None )
+ self.assertEqual( False, (date.representsValidDate()) )
+ date = None
+ pass
+
+ def test_Validation_Date3(self):
+ date = libsbml.Date("Jan 12")
+ self.assert_( date != None )
+ self.assertEqual( False, (date.representsValidDate()) )
+ date = None
+ pass
+
+ def test_Validation_Date4(self):
+ date = libsbml.Date(2007,12,30,12,15,45,1,2,0)
+ self.assert_( date != None )
+ self.assertEqual( True, date.representsValidDate() )
+ date = None
+ pass
+
+ def test_Validation_Date_Default(self):
+ date1 = libsbml.Date()
+ date2 = libsbml.Date("")
+ self.assert_( date1.getYear() == date2.getYear() )
+ self.assert_( date1.getMonth() == date2.getMonth() )
+ self.assert_( date1.getDay() == date2.getDay() )
+ self.assert_( date1.getHour() == date2.getHour() )
+ self.assert_( date1.getMinute() == date2.getMinute() )
+ self.assert_( date1.getSecond() == date2.getSecond() )
+ self.assert_( date1.getSignOffset() == date2.getSignOffset() )
+ self.assert_( date1.getHoursOffset() == date2.getHoursOffset() )
+ self.assert_( date1.getMinutesOffset() == date2.getMinutesOffset() )
+ date1 = None
+ date2 = None
+ pass
+
+ def test_Validation_ModelCreator(self):
+ mc = libsbml.ModelCreator()
+ self.assert_( mc != None )
+ self.assertEqual( False, (mc.hasRequiredAttributes()) )
+ mc.setEmail("k123")
+ self.assertEqual( False, (mc.hasRequiredAttributes()) )
+ mc.setFamilyName("Keating")
+ self.assertEqual( False, (mc.hasRequiredAttributes()) )
+ mc.setGivenName("Sarah")
+ self.assertEqual( True, mc.hasRequiredAttributes() )
+ mc = None
+ pass
+
+ def test_Validation_ModelHistory1(self):
+ mh = libsbml.ModelHistory()
+ self.assert_( mh != None )
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ date = libsbml.Date(2007,12,30,12,15,45,1,2,0)
+ mh.setCreatedDate(date)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mh.setModifiedDate(date)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mc = libsbml.ModelCreator()
+ mc.setFamilyName("Keating")
+ mc.setGivenName("Sarah")
+ mh.addCreator(mc)
+ self.assertEqual( True, mh.hasRequiredAttributes() )
+ mh = None
+ pass
+
+ def test_Validation_ModelHistory2(self):
+ mh = libsbml.ModelHistory()
+ self.assert_( mh != None )
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ date = libsbml.Date(200,12,30,12,15,45,1,2,0)
+ mh.setCreatedDate(date)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mh.setModifiedDate(date)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mc = libsbml.ModelCreator()
+ mc.setFamilyName("Keating")
+ mc.setGivenName("Sarah")
+ mh.addCreator(mc)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mh = None
+ pass
+
+ def test_Validation_ModelHistory3(self):
+ mh = libsbml.ModelHistory()
+ self.assert_( mh != None )
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ date = libsbml.Date(2007,12,30,12,15,45,1,2,0)
+ mh.setCreatedDate(date)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mh.setModifiedDate(date)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mc = libsbml.ModelCreator()
+ mc.setFamilyName("Keating")
+ mh.addCreator(mc)
+ self.assertEqual( False, (mh.hasRequiredAttributes()) )
+ mh = None
+ pass
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(TestValidation))
+
+ return suite
+
+if __name__ == "__main__":
+ if unittest.TextTestRunner(verbosity=1).run(suite()).wasSuccessful() :
+ sys.exit(0)
+ else:
+ sys.exit(1)
Modified: trunk/libsbml/src/bindings/ruby/test/annotation/TestRDFAnnotationC.rb
===================================================================
--- trunk/libsbml/src/bindings/ruby/test/annotation/TestRDFAnnotationC.rb 2011-01-26 16:10:23 UTC (rev 12704)
+++ trunk/libsbml/src/bindings/ruby/test/annotation/TestRDFAnnotationC.rb 2011-01-26 16:38:13 UTC (rev 12705)
@@ -1,217 +1,226 @@
-# @file TestRDFAnnotationC.rb
-# @brief RDFAnnotation parser unit tests
-#
-# @author Akiya Jouraku (Ruby conversion)
-# @author Sarah Keating
-#
-# $Id$
-# $HeadURL$
-#
-# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
-#
-# DO NOT EDIT THIS FILE.
-#
-# This file was generated automatically by converting the file located at
-# src/annotation/test/TestRDFAnnotationC.c
-# using the conversion program dev/utilities/translateTests/translateTests.pl.
-# Any changes made here will be lost the next time the file is regenerated.
-#
-# -----------------------------------------------------------------------------
-# This file is part of libSBML. Please visit http://sbml.org for more
-# information about SBML, and the latest version of libSBML.
-#
-# Copyright 2005-2010 California Institute of Technology.
-# Copyright 2002-2005 California Institute of Technology and
-# Japan Science and Technology Corporation.
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation. A copy of the license agreement is provided
-# in the file named "LICENSE.txt" included with this software distribution
-# and also available online as http://sbml.org/software/libsbml/license.html
-# -----------------------------------------------------------------------------
-require 'test/unit'
-require 'libSBML'
-
-class TestRDFAnnotationC < Test::Unit::TestCase
-
- def setup
- filename = "../../annotation/test/test-data/annotation.xml"
- @@d = LibSBML::readSBML(filename)
- @@m = @@d.getModel()
- end
-
- def teardown
- @@d = nil
- end
-
- def test_RDFAnnotation_C_delete
- obj = @@m.getCompartment(0)
- node = LibSBML::RDFAnnotationParser.parseCVTerms(obj)
- n1 = LibSBML::RDFAnnotationParser.deleteRDFAnnotation(node)
- assert( n1.getNumChildren() == 0 )
- assert (( "annotation" == n1.getName() ))
- node = nil
- end
-
- def test_RDFAnnotation_C_getModelHistory
- assert( !( @@m == nil) )
- history = @@m.getModelHistory()
- assert( history != nil )
- mc = history.getCreator(0)
- assert (( "Le Novere" == mc.getFamilyName() ))
- assert (( "Nicolas" == mc.getGivenName() ))
- assert (( "le...@eb..." == mc.getEmail() ))
- assert (( "EMBL-EBI" == mc.getOrganisation() ))
- date = history.getCreatedDate()
- assert( date.getYear() == 2005 )
- assert( date.getMonth() == 2 )
- assert( date.getDay() == 2 )
- assert( date.getHour() == 14 )
- assert( date.getMinute() == 56 )
- assert( date.getSecond() == 11 )
- assert( date.getSignOffset() == 0 )
- assert( date.getHoursOffset() == 0 )
- assert( date.getMinutesOffset() == 0 )
- assert (( "2005-02-02T14:56:11Z" == date.getDateAsString() ))
- date = history.getModifiedDate()
- assert( date.getYear() == 2006 )
- assert( date.getMonth() == 5 )
- assert( date.getDay() == 30 )
- assert( date.getHour() == 10 )
- assert( date.getMinute() == 46 )
- assert( date.getSecond() == 2 )
- assert( date.getSignOffset() == 0 )
- assert( date.getHoursOffset() == 0 )
- assert( date.getMinutesOffset() == 0 )
- assert (( "2006-05-30T10:46:02Z" == date.getDateAsString() ))
- end
-
- def test_RDFAnnotation_C_parseCVTerms
- obj = @@m.getCompartment(0)
- node = LibSBML::RDFAnnotationParser.parseCVTerms(obj)
- assert( node.getNumChildren() == 1 )
- rdf = node.getChild(0)
- assert (( "RDF" == rdf.getName() ))
- assert (( "rdf" == rdf.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
- assert( rdf.getNumChildren() == 1 )
- desc = rdf.getChild(0)
- assert (( "Description" == desc.getName() ))
- assert (( "rdf" == desc.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
- assert( desc.getNumChildren() == 1 )
- is1 = desc.getChild(0)
- assert (( "is" == is1.getName() ))
- assert (( "bqbiol" == is1.getPrefix() ))
- assert( is1.getNumChildren() == 1 )
- bag = is1.getChild(0)
- assert (( "Bag" == bag.getName() ))
- assert (( "rdf" == bag.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == bag.getURI() ))
- assert( bag.getNumChildren() == 4 )
- li = bag.getChild(0)
- assert (( "li" == li.getName() ))
- assert (( "rdf" == li.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
- assert( li.getNumChildren() == 0 )
- li1 = bag.getChild(1)
- assert (( "li" == li1.getName() ))
- assert (( "rdf" == li1.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ))
- assert( li1.getNumChildren() == 0 )
- li2 = bag.getChild(2)
- assert (( "li" == li2.getName() ))
- assert (( "rdf" == li2.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ))
- assert( li2.getNumChildren() == 0 )
- li3 = bag.getChild(3)
- assert (( "li" == li3.getName() ))
- assert (( "rdf" == li3.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ))
- assert( li3.getNumChildren() == 0 )
- node = nil
- end
-
- def test_RDFAnnotation_C_parseModelHistory
- node = LibSBML::RDFAnnotationParser.parseModelHistory(@@m)
- assert( node.getNumChildren() == 1 )
- rdf = node.getChild(0)
- assert (( "RDF" == rdf.getName() ))
- assert (( "rdf" == rdf.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
- assert( rdf.getNumChildren() == 1 )
- desc = rdf.getChild(0)
- assert (( "Description" == desc.getName() ))
- assert (( "rdf" == desc.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
- assert( desc.getNumChildren() == 3 )
- creator = desc.getChild(0)
- assert (( "creator" == creator.getName() ))
- assert (( "dc" == creator.getPrefix() ))
- assert (( "http://purl.org/dc/elements/1.1/" == creator.getURI() ))
- assert( creator.getNumChildren() == 1 )
- bag = creator.getChild(0)
- assert (( "Bag" == bag.getName() ))
- assert (( "rdf" == bag.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == bag.getURI() ))
- assert( bag.getNumChildren() == 1 )
- li = bag.getChild(0)
- assert (( "li" == li.getName() ))
- assert (( "rdf" == li.getPrefix() ))
- assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
- assert( li.getNumChildren() == 3 )
- n = li.getChild(0)
- assert (( "N" == n.getName() ))
- assert (( "vCard" == n.getPrefix() ))
- assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == n.getURI() ))
- assert( n.getNumChildren() == 2 )
- family = n.getChild(0)
- assert (( "Family" == family.getName() ))
- assert (( "vCard" == family.getPrefix() ))
- assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == family.getURI() ))
- assert( family.getNumChildren() == 1 )
- given = n.getChild(1)
- assert (( "Given" == given.getName() ))
- assert (( "vCard" == given.getPrefix() ))
- assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == given.getURI() ))
- assert( given.getNumChildren() == 1 )
- email = li.getChild(1)
- assert (( "EMAIL" == email.getName() ))
- assert (( "vCard" == email.getPrefix() ))
- assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == email.getURI() ))
- assert( email.getNumChildren() == 1 )
- org = li.getChild(2)
- assert (( "ORG" == org.getName() ))
- assert (( "vCard" == org.getPrefix() ))
- assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == org.getURI() ))
- assert( org.getNumChildren() == 1 )
- orgname = org.getChild(0)
- assert (( "Orgname" == orgname.getName() ))
- assert (( "vCard" == orgname.getPrefix() ))
- assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == orgname.getURI() ))
- assert( orgname.getNumChildren() == 1 )
- created = desc.getChild(1)
- assert (( "created" == created.getName() ))
- assert (( "dcterms" == created.getPrefix() ))
- assert (( "http://purl.org/dc/terms/" == created.getURI() ))
- assert( created.getNumChildren() == 1 )
- cr_date = created.getChild(0)
- assert (( "W3CDTF" == cr_date.getName() ))
- assert (( "dcterms" == cr_date.getPrefix() ))
- assert (( "http://purl.org/dc/terms/" == cr_date.getURI() ))
- assert( cr_date.getNumChildren() == 1 )
- modified = desc.getChild(2)
- assert (( "modified" == modified.getName() ))
- assert (( "dcterms" == modified.getPrefix() ))
- assert (( "http://purl.org/dc/terms/" == modified.getURI() ))
- assert( modified.getNumChildren() == 1 )
- mo_date = created.getChild(0)
- assert (( "W3CDTF" == mo_date.getName() ))
- assert (( "dcterms" == mo_date.getPrefix() ))
- assert (( "http://purl.org/dc/terms/" == mo_date.getURI() ))
- assert( mo_date.getNumChildren() == 1 )
- node = nil
- end
-
-end
+# @file TestRDFAnnotationC.rb
+# @brief RDFAnnotation parser unit tests
+#
+# @author Akiya Jouraku (Ruby conversion)
+# @author Sarah Keating
+#
+# $Id$
+# $HeadURL$
+#
+# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+#
+# DO NOT EDIT THIS FILE.
+#
+# This file was generated automatically by converting the file located at
+# src/annotation/test/TestRDFAnnotationC.c
+# using the conversion program dev/utilities/translateTests/translateTests.pl.
+# Any changes made here will be lost the next time the file is regenerated.
+#
+# -----------------------------------------------------------------------------
+# This file is part of libSBML. Please visit http://sbml.org for more
+# information about SBML, and the latest version of libSBML.
+#
+# Copyright 2005-2010 California Institute of Technology.
+# Copyright 2002-2005 California Institute of Technology and
+# Japan Science and Technology Corporation.
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation. A copy of the license agreement is provided
+# in the file named "LICENSE.txt" included with this software distribution
+# and also available online as http://sbml.org/software/libsbml/license.html
+# -----------------------------------------------------------------------------
+require 'test/unit'
+require 'libSBML'
+
+class TestRDFAnnotationC < Test::Unit::TestCase
+
+ def setup
+ filename = "../../annotation/test/test-data/annotation.xml"
+ @@d = LibSBML::readSBML(filename)
+ @@m = @@d.getModel()
+ end
+
+ def teardown
+ @@d = nil
+ end
+
+ def test_RDFAnnotation_C_accessWithNULL
+ assert( LibSBML::RDFAnnotationParser.createCVTerms(nil) == nil )
+ assert( LibSBML::RDFAnnotationParser.createRDFDescription(nil) == nil )
+ assert( LibSBML::RDFAnnotationParser.deleteRDFAnnotation(nil) == nil )
+ assert( LibSBML::RDFAnnotationParser.parseCVTerms(nil) == nil )
+ assert( LibSBML::RDFAnnotationParser.parseModelHistory(nil) == nil )
+ LibSBML::RDFAnnotationParser.parseRDFAnnotation(nil,nil)
+ end
+
+ def test_RDFAnnotation_C_delete
+ obj = @@m.getCompartment(0)
+ node = LibSBML::RDFAnnotationParser.parseCVTerms(obj)
+ n1 = LibSBML::RDFAnnotationParser.deleteRDFAnnotation(node)
+ assert( n1.getNumChildren() == 0 )
+ assert (( "annotation" == n1.getName() ))
+ node = nil
+ end
+
+ def test_RDFAnnotation_C_getModelHistory
+ assert( !( @@m == nil) )
+ history = @@m.getModelHistory()
+ assert( history != nil )
+ mc = history.getCreator(0)
+ assert (( "Le Novere" == mc.getFamilyName() ))
+ assert (( "Nicolas" == mc.getGivenName() ))
+ assert (( "le...@eb..." == mc.getEmail() ))
+ assert (( "EMBL-EBI" == mc.getOrganisation() ))
+ date = history.getCreatedDate()
+ assert( date.getYear() == 2005 )
+ assert( date.getMonth() == 2 )
+ assert( date.getDay() == 2 )
+ assert( date.getHour() == 14 )
+ assert( date.getMinute() == 56 )
+ assert( date.getSecond() == 11 )
+ assert( date.getSignOffset() == 0 )
+ assert( date.getHoursOffset() == 0 )
+ assert( date.getMinutesOffset() == 0 )
+ assert (( "2005-02-02T14:56:11Z" == date.getDateAsString() ))
+ date = history.getModifiedDate()
+ assert( date.getYear() == 2006 )
+ assert( date.getMonth() == 5 )
+ assert( date.getDay() == 30 )
+ assert( date.getHour() == 10 )
+ assert( date.getMinute() == 46 )
+ assert( date.getSecond() == 2 )
+ assert( date.getSignOffset() == 0 )
+ assert( date.getHoursOffset() == 0 )
+ assert( date.getMinutesOffset() == 0 )
+ assert (( "2006-05-30T10:46:02Z" == date.getDateAsString() ))
+ end
+
+ def test_RDFAnnotation_C_parseCVTerms
+ obj = @@m.getCompartment(0)
+ node = LibSBML::RDFAnnotationParser.parseCVTerms(obj)
+ assert( node.getNumChildren() == 1 )
+ rdf = node.getChild(0)
+ assert (( "RDF" == rdf.getName() ))
+ assert (( "rdf" == rdf.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
+ assert( rdf.getNumChildren() == 1 )
+ desc = rdf.getChild(0)
+ assert (( "Description" == desc.getName() ))
+ assert (( "rdf" == desc.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
+ assert( desc.getNumChildren() == 1 )
+ is1 = desc.getChild(0)
+ assert (( "is" == is1.getName() ))
+ assert (( "bqbiol" == is1.getPrefix() ))
+ assert( is1.getNumChildren() == 1 )
+ bag = is1.getChild(0)
+ assert (( "Bag" == bag.getName() ))
+ assert (( "rdf" == bag.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == bag.getURI() ))
+ assert( bag.getNumChildren() == 4 )
+ li = bag.getChild(0)
+ assert (( "li" == li.getName() ))
+ assert (( "rdf" == li.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
+ assert( li.getNumChildren() == 0 )
+ li1 = bag.getChild(1)
+ assert (( "li" == li1.getName() ))
+ assert (( "rdf" == li1.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ))
+ assert( li1.getNumChildren() == 0 )
+ li2 = bag.getChild(2)
+ assert (( "li" == li2.getName() ))
+ assert (( "rdf" == li2.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ))
+ assert( li2.getNumChildren() == 0 )
+ li3 = bag.getChild(3)
+ assert (( "li" == li3.getName() ))
+ assert (( "rdf" == li3.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ))
+ assert( li3.getNumChildren() == 0 )
+ node = nil
+ end
+
+ def test_RDFAnnotation_C_parseModelHistory
+ node = LibSBML::RDFAnnotationParser.parseModelHistory(@@m)
+ assert( node.getNumChildren() == 1 )
+ rdf = node.getChild(0)
+ assert (( "RDF" == rdf.getName() ))
+ assert (( "rdf" == rdf.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ))
+ assert( rdf.getNumChildren() == 1 )
+ desc = rdf.getChild(0)
+ assert (( "Description" == desc.getName() ))
+ assert (( "rdf" == desc.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ))
+ assert( desc.getNumChildren() == 3 )
+ creator = desc.getChild(0)
+ assert (( "creator" == creator.getName() ))
+ assert (( "dc" == creator.getPrefix() ))
+ assert (( "http://purl.org/dc/elements/1.1/" == creator.getURI() ))
+ assert( creator.getNumChildren() == 1 )
+ bag = creator.getChild(0)
+ assert (( "Bag" == bag.getName() ))
+ assert (( "rdf" == bag.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == bag.getURI() ))
+ assert( bag.getNumChildren() == 1 )
+ li = bag.getChild(0)
+ assert (( "li" == li.getName() ))
+ assert (( "rdf" == li.getPrefix() ))
+ assert (( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ))
+ assert( li.getNumChildren() == 3 )
+ n = li.getChild(0)
+ assert (( "N" == n.getName() ))
+ assert (( "vCard" == n.getPrefix() ))
+ assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == n.getURI() ))
+ assert( n.getNumChildren() == 2 )
+ family = n.getChild(0)
+ assert (( "Family" == family.getName() ))
+ assert (( "vCard" == family.getPrefix() ))
+ assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == family.getURI() ))
+ assert( family.getNumChildren() == 1 )
+ given = n.getChild(1)
+ assert (( "Given" == given.getName() ))
+ assert (( "vCard" == given.getPrefix() ))
+ assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == given.getURI() ))
+ assert( given.getNumChildren() == 1 )
+ email = li.getChild(1)
+ assert (( "EMAIL" == email.getName() ))
+ assert (( "vCard" == email.getPrefix() ))
+ assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == email.getURI() ))
+ assert( email.getNumChildren() == 1 )
+ org = li.getChild(2)
+ assert (( "ORG" == org.getName() ))
+ assert (( "vCard" == org.getPrefix() ))
+ assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == org.getURI() ))
+ assert( org.getNumChildren() == 1 )
+ orgname = org.getChild(0)
+ assert (( "Orgname" == orgname.getName() ))
+ assert (( "vCard" == orgname.getPrefix() ))
+ assert (( "http://www.w3.org/2001/vcard-rdf/3.0#" == orgname.getURI() ))
+ assert( orgname.getNumChildren() == 1 )
+ created = desc.getChild(1)
+ assert (( "created" == created.getName() ))
+ assert (( "dcterms" == created.getPrefix() ))
+ assert (( "http://purl.org/dc/terms/" == created.getURI() ))
+ assert( created.getNumChildren() == 1 )
+ cr_date = created.getChild(0)
+ assert (( "W3CDTF" == cr_date.getName() ))
+ assert (( "dcterms" == cr_date.getPrefix() ))
+ assert (( "http://purl.org/dc/terms/" == cr_date.getURI() ))
+ assert( cr_date.getNumChildren() == 1 )
+ modified = desc.getChild(2)
+ assert (( "modified" == modified.getName() ))
+ assert (( "dcterms" == modified.getPrefix() ))
+ assert (( "http://purl.org/dc/terms/" == modified.getURI() ))
+ assert( modified.getNumChildren() == 1 )
+ mo_date = created.getChild(0)
+ assert (( "W3CDTF" == mo_date.getName() ))
+ assert (( "dcterms" == mo_date.getPrefix() ))
+ assert (( "http://purl.org/dc/terms/" == mo_date.getURI() ))
+ assert( mo_date.getNumChildren() == 1 )
+ node = nil
+ end
+
+end
Modified: trunk/libsbml/src/bindings/ruby/test/annotation/TestValidation.rb
===================================================================
--- trunk/libsbml/src/bindings/ruby/test/annotation/TestValidation.rb 2011-01-26 16:10:23 UTC (rev 12704)
+++ trunk/libsbml/src/bindings/ruby/test/annotation/TestValidation.rb 2011-01-26 16:38:13 UTC (rev 12705)
@@ -1,155 +1,171 @@
-# @file TestValidation.rb
-# @brief Validation of Date ModelCreator and ModelHistory unit tests
-#
-# @author Akiya Jouraku (Ruby conversion)
-# @author Sarah Keating
-#
-# $Id$
-# $HeadURL$
-#
-# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
-#
-# DO NOT EDIT THIS FILE.
-#
-# This file was generated automatically by converting the file located at
-# src/annotation/test/TestValidation.cpp
-# using the conversion program dev/utilities/translateTests/translateTests.pl.
-# Any changes made here will be lost the next time the file is regenerated.
-#
-# -----------------------------------------------------------------------------
-# This file is part of libSBML. Please visit http://sbml.org for more
-# information about SBML, and the latest version of libSBML.
-#
-# Copyright 2005-2010 California Institute of Technology.
-# Copyright 2002-2005 California Institute of Technology and
-# Japan Science and Technology Corporation.
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation. A copy of the license agreement is provided
-# in the file named "LICENSE.txt" included with this software distribution
-# and also available online as http://sbml.org/software/libsbml/license.html
-# -----------------------------------------------------------------------------
-require 'test/unit'
-require 'libSBML'
-
-class TestValidation < Test::Unit::TestCase
-
- def test_Validation_CVTerm1
- cv = LibSBML::CVTerm.new()
- assert( cv != nil )
- assert_equal false, (cv.hasRequiredAttributes())
- cv.setQualifierType(LibSBML::MODEL_QUALIFIER)
- assert_equal false, (cv.hasRequiredAttributes())
- cv.setModelQualifierType(LibSBML::BQM_IS)
- assert_equal false, (cv.hasRequiredAttributes())
- cv.addResource("ggg")
- assert_equal true, (cv.hasRequiredAttributes())
- cv = nil
- end
-
- def test_Validation_CVTerm2
- cv = LibSBML::CVTerm.new()
- assert( cv != nil )
- assert_equal false, (cv.hasRequiredAttributes())
- cv.setQualifierType(LibSBML::BIOLOGICAL_QUALIFIER)
- assert_equal false, (cv.hasRequiredAttributes())
- cv.setBiologicalQualifierType(LibSBML::BQB_IS)
- assert_equal false, (cv.hasRequiredAttributes())
- cv.addResource("ggg")
- assert_equal true, (cv.hasRequiredAttributes())
- cv = nil
- end
-
- def test_Validation_Date1
- date = LibSBML::Date.new(200,12,30,12,15,45,1,2,0)
- assert( date != nil )
- assert_equal false, (date.representsValidDate())
- date = nil
- end
-
- def test_Validation_Date2
- date = LibSBML::Date.new(2007,14,30,12,15,45,1,2,0)
- assert( date != nil )
- assert_equal false, (date.representsValidDate())
- date = nil
- end
-
- def test_Validation_Date3
- date = LibSBML::Date.new("Jan 12")
- assert( date != nil )
- assert_equal false, (date.representsValidDate())
- date = nil
- end
-
- def test_Validation_Date4
- date = LibSBML::Date.new(2007,12,30,12,15,45,1,2,0)
- assert( date != nil )
- assert_equal true, date.representsValidDate()
- date = nil
- end
-
- def test_Validation_ModelCreator
- mc = LibSBML::ModelCreator.new()
- assert( mc != nil )
- assert_equal false, (mc.hasRequiredAttributes())
- mc.setEmail("k123")
- assert_equal false, (mc.hasRequiredAttributes())
- mc.setFamilyName("Keating")
- assert_equal false, (mc.hasRequiredAttributes())
- mc.setGivenName("Sarah")
- assert_equal true, mc.hasRequiredAttributes()
- mc = nil
- end
-
- def test_Validation_ModelHistory1
- mh = LibSBML::ModelHistory.new()
- assert( mh != nil )
- assert_equal false, (mh.hasRequiredAttributes())
- date = LibSBML::Date.new(2007,12,30,12,15,45,1,2,0)
- mh.setCreatedDate(date)
- assert_equal false, (mh.hasRequiredAttributes())
- mh.setModifiedDate(date)
- assert_equal false, (mh.hasRequiredAttributes())
- mc = LibSBML::ModelCreator.new()
- mc.setFamilyName("Keating")
- mc.setGivenName("Sarah")
- mh.addCreator(mc)
- assert_equal true, mh.hasRequiredAttributes()
- mh = nil
- end
-
- def test_Validation_ModelHistory2
- mh = LibSBML::ModelHistory.new()
- assert( mh != nil )
- assert_equal false, (mh.hasRequiredAttributes())
- date = LibSBML::Date.new(200,12,30,12,15,45,1,2,0)
- mh.setCreatedDate(date)
- assert_equal false, (mh.hasRequiredAttributes())
- mh.setModifiedDate(date)
- assert_equal false, (mh.hasRequiredAttributes())
- mc = LibSBML::ModelCreator.new()
- mc.setFamilyName("Keating")
- mc.setGivenName("Sarah")
- mh.addCreator(mc)
- assert_equal false, (mh.hasRequiredAttributes())
- mh = nil
- end
-
- def test_Validation_ModelHistory3
- mh = LibSBML::ModelHistory.new()
- assert( mh != nil )
- assert_equal false, (mh.hasRequiredAttributes())
- date = LibSBML::Date.new(2007,12,30,12,15,45,1,2,0)
- mh.setCreatedDate(date)
- assert_equal false, (mh.hasRequiredAttributes())
- mh.setModifiedDate(date)
- assert_equal false, (mh.hasRequiredAttributes())
- mc = LibSBML::ModelCreator.new()
- mc.setFamilyName("Keating")
- mh.addCreator(mc)
- assert_equal false, (mh.hasRequiredAttributes())
- mh = nil
- end
-
-end
+# @file TestValidation.rb
+# @brief Validation of Date ModelCreator and ModelHistory unit tests
+#
+# @author Akiya Jouraku (Ruby conversion)
+# @author Sarah Keating
+#
+# $Id$
+# $HeadURL$
+#
+# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+#
+# DO NOT EDIT THIS FILE.
+#
+# This file was generated automatically by converting the file located at
+# src/annotation/test/TestValidation.cpp
+# using the conversion program dev/utilities/translateTests/translateTests.pl.
+# Any changes made here will be lost the next time the file is reg...
[truncated message content] |
|
From: <mh...@us...> - 2011-01-26 22:37:11
|
Revision: 12707
http://sbml.svn.sourceforge.net/sbml/?rev=12707&view=rev
Author: mhucka
Date: 2011-01-26 18:26:02 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Added another common text fragment file.
Modified Paths:
--------------
trunk/libsbml/docs/src/Makefile.in
Added Paths:
-----------
trunk/libsbml/docs/src/common-text/cvterm-common-description-text.html
Modified: trunk/libsbml/docs/src/Makefile.in
===================================================================
--- trunk/libsbml/docs/src/Makefile.in 2011-01-26 18:24:53 UTC (rev 12706)
+++ trunk/libsbml/docs/src/Makefile.in 2011-01-26 18:26:02 UTC (rev 12707)
@@ -95,6 +95,7 @@
common-text/comment-set-methods.html \
common-text/compartment-size-recommendations.html \
common-text/compartment-size-restrictions.html \
+ common-text/cvterm-common-description-text.html \
common-text/id-syntax.html \
common-text/math-functions.html \
common-text/math-precedence-table.html \
Added: trunk/libsbml/docs/src/common-text/cvterm-common-description-text.html
===================================================================
--- trunk/libsbml/docs/src/common-text/cvterm-common-description-text.html (rev 0)
+++ trunk/libsbml/docs/src/common-text/cvterm-common-description-text.html 2011-01-26 18:26:02 UTC (rev 12707)
@@ -0,0 +1,25 @@
+The RDF element used in the SBML format for referring to external
+entities is <code><rdf:Description></code>, with a
+<code><rdf:Bag></code> element inside of it containing one or
+more <code><rdf:li></code> elements. The following template
+illustrates the structure:
+<DIV class="fragment">
+<rdf:Description rdf:about="#<span style="border-bottom: 1px solid black">meta id</span>"><br>
+ <span style="background-color: #ddd; border-bottom: 2px dotted #888">HISTORY</span><br>
+ <<span style="background-color: #bbb">RELATION_ELEMENT</span>><br>
+ <rdf:Bag><br>
+ <rdf:li rdf:resource="<span style="background-color: #d0d0ee">resource URI</span>" /><br>
+ <span style="background-color: #edd">...</span><br>
+ </rdf:Bag><br>
+ </<span style="background-color: #bbb">RELATION_ELEMENT</span>><br>
+ <span style="background-color: #edd">...</span><br>
+</rdf:Description><br>
+</div>
+In the template above, the placeholder <span class="code"
+style="border-bottom: 1px solid black">meta id</span> stands for the
+element's meta identifier, which is a field available on all SBML
+components derived from the SBase base object class. The <span
+style="border-bottom: 2px dotted #888">dotted</span> portions are
+optional, and the ellipses <span class="code" style="background-color:
+#edd">...</span> are placeholders for zero or more elements of the
+same form as the immediately preceding element.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-26 22:37:11
|
Revision: 12708
http://sbml.svn.sourceforge.net/sbml/?rev=12708&view=rev
Author: mhucka
Date: 2011-01-26 18:27:00 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Massive documentation enhancement.
Modified Paths:
--------------
trunk/libsbml/src/annotation/CVTerm.h
Modified: trunk/libsbml/src/annotation/CVTerm.h
===================================================================
--- trunk/libsbml/src/annotation/CVTerm.h 2011-01-26 18:26:02 UTC (rev 12707)
+++ trunk/libsbml/src/annotation/CVTerm.h 2011-01-26 18:27:00 UTC (rev 12708)
@@ -26,29 +26,133 @@
*
* @htmlinclude not-sbml-warning.html
*
- * CVTerm is a libSBML construct used as part of the libSBML support for
- * annotations conforming to the guidelines specified by MIRIAM ("Minimum
- * Information Requested in the Annotation of biochemical Models"). The
- * general scheme is as follows. A set of RDF-based annotations attached
- * to a given SBML <code><annotation></code> element are read by
- * RDFAnnotationParser and converted into a list of CVTerm objects. Each
- * CVTerm object instance stores the following components of an annotation:
+ * The SBML Level 2 and Level 3 specifications define a simple
+ * format for annotating models when (a) referring to controlled vocabulary
+ * terms and database identifiers that define and describe biological and
+ * biochemical entities, and (b) describing the creator of a model and its
+ * modification history. This SBML format is a concrete syntax that
+ * conforms to the guidelines of MIRIAM ("Minimum Information Requested in
+ * the Annotation of biochemical Models", <i>Nature Biotechnology</i>,
+ * vol. 23, no. 12, Dec. 2005). The format uses a subset of W3C RDF (<a
+ * target="_blank" href="http://www.w3.org/RDF/">Resource Description
+ * Format</a>). In order to help application developers work with
+ * annotations in this format, libSBML provides several helper classes that
+ * provide higher-level interfaces to the data elements; these classes
+ * include CVTerm, ModelCreator, ModelHistory, RDFAnnotationParser, and
+ * Date.
+ *
+ * @section annotation-parts Components of an SBML annotation
+ *
+ * The SBML annotation format consists of RDF-based content placed inside
+ * an <code><annotation></code> element attached to an SBML component
+ * such as Species, Compartment, etc. The following template illustrates
+ * the different parts of SBML annotations in XML form:
*
+<div class="fragment">
+<<span style="background-color: #bbb">SBML_ELEMENT</span> <span style="background-color: #d0eed0">+++</span> metaid="<span style="border-bottom: 1px solid black">meta id</span>" <span style="background-color: #d0eed0">+++</span>><br>
+ <span style="background-color: #d0eed0">+++</span><br>
+ <annotation><br>
+ <span style="background-color: #d0eed0">+++</span><br>
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"<br>
+ xmlns:dc="http://purl.org/dc/elements/1.1/"<br>
+ xmlns:dcterm="http://purl.org/dc/terms/"<br>
+ xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#"<br>
+ xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"<br>
+ xmlns:bqmodel="http://biomodels.net/model-qualifiers/" ><br>
+ <rdf:Description rdf:about="#<span style="border-bottom: 1px solid black">meta id</span>"><br>
+ <span style="background-color: #ddd; border-bottom: 2px dotted #888">HISTORY</span><br>
+ <<span style="background-color: #bbb">RELATION_ELEMENT</span>><br>
+ <rdf:Bag><br>
+ <rdf:li rdf:resource="<span style="background-color: #d0d0ee">URI</span>" /><br>
+ <span style="background-color: #edd">...</span><br>
+ </rdf:Bag><br>
+ </<span style="background-color: #bbb">RELATION_ELEMENT</span>><br>
+ <span style="background-color: #edd">...</span><br>
+ </rdf:Description><br>
+ <span style="background-color: #d0eed0">+++</span><br>
+ </rdf:RDF><br>
+ <span style="background-color: #d0eed0">+++</span><br>
+ </annotation><br>
+ <span style="background-color: #d0eed0">+++</span><br>
+</<span style="background-color: #bbb">SBML_ELEMENT</span>><br>
+</div>
+ *
+ * In the template above, the placeholder
+ * <span class="code" style="background-color: #bbb">SBML_ELEMENT</span> stands for
+ * the XML tag name of an SBML model component (e.g., <code>model</code>,
+ * <code>reaction</code>, etc.) and the placeholder
+ * <span class="code" style="border-bottom: 1px solid black">meta id</span>
+ * stands for the element's meta identifier, which is a field available
+ * on all SBML components derived from the SBase base object class.
+ * The <span style="border-bottom: 2px dotted #888">dotted</span>
+ * portions are optional, the symbol
+ * <span class="code" style="background-color: #d0eed0">+++</span> is a placeholder
+ * for either no content or valid XML content that is not defined by
+ * the annotation scheme, and the ellipses
+ * <span class="code" style="background-color: #edd">...</span>
+ * are placeholders for zero or more elements of the same form as the
+ * immediately preceding element. The optional content
+ * <span class="code" style="background-color: #ddd; border-bottom: 2px dotted #888">HISTORY</span>
+ * is a creation and modification history; in libSBML, this is stored
+ * using ModelHistory objects.
+ *
+ * The placeholder <span class="code" style="background-color: #bbb">RELATION_ELEMENT</span>
+ * refers to a BioModels.net qualifier element name. This is an element in
+ * either the XML namespace
+ * <code>"http://biomodels.net/model-qualifiers"</code> (for model
+ * qualifiers) or <code>"http://biomodels.net/biology-qualifiers"</code>
+ * (for biological qualifier). The <span class="code" style="background-color: #d0d0ee">URI</span>
+ * is a required data value that uniquely identifies a resource and
+ * data within that resource to which the annotation refers. (Since
+ * a URI is only a label, not an address, applications will often
+ * want a means of looking up the resource to which the URI refers.
+ * Providing the facilities for doing this is the purpose of
+ * <a target="_blank" href="http://biomodels.net/miriam">MIRIAM Resources</a>.)
+ *
+ * The relation-resource pairs above are the "controlled vocabulary" terms
+ * that which CVTerm is designed to store and manipulate. The next section
+ * describes these parts in more detail. For more information about
+ * SBML annotations in general, please refer to Section 6 in the
+ * SBML Level 2 (Versions 2–4) or Level 3 specification
+ * documents.
+ *
+ *
+ * @section cvterm-parts The parts of a CVTerm
+ *
+ * Annotations that refer to controlled vocabularies are managed in libSBML
+ * using CVTerm objects. A set of RDF-based annotations attached to a
+ * given SBML <code><annotation></code> element are read by
+ * RDFAnnotationParser and converted into a list of these CVTerm objects.
+ * Each CVTerm object instance stores the following components of an
+ * annotation:
+ *
* <ul>
- * <li>The qualifier, which can be a MIRIAM "biological qualifier", a
- * "model qualifier", or an unknown qualifier (as far as the CVTerm class
- * is concerned). Qualifiers are used in MIRIAM to indicate the nature of
- * the relationship between the object being annotated and the resource.
- * In CVTerm, the qualifiers can be manipulated using the methods
- * CVTerm::getQualifierType(),
- * CVTerm::setQualifierType(@if java int type@endif),
- * and related methods.
+ *
+ * <li>The @em qualifier, which can be a BioModels.net "biological
+ * qualifier", a BioModels.net "model qualifier", or an unknown qualifier
+ * (as far as the CVTerm class is concerned). Qualifiers are used in
+ * MIRIAM to indicate the nature of the relationship between the object
+ * being annotated and the resource. In CVTerm, the qualifiers can be
+ * manipulated using the methods CVTerm::getQualifierType(),
+ * CVTerm::setQualifierType(@if java int type@endif), and related methods.
*
- * <li>The resource, represent by a URI (note: not a URL). In CVTerm, the
+ * <li>The @em resource, represented by a URI (which, we must remind
+ * developers, is not the same as a URL). In the CVTerm class, the
* resource component can be manipulated using the methods
- * CVTerm::addResource(@if java String resource@endif)
- * and CVTerm::removeResource(@if java String resource@endif).
+ * CVTerm::addResource(@if java String resource@endif) and
+ * CVTerm::removeResource(@if java String resource@endif).
+ *
* </ul>
+ *
+ * Note that a CVTerm contains a single qualifier, but possibly more than
+ * one resource. This corresponds to the possibility of an annotation
+ * pointing to multiple resources yet having the same BioModels.net
+ * qualifier. The CVTerm object class supports this by supporting a list
+ * of resources.
+ *
+ * Detailed explanations of the qualifiers defined by BioModels.net can be
+ * found at <a target="_blank"
+ * href="http://biomodels.net/qualifiers">http://biomodels.net/qualifiers</a>.
*/
#ifndef CVTerm_h
@@ -114,17 +218,43 @@
public:
/**
- * Creates a new CVTerm, optionally with the given @if clike #QualifierType_t@endif@if java qualifier type code@endif value
+ * Creates an empty CVTerm, optionally with the given
+ * @if clike #QualifierType_t@endif@if java qualifier type code@endif value
* @p type.
*
- * The possible qualifier types are @link QualifierType_t#MODEL_QUALIFIER MODEL_QUALIFIER@endlink
- * and @link QualifierType_t#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER@endlink. If an explicit
- * value for @p type is not given, this method defaults to using
- * @link QualifierType_t#UNKNOWN_QUALIFIER UNKNOWN_QUALIFIER@endlink. The
- * @if clike #QualifierType_t@endif@if java qualifier type code@endif type
- * value can be set later using the CVTerm::setQualifierType(@if java int type@endif)
- * method.
+ * The SBML Level 2 and Level 3 specifications define a simple
+ * format for annotating models when (a) referring to controlled
+ * vocabulary terms and database identifiers that define and describe
+ * biological and biochemical entities, and (b) describing the creator of
+ * a model and its modification history. The annotation content is
+ * stored in <code><annotation></code> elements attached to
+ * individual SBML elements. The format for storing the content inside
+ * SBML <code><annotation></code> elements is a subset of W3C RDF
+ * (<a target="_blank" href="http://www.w3.org/RDF/">Resource Description
+ * Format</a>) expressed in XML. The CVTerm class provides a programming
+ * interface for working directly with controlled vocabulary term ("CV
+ * term") objects without having to deal directly with the XML form.
+ * When libSBML reads in an SBML model containing RDF annotations, it
+ * parses those annotations into a list of CVTerm objects, and when
+ * writing a model, it parses the CVTerm objects back into the
+ * appropriate SBML <code><annotation></code> structure.
*
+ * This method creates an empty CVTerm object. The possible qualifier
+ * types usable as values of @p type are @link
+ * QualifierType_t#MODEL_QUALIFIER MODEL_QUALIFIER@endlink and @link
+ * QualifierType_t#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER@endlink. If
+ * an explicit value for @p type is not given, this method defaults to
+ * using @link QualifierType_t#UNKNOWN_QUALIFIER
+ * UNKNOWN_QUALIFIER@endlink. The @if clike #QualifierType_t@endif@if
+ * java qualifier type code@endif type value can be set later using the
+ * CVTerm::setQualifierType(@if java int type@endif) method.
+ *
+ * Different BioModels.net qualifier elements encode different types of
+ * relationships. Please refer to the SBML specification or the <a
+ * target="_blank" href="http://biomodels.net/qualifiers/">BioModels.net
+ * qualifiers web page</a> for an explanation of the meaning of these
+ * different qualifiers.
+ *
* @param type a @if clike #QualifierType_t@endif@if java qualifier type code@endif value
*
* @if notcpp @docnote @htmlinclude warn-default-args-in-docs.html @endif
@@ -135,14 +265,32 @@
/**
* Create a new CVTerm from the given XMLNode.
*
- * In libSBML, RDF annotations on a model component are stored as a list
- * of CVTerm ("controlled vocabulary term") objects. This allows the
- * user to interact with the CVTerm objects directly. When LibSBML reads
- * in a model containing RDFAnnotation, it parses them into a list of
- * CVTerm objects, and when writing a model, it parses the CVTerm objects
- * into the appropriate SBML <code><annotation></code> structure.
+ * The SBML Level 2 and Level 3 specifications define a simple
+ * format for annotating models when (a) referring to controlled
+ * vocabulary terms and database identifiers that define and describe
+ * biological and biochemical entities, and (b) describing the creator of
+ * a model and its modification history. The annotation content is
+ * stored in <code><annotation></code> elements attached to
+ * individual SBML elements. The format for storing the content inside
+ * SBML <code><annotation></code> elements is a subset of W3C RDF
+ * (<a target="_blank" href="http://www.w3.org/RDF/">Resource Description
+ * Format</a>) expressed in XML. The CVTerm class provides a programming
+ * interface for working directly with controlled vocabulary term ("CV
+ * term") objects without having to deal directly with the XML form.
+ * When libSBML reads in an SBML model containing RDF annotations, it
+ * parses those annotations into a list of CVTerm objects, and when
+ * writing a model, it parses the CVTerm objects back into the
+ * appropriate SBML <code><annotation></code> structure.
*
- * This method creates a CVTerm from the XMLNode object supplied.
+ * This method creates a CVTerm object from the XMLNode object @p node.
+ * Recall that XMLNode is a node in an XML tree of elements, and each
+ * such element can be placed in a namespace. This constructor looks for
+ * the element to be in the XML namespaces
+ * <code>"http://biomodels.net/model-qualifiers"</code> (for
+ * model qualifiers) and
+ * <code>"http://biomodels.net/biology-qualifiers"</code> (for
+ * biological qualifier), and if they are, creates CVTerm objects for
+ * the result.
*
* @param node an %XMLNode representing a CVTerm.
*
@@ -159,7 +307,7 @@
/**
- * Copy constructor; creates a copy of a CVTerm.
+ * Copy constructor; creates a copy of a CVTerm object.
*
* @param orig the CVTerm instance to copy.
*/
@@ -182,10 +330,38 @@
/**
* Returns the qualifier type code for this CVTerm object.
+ *
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The placeholder <span class="code" style="background-color:
+ * #bbb">RELATION_ELEMENT</span> refers to a BioModels.net qualifier
+ * element name. This is an element in either the XML namespace
+ * <code>"http://biomodels.net/model-qualifiers"</code> (for model
+ * qualifiers) or <code>"http://biomodels.net/biology-qualifiers"</code>
+ * (for biological qualifier). The present method returns a code
+ * identifying which one of these two relationship namespaces is being
+ * used; any other qualifier in libSBML is considered unknown (as far as
+ * the CVTerm class is concerned). Consequently, this method will return
+ * one of the following values:
*
+ * @li @link QualifierType_t#MODEL_QUALIFIER MODEL_QUALIFIER@endlink
+ * @li @link QualifierType_t#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER@endlink
+ * @li @link QualifierType_t#UNKNOWN_QUALIFIER UNKNOWN_QUALIFIER@endlink
+ *
+ * The specific relationship of this CVTerm to the enclosing SBML object
+ * can be determined using the CVTerm methods such as
+ * getModelQualifierType() and getBiologicalQualifierType(). Callers
+ * will typically want to use the present method to find out which one of
+ * the @em other two methods to call to find out the specific
+ * relationship.
+ *
* @return the @if clike #QualifierType_t@endif@if java qualifier type code@endif value of this object or
* @link QualifierType_t#UNKNOWN_QUALIFIER UNKNOWN_QUALIFIER@endlink
* (the default).
+ *
+ * @see getResources()
+ * @see getModelQualifierType()
+ * @see getBiologicalQualifierType()
*/
QualifierType_t getQualifierType();
@@ -193,6 +369,28 @@
/**
* Returns the model qualifier type code for this CVTerm object.
*
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The placeholder <span class="code" style="background-color:
+ * #bbb">RELATION_ELEMENT</span> refers to a BioModels.net qualifier
+ * element name. This is an element in either the XML namespace
+ * <code>"http://biomodels.net/model-qualifiers"</code> (for model
+ * qualifiers) or <code>"http://biomodels.net/biology-qualifiers"</code>
+ * (for biological qualifier). Callers will typically use
+ * getQualifierType() to find out the type of qualifier relevant to this
+ * particular CVTerm object, then if it is a @em model qualifier, use the
+ * present method to determine the specific qualifier. The set of known
+ * model qualifiers is, at the time of this libSBML release, the
+ * following:
+ *
+ * @li @link ModelQualifierType_t#BQM_IS BQM_IS@endlink
+ * @li @link ModelQualifierType_t#BQM_IS_DESCRIBED_BY BQM_IS_DESCRIBED_BY@endlink
+ * @li @link ModelQualifierType_t#BQM_IS_DERIVED_FROM BQM_IS_DERIVED_FROM@endlink
+ *
+ * Any other BioModels.net qualifier found in the model is considered
+ * unknown by libSBML and reported as
+ * @link ModelQualifierType_t#BQM_UNKNOWN BQM_UNKNOWN@endlink.
+ *
* @return the @if clike #ModelQualifierType_t@endif@if java model qualifier type code@endif value of this object or
* @link ModelQualifierType_t#BQM_UNKNOWN BQM_UNKNOWN@endlink
* (the default).
@@ -203,6 +401,37 @@
/**
* Returns the biological qualifier type code for this CVTerm object.
*
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The placeholder <span class="code" style="background-color:
+ * #bbb">RELATION_ELEMENT</span> refers to a BioModels.net qualifier
+ * element name. This is an element in either the XML namespace
+ * <code>"http://biomodels.net/model-qualifiers"</code> (for model
+ * qualifiers) or <code>"http://biomodels.net/biology-qualifiers"</code>
+ * (for biological qualifier). Callers will typically use
+ * getQualifierType() to find out the type of qualifier relevant to this
+ * particular CVTerm object, then if it is a @em biological qualifier,
+ * use the present method to determine the specific qualifier. The set
+ * of known biological qualifiers is, at the time of this libSBML
+ * release, the following:
+ *
+ * @li @link BiolQualifierType_t#BQB_IS BQB_IS@endlink
+ * @li @link BiolQualifierType_t#BQB_HAS_PART BQB_HAS_PART@endlink
+ * @li @link BiolQualifierType_t#BQB_IS_PART_OF BQB_IS_PART_OF@endlink
+ * @li @link BiolQualifierType_t#BQB_IS_VERSION_OF BQB_IS_VERSION_OF@endlink
+ * @li @link BiolQualifierType_t#BQB_HAS_VERSION BQB_HAS_VERSION@endlink
+ * @li @link BiolQualifierType_t#BQB_IS_HOMOLOG_TO BQB_IS_HOMOLOG_TO@endlink
+ * @li @link BiolQualifierType_t#BQB_IS_DESCRIBED_BY BQB_IS_DESCRIBED_BY@endlink
+ * @li @link BiolQualifierType_t#BQB_IS_ENCODED_BY BQB_IS_ENCODED_BY@endlink
+ * @li @link BiolQualifierType_t#BQB_ENCODES BQB_ENCODES@endlink
+ * @li @link BiolQualifierType_t#BQB_OCCURS_IN BQB_OCCURS_IN@endlink
+ * @li @link BiolQualifierType_t#BQB_HAS_PROPERTY BQB_HAS_PROPERTY@endlink
+ * @li @link BiolQualifierType_t#BQB_IS_PROPERTY_OF BQB_IS_PROPERTY_OF@endlink
+ *
+ * Any other BioModels.net qualifier found in the model is considered
+ * unknown by libSBML and reported as
+ * @link BiolQualifierType_t#BQB_UNKNOWN BQB_UNKNOWN@endlink.
+ *
* @return the @if clike #BiolQualifierType_t@endif@if java biology qualifier type code@endif value of this object or
* @link BiolQualifierType_t#BQB_UNKNOWN BQB_UNKNOWN@endlink
* (the default).
@@ -211,9 +440,26 @@
/**
- * Returns the resources for this CVTerm object.
+ * Returns the resource references for this CVTerm object.
+ *
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The <span class="code" style="background-color: #d0d0ee">resource
+ * URI</span> values shown in the template above are stored internally in
+ * CVTerm objects using an XMLAttributes object. Each attribute stored
+ * inside the XMLAttributes will have the same name (specifically,
+ * "<code>rdf:resource</code>") but a different value, and the
+ * value will be a <span class="code" style="background-color:
+ * #d0d0ee">resource URI</span> shown in the XML template above.
+ *
+ * A valid CVTerm entity must always have at least one resource and
+ * a value for the relationship qualifier.
*
* @return the XMLAttributes that store the resources of this CVTerm.
+ *
+ * @see getQualifierType()
+ * @see addResource()
+ * @see getResourceURI()
*/
XMLAttributes * getResources();
@@ -221,7 +467,24 @@
/**
* Returns the resources for this CVTerm object.
*
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The <span class="code" style="background-color: #d0d0ee">resource
+ * URI</span> values shown in the template above are stored internally in
+ * CVTerm objects using an XMLAttributes object. Each attribute stored
+ * inside the XMLAttributes will have the same name (specifically,
+ * "<code>rdf:resource</code>") but a different value, and the
+ * value will be a <span class="code" style="background-color:
+ * #d0d0ee">resource URI</span> shown in the XML template above.
+ *
+ * A valid CVTerm entity must always have at least one resource and
+ * a value for the relationship qualifier.
+ *
* @return the XMLAttributes that store the resources of this CVTerm.
+ *
+ * @see getQualifierType()
+ * @see addResource()
+ * @see getResourceURI()
*/
const XMLAttributes * getResources() const;
@@ -229,23 +492,46 @@
/**
* Returns the number of resources for this CVTerm object.
*
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The fragment above illustrates that there can be more than one
+ * resource referenced by a given relationship annotation (i.e., the
+ * <span class="code" style="background-color: #d0d0ee">resource
+ * URI</span> values associated with a particular <span class="code"
+ * style="background-color: #bbb">RELATION_ELEMENT</span>). The present
+ * method returns a count of the resources stored in this CVTerm object.
+ *
* @return the number of resources in the set of XMLAttributes
* of this CVTerm.
+ *
+ * @see getResources()
+ * @see getResourceURI()
*/
unsigned int getNumResources();
/**
- * Returns the value of the nth resource for this CVTerm object.
+ * Returns the value of the <em>n</em>th resource for this CVTerm object.
*
+ * @htmlinclude cvterm-common-description-text.html
+ *
+ * The fragment above illustrates that there can be more than one
+ * resource referenced by a given relationship annotation (i.e., the
+ * <span class="code" style="background-color: #d0d0ee">resource
+ * URI</span> values associated with a particular <span class="code"
+ * style="background-color: #bbb">RELATION_ELEMENT</span>). LibSBML
+ * stores all resource URIs in a single CVTerm object for a given
+ * relationship. Callers can use getNumResources() to find out how many
+ * resources are stored in this CVTerm object, then call this method to
+ * retrieve the <em>n</em>th resource URI.
+ *
* @param n the index of the resource to query
*
* @return string representing the value of the nth resource
* in the set of XMLAttributes of this CVTerm.
*
- * @note Since the values of the resource attributes in a CVTerm are
- * URIs, this is a convenience method to facilitate interaction with the
- * CVTerm class.
+ * @see getNumResources()
+ * @see getQualifierType()
*/
std::string getResourceURI(unsigned int n);
@@ -300,45 +586,109 @@
/**
- * Adds a resource to the CVTerm.
+ * Adds a resource reference to this CVTerm object.
*
- * @param resource string representing the resource; e.g.,
+ * The SBML Level 2 and Level 3 specifications define a simple
+ * standardized format for annotating models with references to
+ * controlled vocabulary terms and database identifiers that define and
+ * describe biological and biochemical entities. This annotation format
+ * consists of RDF-based content placed inside an
+ * <code><annotation></code> element attached to an SBML component
+ * such as Species, Compartment, etc.
+ *
+ * The specific RDF element used in this SBML format for referring to
+ * external entities is <code><rdf:Description></code>, with a
+ * <code><rdf:Bag></code> element inside of it containing one or
+ * more <code><rdf:li></code> elements. Each such element refers
+ * to a data item in an external resource; the resource and data item are
+ * together identified uniquely using a URI. The following template
+ * illustrates the structure:
+ *
+<DIV class="fragment">
+<rdf:Description rdf:about="#<span style="border-bottom: 1px solid black">meta id</span>"><br>
+ <span style="background-color: #ddd; border-bottom: 2px dotted #888">HISTORY</span><br>
+ <<span style="background-color: #bbb">RELATION_ELEMENT</span>><br>
+ <rdf:Bag><br>
+ <rdf:li rdf:resource="<span style="background-color: #d0d0ee">resource URI</span>" /><br>
+ <span style="background-color: #edd">...</span><br>
+ </rdf:Bag><br>
+ </<span style="background-color: #bbb">RELATION_ELEMENT</span>><br>
+ <span style="background-color: #edd">...</span><br>
+</rdf:Description><br>
+</div>
+ *
+ * In the template above, the placeholder <span class="code"
+ * style="border-bottom: 1px solid black">meta id</span> stands for the
+ * element's meta identifier, which is a field available on all SBML
+ * components derived from the SBase base object class. The <span
+ * style="border-bottom: 2px dotted #888">dotted</span> portions are
+ * optional, and the ellipses <span class="code" style="background-color:
+ * #edd">...</span> are placeholders for zero or more elements of the
+ * same form as the immediately preceding element. The placeholder <span
+ * class="code" style="background-color: #bbb">RELATION_ELEMENT</span>
+ * refers to a BioModels.net qualifier element name. This is an element
+ * in either the XML namespace
+ * <code>"http://biomodels.net/model-qualifiers"</code> (for model
+ * qualifiers) or <code>"http://biomodels.net/biology-qualifiers"</code>
+ * (for biological qualifier).
+ *
+ * The <span class="code" style="background-color: #d0d0ee">resource
+ * URI</span> is a required data value that uniquely identifies a
+ * resource and data within that resource to which the annotation refers.
+ * The present method allows callers to add a reference to a resource URI
+ * with the same relationship to the enclosing SBML object. (In other
+ * words, the argument to this method is a <span class="code"
+ * style="background-color: #d0d0ee">resource URI</span> as shown in the
+ * XML fragment above.) Resources are stored in this CVTerm object
+ * within an XMLAttributes object.
+ *
+ * The relationship of this CVTerm to the enclosing SBML object can be
+ * determined using the CVTerm methods such as getModelQualifierType()
+ * and getBiologicalQualifierType().
+ *
+ * @param resource a string representing the URI of the resource and data
+ * item being referenced; e.g.,
* <code>"http://www.geneontology.org/#GO:0005892"</code>.
*
- * @note This method adds the name <code>"rdf:resource"</code> to the
- * attribute prior to adding it to the resources in this CVTerm object.
- *
- * @return integer value indicating success/failure of the
- * function. The possible values
- * returned by this function are:
+ * @return integer value indicating success/failure of the call. The
+ * possible values returned by this function are:
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink
+ *
+ * @see getResources()
+ * @see removeResource()
+ * @see getQualifierType()
+ * @see getModelQualifierType()
+ * @see getBiologicalQualifierType()
*/
int addResource(const std::string& resource);
/**
- * Removes a resource from the CVTerm.
+ * Removes a resource URI from the set of resources stored in this CVTerm
+ * object.
*
- * @param resource string representing the resource; e.g.,
- * <code>"http://www.geneontology.org/#GO:0005892"</code>.
+ * @param resource a string representing the resource URI to remove;
+ * e.g., <code>"http://www.geneontology.org/#GO:0005892"</code>.
*
* @return integer value indicating success/failure of the
* function. The possible values
* returned by this function are:
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
* @li @link OperationReturnValues_t#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink
+ *
+ * @see addResource();
*/
int removeResource(std::string resource);
/**
- * Predicate returning @c true if all the
- * required elements for this Rule object have been set.
+ * Predicate returning @c true if all the required elements for this
+ * CVTerm object have been set.
*
* @note The required attributes for a CVTerm are:
- * @li qualifierType and appropriate biologicalQualifierType or
- * @li modelQualifierType and at least one resource.
+ * @li a <em>qualifier type</em>, which can be either a model qualifier or a biological qualifier
+ * @li at least one resource
*/
bool hasRequiredAttributes();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-26 22:37:11
|
Revision: 12709
http://sbml.svn.sourceforge.net/sbml/?rev=12709&view=rev
Author: mhucka
Date: 2011-01-26 18:27:40 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Small correction to a statement.
Modified Paths:
--------------
trunk/libsbml/src/annotation/RDFAnnotation.h
Modified: trunk/libsbml/src/annotation/RDFAnnotation.h
===================================================================
--- trunk/libsbml/src/annotation/RDFAnnotation.h 2011-01-26 18:27:00 UTC (rev 12708)
+++ trunk/libsbml/src/annotation/RDFAnnotation.h 2011-01-26 18:27:40 UTC (rev 12709)
@@ -32,8 +32,8 @@
* ("Minimum Information Requested in the Annotation of biochemical
* Models", <i>Nature Biotechnology</i>, vol. 23, no. 12, Dec. 2005).
* Section 6 of the SBML Level 2 and Level 3 specification
- * documents defines a recommended way of encoding MIRIAM information as
- * RDF annotations in SBML. The general scheme is as follows. A set of
+ * documents defines a recommended way of encoding MIRIAM information using
+ * a subset of RDF in SBML. The general scheme is as follows. A set of
* RDF-based annotations attached to a given SBML
* <code><annotation></code> element are read by RDFAnnotationParser
* and converted into a list of CVTerm objects. There
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2011-01-26 22:37:11
|
Revision: 12706
http://sbml.svn.sourceforge.net/sbml/?rev=12706&view=rev
Author: mhucka
Date: 2011-01-26 18:24:53 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Removed some stray doxygen comment starters that caused comments to be
merged into the intended documentation.
Modified Paths:
--------------
trunk/libsbml/src/annotation/CVTerm.cpp
Modified: trunk/libsbml/src/annotation/CVTerm.cpp
===================================================================
--- trunk/libsbml/src/annotation/CVTerm.cpp 2011-01-26 16:38:13 UTC (rev 12705)
+++ trunk/libsbml/src/annotation/CVTerm.cpp 2011-01-26 18:24:53 UTC (rev 12706)
@@ -189,9 +189,9 @@
-/**
- * clones the CVTerm
- */
+/*
+ * clones the CVTerm
+ */
CVTerm* CVTerm::clone() const
{
CVTerm* term=new CVTerm(*this);
@@ -330,7 +330,7 @@
}
-/**
+ /*
* adds a resource to the term
*/
int
@@ -347,7 +347,7 @@
}
-/**
+ /*
* removes a resource to the term
*/
int
@@ -379,7 +379,7 @@
return result;
}
-/** @cond doxygen-libsbml-internal */
+ /* @cond doxygen-libsbml-internal */
bool
CVTerm::hasRequiredAttributes()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-26 22:37:09
|
Revision: 12710
http://sbml.svn.sourceforge.net/sbml/?rev=12710&view=rev
Author: sarahkeating
Date: 2011-01-26 18:43:35 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
The $cat variable was not correctly identifying the directory. I replaced the code with the if statement that is used to find the CurTestDir variable which does work.
Modified Paths:
--------------
trunk/libsbml/dev/utilities/translateTests/translateTests.pl
Modified: trunk/libsbml/dev/utilities/translateTests/translateTests.pl
===================================================================
--- trunk/libsbml/dev/utilities/translateTests/translateTests.pl 2011-01-26 18:27:40 UTC (rev 12709)
+++ trunk/libsbml/dev/utilities/translateTests/translateTests.pl 2011-01-26 18:43:35 UTC (rev 12710)
@@ -3420,7 +3420,7 @@
my ($file) = @_;
my $cat = 'sbml';
- $cat = $1 if ( $file =~ m|/src/([^/]*)/| );
+ $cat = $1 if ( $file =~ m| (\w+)/test/ |x );
$file =~ s/.*\///;
my $ofile = $file;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-26 16:10:31
|
Revision: 12704
http://sbml.svn.sourceforge.net/sbml/?rev=12704&view=rev
Author: sarahkeating
Date: 2011-01-26 16:10:23 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
updated for new test in annotation/test directory
Modified Paths:
--------------
trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestRDFAnnotationC.java
trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestValidation.java
Modified: trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestRDFAnnotationC.java
===================================================================
--- trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestRDFAnnotationC.java 2011-01-26 15:38:37 UTC (rev 12703)
+++ trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestRDFAnnotationC.java 2011-01-26 16:10:23 UTC (rev 12704)
@@ -1,363 +1,373 @@
-/*
- * @file TestRDFAnnotationC.java
- * @brief RDFAnnotation parser unit tests
- *
- * @author Akiya Jouraku (Java conversion)
- * @author Sarah Keating
- *
- * $Id$
- * $HeadURL$
- *
- * ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
- *
- * DO NOT EDIT THIS FILE.
- *
- * This file was generated automatically by converting the file located at
- * src/annotation/test/TestRDFAnnotationC.c
- * using the conversion program dev/utilities/translateTests/translateTests.pl.
- * Any changes made here will be lost the next time the file is regenerated.
- *
- * -----------------------------------------------------------------------------
- * This file is part of libSBML. Please visit http://sbml.org for more
- * information about SBML, and the latest version of libSBML.
- *
- * Copyright 2005-2010 California Institute of Technology.
- * Copyright 2002-2005 California Institute of Technology and
- * Japan Science and Technology Corporation.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation. A copy of the license agreement is provided
- * in the file named "LICENSE.txt" included with this software distribution
- * and also available online as http://sbml.org/software/libsbml/license.html
- * -----------------------------------------------------------------------------
- */
-
-package org.sbml.libsbml.test.annotation;
-
-import org.sbml.libsbml.*;
-
-import java.io.File;
-import java.lang.AssertionError;
-
-public class TestRDFAnnotationC {
-
- static void assertTrue(boolean condition) throws AssertionError
- {
- if (condition == true)
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(Object a, Object b) throws AssertionError
- {
- if ( (a == null) && (b == null) )
- {
- return;
- }
- else if ( (a == null) || (b == null) )
- {
- throw new AssertionError();
- }
- else if (a.equals(b))
- {
- return;
- }
-
- throw new AssertionError();
- }
-
- static void assertNotEquals(Object a, Object b) throws AssertionError
- {
- if ( (a == null) && (b == null) )
- {
- throw new AssertionError();
- }
- else if ( (a == null) || (b == null) )
- {
- return;
- }
- else if (a.equals(b))
- {
- throw new AssertionError();
- }
- }
-
- static void assertEquals(boolean a, boolean b) throws AssertionError
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(boolean a, boolean b) throws AssertionError
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(int a, int b) throws AssertionError
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(int a, int b) throws AssertionError
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
- private SBMLDocument d;
- private Model m;
-
- protected void setUp() throws Exception
- {
- String filename = "../../annotation/test/test-data/annotation.xml";
- d = libsbml.readSBML(filename);
- m = d.getModel();
- }
-
- protected void tearDown() throws Exception
- {
- d = null;
- }
-
- public void test_RDFAnnotation_C_delete()
- {
- SBase obj = m.getCompartment(0);
- XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
- XMLNode n1 = RDFAnnotationParser.deleteRDFAnnotation(node);
- assertTrue( n1.getNumChildren() == 0 );
- assertTrue(n1.getName().equals( "annotation"));
- node = null;
- }
-
- public void test_RDFAnnotation_C_getModelHistory()
- {
- assertTrue( ! (m == null) );
- ModelHistory history = m.getModelHistory();
- assertTrue( history != null );
- ModelCreator mc = history.getCreator(0);
- assertTrue(mc.getFamilyName().equals( "Le Novere"));
- assertTrue(mc.getGivenName().equals( "Nicolas"));
- assertTrue(mc.getEmail().equals( "le...@eb..."));
- assertTrue(mc.getOrganisation().equals( "EMBL-EBI"));
- Date date = history.getCreatedDate();
- assertTrue( date.getYear() == 2005 );
- assertTrue( date.getMonth() == 2 );
- assertTrue( date.getDay() == 2 );
- assertTrue( date.getHour() == 14 );
- assertTrue( date.getMinute() == 56 );
- assertTrue( date.getSecond() == 11 );
- assertTrue( date.getSignOffset() == 0 );
- assertTrue( date.getHoursOffset() == 0 );
- assertTrue( date.getMinutesOffset() == 0 );
- assertTrue(date.getDateAsString().equals( "2005-02-02T14:56:11Z"));
- date = history.getModifiedDate();
- assertTrue( date.getYear() == 2006 );
- assertTrue( date.getMonth() == 5 );
- assertTrue( date.getDay() == 30 );
- assertTrue( date.getHour() == 10 );
- assertTrue( date.getMinute() == 46 );
- assertTrue( date.getSecond() == 2 );
- assertTrue( date.getSignOffset() == 0 );
- assertTrue( date.getHoursOffset() == 0 );
- assertTrue( date.getMinutesOffset() == 0 );
- assertTrue(date.getDateAsString().equals( "2006-05-30T10:46:02Z"));
- }
-
- public void test_RDFAnnotation_C_parseCVTerms()
- {
- SBase obj = m.getCompartment(0);
- XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
- assertTrue( node.getNumChildren() == 1 );
- XMLNode rdf = node.getChild(0);
- assertTrue(rdf.getName().equals( "RDF"));
- assertTrue(rdf.getPrefix().equals( "rdf"));
- assertTrue(rdf.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( rdf.getNumChildren() == 1 );
- XMLNode desc = rdf.getChild(0);
- assertTrue(desc.getName().equals( "Description"));
- assertTrue(desc.getPrefix().equals( "rdf"));
- assertTrue(desc.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( desc.getNumChildren() == 1 );
- XMLNode is1 = desc.getChild(0);
- assertTrue(is1.getName().equals( "is"));
- assertTrue(is1.getPrefix().equals( "bqbiol"));
- assertTrue( is1.getNumChildren() == 1 );
- XMLNode Bag = is1.getChild(0);
- assertTrue(Bag.getName().equals( "Bag"));
- assertTrue(Bag.getPrefix().equals( "rdf"));
- assertTrue(Bag.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( Bag.getNumChildren() == 4 );
- XMLNode li = Bag.getChild(0);
- assertTrue(li.getName().equals( "li"));
- assertTrue(li.getPrefix().equals( "rdf"));
- assertTrue(li.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( li.getNumChildren() == 0 );
- XMLNode li1 = Bag.getChild(1);
- assertTrue(li1.getName().equals( "li"));
- assertTrue(li1.getPrefix().equals( "rdf"));
- assertTrue(li1.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( li1.getNumChildren() == 0 );
- XMLNode li2 = Bag.getChild(2);
- assertTrue(li2.getName().equals( "li"));
- assertTrue(li2.getPrefix().equals( "rdf"));
- assertTrue(li2.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( li2.getNumChildren() == 0 );
- XMLNode li3 = Bag.getChild(3);
- assertTrue(li3.getName().equals( "li"));
- assertTrue(li3.getPrefix().equals( "rdf"));
- assertTrue(li3.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( li3.getNumChildren() == 0 );
- node = null;
- }
-
- public void test_RDFAnnotation_C_parseModelHistory()
- {
- XMLNode node = RDFAnnotationParser.parseModelHistory(m);
- assertTrue( node.getNumChildren() == 1 );
- XMLNode rdf = node.getChild(0);
- assertTrue(rdf.getName().equals( "RDF"));
- assertTrue(rdf.getPrefix().equals( "rdf"));
- assertTrue(rdf.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( rdf.getNumChildren() == 1 );
- XMLNode desc = rdf.getChild(0);
- assertTrue(desc.getName().equals( "Description"));
- assertTrue(desc.getPrefix().equals( "rdf"));
- assertTrue(desc.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( desc.getNumChildren() == 3 );
- XMLNode creator = desc.getChild(0);
- assertTrue(creator.getName().equals( "creator"));
- assertTrue(creator.getPrefix().equals( "dc"));
- assertTrue(creator.getURI().equals( "http://purl.org/dc/elements/1.1/"));
- assertTrue( creator.getNumChildren() == 1 );
- XMLNode Bag = creator.getChild(0);
- assertTrue(Bag.getName().equals( "Bag"));
- assertTrue(Bag.getPrefix().equals( "rdf"));
- assertTrue(Bag.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( Bag.getNumChildren() == 1 );
- XMLNode li = Bag.getChild(0);
- assertTrue(li.getName().equals( "li"));
- assertTrue(li.getPrefix().equals( "rdf"));
- assertTrue(li.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
- assertTrue( li.getNumChildren() == 3 );
- XMLNode N = li.getChild(0);
- assertTrue(N.getName().equals( "N"));
- assertTrue(N.getPrefix().equals( "vCard"));
- assertTrue(N.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
- assertTrue( N.getNumChildren() == 2 );
- XMLNode Family = N.getChild(0);
- assertTrue(Family.getName().equals( "Family"));
- assertTrue(Family.getPrefix().equals( "vCard"));
- assertTrue(Family.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
- assertTrue( Family.getNumChildren() == 1 );
- XMLNode Given = N.getChild(1);
- assertTrue(Given.getName().equals( "Given"));
- assertTrue(Given.getPrefix().equals( "vCard"));
- assertTrue(Given.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
- assertTrue( Given.getNumChildren() == 1 );
- XMLNode EMAIL = li.getChild(1);
- assertTrue(EMAIL.getName().equals( "EMAIL"));
- assertTrue(EMAIL.getPrefix().equals( "vCard"));
- assertTrue(EMAIL.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
- assertTrue( EMAIL.getNumChildren() == 1 );
- XMLNode ORG = li.getChild(2);
- assertTrue(ORG.getName().equals( "ORG"));
- assertTrue(ORG.getPrefix().equals( "vCard"));
- assertTrue(ORG.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
- assertTrue( ORG.getNumChildren() == 1 );
- XMLNode Orgname = ORG.getChild(0);
- assertTrue(Orgname.getName().equals( "Orgname"));
- assertTrue(Orgname.getPrefix().equals( "vCard"));
- assertTrue(Orgname.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
- assertTrue( Orgname.getNumChildren() == 1 );
- XMLNode created = desc.getChild(1);
- assertTrue(created.getName().equals( "created"));
- assertTrue(created.getPrefix().equals( "dcterms"));
- assertTrue(created.getURI().equals( "http://purl.org/dc/terms/"));
- assertTrue( created.getNumChildren() == 1 );
- XMLNode cr_date = created.getChild(0);
- assertTrue(cr_date.getName().equals( "W3CDTF"));
- assertTrue(cr_date.getPrefix().equals( "dcterms"));
- assertTrue(cr_date.getURI().equals( "http://purl.org/dc/terms/"));
- assertTrue( cr_date.getNumChildren() == 1 );
- XMLNode modified = desc.getChild(2);
- assertTrue(modified.getName().equals( "modified"));
- assertTrue(modified.getPrefix().equals( "dcterms"));
- assertTrue(modified.getURI().equals( "http://purl.org/dc/terms/"));
- assertTrue( modified.getNumChildren() == 1 );
- XMLNode mo_date = created.getChild(0);
- assertTrue(mo_date.getName().equals( "W3CDTF"));
- assertTrue(mo_date.getPrefix().equals( "dcterms"));
- assertTrue(mo_date.getURI().equals( "http://purl.org/dc/terms/"));
- assertTrue( mo_date.getNumChildren() == 1 );
- node = null;
- }
-
- /**
- * Loads the SWIG-generated libSBML Java module when this class is
- * loaded, or reports a sensible diagnostic message about why it failed.
- */
- static
- {
- String varname;
- String shlibname;
-
- if (System.getProperty("mrj.version") != null)
- {
- varname = "DYLD_LIBRARY_PATH"; // We're on a Mac.
- shlibname = "libsbmlj.jnilib and/or libsbml.dylib";
- }
- else
- {
- varname = "LD_LIBRARY_PATH"; // We're not on a Mac.
- shlibname = "libsbmlj.so and/or libsbml.so";
- }
-
- try
- {
- System.loadLibrary("sbmlj");
- // For extra safety, check that the jar file is in the classpath.
- Class.forName("org.sbml.libsbml.libsbml");
- }
- catch (SecurityException e)
- {
- e.printStackTrace();
- System.err.println("Could not load the libSBML library files due to a"+
- " security exception.\n");
- System.exit(1);
- }
- catch (UnsatisfiedLinkError e)
- {
- e.printStackTrace();
- System.err.println("Error: could not link with the libSBML library files."+
- " It is likely\nyour " + varname +
- " environment variable does not include the directories\n"+
- "containing the " + shlibname + " library files.\n");
- System.exit(1);
- }
- catch (ClassNotFoundException e)
- {
- e.printStackTrace();
- System.err.println("Error: unable to load the file libsbmlj.jar."+
- " It is likely\nyour -classpath option and CLASSPATH" +
- " environment variable\n"+
- "do not include the path to libsbmlj.jar.\n");
- System.exit(1);
- }
- }
-}
+/*
+ * @file TestRDFAnnotationC.java
+ * @brief RDFAnnotation parser unit tests
+ *
+ * @author Akiya Jouraku (Java conversion)
+ * @author Sarah Keating
+ *
+ * $Id$
+ * $HeadURL$
+ *
+ * ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+ *
+ * DO NOT EDIT THIS FILE.
+ *
+ * This file was generated automatically by converting the file located at
+ * src/annotation/test/TestRDFAnnotationC.c
+ * using the conversion program dev/utilities/translateTests/translateTests.pl.
+ * Any changes made here will be lost the next time the file is regenerated.
+ *
+ * -----------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright 2005-2010 California Institute of Technology.
+ * Copyright 2002-2005 California Institute of Technology and
+ * Japan Science and Technology Corporation.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * -----------------------------------------------------------------------------
+ */
+
+package org.sbml.libsbml.test.annotation;
+
+import org.sbml.libsbml.*;
+
+import java.io.File;
+import java.lang.AssertionError;
+
+public class TestRDFAnnotationC {
+
+ static void assertTrue(boolean condition) throws AssertionError
+ {
+ if (condition == true)
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(Object a, Object b) throws AssertionError
+ {
+ if ( (a == null) && (b == null) )
+ {
+ return;
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if (a.equals(b))
+ {
+ return;
+ }
+
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(Object a, Object b) throws AssertionError
+ {
+ if ( (a == null) && (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ return;
+ }
+ else if (a.equals(b))
+ {
+ throw new AssertionError();
+ }
+ }
+
+ static void assertEquals(boolean a, boolean b) throws AssertionError
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(boolean a, boolean b) throws AssertionError
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(int a, int b) throws AssertionError
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(int a, int b) throws AssertionError
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+ private SBMLDocument d;
+ private Model m;
+
+ protected void setUp() throws Exception
+ {
+ String filename = "../../annotation/test/test-data/annotation.xml";
+ d = libsbml.readSBML(filename);
+ m = d.getModel();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ d = null;
+ }
+
+ public void test_RDFAnnotation_C_accessWithNULL()
+ {
+ assertTrue( RDFAnnotationParser.createCVTerms(null) == null );
+ assertTrue( RDFAnnotationParser.createRDFDescription(null) == null );
+ assertTrue( RDFAnnotationParser.deleteRDFAnnotation(null) == null );
+ assertTrue( RDFAnnotationParser.parseCVTerms(null) == null );
+ assertTrue( RDFAnnotationParser.parseModelHistory(null) == null );
+ RDFAnnotationParser.parseRDFAnnotation(null,null);
+ }
+
+ public void test_RDFAnnotation_C_delete()
+ {
+ SBase obj = m.getCompartment(0);
+ XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
+ XMLNode n1 = RDFAnnotationParser.deleteRDFAnnotation(node);
+ assertTrue( n1.getNumChildren() == 0 );
+ assertTrue(n1.getName().equals( "annotation"));
+ node = null;
+ }
+
+ public void test_RDFAnnotation_C_getModelHistory()
+ {
+ assertTrue( ! (m == null) );
+ ModelHistory history = m.getModelHistory();
+ assertTrue( history != null );
+ ModelCreator mc = history.getCreator(0);
+ assertTrue(mc.getFamilyName().equals( "Le Novere"));
+ assertTrue(mc.getGivenName().equals( "Nicolas"));
+ assertTrue(mc.getEmail().equals( "le...@eb..."));
+ assertTrue(mc.getOrganisation().equals( "EMBL-EBI"));
+ Date date = history.getCreatedDate();
+ assertTrue( date.getYear() == 2005 );
+ assertTrue( date.getMonth() == 2 );
+ assertTrue( date.getDay() == 2 );
+ assertTrue( date.getHour() == 14 );
+ assertTrue( date.getMinute() == 56 );
+ assertTrue( date.getSecond() == 11 );
+ assertTrue( date.getSignOffset() == 0 );
+ assertTrue( date.getHoursOffset() == 0 );
+ assertTrue( date.getMinutesOffset() == 0 );
+ assertTrue(date.getDateAsString().equals( "2005-02-02T14:56:11Z"));
+ date = history.getModifiedDate();
+ assertTrue( date.getYear() == 2006 );
+ assertTrue( date.getMonth() == 5 );
+ assertTrue( date.getDay() == 30 );
+ assertTrue( date.getHour() == 10 );
+ assertTrue( date.getMinute() == 46 );
+ assertTrue( date.getSecond() == 2 );
+ assertTrue( date.getSignOffset() == 0 );
+ assertTrue( date.getHoursOffset() == 0 );
+ assertTrue( date.getMinutesOffset() == 0 );
+ assertTrue(date.getDateAsString().equals( "2006-05-30T10:46:02Z"));
+ }
+
+ public void test_RDFAnnotation_C_parseCVTerms()
+ {
+ SBase obj = m.getCompartment(0);
+ XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
+ assertTrue( node.getNumChildren() == 1 );
+ XMLNode rdf = node.getChild(0);
+ assertTrue(rdf.getName().equals( "RDF"));
+ assertTrue(rdf.getPrefix().equals( "rdf"));
+ assertTrue(rdf.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( rdf.getNumChildren() == 1 );
+ XMLNode desc = rdf.getChild(0);
+ assertTrue(desc.getName().equals( "Description"));
+ assertTrue(desc.getPrefix().equals( "rdf"));
+ assertTrue(desc.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( desc.getNumChildren() == 1 );
+ XMLNode is1 = desc.getChild(0);
+ assertTrue(is1.getName().equals( "is"));
+ assertTrue(is1.getPrefix().equals( "bqbiol"));
+ assertTrue( is1.getNumChildren() == 1 );
+ XMLNode Bag = is1.getChild(0);
+ assertTrue(Bag.getName().equals( "Bag"));
+ assertTrue(Bag.getPrefix().equals( "rdf"));
+ assertTrue(Bag.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( Bag.getNumChildren() == 4 );
+ XMLNode li = Bag.getChild(0);
+ assertTrue(li.getName().equals( "li"));
+ assertTrue(li.getPrefix().equals( "rdf"));
+ assertTrue(li.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( li.getNumChildren() == 0 );
+ XMLNode li1 = Bag.getChild(1);
+ assertTrue(li1.getName().equals( "li"));
+ assertTrue(li1.getPrefix().equals( "rdf"));
+ assertTrue(li1.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( li1.getNumChildren() == 0 );
+ XMLNode li2 = Bag.getChild(2);
+ assertTrue(li2.getName().equals( "li"));
+ assertTrue(li2.getPrefix().equals( "rdf"));
+ assertTrue(li2.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( li2.getNumChildren() == 0 );
+ XMLNode li3 = Bag.getChild(3);
+ assertTrue(li3.getName().equals( "li"));
+ assertTrue(li3.getPrefix().equals( "rdf"));
+ assertTrue(li3.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( li3.getNumChildren() == 0 );
+ node = null;
+ }
+
+ public void test_RDFAnnotation_C_parseModelHistory()
+ {
+ XMLNode node = RDFAnnotationParser.parseModelHistory(m);
+ assertTrue( node.getNumChildren() == 1 );
+ XMLNode rdf = node.getChild(0);
+ assertTrue(rdf.getName().equals( "RDF"));
+ assertTrue(rdf.getPrefix().equals( "rdf"));
+ assertTrue(rdf.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( rdf.getNumChildren() == 1 );
+ XMLNode desc = rdf.getChild(0);
+ assertTrue(desc.getName().equals( "Description"));
+ assertTrue(desc.getPrefix().equals( "rdf"));
+ assertTrue(desc.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( desc.getNumChildren() == 3 );
+ XMLNode creator = desc.getChild(0);
+ assertTrue(creator.getName().equals( "creator"));
+ assertTrue(creator.getPrefix().equals( "dc"));
+ assertTrue(creator.getURI().equals( "http://purl.org/dc/elements/1.1/"));
+ assertTrue( creator.getNumChildren() == 1 );
+ XMLNode Bag = creator.getChild(0);
+ assertTrue(Bag.getName().equals( "Bag"));
+ assertTrue(Bag.getPrefix().equals( "rdf"));
+ assertTrue(Bag.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( Bag.getNumChildren() == 1 );
+ XMLNode li = Bag.getChild(0);
+ assertTrue(li.getName().equals( "li"));
+ assertTrue(li.getPrefix().equals( "rdf"));
+ assertTrue(li.getURI().equals( "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ assertTrue( li.getNumChildren() == 3 );
+ XMLNode N = li.getChild(0);
+ assertTrue(N.getName().equals( "N"));
+ assertTrue(N.getPrefix().equals( "vCard"));
+ assertTrue(N.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
+ assertTrue( N.getNumChildren() == 2 );
+ XMLNode Family = N.getChild(0);
+ assertTrue(Family.getName().equals( "Family"));
+ assertTrue(Family.getPrefix().equals( "vCard"));
+ assertTrue(Family.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
+ assertTrue( Family.getNumChildren() == 1 );
+ XMLNode Given = N.getChild(1);
+ assertTrue(Given.getName().equals( "Given"));
+ assertTrue(Given.getPrefix().equals( "vCard"));
+ assertTrue(Given.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
+ assertTrue( Given.getNumChildren() == 1 );
+ XMLNode EMAIL = li.getChild(1);
+ assertTrue(EMAIL.getName().equals( "EMAIL"));
+ assertTrue(EMAIL.getPrefix().equals( "vCard"));
+ assertTrue(EMAIL.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
+ assertTrue( EMAIL.getNumChildren() == 1 );
+ XMLNode ORG = li.getChild(2);
+ assertTrue(ORG.getName().equals( "ORG"));
+ assertTrue(ORG.getPrefix().equals( "vCard"));
+ assertTrue(ORG.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
+ assertTrue( ORG.getNumChildren() == 1 );
+ XMLNode Orgname = ORG.getChild(0);
+ assertTrue(Orgname.getName().equals( "Orgname"));
+ assertTrue(Orgname.getPrefix().equals( "vCard"));
+ assertTrue(Orgname.getURI().equals( "http://www.w3.org/2001/vcard-rdf/3.0#"));
+ assertTrue( Orgname.getNumChildren() == 1 );
+ XMLNode created = desc.getChild(1);
+ assertTrue(created.getName().equals( "created"));
+ assertTrue(created.getPrefix().equals( "dcterms"));
+ assertTrue(created.getURI().equals( "http://purl.org/dc/terms/"));
+ assertTrue( created.getNumChildren() == 1 );
+ XMLNode cr_date = created.getChild(0);
+ assertTrue(cr_date.getName().equals( "W3CDTF"));
+ assertTrue(cr_date.getPrefix().equals( "dcterms"));
+ assertTrue(cr_date.getURI().equals( "http://purl.org/dc/terms/"));
+ assertTrue( cr_date.getNumChildren() == 1 );
+ XMLNode modified = desc.getChild(2);
+ assertTrue(modified.getName().equals( "modified"));
+ assertTrue(modified.getPrefix().equals( "dcterms"));
+ assertTrue(modified.getURI().equals( "http://purl.org/dc/terms/"));
+ assertTrue( modified.getNumChildren() == 1 );
+ XMLNode mo_date = created.getChild(0);
+ assertTrue(mo_date.getName().equals( "W3CDTF"));
+ assertTrue(mo_date.getPrefix().equals( "dcterms"));
+ assertTrue(mo_date.getURI().equals( "http://purl.org/dc/terms/"));
+ assertTrue( mo_date.getNumChildren() == 1 );
+ node = null;
+ }
+
+ /**
+ * Loads the SWIG-generated libSBML Java module when this class is
+ * loaded, or reports a sensible diagnostic message about why it failed.
+ */
+ static
+ {
+ String varname;
+ String shlibname;
+
+ if (System.getProperty("mrj.version") != null)
+ {
+ varname = "DYLD_LIBRARY_PATH"; // We're on a Mac.
+ shlibname = "libsbmlj.jnilib and/or libsbml.dylib";
+ }
+ else
+ {
+ varname = "LD_LIBRARY_PATH"; // We're not on a Mac.
+ shlibname = "libsbmlj.so and/or libsbml.so";
+ }
+
+ try
+ {
+ System.loadLibrary("sbmlj");
+ // For extra safety, check that the jar file is in the classpath.
+ Class.forName("org.sbml.libsbml.libsbml");
+ }
+ catch (SecurityException e)
+ {
+ e.printStackTrace();
+ System.err.println("Could not load the libSBML library files due to a"+
+ " security exception.\n");
+ System.exit(1);
+ }
+ catch (UnsatisfiedLinkError e)
+ {
+ e.printStackTrace();
+ System.err.println("Error: could not link with the libSBML library files."+
+ " It is likely\nyour " + varname +
+ " environment variable does not include the directories\n"+
+ "containing the " + shlibname + " library files.\n");
+ System.exit(1);
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ System.err.println("Error: unable to load the file libsbmlj.jar."+
+ " It is likely\nyour -classpath option and CLASSPATH" +
+ " environment variable\n"+
+ "do not include the path to libsbmlj.jar.\n");
+ System.exit(1);
+ }
+ }
+}
Modified: trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestValidation.java
===================================================================
--- trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestValidation.java 2011-01-26 15:38:37 UTC (rev 12703)
+++ trunk/libsbml/src/bindings/java/test/org/sbml/libsbml/test/annotation/TestValidation.java 2011-01-26 16:10:23 UTC (rev 12704)
@@ -1,303 +1,320 @@
-/*
- * @file TestValidation.java
- * @brief Validation of Date ModelCreator and ModelHistory unit tests
- *
- * @author Akiya Jouraku (Java conversion)
- * @author Sarah Keating
- *
- * $Id$
- * $HeadURL$
- *
- * ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
- *
- * DO NOT EDIT THIS FILE.
- *
- * This file was generated automatically by converting the file located at
- * src/annotation/test/TestValidation.cpp
- * using the conversion program dev/utilities/translateTests/translateTests.pl.
- * Any changes made here will be lost the next time the file is regenerated.
- *
- * -----------------------------------------------------------------------------
- * This file is part of libSBML. Please visit http://sbml.org for more
- * information about SBML, and the latest version of libSBML.
- *
- * Copyright 2005-2010 California Institute of Technology.
- * Copyright 2002-2005 California Institute of Technology and
- * Japan Science and Technology Corporation.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation. A copy of the license agreement is provided
- * in the file named "LICENSE.txt" included with this software distribution
- * and also available online as http://sbml.org/software/libsbml/license.html
- * -----------------------------------------------------------------------------
- */
-
-package org.sbml.libsbml.test.annotation;
-
-import org.sbml.libsbml.*;
-
-import java.io.File;
-import java.lang.AssertionError;
-
-public class TestValidation {
-
- static void assertTrue(boolean condition) throws AssertionError
- {
- if (condition == true)
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(Object a, Object b) throws AssertionError
- {
- if ( (a == null) && (b == null) )
- {
- return;
- }
- else if ( (a == null) || (b == null) )
- {
- throw new AssertionError();
- }
- else if (a.equals(b))
- {
- return;
- }
-
- throw new AssertionError();
- }
-
- static void assertNotEquals(Object a, Object b) throws AssertionError
- {
- if ( (a == null) && (b == null) )
- {
- throw new AssertionError();
- }
- else if ( (a == null) || (b == null) )
- {
- return;
- }
- else if (a.equals(b))
- {
- throw new AssertionError();
- }
- }
-
- static void assertEquals(boolean a, boolean b) throws AssertionError
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(boolean a, boolean b) throws AssertionError
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(int a, int b) throws AssertionError
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(int a, int b) throws AssertionError
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- public void test_Validation_CVTerm1()
- {
- CVTerm cv = new CVTerm();
- assertTrue( cv != null );
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setQualifierType(libsbml.MODEL_QUALIFIER);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setModelQualifierType(libsbml.BQM_IS);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.addResource("ggg");
- assertEquals( true, (cv.hasRequiredAttributes()) );
- cv = null;
- }
-
- public void test_Validation_CVTerm2()
- {
- CVTerm cv = new CVTerm();
- assertTrue( cv != null );
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setBiologicalQualifierType(libsbml.BQB_IS);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.addResource("ggg");
- assertEquals( true, (cv.hasRequiredAttributes()) );
- cv = null;
- }
-
- public void test_Validation_Date1()
- {
- Date date = new Date(200,12,30,12,15,45,1,2,0);
- assertTrue( date != null );
- assertEquals( false, (date.representsValidDate()) );
- date = null;
- }
-
- public void test_Validation_Date2()
- {
- Date date = new Date(2007,14,30,12,15,45,1,2,0);
- assertTrue( date != null );
- assertEquals( false, (date.representsValidDate()) );
- date = null;
- }
-
- public void test_Validation_Date3()
- {
- Date date = new Date("Jan 12");
- assertTrue( date != null );
- assertEquals( false, (date.representsValidDate()) );
- date = null;
- }
-
- public void test_Validation_Date4()
- {
- Date date = new Date(2007,12,30,12,15,45,1,2,0);
- assertTrue( date != null );
- assertEquals( true, date.representsValidDate() );
- date = null;
- }
-
- public void test_Validation_ModelCreator()
- {
- ModelCreator mc = new ModelCreator();
- assertTrue( mc != null );
- assertEquals( false, (mc.hasRequiredAttributes()) );
- mc.setEmail("k123");
- assertEquals( false, (mc.hasRequiredAttributes()) );
- mc.setFamilyName("Keating");
- assertEquals( false, (mc.hasRequiredAttributes()) );
- mc.setGivenName("Sarah");
- assertEquals( true, mc.hasRequiredAttributes() );
- mc = null;
- }
-
- public void test_Validation_ModelHistory1()
- {
- ModelHistory mh = new ModelHistory();
- assertTrue( mh != null );
- assertEquals( false, (mh.hasRequiredAttributes()) );
- Date date = new Date(2007,12,30,12,15,45,1,2,0);
- mh.setCreatedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh.setModifiedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- ModelCreator mc = new ModelCreator();
- mc.setFamilyName("Keating");
- mc.setGivenName("Sarah");
- mh.addCreator(mc);
- assertEquals( true, mh.hasRequiredAttributes() );
- mh = null;
- }
-
- public void test_Validation_ModelHistory2()
- {
- ModelHistory mh = new ModelHistory();
- assertTrue( mh != null );
- assertEquals( false, (mh.hasRequiredAttributes()) );
- Date date = new Date(200,12,30,12,15,45,1,2,0);
- mh.setCreatedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh.setModifiedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- ModelCreator mc = new ModelCreator();
- mc.setFamilyName("Keating");
- mc.setGivenName("Sarah");
- mh.addCreator(mc);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh = null;
- }
-
- public void test_Validation_ModelHistory3()
- {
- ModelHistory mh = new ModelHistory();
- assertTrue( mh != null );
- assertEquals( false, (mh.hasRequiredAttributes()) );
- Date date = new Date(2007,12,30,12,15,45,1,2,0);
- mh.setCreatedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh.setModifiedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- ModelCreator mc = new ModelCreator();
- mc.setFamilyName("Keating");
- mh.addCreator(mc);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh = null;
- }
-
- /**
- * Loads the SWIG-generated libSBML Java module when this class is
- * loaded, or reports a sensible diagnostic message about why it failed.
- */
- static
- {
- String varname;
- String shlibname;
-
- if (System.getProperty("mrj.version") != null)
- {
- varname = "DYLD_LIBRARY_PATH"; // We're on a Mac.
- shlibname = "libsbmlj.jnilib and/or libsbml.dylib";
- }
- else
- {
- varname = "LD_LIBRARY_PATH"; // We're not on a Mac.
- shlibname = "libsbmlj.so and/or libsbml.so";
- }
-
- try
- {
- System.loadLibrary("sbmlj");
- // For extra safety, check that the jar file is in the classpath.
- Class.forName("org.sbml.libsbml.libsbml");
- }
- catch (SecurityException e)
- {
- e.printStackTrace();
- System.err.println("Could not load the libSBML library files due to a"+
- " security exception.\n");
- System.exit(1);
- }
- catch (UnsatisfiedLinkError e)
- {
- e.printStackTrace();
- System.err.println("Error: could not link with the libSBML library files."+
- " It is likely\nyour " + varname +
- " environment variable does not include the directories\n"+
- "containing the " + shlibname + " library files.\n");
- System.exit(1);
- }
- catch (ClassNotFoundException e)
- {
- e.printStackTrace();
- System.err.println("Error: unable to load the file libsbmlj.jar."+
- " It is likely\nyour -classpath option and CLASSPATH" +
- " environment variable\n"+
- "do not include the path to libsbmlj.jar.\n");
- System.exit(1);
- }
- }
-}
+/*
+ * @file TestValidation.java
+ * @brief Validation of Date ModelCreator and ModelHistory unit tests
+ *
+ * @author Akiya Jouraku (Java conversion)
+ * @author Sarah Keating
+ *
+ * $Id$
+ * $HeadURL$
+ *
+ * ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+ *
+ * DO NOT EDIT THIS FILE.
+ *
+ * This file was generated automatically by converting the file located at
+ * src/annotation/test/TestValidation.cpp
+ * using the conversion program dev/utilities/translateTests/translateTests.pl.
+ * Any changes made here will be lost the next time the file is regenerated.
+ *
+ * -----------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright 2005-2010 California Institute of Technology.
+ * Copyright 2002-2005 California Institute of Technology and
+ * Japan Science and Technology Corporation.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * -----------------------------------------------------------------------------
+ */
+
+package org.sbml.libsbml.test.annotation;
+
+import org.sbml.libsbml.*;
+
+import java.io.File;
+import java.lang.AssertionError;
+
+public class TestValidation {
+
+ static void assertTrue(boolean condition) throws AssertionError
+ {
+ if (condition == true)
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(Object a, Object b) throws AssertionError
+ {
+ if ( (a == null) && (b == null) )
+ {
+ return;
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if (a.equals(b))
+ {
+ return;
+ }
+
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(Object a, Object b) throws AssertionError
+ {
+ if ( (a == null) && (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ return;
+ }
+ else if (a.equals(b))
+ {
+ throw new AssertionError();
+ }
+ }
+
+ static void assertEquals(boolean a, boolean b) throws AssertionError
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(boolean a, boolean b) throws AssertionError
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(int a, int b) throws AssertionError
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(int a, int b) throws AssertionError
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ public void test_Validation_CVTerm1()
+ {
+ CVTerm cv = new CVTerm();
+ assertTrue( cv != null );
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setQualifierType(libsbml.MODEL_QUALIFIER);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setModelQualifierType(libsbml.BQM_IS);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.addResource("ggg");
+ assertEquals( true, (cv.hasRequiredAttributes()) );
+ cv = null;
+ }
+
+ public void test_Validation_CVTerm2()
+ {
+ CVTerm cv = new CVTerm();
+ assertTrue( cv != null );
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setBiologicalQualifierType(libsbml.BQB_IS);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.addResource("ggg");
+ assertEquals( true, (cv.hasRequiredAttributes()) );
+ cv = null;
+ }
+
+ public void test_Validation_Date1()
+ {
+ Date date = new Date(200,12,30,12,15,45,1,2,0);
+ assertTrue( date != null );
+ assertEquals( false, (date.representsValidDate()) );
+ date = null;
+ }
+
+ public void test_Validation_Date2()
+ {
+ Date date = new Date(2007,14,30,12,15,45,1,2,0);
+ assertTrue( date != null );
+ assertEquals( false, (date.representsValidDate()) );
+ date = null;
+ }
+
+ public void test_Validation_Date3()
+ {
+ Date date = new Date("Jan 12");
+ assertTrue( date != null );
+ assertEquals( false, (date.representsValidDate()) );
+ date = null;
+ }
+
+ public void test_Validation_Date4()
+ {
+ Date date = new Date(2007,12,30,12,15,45,1,2,0);
+ assertTrue( date != null );
+ assertEquals( true, date.representsValidDate() );
+ date = null;
+ }
+
+ public void test_Validation_Date_Default()
+ {
+ Date date1 = new Date();
+ Date date2 = new Date("");
+ assertTrue( date1.getYear() == (date2.getYear()) );
+ assertTrue( date1.getMonth() == (date2.getMonth()) );
+ assertTrue( date1.getDay() == (date2.getDay()) );
+ assertTrue( date1.getHour() == (date2.getHour()) );
+ assertTrue( date1.getMinute() == (date2.getMinute()) );
+ assertTrue( date1.getSecond() == (date2.getSecond()) );
+ assertTrue( date1.getSignOffset() == (date2.getSignOffset()) );
+ assertTrue( date1.getHoursOffset() == (date2.getHoursOffset()) );
+ assertTrue( date1.getMinutesOffset() == (date2.getMinutesOffset()) );
+ date1 = null;
+ date2 = null;
+ }
+
+ public void test_Validation_ModelCreator()
+ {
+ ModelCreator mc = new ModelCreator();
+ assertTrue( mc != null );
+ assertEquals( false, (mc.hasRequiredAttributes()) );
+ mc.setEmail("k123");
+ assertEquals( false, (mc.hasRequiredAttributes()) );
+ mc.setFamilyName("Keating");
+ assertEquals( false, (mc.hasRequiredAttributes()) );
+ mc.setGivenName("Sarah");
+ assertEquals( true, mc.hasRequiredAttributes() );
+ mc = null;
+ }
+
+ public void test_Validation_ModelHistory1()
+ {
+ ModelHistory mh = new ModelHistory();
+ assertTrue( mh != null );
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ Date date = new Date(2007,12,30,12,15,45,1,2,0);
+ mh.setCreatedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh.setModifiedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ ModelCreator mc = new ModelCreator();
+ mc.setFamilyName("Keating");
+ mc.setGivenName("Sarah");
+ mh.addCreator(mc);
+ assertEquals( true, mh.hasRequiredAttributes() );
+ mh = null;
+ }
+
+ public void test_Validation_ModelHistory2()
+ {
+ ModelHistory mh = new ModelHistory();
+ assertTrue( mh != null );
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ Date date = new Date(200,12,30,12,15,45,1,2,0);
+ mh.setCreatedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh.setModifiedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ ModelCreator mc = new ModelCreator();
+ mc.setFamilyName("Keating");
+ mc.setGivenName("Sarah");
+ mh.addCreator(mc);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh = null;
+ }
+
+ public void test_Validation_ModelHistory3()
+ {
+ ModelHistory mh = new ModelHistory();
+ assertTrue( mh != null );
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ Date date = new Date(2007,12,30,12,15,45,1,2,0);
+ mh.setCreatedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh.setModifiedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ ModelCreator mc = new ModelCreator();
+ mc.setFamilyName("Keating");
+ mh.addCreator(mc);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh = null;
+ }
+
+ /**
+ * Loads the SWIG-generated libSBML Java module when this class is
+ * loaded, or reports a sensible diagnostic message about why it failed.
+ */
+ static
+ {
+ String varname;
+ String shlibname;
+
+ if (System.getProperty("mrj.version") != null)
+ {
+ varname = "DYLD_LIBRARY_PATH"; // We're on a Mac.
+ shlibname = "libsbmlj.jnilib and/or libsbml.dylib";
+ }
+ else
+ {
+ varname = "LD_LIBRARY_PATH"; // We're not on a Mac.
+ shlibname = "libsbmlj.so and/or libsbml.so";
+ }
+
+ try
+ {
+ System.loadLibrary("sbmlj");
+ // For extra safety, check that the jar file is in the classpath.
+ Class.forName("org.sbml.libsbml.libsbml");
+ }
+ catch (SecurityException e)
+ {
+ e.printStackTrace();
+ System.err.println("Could not load the libSBML library files due to a"+
+ " security exception.\n");
+ System.exit(1);
+ }
+ catch (UnsatisfiedLinkError e)
+ {
+ e.printStackTrace();
+ System.err.println("Error: could not link with the libSBML library files."+
+ " It is likely\nyour " + varname +
+ " environment variable does not include the directories\n"+
+ "containing the " + shlibname + " library files.\n");
+ System.exit(1);
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ System.err.println("Error: unable to load the file libsbmlj.jar."+
+ " It is likely\nyour -classpath option and CLASSPATH" +
+ " environment variable\n"+
+ "do not include the path to libsbmlj.jar.\n");
+ System.exit(1);
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-26 15:38:43
|
Revision: 12703
http://sbml.svn.sourceforge.net/sbml/?rev=12703&view=rev
Author: sarahkeating
Date: 2011-01-26 15:38:37 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
updated for new test in annotation/test directory
Modified Paths:
--------------
trunk/libsbml/dev/utilities/translateTests/translateTests.pl
Modified: trunk/libsbml/dev/utilities/translateTests/translateTests.pl
===================================================================
--- trunk/libsbml/dev/utilities/translateTests/translateTests.pl 2011-01-26 15:37:25 UTC (rev 12702)
+++ trunk/libsbml/dev/utilities/translateTests/translateTests.pl 2011-01-26 15:38:37 UTC (rev 12703)
@@ -26,7 +26,7 @@
(my $myname = $0) =~ s,.*[\/\\],,;
my $usage = <<EOF;
-Usage: $myname [-d output_dir] [-h] [-r|-p|-j|-c] ctest_file [ ctest_file2 ... ]
+Usage: $myname [-o output_dir] [-h] [-r|-p|-j|-c] ctest_file [ ctest_file2 ... ]
-r : Converts given C/C++ test files into Ruby scripts (*Default*)
-p : Converts given C/C++ test files into Python scripts
-j : Converts given C/C++ test files into Java files
@@ -138,6 +138,7 @@
addFormulaUnitsData => 0,
getInternalId => 0,
setInternalId => 0,
+ parseRDFAnnotationWithModelHistory => 0,
);
my %IgnoreTestFunc = (
@@ -180,9 +181,13 @@
test_Date_setHoursOffset_neg_arg => 0,
test_Date_setOffsetSign => 0,
test_Date_ConstructorException => 0,
+ test_Date_accessWithNULL => 0,
test_ModelCreator_ConstructorException => 0,
+ test_ModelCreator_accessWithNULL => 0,
test_ModelHistory_ConstructorException => 0,
+ test_ModelHistory_accessWithNULL => 0,
test_CVTerm_ConstructorException => 0,
+ test_CVTerm_accessWithNULL => 0,
test_Model_copyConstructor => 0,
test_Model_assignmentOperator => 0,
test_Model_clone => 0,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2011-01-26 15:37:32
|
Revision: 12702
http://sbml.svn.sourceforge.net/sbml/?rev=12702&view=rev
Author: sarahkeating
Date: 2011-01-26 15:37:25 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
updated tests in line with current annotation/test directory
Modified Paths:
--------------
trunk/libsbml/src/bindings/csharp/test/annotation/TestRDFAnnotationC.cs
trunk/libsbml/src/bindings/csharp/test/annotation/TestValidation.cs
Modified: trunk/libsbml/src/bindings/csharp/test/annotation/TestRDFAnnotationC.cs
===================================================================
--- trunk/libsbml/src/bindings/csharp/test/annotation/TestRDFAnnotationC.cs 2011-01-26 07:30:37 UTC (rev 12701)
+++ trunk/libsbml/src/bindings/csharp/test/annotation/TestRDFAnnotationC.cs 2011-01-26 15:37:25 UTC (rev 12702)
@@ -1,321 +1,331 @@
-/// @file TestRDFAnnotationC.cs
-/// @brief RDFAnnotation parser unit tests
-/// @author Frank Bergmann (Csharp conversion)
-/// @author Akiya Jouraku (Csharp conversion)
-/// @author Sarah Keating
-///
-/// $Id$
-/// $HeadURL$
-///
-/// ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
-///
-/// DO NOT EDIT THIS FILE.
-///
-/// This file was generated automatically by converting the file located at
-/// src/annotation/test/TestRDFAnnotationC.c
-/// using the conversion program dev/utilities/translateTests/translateTests.pl.
-/// Any changes made here will be lost the next time the file is regenerated.
-///
-/// -----------------------------------------------------------------------------
-/// This file is part of libSBML. Please visit http://sbml.org for more
-/// information about SBML, and the latest version of libSBML.
-///
-/// Copyright 2005-2010 California Institute of Technology.
-/// Copyright 2002-2005 California Institute of Technology and
-/// Japan Science and Technology Corporation.
-///
-/// This library is free software; you can redistribute it and/or modify it
-/// under the terms of the GNU Lesser General Public License as published by
-/// the Free Software Foundation. A copy of the license agreement is provided
-/// in the file named "LICENSE.txt" included with this software distribution
-/// and also available online as http://sbml.org/software/libsbml/license.html
-/// -----------------------------------------------------------------------------
-
-
-namespace LibSBMLCSTest {
-
- using libsbml;
-
- using System;
-
- using System.IO;
-
- public class TestRDFAnnotationC {
- public class AssertionError : System.Exception
- {
- public AssertionError() : base()
- {
-
- }
- }
-
-
- static void assertTrue(bool condition)
- {
- if (condition == true)
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(object a, object b)
- {
- if ( (a == null) && (b == null) )
- {
- return;
- }
- else if ( (a == null) || (b == null) )
- {
- throw new AssertionError();
- }
- else if (a.Equals(b))
- {
- return;
- }
-
- throw new AssertionError();
- }
-
- static void assertNotEquals(object a, object b)
- {
- if ( (a == null) && (b == null) )
- {
- throw new AssertionError();
- }
- else if ( (a == null) || (b == null) )
- {
- return;
- }
- else if (a.Equals(b))
- {
- throw new AssertionError();
- }
- }
-
- static void assertEquals(bool a, bool b)
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(bool a, bool b)
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(int a, int b)
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(int a, int b)
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- private SBMLDocument d;
- private Model m;
-
- public void setUp()
- {
- string filename = "../../annotation/test/test-data/annotation.xml";
- d = libsbml.readSBML(filename);
- m = d.getModel();
- }
-
- public void tearDown()
- {
- d = null;
- }
-
- public void test_RDFAnnotation_C_delete()
- {
- SBase obj = m.getCompartment(0);
- XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
- XMLNode n1 = RDFAnnotationParser.deleteRDFAnnotation(node);
- assertTrue( n1.getNumChildren() == 0 );
- assertTrue(( "annotation" == n1.getName() ));
- node = null;
- }
-
- public void test_RDFAnnotation_C_getModelHistory()
- {
- assertTrue( ! (m == null) );
- ModelHistory history = m.getModelHistory();
- assertTrue( history != null );
- ModelCreator mc = history.getCreator(0);
- assertTrue(( "Le Novere" == mc.getFamilyName() ));
- assertTrue(( "Nicolas" == mc.getGivenName() ));
- assertTrue(( "le...@eb..." == mc.getEmail() ));
- assertTrue(( "EMBL-EBI" == mc.getOrganisation() ));
- Date date = history.getCreatedDate();
- assertTrue( date.getYear() == 2005 );
- assertTrue( date.getMonth() == 2 );
- assertTrue( date.getDay() == 2 );
- assertTrue( date.getHour() == 14 );
- assertTrue( date.getMinute() == 56 );
- assertTrue( date.getSecond() == 11 );
- assertTrue( date.getSignOffset() == 0 );
- assertTrue( date.getHoursOffset() == 0 );
- assertTrue( date.getMinutesOffset() == 0 );
- assertTrue(( "2005-02-02T14:56:11Z" == date.getDateAsString() ));
- date = history.getModifiedDate();
- assertTrue( date.getYear() == 2006 );
- assertTrue( date.getMonth() == 5 );
- assertTrue( date.getDay() == 30 );
- assertTrue( date.getHour() == 10 );
- assertTrue( date.getMinute() == 46 );
- assertTrue( date.getSecond() == 2 );
- assertTrue( date.getSignOffset() == 0 );
- assertTrue( date.getHoursOffset() == 0 );
- assertTrue( date.getMinutesOffset() == 0 );
- assertTrue(( "2006-05-30T10:46:02Z" == date.getDateAsString() ));
- }
-
- public void test_RDFAnnotation_C_parseCVTerms()
- {
- SBase obj = m.getCompartment(0);
- XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
- assertTrue( node.getNumChildren() == 1 );
- XMLNode rdf = node.getChild(0);
- assertTrue(( "RDF" == rdf.getName() ));
- assertTrue(( "rdf" == rdf.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ));
- assertTrue( rdf.getNumChildren() == 1 );
- XMLNode desc = rdf.getChild(0);
- assertTrue(( "Description" == desc.getName() ));
- assertTrue(( "rdf" == desc.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ));
- assertTrue( desc.getNumChildren() == 1 );
- XMLNode is1 = desc.getChild(0);
- assertTrue(( "is" == is1.getName() ));
- assertTrue(( "bqbiol" == is1.getPrefix() ));
- assertTrue( is1.getNumChildren() == 1 );
- XMLNode Bag = is1.getChild(0);
- assertTrue(( "Bag" == Bag.getName() ));
- assertTrue(( "rdf" == Bag.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ));
- assertTrue( Bag.getNumChildren() == 4 );
- XMLNode li = Bag.getChild(0);
- assertTrue(( "li" == li.getName() ));
- assertTrue(( "rdf" == li.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ));
- assertTrue( li.getNumChildren() == 0 );
- XMLNode li1 = Bag.getChild(1);
- assertTrue(( "li" == li1.getName() ));
- assertTrue(( "rdf" == li1.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ));
- assertTrue( li1.getNumChildren() == 0 );
- XMLNode li2 = Bag.getChild(2);
- assertTrue(( "li" == li2.getName() ));
- assertTrue(( "rdf" == li2.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ));
- assertTrue( li2.getNumChildren() == 0 );
- XMLNode li3 = Bag.getChild(3);
- assertTrue(( "li" == li3.getName() ));
- assertTrue(( "rdf" == li3.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ));
- assertTrue( li3.getNumChildren() == 0 );
- node = null;
- }
-
- public void test_RDFAnnotation_C_parseModelHistory()
- {
- XMLNode node = RDFAnnotationParser.parseModelHistory(m);
- assertTrue( node.getNumChildren() == 1 );
- XMLNode rdf = node.getChild(0);
- assertTrue(( "RDF" == rdf.getName() ));
- assertTrue(( "rdf" == rdf.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ));
- assertTrue( rdf.getNumChildren() == 1 );
- XMLNode desc = rdf.getChild(0);
- assertTrue(( "Description" == desc.getName() ));
- assertTrue(( "rdf" == desc.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ));
- assertTrue( desc.getNumChildren() == 3 );
- XMLNode creator = desc.getChild(0);
- assertTrue(( "creator" == creator.getName() ));
- assertTrue(( "dc" == creator.getPrefix() ));
- assertTrue(( "http://purl.org/dc/elements/1.1/" == creator.getURI() ));
- assertTrue( creator.getNumChildren() == 1 );
- XMLNode Bag = creator.getChild(0);
- assertTrue(( "Bag" == Bag.getName() ));
- assertTrue(( "rdf" == Bag.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ));
- assertTrue( Bag.getNumChildren() == 1 );
- XMLNode li = Bag.getChild(0);
- assertTrue(( "li" == li.getName() ));
- assertTrue(( "rdf" == li.getPrefix() ));
- assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ));
- assertTrue( li.getNumChildren() == 3 );
- XMLNode N = li.getChild(0);
- assertTrue(( "N" == N.getName() ));
- assertTrue(( "vCard" == N.getPrefix() ));
- assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == N.getURI() ));
- assertTrue( N.getNumChildren() == 2 );
- XMLNode Family = N.getChild(0);
- assertTrue(( "Family" == Family.getName() ));
- assertTrue(( "vCard" == Family.getPrefix() ));
- assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Family.getURI() ));
- assertTrue( Family.getNumChildren() == 1 );
- XMLNode Given = N.getChild(1);
- assertTrue(( "Given" == Given.getName() ));
- assertTrue(( "vCard" == Given.getPrefix() ));
- assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Given.getURI() ));
- assertTrue( Given.getNumChildren() == 1 );
- XMLNode EMAIL = li.getChild(1);
- assertTrue(( "EMAIL" == EMAIL.getName() ));
- assertTrue(( "vCard" == EMAIL.getPrefix() ));
- assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == EMAIL.getURI() ));
- assertTrue( EMAIL.getNumChildren() == 1 );
- XMLNode ORG = li.getChild(2);
- assertTrue(( "ORG" == ORG.getName() ));
- assertTrue(( "vCard" == ORG.getPrefix() ));
- assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == ORG.getURI() ));
- assertTrue( ORG.getNumChildren() == 1 );
- XMLNode Orgname = ORG.getChild(0);
- assertTrue(( "Orgname" == Orgname.getName() ));
- assertTrue(( "vCard" == Orgname.getPrefix() ));
- assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Orgname.getURI() ));
- assertTrue( Orgname.getNumChildren() == 1 );
- XMLNode created = desc.getChild(1);
- assertTrue(( "created" == created.getName() ));
- assertTrue(( "dcterms" == created.getPrefix() ));
- assertTrue(( "http://purl.org/dc/terms/" == created.getURI() ));
- assertTrue( created.getNumChildren() == 1 );
- XMLNode cr_date = created.getChild(0);
- assertTrue(( "W3CDTF" == cr_date.getName() ));
- assertTrue(( "dcterms" == cr_date.getPrefix() ));
- assertTrue(( "http://purl.org/dc/terms/" == cr_date.getURI() ));
- assertTrue( cr_date.getNumChildren() == 1 );
- XMLNode modified = desc.getChild(2);
- assertTrue(( "modified" == modified.getName() ));
- assertTrue(( "dcterms" == modified.getPrefix() ));
- assertTrue(( "http://purl.org/dc/terms/" == modified.getURI() ));
- assertTrue( modified.getNumChildren() == 1 );
- XMLNode mo_date = created.getChild(0);
- assertTrue(( "W3CDTF" == mo_date.getName() ));
- assertTrue(( "dcterms" == mo_date.getPrefix() ));
- assertTrue(( "http://purl.org/dc/terms/" == mo_date.getURI() ));
- assertTrue( mo_date.getNumChildren() == 1 );
- node = null;
- }
-
- }
-}
+/// @file TestRDFAnnotationC.cs
+/// @brief RDFAnnotation parser unit tests
+/// @author Frank Bergmann (Csharp conversion)
+/// @author Akiya Jouraku (Csharp conversion)
+/// @author Sarah Keating
+///
+/// $Id$
+/// $HeadURL$
+///
+/// ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+///
+/// DO NOT EDIT THIS FILE.
+///
+/// This file was generated automatically by converting the file located at
+/// src/annotation/test/TestRDFAnnotationC.c
+/// using the conversion program dev/utilities/translateTests/translateTests.pl.
+/// Any changes made here will be lost the next time the file is regenerated.
+///
+/// -----------------------------------------------------------------------------
+/// This file is part of libSBML. Please visit http://sbml.org for more
+/// information about SBML, and the latest version of libSBML.
+///
+/// Copyright 2005-2010 California Institute of Technology.
+/// Copyright 2002-2005 California Institute of Technology and
+/// Japan Science and Technology Corporation.
+///
+/// This library is free software; you can redistribute it and/or modify it
+/// under the terms of the GNU Lesser General Public License as published by
+/// the Free Software Foundation. A copy of the license agreement is provided
+/// in the file named "LICENSE.txt" included with this software distribution
+/// and also available online as http://sbml.org/software/libsbml/license.html
+/// -----------------------------------------------------------------------------
+
+
+namespace LibSBMLCSTest {
+
+ using libsbml;
+
+ using System;
+
+ using System.IO;
+
+ public class TestRDFAnnotationC {
+ public class AssertionError : System.Exception
+ {
+ public AssertionError() : base()
+ {
+
+ }
+ }
+
+
+ static void assertTrue(bool condition)
+ {
+ if (condition == true)
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(object a, object b)
+ {
+ if ( (a == null) && (b == null) )
+ {
+ return;
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if (a.Equals(b))
+ {
+ return;
+ }
+
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(object a, object b)
+ {
+ if ( (a == null) && (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ return;
+ }
+ else if (a.Equals(b))
+ {
+ throw new AssertionError();
+ }
+ }
+
+ static void assertEquals(bool a, bool b)
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(bool a, bool b)
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(int a, int b)
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(int a, int b)
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ private SBMLDocument d;
+ private Model m;
+
+ public void setUp()
+ {
+ string filename = "../../annotation/test/test-data/annotation.xml";
+ d = libsbml.readSBML(filename);
+ m = d.getModel();
+ }
+
+ public void tearDown()
+ {
+ d = null;
+ }
+
+ public void test_RDFAnnotation_C_accessWithNULL()
+ {
+ assertTrue( RDFAnnotationParser.createCVTerms(null) == null );
+ assertTrue( RDFAnnotationParser.createRDFDescription(null) == null );
+ assertTrue( RDFAnnotationParser.deleteRDFAnnotation(null) == null );
+ assertTrue( RDFAnnotationParser.parseCVTerms(null) == null );
+ assertTrue( RDFAnnotationParser.parseModelHistory(null) == null );
+ RDFAnnotationParser.parseRDFAnnotation(null,null);
+ }
+
+ public void test_RDFAnnotation_C_delete()
+ {
+ SBase obj = m.getCompartment(0);
+ XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
+ XMLNode n1 = RDFAnnotationParser.deleteRDFAnnotation(node);
+ assertTrue( n1.getNumChildren() == 0 );
+ assertTrue(( "annotation" == n1.getName() ));
+ node = null;
+ }
+
+ public void test_RDFAnnotation_C_getModelHistory()
+ {
+ assertTrue( ! (m == null) );
+ ModelHistory history = m.getModelHistory();
+ assertTrue( history != null );
+ ModelCreator mc = history.getCreator(0);
+ assertTrue(( "Le Novere" == mc.getFamilyName() ));
+ assertTrue(( "Nicolas" == mc.getGivenName() ));
+ assertTrue(( "le...@eb..." == mc.getEmail() ));
+ assertTrue(( "EMBL-EBI" == mc.getOrganisation() ));
+ Date date = history.getCreatedDate();
+ assertTrue( date.getYear() == 2005 );
+ assertTrue( date.getMonth() == 2 );
+ assertTrue( date.getDay() == 2 );
+ assertTrue( date.getHour() == 14 );
+ assertTrue( date.getMinute() == 56 );
+ assertTrue( date.getSecond() == 11 );
+ assertTrue( date.getSignOffset() == 0 );
+ assertTrue( date.getHoursOffset() == 0 );
+ assertTrue( date.getMinutesOffset() == 0 );
+ assertTrue(( "2005-02-02T14:56:11Z" == date.getDateAsString() ));
+ date = history.getModifiedDate();
+ assertTrue( date.getYear() == 2006 );
+ assertTrue( date.getMonth() == 5 );
+ assertTrue( date.getDay() == 30 );
+ assertTrue( date.getHour() == 10 );
+ assertTrue( date.getMinute() == 46 );
+ assertTrue( date.getSecond() == 2 );
+ assertTrue( date.getSignOffset() == 0 );
+ assertTrue( date.getHoursOffset() == 0 );
+ assertTrue( date.getMinutesOffset() == 0 );
+ assertTrue(( "2006-05-30T10:46:02Z" == date.getDateAsString() ));
+ }
+
+ public void test_RDFAnnotation_C_parseCVTerms()
+ {
+ SBase obj = m.getCompartment(0);
+ XMLNode node = RDFAnnotationParser.parseCVTerms(obj);
+ assertTrue( node.getNumChildren() == 1 );
+ XMLNode rdf = node.getChild(0);
+ assertTrue(( "RDF" == rdf.getName() ));
+ assertTrue(( "rdf" == rdf.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ));
+ assertTrue( rdf.getNumChildren() == 1 );
+ XMLNode desc = rdf.getChild(0);
+ assertTrue(( "Description" == desc.getName() ));
+ assertTrue(( "rdf" == desc.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ));
+ assertTrue( desc.getNumChildren() == 1 );
+ XMLNode is1 = desc.getChild(0);
+ assertTrue(( "is" == is1.getName() ));
+ assertTrue(( "bqbiol" == is1.getPrefix() ));
+ assertTrue( is1.getNumChildren() == 1 );
+ XMLNode Bag = is1.getChild(0);
+ assertTrue(( "Bag" == Bag.getName() ));
+ assertTrue(( "rdf" == Bag.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ));
+ assertTrue( Bag.getNumChildren() == 4 );
+ XMLNode li = Bag.getChild(0);
+ assertTrue(( "li" == li.getName() ));
+ assertTrue(( "rdf" == li.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ));
+ assertTrue( li.getNumChildren() == 0 );
+ XMLNode li1 = Bag.getChild(1);
+ assertTrue(( "li" == li1.getName() ));
+ assertTrue(( "rdf" == li1.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ));
+ assertTrue( li1.getNumChildren() == 0 );
+ XMLNode li2 = Bag.getChild(2);
+ assertTrue(( "li" == li2.getName() ));
+ assertTrue(( "rdf" == li2.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ));
+ assertTrue( li2.getNumChildren() == 0 );
+ XMLNode li3 = Bag.getChild(3);
+ assertTrue(( "li" == li3.getName() ));
+ assertTrue(( "rdf" == li3.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ));
+ assertTrue( li3.getNumChildren() == 0 );
+ node = null;
+ }
+
+ public void test_RDFAnnotation_C_parseModelHistory()
+ {
+ XMLNode node = RDFAnnotationParser.parseModelHistory(m);
+ assertTrue( node.getNumChildren() == 1 );
+ XMLNode rdf = node.getChild(0);
+ assertTrue(( "RDF" == rdf.getName() ));
+ assertTrue(( "rdf" == rdf.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ));
+ assertTrue( rdf.getNumChildren() == 1 );
+ XMLNode desc = rdf.getChild(0);
+ assertTrue(( "Description" == desc.getName() ));
+ assertTrue(( "rdf" == desc.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ));
+ assertTrue( desc.getNumChildren() == 3 );
+ XMLNode creator = desc.getChild(0);
+ assertTrue(( "creator" == creator.getName() ));
+ assertTrue(( "dc" == creator.getPrefix() ));
+ assertTrue(( "http://purl.org/dc/elements/1.1/" == creator.getURI() ));
+ assertTrue( creator.getNumChildren() == 1 );
+ XMLNode Bag = creator.getChild(0);
+ assertTrue(( "Bag" == Bag.getName() ));
+ assertTrue(( "rdf" == Bag.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ));
+ assertTrue( Bag.getNumChildren() == 1 );
+ XMLNode li = Bag.getChild(0);
+ assertTrue(( "li" == li.getName() ));
+ assertTrue(( "rdf" == li.getPrefix() ));
+ assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ));
+ assertTrue( li.getNumChildren() == 3 );
+ XMLNode N = li.getChild(0);
+ assertTrue(( "N" == N.getName() ));
+ assertTrue(( "vCard" == N.getPrefix() ));
+ assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == N.getURI() ));
+ assertTrue( N.getNumChildren() == 2 );
+ XMLNode Family = N.getChild(0);
+ assertTrue(( "Family" == Family.getName() ));
+ assertTrue(( "vCard" == Family.getPrefix() ));
+ assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Family.getURI() ));
+ assertTrue( Family.getNumChildren() == 1 );
+ XMLNode Given = N.getChild(1);
+ assertTrue(( "Given" == Given.getName() ));
+ assertTrue(( "vCard" == Given.getPrefix() ));
+ assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Given.getURI() ));
+ assertTrue( Given.getNumChildren() == 1 );
+ XMLNode EMAIL = li.getChild(1);
+ assertTrue(( "EMAIL" == EMAIL.getName() ));
+ assertTrue(( "vCard" == EMAIL.getPrefix() ));
+ assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == EMAIL.getURI() ));
+ assertTrue( EMAIL.getNumChildren() == 1 );
+ XMLNode ORG = li.getChild(2);
+ assertTrue(( "ORG" == ORG.getName() ));
+ assertTrue(( "vCard" == ORG.getPrefix() ));
+ assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == ORG.getURI() ));
+ assertTrue( ORG.getNumChildren() == 1 );
+ XMLNode Orgname = ORG.getChild(0);
+ assertTrue(( "Orgname" == Orgname.getName() ));
+ assertTrue(( "vCard" == Orgname.getPrefix() ));
+ assertTrue(( "http://www.w3.org/2001/vcard-rdf/3.0#" == Orgname.getURI() ));
+ assertTrue( Orgname.getNumChildren() == 1 );
+ XMLNode created = desc.getChild(1);
+ assertTrue(( "created" == created.getName() ));
+ assertTrue(( "dcterms" == created.getPrefix() ));
+ assertTrue(( "http://purl.org/dc/terms/" == created.getURI() ));
+ assertTrue( created.getNumChildren() == 1 );
+ XMLNode cr_date = created.getChild(0);
+ assertTrue(( "W3CDTF" == cr_date.getName() ));
+ assertTrue(( "dcterms" == cr_date.getPrefix() ));
+ assertTrue(( "http://purl.org/dc/terms/" == cr_date.getURI() ));
+ assertTrue( cr_date.getNumChildren() == 1 );
+ XMLNode modified = desc.getChild(2);
+ assertTrue(( "modified" == modified.getName() ));
+ assertTrue(( "dcterms" == modified.getPrefix() ));
+ assertTrue(( "http://purl.org/dc/terms/" == modified.getURI() ));
+ assertTrue( modified.getNumChildren() == 1 );
+ XMLNode mo_date = created.getChild(0);
+ assertTrue(( "W3CDTF" == mo_date.getName() ));
+ assertTrue(( "dcterms" == mo_date.getPrefix() ));
+ assertTrue(( "http://purl.org/dc/terms/" == mo_date.getURI() ));
+ assertTrue( mo_date.getNumChildren() == 1 );
+ node = null;
+ }
+
+ }
+}
Modified: trunk/libsbml/src/bindings/csharp/test/annotation/TestValidation.cs
===================================================================
--- trunk/libsbml/src/bindings/csharp/test/annotation/TestValidation.cs 2011-01-26 07:30:37 UTC (rev 12701)
+++ trunk/libsbml/src/bindings/csharp/test/annotation/TestValidation.cs 2011-01-26 15:37:25 UTC (rev 12702)
@@ -1,261 +1,278 @@
-/// @file TestValidation.cs
-/// @brief Validation of Date ModelCreator and ModelHistory unit tests
-/// @author Frank Bergmann (Csharp conversion)
-/// @author Akiya Jouraku (Csharp conversion)
-/// @author Sarah Keating
-///
-/// $Id$
-/// $HeadURL$
-///
-/// ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
-///
-/// DO NOT EDIT THIS FILE.
-///
-/// This file was generated automatically by converting the file located at
-/// src/annotation/test/TestValidation.cpp
-/// using the conversion program dev/utilities/translateTests/translateTests.pl.
-/// Any changes made here will be lost the next time the file is regenerated.
-///
-/// -----------------------------------------------------------------------------
-/// This file is part of libSBML. Please visit http://sbml.org for more
-/// information about SBML, and the latest version of libSBML.
-///
-/// Copyright 2005-2010 California Institute of Technology.
-/// Copyright 2002-2005 California Institute of Technology and
-/// Japan Science and Technology Corporation.
-///
-/// This library is free software; you can redistribute it and/or modify it
-/// under the terms of the GNU Lesser General Public License as published by
-/// the Free Software Foundation. A copy of the license agreement is provided
-/// in the file named "LICENSE.txt" included with this software distribution
-/// and also available online as http://sbml.org/software/libsbml/license.html
-/// -----------------------------------------------------------------------------
-
-
-namespace LibSBMLCSTest {
-
- using libsbml;
-
- using System;
-
- using System.IO;
-
- public class TestValidation {
- public class AssertionError : System.Exception
- {
- public AssertionError() : base()
- {
-
- }
- }
-
-
- static void assertTrue(bool condition)
- {
- if (condition == true)
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(object a, object b)
- {
- if ( (a == null) && (b == null) )
- {
- return;
- }
- else if ( (a == null) || (b == null) )
- {
- throw new AssertionError();
- }
- else if (a.Equals(b))
- {
- return;
- }
-
- throw new AssertionError();
- }
-
- static void assertNotEquals(object a, object b)
- {
- if ( (a == null) && (b == null) )
- {
- throw new AssertionError();
- }
- else if ( (a == null) || (b == null) )
- {
- return;
- }
- else if (a.Equals(b))
- {
- throw new AssertionError();
- }
- }
-
- static void assertEquals(bool a, bool b)
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(bool a, bool b)
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertEquals(int a, int b)
- {
- if ( a == b )
- {
- return;
- }
- throw new AssertionError();
- }
-
- static void assertNotEquals(int a, int b)
- {
- if ( a != b )
- {
- return;
- }
- throw new AssertionError();
- }
-
-
- public void test_Validation_CVTerm1()
- {
- CVTerm cv = new CVTerm();
- assertTrue( cv != null );
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setQualifierType(libsbml.MODEL_QUALIFIER);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setModelQualifierType(libsbml.BQM_IS);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.addResource("ggg");
- assertEquals( true, (cv.hasRequiredAttributes()) );
- cv = null;
- }
-
- public void test_Validation_CVTerm2()
- {
- CVTerm cv = new CVTerm();
- assertTrue( cv != null );
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.setBiologicalQualifierType(libsbml.BQB_IS);
- assertEquals( false, (cv.hasRequiredAttributes()) );
- cv.addResource("ggg");
- assertEquals( true, (cv.hasRequiredAttributes()) );
- cv = null;
- }
-
- public void test_Validation_Date1()
- {
- Date date = new Date(200,12,30,12,15,45,1,2,0);
- assertTrue( date != null );
- assertEquals( false, (date.representsValidDate()) );
- date = null;
- }
-
- public void test_Validation_Date2()
- {
- Date date = new Date(2007,14,30,12,15,45,1,2,0);
- assertTrue( date != null );
- assertEquals( false, (date.representsValidDate()) );
- date = null;
- }
-
- public void test_Validation_Date3()
- {
- Date date = new Date("Jan 12");
- assertTrue( date != null );
- assertEquals( false, (date.representsValidDate()) );
- date = null;
- }
-
- public void test_Validation_Date4()
- {
- Date date = new Date(2007,12,30,12,15,45,1,2,0);
- assertTrue( date != null );
- assertEquals( true, date.representsValidDate() );
- date = null;
- }
-
- public void test_Validation_ModelCreator()
- {
- ModelCreator mc = new ModelCreator();
- assertTrue( mc != null );
- assertEquals( false, (mc.hasRequiredAttributes()) );
- mc.setEmail("k123");
- assertEquals( false, (mc.hasRequiredAttributes()) );
- mc.setFamilyName("Keating");
- assertEquals( false, (mc.hasRequiredAttributes()) );
- mc.setGivenName("Sarah");
- assertEquals( true, mc.hasRequiredAttributes() );
- mc = null;
- }
-
- public void test_Validation_ModelHistory1()
- {
- ModelHistory mh = new ModelHistory();
- assertTrue( mh != null );
- assertEquals( false, (mh.hasRequiredAttributes()) );
- Date date = new Date(2007,12,30,12,15,45,1,2,0);
- mh.setCreatedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh.setModifiedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- ModelCreator mc = new ModelCreator();
- mc.setFamilyName("Keating");
- mc.setGivenName("Sarah");
- mh.addCreator(mc);
- assertEquals( true, mh.hasRequiredAttributes() );
- mh = null;
- }
-
- public void test_Validation_ModelHistory2()
- {
- ModelHistory mh = new ModelHistory();
- assertTrue( mh != null );
- assertEquals( false, (mh.hasRequiredAttributes()) );
- Date date = new Date(200,12,30,12,15,45,1,2,0);
- mh.setCreatedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh.setModifiedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- ModelCreator mc = new ModelCreator();
- mc.setFamilyName("Keating");
- mc.setGivenName("Sarah");
- mh.addCreator(mc);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh = null;
- }
-
- public void test_Validation_ModelHistory3()
- {
- ModelHistory mh = new ModelHistory();
- assertTrue( mh != null );
- assertEquals( false, (mh.hasRequiredAttributes()) );
- Date date = new Date(2007,12,30,12,15,45,1,2,0);
- mh.setCreatedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh.setModifiedDate(date);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- ModelCreator mc = new ModelCreator();
- mc.setFamilyName("Keating");
- mh.addCreator(mc);
- assertEquals( false, (mh.hasRequiredAttributes()) );
- mh = null;
- }
-
- }
-}
+/// @file TestValidation.cs
+/// @brief Validation of Date ModelCreator and ModelHistory unit tests
+/// @author Frank Bergmann (Csharp conversion)
+/// @author Akiya Jouraku (Csharp conversion)
+/// @author Sarah Keating
+///
+/// $Id$
+/// $HeadURL$
+///
+/// ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
+///
+/// DO NOT EDIT THIS FILE.
+///
+/// This file was generated automatically by converting the file located at
+/// src/annotation/test/TestValidation.cpp
+/// using the conversion program dev/utilities/translateTests/translateTests.pl.
+/// Any changes made here will be lost the next time the file is regenerated.
+///
+/// -----------------------------------------------------------------------------
+/// This file is part of libSBML. Please visit http://sbml.org for more
+/// information about SBML, and the latest version of libSBML.
+///
+/// Copyright 2005-2010 California Institute of Technology.
+/// Copyright 2002-2005 California Institute of Technology and
+/// Japan Science and Technology Corporation.
+///
+/// This library is free software; you can redistribute it and/or modify it
+/// under the terms of the GNU Lesser General Public License as published by
+/// the Free Software Foundation. A copy of the license agreement is provided
+/// in the file named "LICENSE.txt" included with this software distribution
+/// and also available online as http://sbml.org/software/libsbml/license.html
+/// -----------------------------------------------------------------------------
+
+
+namespace LibSBMLCSTest {
+
+ using libsbml;
+
+ using System;
+
+ using System.IO;
+
+ public class TestValidation {
+ public class AssertionError : System.Exception
+ {
+ public AssertionError() : base()
+ {
+
+ }
+ }
+
+
+ static void assertTrue(bool condition)
+ {
+ if (condition == true)
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(object a, object b)
+ {
+ if ( (a == null) && (b == null) )
+ {
+ return;
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if (a.Equals(b))
+ {
+ return;
+ }
+
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(object a, object b)
+ {
+ if ( (a == null) && (b == null) )
+ {
+ throw new AssertionError();
+ }
+ else if ( (a == null) || (b == null) )
+ {
+ return;
+ }
+ else if (a.Equals(b))
+ {
+ throw new AssertionError();
+ }
+ }
+
+ static void assertEquals(bool a, bool b)
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(bool a, bool b)
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertEquals(int a, int b)
+ {
+ if ( a == b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+ static void assertNotEquals(int a, int b)
+ {
+ if ( a != b )
+ {
+ return;
+ }
+ throw new AssertionError();
+ }
+
+
+ public void test_Validation_CVTerm1()
+ {
+ CVTerm cv = new CVTerm();
+ assertTrue( cv != null );
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setQualifierType(libsbml.MODEL_QUALIFIER);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setModelQualifierType(libsbml.BQM_IS);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.addResource("ggg");
+ assertEquals( true, (cv.hasRequiredAttributes()) );
+ cv = null;
+ }
+
+ public void test_Validation_CVTerm2()
+ {
+ CVTerm cv = new CVTerm();
+ assertTrue( cv != null );
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.setBiologicalQualifierType(libsbml.BQB_IS);
+ assertEquals( false, (cv.hasRequiredAttributes()) );
+ cv.addResource("ggg");
+ assertEquals( true, (cv.hasRequiredAttributes()) );
+ cv = null;
+ }
+
+ public void test_Validation_Date1()
+ {
+ Date date = new Date(200,12,30,12,15,45,1,2,0);
+ assertTrue( date != null );
+ assertEquals( false, (date.representsValidDate()) );
+ date = null;
+ }
+
+ public void test_Validation_Date2()
+ {
+ Date date = new Date(2007,14,30,12,15,45,1,2,0);
+ assertTrue( date != null );
+ assertEquals( false, (date.representsValidDate()) );
+ date = null;
+ }
+
+ public void test_Validation_Date3()
+ {
+ Date date = new Date("Jan 12");
+ assertTrue( date != null );
+ assertEquals( false, (date.representsValidDate()) );
+ date = null;
+ }
+
+ public void test_Validation_Date4()
+ {
+ Date date = new Date(2007,12,30,12,15,45,1,2,0);
+ assertTrue( date != null );
+ assertEquals( true, date.representsValidDate() );
+ date = null;
+ }
+
+ public void test_Validation_Date_Default()
+ {
+ Date date1 = new Date();
+ Date date2 = new Date("");
+ assertTrue( date1.getYear() == date2.getYear() );
+ assertTrue( date1.getMonth() == date2.getMonth() );
+ assertTrue( date1.getDay() == date2.getDay() );
+ assertTrue( date1.getHour() == date2.getHour() );
+ assertTrue( date1.getMinute() == date2.getMinute() );
+ assertTrue( date1.getSecond() == date2.getSecond() );
+ assertTrue( date1.getSignOffset() == date2.getSignOffset() );
+ assertTrue( date1.getHoursOffset() == date2.getHoursOffset() );
+ assertTrue( date1.getMinutesOffset() == date2.getMinutesOffset() );
+ date1 = null;
+ date2 = null;
+ }
+
+ public void test_Validation_ModelCreator()
+ {
+ ModelCreator mc = new ModelCreator();
+ assertTrue( mc != null );
+ assertEquals( false, (mc.hasRequiredAttributes()) );
+ mc.setEmail("k123");
+ assertEquals( false, (mc.hasRequiredAttributes()) );
+ mc.setFamilyName("Keating");
+ assertEquals( false, (mc.hasRequiredAttributes()) );
+ mc.setGivenName("Sarah");
+ assertEquals( true, mc.hasRequiredAttributes() );
+ mc = null;
+ }
+
+ public void test_Validation_ModelHistory1()
+ {
+ ModelHistory mh = new ModelHistory();
+ assertTrue( mh != null );
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ Date date = new Date(2007,12,30,12,15,45,1,2,0);
+ mh.setCreatedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh.setModifiedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ ModelCreator mc = new ModelCreator();
+ mc.setFamilyName("Keating");
+ mc.setGivenName("Sarah");
+ mh.addCreator(mc);
+ assertEquals( true, mh.hasRequiredAttributes() );
+ mh = null;
+ }
+
+ public void test_Validation_ModelHistory2()
+ {
+ ModelHistory mh = new ModelHistory();
+ assertTrue( mh != null );
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ Date date = new Date(200,12,30,12,15,45,1,2,0);
+ mh.setCreatedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh.setModifiedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ ModelCreator mc = new ModelCreator();
+ mc.setFamilyName("Keating");
+ mc.setGivenName("Sarah");
+ mh.addCreator(mc);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh = null;
+ }
+
+ public void test_Validation_ModelHistory3()
+ {
+ ModelHistory mh = new ModelHistory();
+ assertTrue( mh != null );
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ Date date = new Date(2007,12,30,12,15,45,1,2,0);
+ mh.setCreatedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh.setModifiedDate(date);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ ModelCreator mc = new ModelCreator();
+ mc.setFamilyName("Keating");
+ mh.addCreator(mc);
+ assertEquals( false, (mh.hasRequiredAttributes()) );
+ mh = null;
+ }
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-01-26 07:30:43
|
Revision: 12701
http://sbml.svn.sourceforge.net/sbml/?rev=12701&view=rev
Author: luciansmith
Date: 2011-01-26 07:30:37 +0000 (Wed, 26 Jan 2011)
Log Message:
-----------
Wrong column headers (thanks, Frank!)
Modified Paths:
--------------
trunk/test-suite/cases/semantic/00944/00944-results.csv
Modified: trunk/test-suite/cases/semantic/00944/00944-results.csv
===================================================================
--- trunk/test-suite/cases/semantic/00944/00944-results.csv 2011-01-26 04:17:03 UTC (rev 12700)
+++ trunk/test-suite/cases/semantic/00944/00944-results.csv 2011-01-26 07:30:37 UTC (rev 12701)
@@ -1,4 +1,4 @@
-time,S1,C
+time,S1,k1
0,1,1
0.01,1.009950496,1
0.02,1.019803904,1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|