Wednesday, June 5, 2019

3# First Week Of Coding

The coding period for GSoC'19 officially began on May 27th (Monday).

The first week was pretty much spent in properly setting up the tests for the constraint classes. I tried setting up the project with the help of my mentors during a hangout meeting multiple times.

At first, the OfflineValidatorTests.java was not able to locate classes of the spatial package. But things only got worse later when the class itself refused to run! 3 failed attempts later, we decided that for the time being, I could create a bigjar of the entire jsbml project and run the tests via the command line as:

~$ ant bigjar
~$ java -classpath dist/jsbml-1.5-SNAPSHOT/jsbml-1.5-SNAPSHOT-with-dependencies.jar org.sbml.jsbml.test.OfflineValidatorTests /home/bhavye/GSOC/syntactic-cases-2017-11-20 spatial-20201 xml

I tried to set up the project myself afterwards and got it running finally. In the following text, I will describe the process I followed to get the tests up and running.

  1. Create a new workspace in eclipse.
  2. From the 'File' drop-down menu, select 'Open Projects from File System'.
  3. Locate the jsbml (cloned) directory and select.
  4. Select 'Finish' with default options selected. 
  5. In the package explorer, enter core -> test -> org.sbml.jsbml.test
  6. Right click on OfflineValidatorTests.java -> Run As -> Java Application
  7. Now again right click on  OfflineValidatorTests.java, go in 'Run As' and select 'Run Configurations'.
  8. Enter the 'Dependencies' tab, and select 'Classpath Entries'.
  9. Select 'Add Projects...' and check the tick box of spatial.
  10. Enter the 'Source' tab and select 'Add...'.
  11. Select 'Java Project' and check spatial.
The arguments for the configuration would be of the format:
<test files directory> <error codes (separated by colon if range)> xml

eg:
/home/bhavye/GSOC/spatial-test-files spatial-21305 xml
/home/bhavye/GSOC/spatial-test-files spatial-21301:spatial-21305 xml

The alternate, rather the more neat way of setting up the project would be to select 'Create a New Java Project' at the beginning and then proceed to clear unwanted files from the build path. But that created unforeseen errors. It generates a bin folder to keep all the class files, and so, having the jsbml/bin folder as the default output folder for every project should have worked in the first place.

So finally having my project running, I started creating the actual constraint classes and tested them along the way. I will discuss the modifications in the existing code and the new problems in the forthcoming blogs!
 


No comments:

Post a Comment