RPTools.net

Discussion and Support

Skip to content

It is currently Sun Jul 23, 2017 7:43 am 






Reply to topic  [ 7 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Thu Apr 16, 2015 8:48 am
Posts: 35
 Post subject: [MT] New Maptool java contributor
PostPosted: Fri Apr 17, 2015 6:56 pm 
Hello everyone!

I've only quite recently found out about Maptool and I'm already quite fond of it. I've been on the lookout for an open-soure project that I can contribute towards for quite some time. So it was with great delight that I discovered Maptool!

Short introduction: I'm a 26 year old male from Lund in Sweden. I'm in my final year of acquiring a bachelor's degree in computer science. However, long before I even considered a career in computer science I was having fun with my friends role playing. It started out with Vampire: the Masquerade and GURPS Bunnies & Burrows. Since then I've had the time to try out a lot of different role playing games including D&D4e and a couple of different indie games.

I have snagged task 15.5 (setTokenheight/width) and it's almost complete. I have a couple of questions though:

1. Are there any specific style guides I should follow? I've been looking at the code and trying to follow its example, but it seems to be inconsistent in places.
2. What kind of Object is the method childEvaluate in TokenPropertyFunctions supposed to return? More specifically in this case where the function is a "set-method"?
3. All JUnit test cases don't pass when I try to run them, despite using an unmodified clone of the repository. Is the repo "dirty" or is there something wrong on my end?
4. How do we handle automatic regression testing? I'm trying to write a JUnit test case for task 15.5 but I keep getting errors/exceptions.


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Apr 16, 2015 8:48 am
Posts: 35
 Post subject: Re: [MT] New Maptool java contributor
PostPosted: Sat Apr 18, 2015 7:41 am 
I think I've found the answer to question 2 at least. Most "setters/set-methods" in childEvaluate simply return an empty string upon completion. The notable exception being setSize which returns the new size.

Also, I'd like to apologize in case I have posted this to the wrong sub-forum. As a newly registered user I don't have access to all forums and this was the one that seemed the most appropriate.


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3467
Location: Austin, Tx
 Post subject: Re: [MT] New Maptool java contributor
PostPosted: Sat Apr 18, 2015 7:45 am 
Awesome to have you on board.

No worries on the wrong subforum. One of the moderators will straighten it out at some point. :)

Craig is our lead developer. I'll make sure he knows you're here. Jamz has been contributing quite a bit and may be able to answer questions as well. Jagged is yet another that might be able to help. Az may chime in as well, time permitting.

Thanks for picking up the task. I'll mark it in the spreadsheet as snagged.

Cheers,
Troll

_________________
ImageImage ImageImageImageImage
MapTool/Savage Worlds Blog
Free SW/MT Modules
SW Framework for MT


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12070
Location: Tampa, FL
 Post subject: Re: [MT] New Maptool java contributor
PostPosted: Sat Apr 18, 2015 11:18 am 
d4rkAlf wrote:
Hello everyone!

Welcome, Dark. :)

Quote:
1. Are there any specific style guides I should follow? I've been looking at the code and trying to follow its example, but it seems to be inconsistent in places.

Yeah, it's a little bit of a mess. When I inherited it there were two or three different indentation styles and a few things I didn't like (like a line length of 200 chars!) so I gradually changed the styles as I worked on a particular file and checked it in.

There is a preferences file floating around somewhere that when imported into Eclipse will supposedly set the formatting configuration in a way that you should be able to highlight an entire file and choose "Format", but I've had reports that it doesn't do anything when imported by others. Don't know what to say about that; it works for me and I just exported what I have...

Quote:
2. What kind of Object is the method childEvaluate in TokenPropertyFunctions supposed to return? More specifically in this case where the function is a "set-method"?

Sounds like you've got this one.

There's not a lot of JavaDoc for some modules; that's another thing I was trying to correct. When I had to edit a module, I'd try to go back and add JavaDoc for the class itself and the public methods in the class. But again, I didn't get through all of it.

