/** * Tests path bufferisation when the requested sections are found. */ @Test public void testSectionFoundBuffer() { BufferedConfigurationExplorer explorer; for(int i = 0; i < DEPTH; i++) { moveTo(explorer = (BufferedConfigurationExplorer)getExplorer(), i); backtrack(explorer, i); } }
/** * Tests path bufferisation when the requested sections are not found. */ @Test public void testSectionNotFoundBuffer() { BufferedConfigurationExplorer explorer; for(int i = 0; i < DEPTH; i++) { moveTo(explorer = (BufferedConfigurationExplorer)getExplorer(), i); // Makes sure that a failed moveTo call doesn't corrupt section history. assert !explorer.moveTo(FAKE_SECTION + i, false); backtrack(explorer, i); } }
/** * Tests path bufferisation when the requested sections are not found but created. */ @Test public void testSectionNotFoundAndCreateBuffer() { BufferedConfigurationExplorer explorer; for(int i = 0; i < DEPTH; i++) { moveTo(explorer = (BufferedConfigurationExplorer)getExplorer(), i); // Creates the section, makes sure it was created and takes it off // the section stack. assert explorer.moveTo(FAKE_SECTION + i, true); assert explorer.hasSections(); assert explorer.popSection() != null; // Makes sure backtracking through history works. backtrack(explorer, i); } } }