spring roo - Roo generated test code does not compile for int @Id variable -
I have created a very simple Spring Roo 1.2.5 project with an Entity class MyEntity that has some string variables.
I have a
@ id @ generated value (strategy = GenerationType.AUTO) Private Ent ID; On MyEntity.java to create a primary key, and spring generated Cry
@Test public void MyEntityIntegrationTest.testFindMyEntity () {MyEntity obj = Dod getRandomMyEntity (); Assert.assertNotNull (data on demand "Maiantiti" failed to correctly start ", obj); int id = obj.getPrimaryKey (); Assert.assertNotNull (to provide data identifiers on demand" Maiantiti failed ", id); Obj = MyEntity.findMyEntity (ID); Assert.assertNotNull (" Search method "MyEntity '' illegal ID" + + + "," ", nULL returned for obj); Assert.assertEquals ("The method for 'MyEntity' detected the wrong identifier", id, obj.getPrimaryKey ()); } In the MyEntityIntegrationTest_Roo_IntegrationTest.aj file. Although there are two problems:
1) Type is int, so why does it allocate to integer, then test for zero? If type integer, so the result can not be null could not solve the types of
2) does not last claim compile because JDK 6 compiler assertEquals (int, int):
method assertEquals (string, object, object) is vague sort of way MyEntityIntegrationTest_Roo_IntegrationTest.aj / mu / src / test / java / com / sas / mu line 47 Java problem I can decide to change this field to an integer or long. But @ id says that there are priorities.
Is this a Rs.1.25 bug as I suspect? Is there any fix?
I think this is a Spring rupee bug, so, you can make a request.
To fix this in your project, while the bug is not resolved, you can test the class testFindMyEntity and correct the code by hand. Spring will not make it again in the .j file.
शुरुआत कोडर के लिए जावा भाषा के नमूने
ReplyDeleteजावा में SQL सर्वर में एक छवि सम्मिलित करना