Quote:
3. All JUnit test cases don't pass when I try to run them, despite using an unmodified clone of the repository. Is the repo "dirty" or is there something wrong on my end?

As far as I can remember, the unit tests never worked for me. And to be honest, most of the parts I worked on were UI pieces and those are hard to unit test so they didn't get much love. I was planning to implement a bunch of unit tests for the UPNP stuff but ran into a snag because the lower level library (sbbi-upnp) didn't have any techniques for dependency injection. :(

Quote:
4. How do we handle automatic regression testing? I'm trying to write a JUnit test case for task 15.5 but I keep getting errors/exceptions.

First of all, let me say I'm glad you're interested in writing tests! It hasn't really been a priority on this project and it would be nice to be a little stricter about it in the future. I've pretty much stepped to the side and it's been Craig pushing things forward so he'll be the person setting the rules for that stuff.

I seem to recall that much of the code base is difficult or impossible to test because of the lack of DI interfaces. We're always looking for improvements!

There are, for example, still many areas that need to be localized. We had a user who was going through and extracting the strings for placement in a .properties file (which is automated in Eclipse) but it's a long and hard road so only 10-20% of it was completed, IIRC.

Anyway, welcome to RPTools! Thanks for pitching in!


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1590
Location: Chicagoland
 Post subject: Re: [MT] New Maptool java contributor
PostPosted: Sun Apr 19, 2015 11:39 am 
Welcome aboard!

It truly is a project of done by many developers over many years so 'style' will eb and flow. For formatting code, like Az said, it's a pain to keep in sync and personally think near impossible to enforce, everyone has a style they like. I'm looking into a Gravin plugin that can at least reformat the code on checkin so the git compare will be better.

As for general style, I try and keep things coded like existing if possible and made since but otherwise was more concerned with working code. :)

regarding docs and unit tests, ya, I'm bad with that to. I try and note new functions or line comment hear and there but never bothered with ┼źnit tests. If someone leads that effort and sets standards I'll try and follow em. ;)

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon Sep 15, 2008 8:27 am
Posts: 1165
Location: Bristol, UK
 Post subject: Re: [MT] New Maptool java contributor
PostPosted: Mon Apr 20, 2015 2:57 am 
Welcome. Always nice to log in to my email and see a Pull Request merged :)


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Apr 16, 2015 8:48 am
Posts: 35
 Post subject: Re: [MT] New Maptool java contributor
PostPosted: Tue Apr 21, 2015 4:31 pm 
JamzTheMan wrote:
Welcome aboard!

It truly is a project of done by many developers over many years so 'style' will eb and flow. For formatting code, like Az said, it's a pain to keep in sync and personally think near impossible to enforce, everyone has a style they like. I'm looking into a Gravin plugin that can at least reformat the code on checkin so the git compare will be better.

As for general style, I try and keep things coded like existing if possible and made since but otherwise was more concerned with working code. :)

regarding docs and unit tests, ya, I'm bad with that to. I try and note new functions or line comment hear and there but never bothered with ┼źnit tests. If someone leads that effort and sets standards I'll try and follow em. ;)
Yeah, I totally understand that the style will vary wildly. I was mostly worried that a new standard had possibly been set recently and I would come in like the new kid on the block and make a fool out of myself.

I also totally get that people prefer to write functional code rather than tests and documentation. While I like having automatic tests and documentation I'm not really committed enough at this moment to lead any effort in that area. :roll:

Nota bene: The one "style" thing I've found useful so far is to remove trailing whitespace. It makes it easier to read the output from 'git diff' since you won't get any lines where "nothing" has changed. (E.g. there was a space or tab on an "empty" line that since got removed) In Eclipse it's easy to automate by going into the preferences and then: Java -> Editor -> Save Actions -> Make sure "Additional actions" is ticked -> Click "Configure..." -> Tick "Remove trailing whitespace" and select "All lines". After that Eclipse will remove any pesky whitespace every time you save.

Jagged wrote:
Welcome. Always nice to log in to my email and see a Pull Request merged :)
Haha, good to hear! :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 7 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 3 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman