Author: sohil.shah(a)jboss.com
Date: 2008-04-17 17:12:58 -0400 (Thu, 17 Apr 2008)
New Revision: 10625
Removed:
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/plugin/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelEvent.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelListener.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIAction.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContainer.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPage.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPortal.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIWindow.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MockModelTestCase.java
Log:
code cleanup
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelEvent.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelEvent.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelEvent.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public abstract class ModelEvent
-{
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelListener.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelListener.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ModelListener.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,32 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface ModelListener
-{
- void onEvent(ModelEvent event);
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIAction.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIAction.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIAction.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,55 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * An action that can be triggered.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface UIAction extends UIObject
-{
-
- /**
- * Returns the action display name.
- *
- * @return the display name
- */
- String getDisplayName();
-
- /**
- * Returns the action icon URL.
- *
- * @return the icon URL
- */
- String getIconURL();
-
- /**
- * Returns the action URL.
- *
- * @return the url
- */
- String getURL();
-
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContainer.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContainer.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContainer.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface UIContainer extends UIObject
-{
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContext.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIContext.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,43 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface UIContext extends UIObject
-{
- /**
- *
- * @param id the object id
- * @return the object for the specified id or null if it cannot be found
- */
- UIObject getObject(String id);
-
- /**
- *
- * @param listener the listener
- */
- void addModelListener(ModelListener listener);
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPage.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPage.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPage.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface UIPage extends UIObject
-{
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPortal.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPortal.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIPortal.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface UIPortal extends UIObject
-{
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIWindow.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIWindow.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UIWindow.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,61 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model;
-
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface UIWindow extends UIObject
-{
- /**
- * Returns the window state of the window or null if it does not exist.
- *
- * @return the window state
- */
- WindowState getWindowState();
-
- /**
- * Update the window state of the window.
- *
- * @param windowState the new window state
- */
- void setWindowState(WindowState windowState);
-
- /**
- * Returns the mode of the window or null if it does not exist.
- *
- * @return the mode
- */
- Mode getMode();
-
- /**
- * Update the mode of the window.
- *
- * @param mode the new mode
- */
- void setMode(Mode mode);
-}
Deleted:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MockModelTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MockModelTestCase.java 2008-04-17
20:57:03 UTC (rev 10624)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/MockModelTestCase.java 2008-04-17
21:12:58 UTC (rev 10625)
@@ -1,253 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.test.model;
-
-import org.jboss.portal.presentation.model2.ui.UIPage;
-import org.jboss.portal.presentation.model2.UIObject;
-import org.jboss.portal.presentation.state.StaleStateException;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.test.model.state.structural.MockModel;
-import org.jboss.portal.presentation.test.model.state.structural.MockObject;
-import org.jboss.portal.presentation.test.model.state.structural.MockException;
-import org.jboss.portal.presentation.test.model.state.structural.MockModelImpl;
-
-import java.util.Collections;
-import java.util.Set;
-import java.util.List;
-
-/**
- * Test that the mock model we are using behaves in an expected manner
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class MockModelTestCase extends AbstractModelTestCase<MockObject>
-{
-
- /** . */
- private MockModel model;
-
- /** . */
- private StructuralStateContext structuralStateContext;
-
- protected void setUp() throws Exception
- {
- model = new MockModelImpl();
- structuralStateContext = model.getStructuralStateContext();
- }
-
- protected void tearDown() throws Exception
- {
- model = null;
- structuralStateContext = null;
- }
-
- protected MockObject getRoot()
- {
- return model.getRoot();
- }
-
- public StructuralStateContext getStructuralStateContext()
- {
- return structuralStateContext;
- }
-
- protected Set<String> getPropertyNames(MockObject object)
- {
- return object.getPropertyNames();
- }
-
- protected MockObject getParent(MockObject object)
- {
- return object.getParent();
- }
-
- protected List<? extends MockObject> getChildren(MockObject object)
- {
- return object.getChildren();
- }
-
- protected String getName(MockObject object)
- {
- return object.getName();
- }
-
- protected boolean isValid(MockObject object)
- {
- return object.isValid();
- }
-
- protected Class<? extends UIObject> getType(MockObject object)
- {
- return object.getType();
- }
-
- protected String getId(MockObject object)
- {
- return object.getId();
- }
-
- protected void setProperty(MockObject object, String propertyName, String
propertyValue)
- {
- object.setPropertyValue(propertyName, propertyValue);
- }
-
- protected String getProperty(MockObject mockRoot, String name)
- {
- return mockRoot.getPropertyValue(name);
- }
-
-
- protected MockObject addChild(MockObject object, String name, Class<? extends
UIObject> type)
- {
- return object.addChild(name, type);
- }
-
- protected void destroy(MockObject object)
- {
- model.destroy(object);
- }
-
- public void testDestroyInvalidates() throws MockException
- {
- MockObject mockRoot = getRoot();
- MockObject mockFoo = addChild(mockRoot, "foo", UIPage.class);
-
- //
- destroy(mockFoo);
-
- //
- assertEquals(false, isValid(mockFoo));
- try
- {
- addChild(mockFoo, "juu", UIPage.class);
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.INVALID_OBJECT, e.getCode());
- }
- try
- {
- destroy(mockFoo);
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.INVALID_OBJECT, e.getCode());
- }
- try
- {
- setProperty(mockFoo, "blah", "bluh");
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.INVALID_OBJECT, e.getCode());
- }
- }
-
- public void testMove() throws MockException
- {
- MockObject mockRoot = getRoot();
-
- MockObject mockFoo = addChild(mockRoot, "foo", UIPage.class);
- MockObject mockBar = addChild(mockRoot, "bar", UIPage.class);
-
- mockFoo.move(mockBar);
-
- assertSame(mockBar, getParent(mockFoo));
- assertEquals(Collections.singletonList(mockFoo), getChildren(mockBar));
- assertEquals(Collections.singletonList(mockBar), getChildren(mockRoot));
- }
-
- public void testMoveViolatesConstraint() throws MockException
- {
- MockObject mockRoot = getRoot();
-
- MockObject mockFoo = addChild(mockRoot, "foo", UIPage.class);
- MockObject mockBar = addChild(mockRoot, "bar", UIPage.class);
- MockObject mockJuu = addChild(mockBar, "juu", UIPage.class);
-
- //
- try
- {
- mockRoot.move(mockRoot);
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.CONSTRAINT_VIOLATION, e.getCode());
- }
-
- //
- try
- {
- mockRoot.move(mockFoo);
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.CONSTRAINT_VIOLATION, e.getCode());
- }
-
- //
- try
- {
- mockBar.move(mockBar);
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.CONSTRAINT_VIOLATION, e.getCode());
- }
-
- //
- try
- {
- mockBar.move(mockJuu);
- }
- catch (MockException e)
- {
- assertEquals(MockException.ErrorCode.CONSTRAINT_VIOLATION, e.getCode());
- }
- }
-
- public void testInvalidatedByMove() throws MockException
- {
- MockObject mockRoot = getRoot();
-
- //
- MockObject mockFoo = addChild(mockRoot, "foo", UIPage.class);
- MockObject mockBar = addChild(mockFoo, "bar", UIPage.class);
- MockObject mockJuu = addChild(mockFoo, "juu", UIPage.class);
-
- //
- StructuralObject foo = mockFoo.takeSnapshot();
- StructuralObject bar = mockBar.takeSnapshot();
- StructuralObject juu = mockJuu.takeSnapshot();
-
- //
- mockBar.move(mockJuu);
-
- //
- assertValidity(foo, StaleStateException.class);
- assertValidity(bar, StaleStateException.class);
- assertValidity(juu, StaleStateException.class);
- }
-}