Kevin Brightwell edited this page Aug 26, 2015 · 1 revision

Each UCOSP participant is asked to log all their accomplishments as well as the difficulties they have getting set up to understand Umple and other experiences they have. Difficulties might include understanding how to model in Umple, using UmpleOnline, code that is difficult to figure out, and development tools that are hard to figure out, or don't seem to work properly. The more log entries added the more we can better get a grip on the usability issues with Umple, and the more we can help future new contributors come up to speed.

Log entries

December 7, 2012

Just finished committing the PHP version of sorted associations, this finishes up Issue 184 (on Google Code) along with my time as a UCOSP student. I will note a few things that I encountered while making the second portion of Issue 184 (on Google Code) to help future students:

  • You are adding in new template tests and the files / classes your are generating are showing up in the implementation folder. Go to test/implementation/TemplateTest.java and add in a new line along with the other SampleFileWriter.destroy(etc) lines

  • If you are including a new file to be parsed from XXX_Set_All.jet / XXX_Get_All.jet in the UmpleToTemplate folder you will end up generating jet template errors in eclipse for any non-completed languages. This is because the jet parser is attempting to use the files which do not exist, simply add a new file of the appropriate name but only give it the single <% Ignore ... %> line at the top (this will not effect generation / tests and will stop the warnings).

  • If you cant get new template tests to work for languages OTHER than Java, add in a new testname.java file into the appropriate folder. In that file you simply have a class which extends the test file in the implementation folder (it should also set the language, look at the other files in the language folder for a guide).

December 3, 2012

I am ready to commit the changes to add in sorted associations (only for java at this point). I have run into a snag while trying to create tests for my implementation (particularly parser tests).

The "xPriority" attribute is added at the end of the parsing process, I need to test to ensure that the errors for

  1. The associated class does not have an attribute of the name.
  2. The attribute of the other class is of the wrong type.

I look up to see if the model has any associations, if so, get the class it is bound to, check if the association end is sorted, if so add the attribute. However, during parser tests for some reason the model always seems to have 0 associations by the time the function is called. I looked at a few other functions which add things at the same time as I do and noticed that the errors they can potentially throw are also never tested. This seems to be a separate issue (which I am not sure if it has been raised or not) because not testing these things could lead to future developers making changes which lead to these errors not being properly thrown.

For the moment I have simply not added in these tests, however I will look into issue and see if it should be raised if it hasn't already.

November 28, 2012

Currently working to ensure I have enough tests for the Java implementation of the second part of Issue 184 (on Google Code). I have the sorted keyword parsing properly, removing addXAt/AddOrMoveXAt functons, adding in the priority variable to the class, and the sort function generating / called at the appropriate places.

I will hopefully have the java build commited before the final meeting on Friday, after which I will only have to port the jet templates/tests to the other languages to finish up the issue.

November 23, 2012

I am in the process of parsing the sorted keyword for the second part of issue 184 (on Google Code). I have been using UCOSPSonyaAdams project of adding in the immutable keyword as a knowledgebase/directory as Issue 286 (on Google Code) is very similar to mine in some ways. Working with this code has proved to be a bit more difficult than the first part of my issue. However, I am working through it and luckily am able to just do a project wide search for “immutable” to see where Sonya added code which is a nice guide map.

During my work on this part of the issue I have came upon a few questions that I am unsure about:

Can an association be immutable and sorted? Should I disallow it?

When creating a many to many relationship you may want both ends of the association sorted. I’m assuming the syntax would be as shown below?

class Mentor
  sorted {id} 1 -- * Student sorted{someValue};

Finally, I am assuming that an association may only be sorted by base types (Integer, String, Long etc)

November 15, 2012

I added in the AddXAt/AddOrMoveXAt functions into Ruby this week. I also made contact with the lead of the Cpp side of things and was told that it is not a good time to add in these features.

I will be adding in the final part of Issue 184 (on Google Code) throughout the coming week.

November 9, 2012

This past week was spent "porting" my additions to umple to the other languages umple can generate. I just committed a build which adds addXAt & addOrMoveXAt functions to PHP generation. Ruby generation will be soon to follow and shouldn't take more than a day and a half. Once ruby has been added the first portion of Issue 184 (on Google Code) will be complete (this is assuming I do not need to add this to the Cpp project, more on this below). With the first part of the issue completed I will move onto the second and final part which requires that I add a new token to the umple grammar. As I did last time I will look through the commits and find one where someone did something similar as that proved very helpful.

