@Test public void getCreated() throws IOException { Thread newThread = new Thread() { public void run() { try { table = provider.createTable("table", types); } catch (IOException e) { Assert.fail(e.getMessage()); } } }; try { newThread.start(); newThread.join(); } catch (InterruptedException e) { Assert.fail(e.getMessage()); } Assert.assertSame("error: should get table", provider.getTable("table"), table); }
@Test public void getRemoved() throws IOException { provider.createTable("table", types); Thread newThread = new Thread() { public void run() { try { provider.removeTable("table"); } catch (IOException e) { Assert.fail(e.getMessage()); } } }; try { newThread.start(); newThread.join(); } catch (InterruptedException e) { Assert.fail(e.getMessage()); } Assert.assertNull("error: should be no table", provider.getTable("table")); }