@Test
public void testExportMenus() {
// Create test objects
ContextAwareMenu thisMenu = new ThisExportMenu();
ContextAwareMenu objsMenu = new ObjectsExportMenu();
thisMenu.initialize();
objsMenu.initialize();
// Name is specified in code, so verify it
Assert.assertEquals(thisMenu.getText(), "Export");
Assert.assertEquals(objsMenu.getText(), "Export");
// Should always return true to canHandle
Assert.assertTrue(thisMenu.canHandle(null));
Assert.assertTrue(objsMenu.canHandle(null));
// Verify that expected extension points are published
String[] thisExts = thisMenu.getExtensionMenubarPaths();
String[] objsExts = objsMenu.getExtensionMenubarPaths();
Assert.assertEquals(thisExts[0], "/this/export.ext");
Assert.assertEquals(objsExts[0], "/objects/export.ext");
// Verify that export to image is included
Assert.assertTrue(find("EXPORT_THIS_TO_IMAGE", thisMenu));