Author: chris.laprun(a)jboss.com
Date: 2010-08-30 07:44:17 -0400 (Mon, 30 Aug 2010)
New Revision: 3968
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportContext.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java
Log:
- Changed handling of null portlet handles as a null portlet handle is not an
InvalidHandle since the handle is a non-nillable element at the XML
level so should result in an OperationFailed exception and updated test cases
accordingly.
- Replaced use of NotYetImplementedException by NotYetImplemented (that added an undesired
dependency on org.jboss.messaging)
- Fixed more typos and removed use of ExtendedAssert where unneeded.
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportContext.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportContext.java 2010-08-30
10:58:25 UTC (rev 3967)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportContext.java 2010-08-30
11:44:17 UTC (rev 3968)
@@ -1,33 +1,33 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2010, 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.exports.data;
+import org.oasis.wsrp.v2.Lifetime;
+
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
-import org.oasis.wsrp.v2.Lifetime;
-
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
@@ -38,20 +38,20 @@
protected static final String ENCODING = "UTF-8";
public static final String TYPE = "WSRP_EC";
public static final double VERSION = 1.0;
-
-
+
+
protected Lifetime lifeTime;
protected final boolean exportByValue;
-
+
protected List<String> portlets;
-
+
//for now, we don't store anything in the exported by value ExportContext
public ExportContext()
{
this.lifeTime = null;
this.exportByValue = true;
}
-
+
public ExportContext(boolean exportByValue, Lifetime lifetime)
{
//ignore the lifetime if we are exporting by value
@@ -65,22 +65,22 @@
}
this.exportByValue = exportByValue;
}
-
+
public boolean isExportByValue()
{
return this.exportByValue;
}
-
+
public Lifetime getLifeTime()
{
return lifeTime;
}
-
+
public void setLifeTime(Lifetime lifetime)
{
this.lifeTime = lifetime;
}
-
+
public void addPortlet(String portletName)
{
if (portlets == null)
@@ -89,7 +89,7 @@
}
this.portlets.add(portletName);
}
-
+
public static ExportContext create(byte[] bytes)
{
//for now, we don't store anything in the stored by value ExportContext
@@ -101,7 +101,7 @@
{
return TYPE;
}
-
+
public double getVersion()
{
return VERSION;
@@ -109,7 +109,7 @@
protected byte[] internalEncodeAsBytes() throws UnsupportedEncodingException
{
- return "EMPTY".getBytes(ENCODING);
+ return "EMPTY".getBytes(ENCODING); // todo: Matt, is this needed?
}
}
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java 2010-08-30
10:58:25 UTC (rev 3967)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/PortletManagementHandler.java 2010-08-30
11:44:17 UTC (rev 3968)
@@ -504,7 +504,7 @@
WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(exportPortlets,
"ExportPortlets", "ExportPortlets");
List<PortletContext> portletContexts = exportPortlets.getPortletContext();
- if (portletContexts == null || portletContexts.isEmpty())
+ if (!ParameterValidation.existsAndIsNotEmpty(portletContexts))
{
throw WSRP2ExceptionFactory.createWSException(MissingParameters.class,
"Missing required portletContext in ExportPortlets.", null);
}
@@ -533,8 +533,8 @@
}
- List<ExportedPortlet> exportedPortlets = new
ArrayList<ExportedPortlet>();
- Map<String, FailedPortlets> failedPortletsMap = new HashMap<String,
FailedPortlets>();
+ List<ExportedPortlet> exportedPortlets = new
ArrayList<ExportedPortlet>(portletContexts.size());
+ Map<String, FailedPortlets> failedPortletsMap = new HashMap<String,
FailedPortlets>(portletContexts.size());
try
{
@@ -551,27 +551,21 @@
String portletHandle = portletContext.getPortletHandle();
byte[] portletState = portletContext.getPortletState();
+ WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(portletHandle,
"Portlet handle");
- if (portletHandle != null)
- {
- org.gatein.pc.api.PortletContext portalPC =
WSRPUtils.convertToPortalPortletContext(portletContext);
+ org.gatein.pc.api.PortletContext portalPC =
WSRPUtils.convertToPortalPortletContext(portletContext);
- producer.getPortletInvoker().getPortlet(portalPC);
+ producer.getPortletInvoker().getPortlet(portalPC);
- org.gatein.pc.api.PortletContext exportedPortalPC =
producer.getPortletInvoker().exportPortlet(PortletStateType.OPAQUE, portalPC);
+ org.gatein.pc.api.PortletContext exportedPortalPC =
producer.getPortletInvoker().exportPortlet(PortletStateType.OPAQUE, portalPC);
- PortletContext exportedPortalContext =
WSRPUtils.convertToWSRPPortletContext(exportedPortalPC);
- portletHandle = exportedPortalContext.getPortletHandle();
- portletState = exportedPortalContext.getPortletState();
+ PortletContext exportedPortalContext =
WSRPUtils.convertToWSRPPortletContext(exportedPortalPC);
+ portletHandle = exportedPortalContext.getPortletHandle();
+ portletState = exportedPortalContext.getPortletState();
- if (exportedPortalPC == null)
- {
- WSRP2ExceptionFactory.throwWSException(InvalidHandle.class,
"Could not find a portlet with handle " + portletHandle + " in the
producer", null);
- }
- }
- else
+ if (exportedPortalPC == null)
{
- WSRP2ExceptionFactory.throwWSException(InvalidHandle.class, "A
portlet handle cannot be null.", null);
+ WSRP2ExceptionFactory.throwWSException(InvalidHandle.class, "Could
not find a portlet with handle " + portletHandle + " in the producer",
null);
}
//get the exportPortletData
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java 2010-08-30
10:58:25 UTC (rev 3967)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java 2010-08-30
11:44:17 UTC (rev 3968)
@@ -36,7 +36,6 @@
import org.gatein.wsrp.producer.WSRPProducerBaseTest;
import org.gatein.wsrp.servlet.ServletAccess;
import org.gatein.wsrp.support.TestMockExportPersistenceManager;
-import org.gatein.wsrp.test.ExtendedAssert;
import org.gatein.wsrp.test.support.MockHttpServletRequest;
import org.gatein.wsrp.test.support.MockHttpServletResponse;
import org.jboss.arquillian.api.Deployment;
@@ -144,31 +143,18 @@
}
@Test
- public void testExportNonExistantHandle() throws Exception
+ public void testExportNonExistentHandle() throws Exception
{
- String nonExistantHandle = "123FakeHandle";
- List<PortletContext> portletContexts =
createPortletContextList(nonExistantHandle);
+ String nonExistentHandle = "123FakeHandle";
+ List<PortletContext> portletContexts =
createPortletContextList(nonExistentHandle);
ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- checkInvalidHandle(response, nonExistantHandle);
+ checkInvalidHandle(response, nonExistentHandle);
}
@Test
- public void testExportNullHandle() throws Exception
- {
- String nullHandle = null;
- List<PortletContext> portletContexts = createPortletContextList(nullHandle);
-
- ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
-
- ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
-
- checkInvalidHandle(response, nullHandle);
- }
-
- @Test
public void testExportNoRegistrationWhenRequired() throws Exception
{
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
@@ -181,7 +167,7 @@
try
{
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- ExtendedAssert.fail("ExportPortlets should fail if registration is required
and none is provided");
+ fail("ExportPortlets should fail if registration is required and none is
provided");
}
catch (InvalidRegistration e)
{
@@ -206,7 +192,7 @@
try
{
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- ExtendedAssert.fail("ExportPortlets should fail if registration is required
and an invalid registration handle is provided");
+ fail("ExportPortlets should fail if registration is required and an invalid
registration handle is provided");
}
catch (InvalidRegistration e)
{
@@ -241,7 +227,7 @@
try
{
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- ExtendedAssert.fail("Should have thrown a MissingParameters fault if no
portlets passed for export.");
+ fail("Should have thrown a MissingParameters fault if no portlets passed
for export.");
}
catch (MissingParameters e)
{
@@ -255,7 +241,7 @@
try
{
ExportPortletsResponse response = producer.exportPortlets(null);
- ExtendedAssert.fail("Should have failed if sending a null exportPortlet
object");
+ fail("Should have failed if sending a null exportPortlet object");
}
catch (MissingParameters e)
{
@@ -266,10 +252,9 @@
@Test
public void testExports() throws Exception
{
- String nullHandle = null;
- String nonExistantHandle = "123FakeHandle";
+ String nonExistentHandle = "123FakeHandle";
String handle = getDefaultHandle();
- List<PortletContext> portletContexts = createPortletContextList(nullHandle,
nonExistantHandle, handle);
+ List<PortletContext> portletContexts =
createPortletContextList(nonExistentHandle, handle);
ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
@@ -290,9 +275,8 @@
FailedPortlets failedPortlets = response.getFailedPortlets().get(0);
assertEquals("InvalidHandle",
failedPortlets.getErrorCode().getLocalPart());
- assertEquals(2, failedPortlets.getPortletHandles().size());
- assertTrue(failedPortlets.getPortletHandles().contains(nullHandle));
- assertTrue(failedPortlets.getPortletHandles().contains(nonExistantHandle));
+ assertEquals(1, failedPortlets.getPortletHandles().size());
+ assertTrue(failedPortlets.getPortletHandles().contains(nonExistentHandle));
}
protected void checkInvalidHandle(ExportPortletsResponse response, String handle)
throws Exception
@@ -386,7 +370,7 @@
try
{
ImportPortletsResponse response = producer.importPortlets(importPortlets);
- ExtendedAssert.fail("ImportPortlets should fail if registration is required
and non is provided");
+ fail("ImportPortlets should fail if registration is required and non is
provided");
}
catch (InvalidRegistration e)
{
@@ -457,7 +441,7 @@
try
{
ImportPortletsResponse response = producer.importPortlets(importPortlets);
- ExtendedAssert.fail("Should have failed when registration is required and
an invalid registration handle is used.");
+ fail("Should have failed when registration is required and an invalid
registration handle is used.");
}
catch (InvalidRegistration e)
{
@@ -480,7 +464,7 @@
try
{
producer.importPortlets(importPortlets);
- ExtendedAssert.fail("Should have thrown an OperationFailedFault");
+ fail("Should have thrown an OperationFailedFault");
}
catch (OperationFailed e)
{
@@ -503,7 +487,7 @@
try
{
producer.importPortlets(importPortlets);
- ExtendedAssert.fail("Should have thrown an OperationFailedFault");
+ fail("Should have thrown an OperationFailedFault");
}
catch (OperationFailed e)
{
@@ -639,7 +623,7 @@
GetMarkup markup = createMarkupRequest(portletContext.getPortletHandle());
MarkupResponse markupResponse = producer.getMarkup(markup);
assertNotNull(markupResponse.getMarkupContext());
- assertEquals("<p>symbol unset stock value: value unset</p>",
new String(markupResponse.getMarkupContext().getItemString()));
+ assertEquals("<p>symbol unset stock value: value unset</p>",
markupResponse.getMarkupContext().getItemString());
}
@Test
@@ -658,7 +642,7 @@
PortletContext portletContext =
performBlockingInteractionOnSessionPortlet(originalHandle, "new value",
StateChange.CLONE_BEFORE_WRITE);
//check that we have a new portlet context
-
ExtendedAssert.assertFalse(originalHandle.equals(portletContext.getPortletHandle()));
+ assertFalse(originalHandle.equals(portletContext.getPortletHandle()));
checkStatePortlet(portletContext.getPortletHandle(), "new value");
@@ -666,12 +650,12 @@
ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- ExtendedAssert.assertFalse(response.getExportedPortlet().isEmpty());
+ assertFalse(response.getExportedPortlet().isEmpty());
List<PortletContext> portletContextsFromExport =
getPortletContext(response);
- ExtendedAssert.assertNotNull(portletContextsFromExport.isEmpty());
- ExtendedAssert.assertEquals(1, portletContexts.size());
+ assertNotNull(portletContextsFromExport.isEmpty());
+ assertEquals(1, portletContexts.size());
PortletContext portletContextFromExport = portletContextsFromExport.get(0);
//we should be getting the handle of the stateless portlet
@@ -777,12 +761,12 @@
ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- ExtendedAssert.assertFalse(response.getExportedPortlet().isEmpty());
+ assertFalse(response.getExportedPortlet().isEmpty());
List<PortletContext> portletContextsFromExport =
getPortletContext(response);
- ExtendedAssert.assertNotNull(portletContextsFromExport.isEmpty());
- ExtendedAssert.assertEquals(1, portletContexts.size());
+ assertNotNull(portletContextsFromExport.isEmpty());
+ assertEquals(1, portletContexts.size());
PortletContext portletContextFromExport = portletContextsFromExport.get(0);
assertEquals(originalHandle, portletContextFromExport.getPortletHandle());
@@ -849,7 +833,7 @@
//Test that doing a release export actually removed the stored RefId
TestMockExportPersistenceManager persistenceManager =
(TestMockExportPersistenceManager)producer.getExportManager().getPersistenceManager();
- ExtendedAssert.assertEquals(0,
persistenceManager.getExportContexts().keySet().size());
+ assertEquals(0, persistenceManager.getExportContexts().keySet().size());
}
@Test
@@ -865,9 +849,9 @@
ImportPortlets importPortlets =
createSimpleImportPortlets(response.getExportContext(), importPortletsList);
ImportPortletsResponse importResponse = producer.importPortlets(importPortlets);
- ExtendedAssert.assertEquals(1, importResponse.getImportedPortlets().size());
- ExtendedAssert.assertEquals(importID,
importResponse.getImportedPortlets().get(0).getImportID());
-
ExtendedAssert.assertNotNull(importResponse.getImportedPortlets().get(0).getNewPortletContext().getPortletHandle());
+ assertEquals(1, importResponse.getImportedPortlets().size());
+ assertEquals(importID, importResponse.getImportedPortlets().get(0).getImportID());
+
assertNotNull(importResponse.getImportedPortlets().get(0).getNewPortletContext().getPortletHandle());
}
protected ExportPortletsResponse exportPortletToPM() throws Exception
@@ -883,12 +867,12 @@
exportPortlets.setExportByValueRequired(false);
//Test that we don't have anything in the PM before doing an export
- ExtendedAssert.assertEquals(0,
persistenceManager.getExportContexts().keySet().size());
+ assertEquals(0, persistenceManager.getExportContexts().keySet().size());
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
//Test that we have an entry in the PM after doing an export
- ExtendedAssert.assertEquals(1,
persistenceManager.getExportContexts().keySet().size());
+ assertEquals(1, persistenceManager.getExportContexts().keySet().size());
return response;
}
@@ -899,7 +883,7 @@
try
{
producer.setExportLifetime(null);
- ExtendedAssert.fail();
+ fail();
}
catch (OperationNotSupported e)
{
@@ -914,7 +898,7 @@
{
SetExportLifetime setExportLifetime =
WSRPTypeFactory.createSetExportLifetime(null, new byte[]{-10, 24, 24, 54, 'a',
'f', 'g'}, null, null);
producer.setExportLifetime(setExportLifetime);
- ExtendedAssert.fail();
+ fail();
}
catch (OperationNotSupported e)
{
@@ -937,7 +921,7 @@
SetExportLifetime setExportLifetime =
WSRPTypeFactory.createSetExportLifetime(null, exportData.encodeAsBytes(), null, null);
producer.setExportLifetime(setExportLifetime);
- ExtendedAssert.fail();
+ fail();
}
catch (OperationNotSupported e)
{
@@ -969,7 +953,7 @@
{
GetMarkup getMarkupOriginalStateless = createMarkupRequest(handle);
MarkupResponse responseOriginalStateless =
producer.getMarkup(getMarkupOriginalStateless);
- ExtendedAssert.assertEquals(expectedValue,
responseOriginalStateless.getMarkupContext().getItemString());
+ assertEquals(expectedValue,
responseOriginalStateless.getMarkupContext().getItemString());
}
protected PortletContext performBlockingInteractionOnSessionPortlet(String handle,
String value, StateChange stateChange) throws Exception
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java 2010-08-30
10:58:25 UTC (rev 3967)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/support/TestMockExportPersistenceManager.java 2010-08-30
11:44:17 UTC (rev 3968)
@@ -1,42 +1,40 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2010, 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.support;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
+import org.gatein.common.NotYetImplemented;
import org.gatein.exports.ExportPersistenceManager;
import org.gatein.exports.data.ExportContext;
import org.gatein.exports.data.ExportPortletData;
import org.gatein.exports.data.PersistedExportData;
-import org.jboss.messaging.util.NotYetImplementedException;
import org.oasis.wsrp.v2.Lifetime;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
@@ -46,9 +44,9 @@
public static final String PEC_TYPE = "P_EC";
public static final double PEC_VERSION = 1.0;
-
- Map<String,ExportContext> exportContexts = new
HashMap<String,ExportContext>();
-
+
+ Map<String, ExportContext> exportContexts = new HashMap<String,
ExportContext>();
+
//For testing purposes only
public Map<String, ExportContext> getExportContexts()
{
@@ -56,7 +54,7 @@
}
public ExportContext getExportContext(String type, double version, byte[] bytes)
throws UnsupportedEncodingException
- {
+ {
if (supports(type, version))
{
PersistedExportData persistedExportData = PersistedExportData.create(bytes);
@@ -101,7 +99,7 @@
public ExportPortletData retrieveExportPortletData(String refid)
{
- throw new NotYetImplementedException();
+ throw new NotYetImplemented();
}
public String storeExportContextData(ExportContext exportContextData)
@@ -120,36 +118,26 @@
public String storeExportPortletData(ExportPortletData exportPortletData)
{
- throw new NotYetImplementedException();
+ throw new NotYetImplemented();
}
public boolean supports(String type, double version)
{
- if (type.equals(PEC_TYPE) && (version == PEC_VERSION))
- {
- return true;
- }
- else
- {
- return false;
- }
+ return type.equals(PEC_TYPE) && (version == PEC_VERSION);
}
- @Override
public Lifetime updateExportLifetime(ExportContext exportContext, Lifetime lifetime)
{
- throw new NotYetImplementedException();
+ throw new NotYetImplemented();
}
- @Override
public byte[] encodeExportContextData(ExportContext exportContext) throws IOException
{
String refId = storeExportContextData(exportContext);
- PersistedExportData persistedExportData = new PersistedExportData(this.PEC_TYPE,
refId);
+ PersistedExportData persistedExportData = new PersistedExportData(PEC_TYPE,
refId);
return persistedExportData.encodeAsBytes();
}
- @Override
public byte[] encodeExportPortletData(ExportContext exportContext, ExportPortletData
exportPortlet)
{
// FIXME encodeExportPortletData