Week 10 ( what we are doing in the class)

March /31/2014

At beginning of the  class, every group’s leader presented the group status. After that, the professor ask us to create the Junit test for the student class and the Degree Audit class,   which is belong to  a J Unit lab master project we got from the git hub on the website: github.com. First, fork the J Unit-lab Repository :

1. Go to the J Unit-lab repository at https://github.com/kwurst/junit-lab
2. Fork the J Unit-Lab repository to your account.
3. Add your instructor and partner(s) as collaborators

Second, download the J Unit lab Repository:

1. In Eclipse, choose File:Import
2. Choose Git:Projects from Git
3. Choose Clone URI
4. Paste the SSH clone URL from GitHub
5. Set the protocol to SSH

6. Select the master branch
7. Choose the directory you want to clone into.
8. Select Use the New Project Wizard
9. Choose Java:Java Project
10. Enter a project name.

After reading the code of J unit-lab code, then create the Student test class and the Degree Audit test class, then I write the test method for every method in  each class. making sure the tests are run correctly, I run to test every single method after I wrote the code for that method. If the test pass it result will display the green bar or the test fail the result will display the red bar.

 

From the blog herangoc » cs@worcester by emtrieu and used with permission of the author. All other rights reserved by the author.

Posted in CS@Worcester | Comments Off

Week 9 ( Group Workign Status)

This week we are working on the new ticket TRUNK -243 ( Clean up Unit Test). In two week ago, one of the guy in the group, he wrote the comment to ask the software developer what is the directory to work on this ticket but we still waiting for the answer.  When we changed some of the code  on a second ticket TRUNK-3009 on wiki page, we got a problem because a developer did not clear on what we had changed,  even we asked them already. That is why , we don’t want to go ahead before getting the answer from a developer. Currently, I’m looking a J-junit test on the google. I’m still looking for any project that relate to the unit test.

From the blog herangoc » cs@worcester by emtrieu and used with permission of the author. All other rights reserved by the author.

Posted in CS@Worcester | Comments Off

Trials

The majority of this week was spent switching from OpenMRS 2.0 and applying the earlier and more stable version of OpenMRS, version 1.9.7. I also decided to reinstall the large test database that was downloadable through OpenMRS. The reasoning behind this was that I was unable to create a drug regimen and then modify that regimen for a current patient. I thought that it might have something to do with the way I initially installed OpenMRS and or the test database. I wanted to see if I was getting the java.Lang errors because the data wasn’t getting parsed into OpenMRS correctly. So I began by uninstalling the latest version of OpenMRS and reinstalled the earlier and more stable version 1.9.7. Once I made the switch and ran mvn clean install and jetty:run, I reconnected to OpenMRS and remembered that I no longer had my large patient database, so I decided to move forward to create a patient instead of reinstalling the entire database. After I created the patient I once again attempted to add a new drug regimen to the patient and again just as before I was given two general errors when I would attempt to add a drug regimen. The first error stated that the start date for the drug regimen had to parse a year in a four digit format (which was happening). The second error was complaining that there was no existing drug ID for the drug name I was trying to assign to the patient. Growing in frustration over the fact that I have been unable to add a regimen so that TR and I can actually get to test our modify dosage system I decided to reload the large patient database one last time and see if that would make a difference. Once I reinstalled it I started MySQL I opened the tables just to make sure that my copy of data wasn’t corrupt. After I satisfied myself that the data was not corrupt I again restarted OpenMRS. Now armed with a full database I tried adding regimens to dozens of different patients with no avail. With this approach obviously not working I started to think that maybe my permissions were set wrong on my development account. So, I went into my Manage User page just to check and I found that my permissions were set correctly. Now totally frustrated I decided to take a break and rethink my current dilemma. Instead of trying to add a drug regimen to a patient I decided to create my own drug and concept and assign it to a patient under the Manage Drug Orders option in the Administration page. First I created a concept because I found out that you cannot create a drug without having a concept first. So with the creation of my concept I went ahead and created the drug Advil, yes Advil, surprisingly enough Advil was not in their database for an available drug. After the concept and drug were created I went into the Manage Drug Orders page in the Administration section and was able to select a patient and actually assign that patient to the new drug I just created. Although this method worked it is still not the correct way to assign someone to a drug regimen. Seeing that TR and I are running out of time to complete this ticket in class we are going to just have to accept that our system may not ever add regimens correctly, but at least now we are able to begin testing whether or not our implementation is functioning correctly. If it is not we will at least have time to re-work the code.

