New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding default constructor to MockSerializationResult. #598
Conversation
I don't know why the tests didn't pass on Travis CI, when I run |
When the Travis CI build, it doesn't know the class |
Sorry for some problem... But if you get fix this problem, I think it's better to work with unit tests. |
This error occurs to me too. Have you pushed all classes in your commit?
|
Yes. I just created the default constructor. It was based on this code: |
I have downloaded your code, and I got the same error that Travis reported. I think that you miss to commit anything. Can you check this? |
I'll check this. |
I checked this and I have commited all. I don't created anything, just the default constructor. May you make a test for me, creating this default constructor and run |
Or you can close this issue and I try create with another branch. |
The problem is on the Symbol |
@garcia-jj May you run the test directly from Eclipse and after run |
Or just rebuild this branch for a test... I don't understand why. |
May be a missed import.
|
The import is there. |
+ |
Because |
Oh Really... Sorry. So, it's better closes this issue or fix it ? |
I don't know if it's a good idea to move a class that was designed to use in tests, to main folder. This default constructor is really necessary? Or we can live without? |
I think we can live without it, even if is easier using the dafault constructor. So, we can after explain about on doc. |
But still I think it's so importante make the developer's life easier. |
Sorry for the english errors, I'm on cellphone. :-) |
Yeah, we love to make the developer's life easier. But in this case, test classes must located under test directory, and not in the main directory. And... are only 4 lines 👍 |
I understand you. We can write something about MockSerializationResult on doc. |
I was reading the new book about VRaptor 4, is cited the use of Also on VRaptor 3 we needed just the default constructor. So it's very important think about this, because may cause confusion on developers and turn more difficult their life. I think that move the class |
I extracted the class to main folder, now the tests are passing. So, if you think it's a good idea... 😃 |
Before, the method |
I don't think we should add this kind of class for |
I think It's important, but just a suggestion. May be a good idea about a plugin. |
What about wait some user ask for it? If (or when) that happens, |
May be, I just think the book's example is a problem, but is a good idea. Also we can write doc about MockSerializationResult. |
VRaptor has to be testable, and the package we cannot force the user to use a constructor that complicated to be able to test serialization. The no-args constructor is the best tool to help the user. What do you think @Turini ? |
/** | ||
* A Simple builder factory for XStreamBuilder tests | ||
*/ | ||
public class XStreamBuilderFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rollback this change. VRaptor is released, we cannot simply remove a class without bumping the major release version.
I made changes on test classes that used cleanInstance from |
Oh, do you want a new PR ? I'll send the new PR. |
can you send a new PR only adding the constructor? |
Ok @Turini. |
thanks! so closing here |
I think testing is core for any application/library, not meant to be a plugin. |
Make sense testing is core for any application. |
@lucascs You didn't invite me, but I will join discution nevertheless. I agree, but not fully. If you watch the code, this constructor is too specific. As I wrote in mailing list, this pull request uses a In this pull request, no converters are used. But if I my application have a converter? So, this pull request may help users, but only in too specific cases. So I don't know if is too valuable to move to core. |
I have no knowledge as you ( @garcia-jj @Turini @lucascs ) and I'm learning a lot with you, but I'll left my opinion. If you need use another constructor, in this case just need call the other constructor and not the default. |
This is my point: this change is too specific to move to core. |
Seeing the class I don't see as a problem. |
@garcia-jj I disagree, the change is not too specific. What if I have no converters, but I still want to know how my class is being serialized? this needs to be easy. |
I think it's a valuable change. It'll work very well for most of the cases. On Tuesday, June 17, 2014, Lucas Cavalcanti notifications@github.com
Rafael Ponte |
Just adding a default constructor to make easier to use it in unit tests.
Now we need use some like:
new MockSerializationResult(new JavassistProxifier(), cleanInstance(), new GsonBuilderWrapper(new MockInstanceImpl<>(jsonSerializers), new MockInstanceImpl<>(jsonDeserializers)));
With this default constructor, we just use some like:
new MockSerializationResult();
What do you think ?