try { libraryHandle.getThemes().add(theme); fail(); } catch(NameException e) { assertNotNull(e); }
libraryHandle.getThemes().add(theme1); assertEquals("NewTheme1",theme1.getName());
	public void testDefineThemes() throws Exception	{		sessionHandle = DesignEngine.newSession(null);		libraryHandle = sessionHandle.createLibrary();		library = (Library) libraryHandle.getModule();		factory = new ElementFactory( library );				//define theme without name		theme = factory.newTheme(null);		assertEquals("NewTheme",theme.getName());		libraryHandle.getThemes().add(theme);				//define theme with duplicated names			try		{		    libraryHandle.getThemes().add(theme);	        fail();		}		catch(NameException e)		{			assertNotNull(e);		} 				//define theme with styles		style1 = factory.newStyle("Style1");		style2 = factory.newStyle("Style2");		theme.getStyles().add(style1);		theme.getStyles().add(style2);		assertEquals(2,theme.getStyles().getCount());			}