Till next time,

Matthew

From the blog mlopatka by matthewlopatka and used with permission of the author. All other rights reserved by the author.

Comments Off

General Update

So, turns out that whole compilation/posting of our completed ticket wasn’t as ‘complete’ as we’d thought. That is to say, rather than compile everything and post it to GitHub, we ended up trying to compile all our individual code first….repeatedly. It took a bit of playing around with, but we figured out that it could all be compiled and pushed up through the GitHub GUI. For whatever reason, whenever we tried it on the Bash, it just wouldn’t work properly.

After finally getting it sent up, we still hadn’t heard back from the admins about whether we’d properly fulfilled the requirements, so we’re not sure where to go with all of this. As a group, we pretty much decided to focus on the book reports that would be due soon, and just wait for confirmation. As I’ve still not heard from Dhimitris (who originally claimed the ticket), all I’ve been doing is reading more from my book.

Frankly, I was right. Reading glorified textbooks isn’t that fun. I prefer sci-fi/fantasy to non-fiction :P

From the blog Kyle's Works » CS@Worcester by kyleprimmer and used with permission of the author. All other rights reserved by the author.

Posted in Computer Science, CS@Worcester | Comments Off

OpenMRS DB issues

I wrote a detailed blog on what I have done since my last entry and in an attempt to undo a paste I hit cmd+z and it deleted everything I wrote. In my anger and frustration I will not be redoing it in as much detail. Essentially what I have been working on was trying to get the correct configuration for the mySQL database. I initially installed mySQL with homebrew. I think this led to some configuration issues so what I did was uninstall the homebrew version of mySQL and re-installed it with the mySQL .dmg that is provided from the mySQL official page. Once this was done there were several steps to take to configure mySQL. I used the instructions provided here for the installation, and here for the post installation configuration. Finally I followed the instructions here to change the root password. Once mySQL was all set up I started tomcat and hit the openMRS site. This launched the initial configuration to the DB, I chose the simple setup with the demo data. Once this was complete I found that I did not seem to have any of the data. To solve this I followed the instructions here. Once the data was added I was able to search for a patient and find one. After that I was able to add a drug regiment which was what we needed to be able to test.

Once we added the drug to a patient we could see where the drugs that a patient is on are populated and the buttons that come along with them. This lead us to decide to redesign how our functionality was implemented. We added a button at the bottom that will have a box open where you can select a drug that a patient is on (a feature that we found doesn’t work as we thought), modify the dosage and how often they should take it. We want to move this box up so that it comes more inline with the buttons that are present with each drug.

This is how it currently looks:
You click the button next to the green arrow and the content in the green box comes up.

We want it to look more like this:

This is what we will be working on now.

From the blog A blog about things by TRStaake and used with permission of the author. All other rights reserved by the author.

Posted in CS_WSU, DB, openMRS | Comments Off

Java Interfaces

This week I have decided to take the blog in a different direction.  Instead of blogging about the weeks’ progress and what’s to come, I am going to start focusing much more on being informative and helpful to readers who may have had similar troubles.  Today, I am going to be talking about interfaces in Java, and how I used them in developing my Rafter Maker app for Android.  Now, why would I want to use an interface?  Well, an interface will allow you to pass objects in your code generically.  For instance, I can create any number of objects which implement the Rafter interface and then pass them all throughout the code defined generically as Rafter.  This makes it possible to retrieve the same data from any type of rafter through a generic variable, while allowing the code in each rafter object to  be unique.  I created some examples to illustrate my point.



