Thank you very much for your reply! I'm glad to have JitPack as well so long we can automate it along with the other maven repositories. It will definitely not be the primary maven repository though.
Hi everyone, it's almost been a week so here's an update on what's going on. Treasury v1.0.0 is almost complete! We are just working on some finishing touches, being: Finishing up the PR: feature: release on tags #102 Finishing up the PR: Support hex codes as advertised #113 Solving: Command message content using quotes (") instea of apostrophes (') (#114) Solving: Distribute plugin jars in GitHub (#110) Writing the Economy API documentation on the Wiki (#5) This will probably be quite time consuming. Perhaps we will write the necessary documentation first, release, and then add to it over time. For instance we can start out by describing how to use Treasury as a consumer or provider, and later on we can describe how accounts, currencies, and so on work. Testing the economy API. I'll need to write a tiny test-purpose economy provider plugin to do this (#15) Set up the JitPack Maven repository (#57) Write the Spigot page, and release! At the current stage, you can put Treasury on your server, run it, even start developing with it. Of course, these are currently snapshots so we recommend you wait until the release. A good idea is to start preparing the code in your plugin(s) so that you can easily add in Treasury support.
I'd rather try make a real-world-like economy provider plugin to test it. It'll be very basic and not usable by server owners.
Mockito is something I don't fully understand. I will really appreciate if someone contributes tests, but I'm not going to write anything with it.
Hi - I know I've not activily participated in the development of your api, but here's my 2 cents: I don't think you need an economy provider plugin in order to test your api. All your abstractions don't use any bukkit types right? so then you could just create an implementation for your api that can just be invoked by junit - it does not need a server environment. One thing you do need to take into account is asynchronicity - tests methods do need to wait until economy responses complete. but you can work around that by having your test-economyprovider-implementation only create responses that complete instantly. You could ask yourself what you are still testing then at that point.. the api? or the implementation of the api? I kinda get now why Vault doesn't have any tests. The economy api only specifies the 'contract'. Implementations ("providers") need to adhere to this. So if you want to have tests, the only useful that I can come up with for testing is that an implementation obeys the the rules of the contract. It doesn't make much sense to 'test' an abstraction layer just on its own. What seems way more useful to me is to create a test suite that implementations can use, to test whether they adhere to the rules of the api.
I fully agree with this. We have JUnit in the repository because at some point it had a class for which I wanted a test, but that was basically it. Now that class is gone. We need to test the plugin part though and if you want to participate, you can download a jar here.
You're correct, the API itself does not need any testing. But, as Ivan said, Treasury is also a plugin, so the plugin side of things needs to be tested to ensure it is reliable. I think the last thing to test is the /treasury economy migrate command. I would have tested the migration command a few days ago, but it requires at least 2 economy providers to be installed. There are currently have zero in existence I don't believe there are any issues with the rest of the plugin, from what I was able to gather. Only a few typos with the messages which Ivan kindly fixed. I understand that we can use various testing software to test the API. However, I want to create a plugin, 'TestEconomy', which mimics real-world usage of Treasury, of course in a very basic way. Not only can this aid in testing Treasury, but it is moreso helpful that it can be used to show how the Treasury API is used. Not in a standard Wiki 'here's a code snippet' way, rather, here is a real plugin with the methods put into practice. I will also be able to support all of Treasury's features within this plugin, something I doubt most economy providers will be able to, e.g. transaction history, non-player accounts with members and permissions, and Bukkit transaction events. This is completely fine! We are interested in everyone's opinions on various matters, regardless of their past participation.
Hi @Rezz and @Nemo_64, It seems to me that JitPack requires zero setup on our end to get working. Simply head to the Treasury page on JitPack and I think you might be able to build any release, commit, etc. I believe this is the case because it is is an 'on-demand' repository. Here are some links that might be useful: JitPack Treasury Link Documentation for the Treasury maven dependency on JitPack
This can be done in a custom plugin, and as for the "events", they are not in Vault for performance reasons, because for example various jobs in the plugin send money to the player's account when an action is triggered (in a couple of cases constantly) - this could overload the server with higher usage. EDIT: And this functionality can also be created in a custom plugin (admittedly more difficult, but it can be done.)
Actually, I think economy events are not in Vault for historical and compatibility reasons. The only reason Vault could gain popularity was because out of the box they support a bunch of different economy providers. Not all of these providers have transaction hooks, so the behaviour of Vault would be ill-defined when running with a plugin without such hooks. Vault's abstraction layer is the 'intersection' of features that economy plugins had at the time, not the 'union'. I don't see a performance problem here either. Calling events is cheap. Heck even CraftBukkit itself calls a PlayerMoveEvent every time a player moves (which happens A LOT). It only becomes a performance issue if an event listener does a computation that is not constant-time.
Either way calling the events is a optional api feature, an economy provider may choose not to call them if they don't want to.
Events are an optional feature and since it's the economy provider the one who decides when to call them it can decide to not call them. As said by @Jannyboy11 events aren't that expensive. And what do you mean with "This can be done in a custom plugin"? I don't see how a custom plugin solves the problems we are trying to solve
Amazing project. Finally an (better) alternative to Vault. Deluxecombat will definitely support Treasury as an currency provider (for PvP points) and in general (for money rewards on kill etc.)! keep it up
I have been working on these changes to the API, check that discussion out if you want to view these and feel free to leave any feedback you have.