Concerning the Cpp project I am not sure if it is required that I add in my functionality at this time. I emailed the person heading up that development but until I get a response I will assume I do not need to add to that project. The reason for this was before thinking to ask I added in the functionality, ran a full build, and only 6 - 8 tests failed. In comparison to the other UmpleToXXX projects this is incredibly low as every feature must be tested as it is added in. This leads me to believe many features of the Cpp project may not be completed at this time and it may be an inopportune time to add in this functionality considering the lack of tests.

(Also, I believe I may have added in some random files un-intentionally during my build now that I looked through the notes more carefully. I will address this if needed tomorrow)

November 2, 2012

This past week has seen me looking through every output test that has an association in it and properly updating the code to contain my new functions. That being said however, I have found a fairly simple (but somewhat in-elegant) way of adding in my functions for all required associations without updating the jet templates for every association type. I got all of the code outputting properly, all of the tests with eclipse passing, now however, the full build was failing. It took me a good hour or more to figure out the problem, which I will illustrate below:

class Mentor {

class Student {
  1 -- 2 Mentor;

The code above, when generated, gives an add/remove Mentor function to the Student class (through discussions with Tim this was deemed correct as the association can be changed on the fly and they may want the functions in the future).

class Mentor {

class Student {
  0..1 -- 2 Mentor;

The above code does NOT generate add/remove Mentor functions in the student class, however it most definitely should as: 1..0 -- * Mentor 1..0 – 3..5 Mentor all generate add/remove functions. I would assume this is a bug but I will refrain from fixing/touching it for now until the UCOSP meeting tomorrow.

October 25, 2012

I was hoping to be able to commit my changes to Issue 184 (on Google Code) to the main build today but unfortunately that does not look like it will happen. Initially I began to go through all of the association_AddXXXXXXXX.jet files and add in the correct formatting to produce the functions I need. However, I realized that this is inefficient and could be done a bit more elegantly.

So long as one “end” of the association is > 1 then the functions I have written are applicable and do not need to be changed (they use the addX() function that is specific to the type of association). In the class association_Set_all.jet there is a LONG list of if/else statements that just check for which type of association is present and then uses the correct add/remove files for them. I am going to see if I can add a statement here that will blanket effect all >1 associations.

October 24, 2012

Have made a bit of progress on Issue 184 (on Google Code) and am finally getting to be able to add new code. I am going to go on a bit about what I have realized in terms of what I must do and how I should do it.

Issue 184 (on Google Code) can be broken up into two main sections:

  1. Associations of type| a...n - b..n | where a > 1 || b > 1

Generate methods addXAt(X, index), addOrMoveXAt(X, index) functions

  1. Associations declared like | sorted {priority} 1 -- many Task |

Do NOT generate the above methods, instead they auto sort on add/remove based on "priority"

To do this (and still follow test driven development) I started by looking through ways to test/assert what was being produced when a language is outputted by Umple (Just as a note I am really only looking at Java at the moment, but everything here can be expanded to other languages). I ended up finally finding the .java.txt files (used for comparison against what the compiler outputs) in the cruise.umple.implementation.java section of the codebase.

Aside I found these files, not by chance, but by pulling up a commit by a past UCOSP student (JordanJohns) and looking through which files he had added/changed. I knew to look through the changes log for his commits as I had read through his log and noted that one of his issues was similar to my own. Although not related to Umple at all, I found it very annoying that you cannot search for changes by a particular member etc. you are forced to scroll through the 2000+ commits.

Once I had found these files I quickly made my own test which compared the output of the below code against some code that I had altered that came from Umple online. I soon realized that there were 30+ files all using associations that, while not failing now, would fail as soon as I implemented the change to code generation (any test that even has an association in it by chance will now produce output that will not match exactly). While not a problem at this time, it will be in the future when I have to change all of these tests for every language Umple can output too. I decided on simply changing a single comparison file for the moment and using that as my test, as creating a new file to test a feature that will again be re-tested many other times seemed useless.

October 18, 2012

Issue 330 (on Google Code) has been completed and I will now move my focus completly to Issue 184 (on Google Code). I have begun by looking through the work Stuart did for his first issue because he altered the code generation as well. Hoping to find more resources/explanations of how the jet templates work exactly, starting with this tutorial: http://www.eclipse.org/articles/Article-JET/jet_tutorial1.html

Hoping to get some basic code up and running mid next week which changes templates properly etc.

October 12, 2012

I have nearly closed up Issue 330 (on Google Code) with only a single problem left to fix before it can be closed. I have been accepted onto Issue 184 (on Google Code) which should take the rest of the term to complete.

While creating my most recent patch I again ran into problems using the assertFailedParse (and its variations). I even occasionally could not get the system to reject any new obviously flawed file. I did resolve this problem by reverting to the command line and doing a full build. It would seem however that while working with eclipse on the tests that I had not "refreshed" the workspace or something along that line, I am not entirely sure.

My next steps are to finish up Issue 330 (on Google Code) and begin reading up / digging through code to help me full understand Issue 184 (on Google Code).

October 2, 2012

I submitted a patch to the Umple dev group last night which adds in attribute name verification (dissallows special characters in the names). This is 1/2 of Issue 330 (on Google Code), the other half of which I will have completed later tonight or early tomorrow depending on feedback from the first patch.

While making the first portion of this patch I stumbled upon something that I do not quite understand. The code:

assertFailedParse("008_invalidAttributeName.ump", new Position(3,2,18));

I used this as a test to ensure that attribute name checking is in place, along with the .ump code:

class Student

However, when making the fix I could not get the test to pass, I continually got the error.

java.lang.AssertionError: expected: cruise.umple.compiler.Position<[3,2]> but was: cruise.umple.compiler.Position<[3,2]>
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.failNotEquals(Assert.java:647)
	at org.junit.Assert.assertEquals(Assert.java:128)
	at org.junit.Assert.assertEquals(Assert.java:147)

Which does not make sense to me as the Positions are equal (I did some testing and the overall offset variable is equal as well). Not quite sure what the problem is but I just ended up using:

assertFailedParse(filename, codenumber);

September 29, 2012

Although in my last post I mentioned that the command line compilation of Umple was working in full, it seems that was not the case (was not running the full build unfortunately). Andrew and I did go through and get it all up and running so I believe that is done (note however that I cannot successfully build the website portion as of yet but this is non-essential to attempting my first task).

Many of my eclipse problems have been solved by what turned out to be an error on my part by not compiling Master.ump before running all tests etc. Now that this is done I am only getting 5 test failures, I am unsure if these are critical or can be ignored for the moment, I will get Andrew to look at them today to confirm.


Got eclipse working properly once Andrew discovered a small defect with UmpleToJava templates which I fixed manually on my working copy (will update to the fix which he committed when available). I am now working on Issue 330 (on Google Code) look to the bug page for updates on that issue/my progress (I will continue to update this as milestones are met).

September 27, 2012

I got the "Build Complete" message from the compiler finally although to get it required a strange fix. When I looked through the error messages I found that it was complaining that Vector was spelt vector, so all I did was use eclipse to replace all the instances of vector with the correct version. Once this was done the command line version worked as I stated. I am now down to 5 failed tests and 0 errors with Eclipse which I will continue working on tonight to be ready for the sprint tomorrow.

September 26, 2012

I started at building Umple via command line. I got through the entire tutorial without major hookups (although there was a few, noted below). Now that ant seems to be running properly the build still does not compile successfully. I am getting many compile warnings/errors which is disappointing, but I will continue to look into this as well as compiling with Eclipse.

Things not noted in command line setup guide:

  • Ensure that you have a JAVA_HOME environment variable that points to your jdk install.

  • I had to manually download and install ant-contrib to be able to begin the compilation process (available here: http://ant-contrib.sourceforge.net/)

September 24, 2012

Got the Umple plugin for Eclipse installed properly along with Jet/Xtext. However, as others in the past have noted in logs I am having problems setting up to develop/compile Umple itself (with Windows). When running the final full test of the project I get 458 Errors & 1036 Failures.

Currently reading through past UCOSP student logs and will see if I can get this sorted out tomorrow.

September 10, 2012

Over the past few days I have looked at and played with the Umple online editor and watched the tutorial videos posted on the Umple website. I attempted to extend some of the examples with new classes etc. to get familiar with the syntax as well as I could. However, it became obvious fairly quickly that editing large systems with Canvas view enabled is not intended. As an example I was attempting to play around with the BankingSystemA sample and I could barely edit any text as the whole editor would hang as it attempted to update the graphical view whenever I stopped typing for a moment. Turning the Canvas view off does rectify this problem but I found that switching on the manual sync option helped a lot to deal with the lag.

I am going to set up the eclipse plugin later on tonight (on my windows install) before I dig any deeper into Umple. I do have a Unix install and will switch to that if need be but I looked over the directions for installing on Windows and it doesn’t seem overly complex.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.