public interface Rafter{

getAngle();
getLength();
getName();

}

Above, is a simplified example of the Rafter interface in my app.  The original has more methods, but that’s the only difference.  



public class ShedRafter implements Rafter{

private double angle, length;

public ShedRafter(double rise, double run){
// calculate angle and length from rise and run
}

@Override
getAngle(){
return angle
}
@Override
getLength(){
return length
}
@Override
getName(){
return "Shed Rafter";
}

Above is a simplified example of a shed rafter class from my app. Notice it implements the Rafter interface and overrides each empty method declaration in the interface. Any class that implements an interface must override all the methods within that interface otherwise you will get an error that says something like “must implement the inherited abstract methods” meaning the abstract (undefined) methods in the interface.


public class GableRafter implements Rafter{

private double angle, length;

public GableRafter(string pitch, double span){

// calculate angle and length from pitch and span
<pre>
@Override
getAngle(){
return angle
}
@Override
getLength(){
return length
}
@Override
getName(){
return "Gable Rafter";
}
}

Above here is a simplified example of a gable rafter class from my app which differs from the shed rafter class, but notice that both classes implement the Rafter interface allowing the creation of a Rafter object that can be a ShedRafter or a GableRafter .


double span = 144, rise = 60, run = 144;
String pitch = "5/12"

Rafter rafter = new ShedRafter(rise, run);
rafter = new GableRafter(span, pitch)

The classes take different  arguments with different names and the algorithms for calculating a rafter from a rise and run versus a pitch and span are also different; though I don’t show them for the purpose of simplicity.  This approach allowed me to perform completely different calculations in each rafter object and on different variables, while still adhering to the interface definition by overriding getAngle(), getLength() and getName().  This way both classes were Rafters and Rafters are  generic.   While in contrast each individual rafter class implementing Rafter’s  is  unique.

This made it easy to create any rafter on the fly and pass it to my output class, which is responsible for displaying the angle length and name of  the rafter.  Now there is no need to check or know what type of rafter you have, because it does not matter, all the differences between rafters have been compartmentalized within the individual definitions.  For instance, the getName() method is easily modified to return the proper names for each rafter, and likewise I can easily change the way I calculate angle and length in the constructor.  The behavior of methods I might add to the interface later on will also be easily modified and will require minimal updating to the code overall.


double span = 144, rise = 60, run = 144;
String pitch = "5/12"

Rafter rafter = new ShedRafter(rise, run);

System.out.println("Print " + rafter.getName() + " Data\n");
System.out.println("The angle is = " + rafter.getAngle());
System.out.println("The length is = " + rafter.getLength() + "\n");

rafter = new GableRafter(span, pitch)

System.out.println("Print " + rafter.getName() + " Data\n");
System.out.println("The angle is = " + rafter.getAngle());
System.out.println("The length is = " + rafter.getLength() + "\n");

Above you can see it is easy now to define a single Rafter variable and use it to get the values from any rafter class which implements the Rafter interface.

Well, thats it for this blog.

Till next time.

From the blog jasonhintlian » cs-wsu by jasonhintlian and used with permission of the author. All other rights reserved by the author.

Posted in cs-wsu | Comments Off

Unit Testing

As a group we continue working and trying to find more detailed information about the assigned ticket. Unfortunately, the lack of communication and responses from the developers is limiting the progress of our project.

Last week, we did the JUnit Lab in class, which was very helpful in understanding how unit testing works. I had to install GitHub in my laptop to be able to open git files in Eclipse. To start working on the Lab, I had to fork JUnit-Lab Repository to my account and then I cloned it from Eclipse.

After going through and finish the lab, I tried to follow the same steps with the OpenMRS-core Repository. I ran into problems, but after so many attempts I finally got to clone the repository by importing the project from a local source. 

From the blog Naty Zelaya » CS@Worcester by natyzelaya and used with permission of the author. All other rights reserved by the author.

Posted in CS 401, CS@Worcester | Comments Off