public void testCleanupSwapDirectory() throws Exception
{
Session s = (SessionImpl)repo.login(credentials, wsEntry.getName());
Node testNode = s.getRootNode().getNode("TestWriteOperations");
PropertyImpl property = (PropertyImpl)testNode.setProperty("name", new ByteArrayInputStream("test".getBytes()));
testNode.save();
WorkspaceContainerFacade wsc = repo.getWorkspaceContainer(s.getWorkspace().getName());
JDBCWorkspaceDataContainer dataContainer =
(JDBCWorkspaceDataContainer)wsc.getComponent(JDBCWorkspaceDataContainer.class);
WorkspaceStorageConnection wscon = dataContainer.openConnection();
if (wscon instanceof StatisticsJDBCStorageConnection)
{
wscon = ((StatisticsJDBCStorageConnection)wscon).getNestedWorkspaceStorageConnection();
}
JDBCStorageConnection con = (JDBCStorageConnection) wscon;
File file =
new File(dataContainer.containerConfig.spoolConfig.tempDirectory, con.getInternalId(property
.getInternalIdentifier()) + "0.0");
con.close();
assertTrue(file.exists());