Announcement Announcement Module
Collapse
No announcement yet.
Issues with Integration Test in Pizza example after removal of Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issues with Integration Test in Pizza example after removal of Roo

    I followed the Roo example pizza example (roo-1.0.2.RELEASE and sts-2.3.2.RELEASE) and after finsihing the example I followed the documentation on how to remove roo (I was keen to see how the java classes would look like without Roo) but found that all integration tests are failing to compile afterwards.

    For example:
    <code>
    public class BaseIntegrationTest {

    @Test
    public void testCountBases() {
    org.junit.Assert.assertNotNull("Data on demand for 'Base' failed to initialize correctly", dod.getRandomBase());
    org.junit.Assert.assertTrue("Counter for 'Base' incorrectly reported there were no entries", count > 0);
    }
    }
    </code>

    Here we don't have the variable count defined, not hard to fix the tests but would be interesting to find out why's etc.

    Regards
    Andreas

  • #2
    That's really odd. I have done a push-in refactor numerous times without a problem and run the tests afterwards. Can you please re-try the push-in refactor? Was the count field still in the ITD? If it's not working, please re-try with the latest version of STS (2.3.3.M1) and log a bug against AJDT if it fails again.

    Comment


    • #3
      Hello

      I ran into the same problem after following the instructions for the removal in Chapter 6 of the reference guide. I found a simple work around. In the post roo SpecialCaseCriteriaDataOnDemand (below) the "obj" variable is undefined.

      public SpecialCaseCriteria getNewTransientSpecialCaseCriteria(int index) {
      obj.setCriteriaValue("criteriaValue_" + index);
      obj.setSpecialCasesId(specialCasesDataOnDemand.get RandomSpecialCases());
      return obj;
      }

      In the original SpecialCaseCriteriaIntegrationTest_Roo_Integration Test.aj the method looked like this:

      public SpecialCaseCriteria SpecialCaseCriteriaDataOnDemand.getNewTransientSpe cialCaseCriteria(int index) {
      com.storeroom.manufacturerservice.domain.SpecialCa seCriteria obj = new com.storeroom.manufacturerservice.domain.SpecialCa seCriteria();
      obj.setCriteriaValue("criteriaValue_" + index);
      obj.setSpecialCasesId(specialCasesDataOnDemand.get RandomSpecialCases());
      return obj;
      }

      Note that the line that is missing from the post Roo version:
      com.storeroom.manufacturerservice.domain.SpecialCa seCriteria obj = new com.storeroom.manufacturerservice.domain.SpecialCa seCriteria();

      I don't have a very big project so I just cut and paste (I know, a sin) the missing code from the Roo to Post Roo version. All test compile and pass. The web app works too.

      Thanks
      Tom

      Comment


      • #4
        Originally posted by tpurcell View Post
        Hello

        I don't have a very big project so I just cut and paste (I know, a sin) the missing code from the Roo to Post Roo version. All test compile and pass. The web app works too.

        Thanks
        Tom
        Hey, Tom. Fancy meeting you here . If you don't push-in refactor, the @RooIntegrationTest lets you disable a given test if you write your own instead (I think you say things like update=false, create=false, etc…) Then it will delete that method from the ITD.

        Comment

        Working...
        X