return perspective;
}
@Test
public void testPerspectiveManager() {
IPluginPerspectiveManager manager = PentahoSystem.get( IPluginPerspectiveManager.class );
assertNotNull( manager );
IPluginPerspective testPerspective = createTestPerspective( "test-perspective-id", "test-perspective-title" );
manager.addPluginPerspective( testPerspective );
assertEquals( 1, manager.getPluginPerspectives().size() );
assertEquals( "test-perspective-id", manager.getPluginPerspectives().get( 0 ).getId() );
assertEquals( "test-perspective-title", manager.getPluginPerspectives().get( 0 ).getTitle() );
assertEquals( "test-content-url", manager.getPluginPerspectives().get( 0 ).getContentUrl() );
manager.getPluginPerspectives().get( 0 ).setContentUrl( "different" );
assertEquals( "different", manager.getPluginPerspectives().get( 0 ).getContentUrl() );
manager.removePluginPerspective( testPerspective );
assertEquals( 0, manager.getPluginPerspectives().size() );
manager.addPluginPerspective( createTestPerspective( "test-perspective-id-1", "test-perspective-title-1" ) );
manager.addPluginPerspective( createTestPerspective( "test-perspective-id-2", "test-perspective-title-2" ) );
manager.addPluginPerspective( createTestPerspective( "test-perspective-id-3", "test-perspective-title-3" ) );
manager.addPluginPerspective( createTestPerspective( "test-perspective-id-4", "test-perspective-title-4" ) );
manager.addPluginPerspective( createTestPerspective( "test-perspective-id-5", "test-perspective-title-5" ) );
assertEquals( 5, manager.getPluginPerspectives().size() );
for ( int i = 0; i < 5; i++ ) {
assertEquals( "test-perspective-id-" + ( i + 1 ), manager.getPluginPerspectives().get( i ).getId() );
assertEquals( "test-perspective-title-" + ( i + 1 ), manager.getPluginPerspectives().get( i ).getTitle() );
assertEquals( 500, manager.getPluginPerspectives().get( i ).getLayoutPriority() );
}
manager.clearPluginPerspectives();
assertEquals( 0, manager.getPluginPerspectives().size() );
}