You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by cz...@apache.org on 2007/03/08 20:10:40 UTC
svn commit: r516149 [4/4] - in /portals/pluto/branches/pluto-1.1.x:
maven-pluto-plugin/src/main/java/org/apache/pluto/maven/
pluto-ant-tasks/src/main/java/org/apache/pluto/ant/
pluto-container/src/main/java/org/apache/pluto/
pluto-container/src/main/ja...
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/Assembler.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/Assembler.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/Assembler.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/Assembler.java Thu Mar 8 11:10:26 2007
@@ -22,7 +22,6 @@
* The pluto assembler is used to assemble a portlet application which is
* deployable to pluto.
*
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
* @version 1.0
* @since Oct 15, 2004
*/
@@ -31,7 +30,7 @@
public static final String PORTLET_XML = "WEB-INF/portlet.xml";
public static final String SERVLET_XML = "WEB-INF/web.xml";
-
+
public static final String DISPATCH_SERVLET_CLASS =
"org.apache.pluto.core.PortletServlet";
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerConfig.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerConfig.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerConfig.java Thu Mar 8 11:10:26 2007
@@ -20,49 +20,48 @@
/**
* The pluto assembler configuration.
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
*/
public class AssemblerConfig {
-
+
// Private Member Variables ------------------------------------------------
-
+
/** The portlet app descriptor, which is usually WEB-INF/portlet.xml. */
- private File portletDescriptor = null;
-
+ private File portletDescriptor;
+
/** The webapp descriptor, which is usually WEB-INF/web.xml. */
- private File webappDescriptor = null;
-
+ private File webappDescriptor;
+
/** The assemble destination, which points to the assembled WAR file. */
- private File destination = null;
+ private File destination;
/** The class of the servlet that will handle portlet requests */
- private String dispatchServletClass = null;
-
+ private String dispatchServletClass;
+
/** A source WAR archive to assemble */
- private File warSource = null;
-
+ private File warSource;
+
// Public Methods ----------------------------------------------------------
-
+
public File getPortletDescriptor() {
return portletDescriptor;
}
-
+
public void setPortletDescriptor(File portletDescriptor) {
this.portletDescriptor = portletDescriptor;
}
-
+
public File getWebappDescriptor() {
return webappDescriptor;
}
-
+
public void setWebappDescriptor(File webappDescriptor) {
this.webappDescriptor = webappDescriptor;
}
-
+
public File getDestination() {
return destination;
}
-
+
public void setDestination(File destination) {
this.destination = destination;
}
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerFactory.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerFactory.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerFactory.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/AssemblerFactory.java Thu Mar 8 11:10:26 2007
@@ -20,24 +20,22 @@
import org.apache.pluto.util.assemble.war.WarAssembler;
/**
- * The pluto assembler factory that creates an assembler.
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
+ * The pluto assembler factory that creates an assembler.
* @version 1.0
* @since Nov 8, 2004
*/
public class AssemblerFactory {
-
+
/** The singleton factory instance. */
private static final AssemblerFactory FACTORY = new AssemblerFactory();
-
+
/**
* Private constructor that prevents external instantiation.
*/
private AssemblerFactory() {
// Do nothing.
}
-
+
/**
* Returns the singleton factory instance.
* @return the singleton factory instance.
@@ -45,10 +43,10 @@
public static AssemblerFactory getFactory() {
return FACTORY;
}
-
-
+
+
// Public Methods ----------------------------------------------------------
-
+
/**
* Creates an assembler to assemble a portlet app WAR file to a web app WAR
* file deployable to pluto.
@@ -63,5 +61,5 @@
return new FileAssembler();
}
}
-
+
}
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/WebXmlRewritingAssembler.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/WebXmlRewritingAssembler.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/WebXmlRewritingAssembler.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/WebXmlRewritingAssembler.java Thu Mar 8 11:10:26 2007
@@ -34,16 +34,15 @@
import org.apache.pluto.descriptors.servlet.WebAppDD;
/**
- * @author Eric Dalquist <a href="mailto:eric.dalquist@doit.wisc.edu">eric.dalquist@doit.wisc.edu</a>
* @version $Revision$
* @todo fix direct dependency on pluto-descriptor-impl
*/
-public abstract class WebXmlRewritingAssembler implements Assembler {
-
+public abstract class WebXmlRewritingAssembler implements Assembler {
+
/**
* Updates the webapp descriptor by injecting portlet wrapper servlet
* definitions and mappings.
- *
+ *
* @param webXmlIn input stream to the webapp descriptor, it will be closed before the web xml is written out.
* @param portletXmlIn input stream to the portlet app descriptor, it will be closed before the web xml is written out.
* @param webXmlOut output stream to the webapp descriptor, it will be flushed and closed.
@@ -62,7 +61,7 @@
dispatchServletClass.trim().length() == 0) {
dispatchServletClass = DISPATCH_SERVLET_CLASS;
}
-
+
WebAppDescriptorService descriptorSvc = new WebAppDescriptorServiceImpl();
WebAppDD webAppDDIn = descriptorSvc.read(webXmlIn);
@@ -70,24 +69,24 @@
new PortletAppDescriptorServiceImpl();
PortletAppDD portletAppDD = portletAppDescriptorService.read(portletXmlIn);
portletXmlIn.close();
-
+
for (Iterator it = portletAppDD.getPortlets().iterator();
it.hasNext(); ) {
-
+
// Read portlet definition.
PortletDD portlet = (PortletDD) it.next();
String name = portlet.getPortletName();
ServletDD servlet = new ServletDD();
servlet.setServletName(name);
-
+
servlet.setServletClass(dispatchServletClass);
InitParamDD initParam = new InitParamDD();
initParam.setParamName("portlet-name");
initParam.setParamValue(name);
servlet.getInitParams().add(initParam);
-
+
LoadOnStartupDD onStartup = new LoadOnStartupDD();
onStartup.setPriority(1);
servlet.setLoadOnStartup(onStartup);
@@ -98,9 +97,9 @@
webAppDDIn.getServlets().add(servlet);
webAppDDIn.getServletMappings().add(servletMapping);
-
+
}
-
+
descriptorSvc.write(webAppDDIn, webXmlOut);
}
}
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/file/FileAssembler.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/file/FileAssembler.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/file/FileAssembler.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/file/FileAssembler.java Thu Mar 8 11:10:26 2007
@@ -28,38 +28,37 @@
/**
*
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
* @version 1.0
* @since Nov 8, 2004
*/
public class FileAssembler extends WebXmlRewritingAssembler {
// Constructor -------------------------------------------------------------
-
+
/**
* Default no-arg constructor.
*/
public FileAssembler() {
// Do nothing.
}
-
-
+
+
// Assembler Impl ----------------------------------------------------------
-
+
public void assemble(AssemblerConfig config) throws UtilityException {
try {
final File webappDescriptor = config.getWebappDescriptor();
InputStream webXmlIn = new FileInputStream(webappDescriptor);
-
+
final File portletDescriptor = config.getPortletDescriptor();
InputStream portletXmlIn = new FileInputStream(portletDescriptor);
-
+
final File destinationDescriptor = config.getDestination();
if (webappDescriptor.equals(destinationDescriptor)) {
final File tempXml = File.createTempFile(webappDescriptor.getName() + ".", ".tmp");
final FileOutputStream webXmlOut = new FileOutputStream(tempXml);
-
+
this.updateWebappDescriptor(webXmlIn, portletXmlIn, webXmlOut, config.getDispatchServletClass());
-
+
//Move the temp file to the destination location
destinationDescriptor.delete();
tempXml.renameTo(destinationDescriptor);
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java Thu Mar 8 11:10:26 2007
@@ -39,34 +39,33 @@
/**
*
- * @author Eric Dalquist <a href="mailto:edalquist@doit.wisc.edu">edalquist@doit.wisc.edu</a>
* @version 1.0
* @since Nov 8, 2004
*/
public class WarAssembler extends WebXmlRewritingAssembler {
// Constructor -------------------------------------------------------------
-
+
/**
* Default no-arg constructor.
*/
public WarAssembler() {
// Do nothing.
}
-
-
+
+
// Assembler Impl ----------------------------------------------------------
-
+
public void assemble(AssemblerConfig config) throws UtilityException {
try {
final File sourceArchive = config.getWarSource();
final File destinationFolder = config.getDestination();
final File destinationArchive = new File(destinationFolder, sourceArchive.getName());
-
+
//If the source and dest are the same a temp location is needed
if (sourceArchive.equals(destinationArchive)) {
final File tempArchive = File.createTempFile(sourceArchive.getName() + ".", ".tmp");
this.assembleWar(sourceArchive, tempArchive, config.getDispatchServletClass());
-
+
//Move the temp file to the destination location
destinationArchive.delete();
tempArchive.renameTo(destinationArchive);
@@ -74,12 +73,12 @@
else {
this.assembleWar(sourceArchive, destinationArchive, config.getDispatchServletClass());
}
-
+
} catch (IOException ex) {
throw new UtilityException(ex.getMessage(), ex, null);
}
}
-
+
/**
* Reads the source JAR copying entries to the dest JAR. The web.xml and portlet.xml are cached
* and after the entire archive is copied (minus the web.xml) a re-written web.xml is generated
@@ -87,7 +86,7 @@
*/
protected void assembleWar(File source, File dest, String dispatchServletClass) throws IOException {
final JarInputStream jarIn = new JarInputStream(new FileInputStream(source));
-
+
try {
//Create the output JAR stream, copying the Manifest
final Manifest manifest = jarIn.getManifest();
@@ -100,12 +99,12 @@
JarEntry servletXmlEntry = null;
byte[] servletXmlBuffer = null;
byte[] portletXmlBuffer = null;
-
+
//Read the source archive entry by entry
JarEntry originalJarEntry;
while ((originalJarEntry = jarIn.getNextJarEntry()) != null) {
final JarEntry newJarEntry = this.smartClone(originalJarEntry);
-
+
//Capture the web.xml JarEntry and contents as a byte[], don't write it out now
if (SERVLET_XML.equals(newJarEntry.getName())) {
servletXmlEntry = newJarEntry;
@@ -123,7 +122,7 @@
IOUtils.copy(jarIn, jarOut);
}
}
-
+
//Checks to make sure the web.xml and portlet.xml were found
if (servletXmlBuffer == null) {
throw new FileNotFoundException("File '" + SERVLET_XML + "' could not be found in the archive '" + source + "'");
@@ -131,25 +130,25 @@
if (portletXmlBuffer == null) {
throw new FileNotFoundException("File '" + PORTLET_XML + "' could not be found in the archive '" + source + "'");
}
-
+
//Create streams of the byte[] data for the updater method
final InputStream webXmlIn = new ByteArrayInputStream(servletXmlBuffer);
final InputStream portletXmlIn = new ByteArrayInputStream(portletXmlBuffer);
final ByteArrayOutputStream webXmlOut = new ByteArrayOutputStream(servletXmlBuffer.length);
-
+
//Update the web.xml
this.updateWebappDescriptor(webXmlIn, portletXmlIn, webXmlOut, dispatchServletClass);
final byte[] webXmlBytes = webXmlOut.toByteArray();
-
+
//If no compression is being used (STORED) we have to manually update the size and crc
if (servletXmlEntry.getMethod() == ZipEntry.STORED) {
servletXmlEntry.setSize(webXmlBytes.length);
-
+
final CRC32 webXmlCrc = new CRC32();
webXmlCrc.update(webXmlBytes);
servletXmlEntry.setCrc(webXmlCrc.getValue());
}
-
+
//write out the web.xml entry and contents
jarOut.putNextEntry(servletXmlEntry);
IOUtils.write(webXmlBytes, jarOut);
@@ -177,7 +176,7 @@
newJarEntry.setSize(originalJarEntry.getSize());
newJarEntry.setCrc(originalJarEntry.getCrc());
}
-
+
return newJarEntry;
}
}
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java Thu Mar 8 11:10:26 2007
@@ -34,14 +34,13 @@
/**
* Command Line Interface to the Pluto Assembler.
*
- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
* @version 1.0
* @since Oct 15, 2004
*/
public class AssemblerCLI {
- private Options options;
- private String[] args;
+ private final Options options;
+ private final String[] args;
public AssemblerCLI(String[] args) {
this.args = args;
@@ -92,7 +91,7 @@
config.setWebappDescriptor(webXml);
config.setPortletDescriptor(portletXml);
config.setDestination(webXml);
-
+
Assembler assembler = AssemblerFactory.getFactory()
.createAssembler(config);
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java Thu Mar 8 11:10:26 2007
@@ -16,22 +16,25 @@
*/
package org.apache.pluto.util.install.file;
-import java.io.*;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.PrintWriter;
-import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* TODO JavaDoc
*
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:
* @version 1.0
* @since Dec 11, 2005
*/
public class TomcatCrossContextGenerator {
private static final String PLUTO_TEMP_DIR = "PlutoDomain";
private static Log LOG = LogFactory.getLog(TomcatCrossContextGenerator.class);
-
+
public static void main(String[] args) throws IOException {
File tomcatHome = new File(args[0]);
@@ -48,13 +51,13 @@
}
/**
- * Creates a tomcat-specific context deployment descriptor
+ * Creates a tomcat-specific context deployment descriptor
* and deploys it.
- *
+ *
* @param confDir Tomcat conf directory
* @param fileName File name of the war
* @param contextName The root name of the context file
- * @throws IOException If there is a problem
+ * @throws IOException If there is a problem
*/
public static void createContextFile(File confDir, String fileName, String contextName) throws IOException {
PrintWriter out = null;
@@ -66,14 +69,14 @@
.append("crossContext=\"true\">").append("</Context>");
File confFile = new File(confDir, contextName+".xml");
if (LOG.isInfoEnabled()) {
- LOG.info("Writing file: "+ confFile.getAbsolutePath());
+ LOG.info("Writing file: "+ confFile.getAbsolutePath());
}
out = new PrintWriter(new FileWriter(confFile));
out.println(contents.toString());
} finally {
if (out != null) {
out.flush();
- out.close();
+ out.close();
}
}
}
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/file/FileAssemblerTest.java Thu Mar 8 11:10:26 2007
@@ -26,23 +26,22 @@
import org.custommonkey.xmlunit.XMLUnit;
/**
- * @author Eric Dalquist <a href="mailto:eric.dalquist@doit.wisc.edu">eric.dalquist@doit.wisc.edu</a>
* @version $Revision$
*/
public class FileAssemblerTest extends XMLTestCase {
- private File webXmlFile = null;
- private File portletXmlFile = null;
- private File assembledWebXmlFile = null;
-
+ private File webXmlFile;
+ private File portletXmlFile;
+ private File assembledWebXmlFile;
+
protected void setUp() throws Exception {
XMLUnit.setIgnoreWhitespace(true);
-
+
final URL webXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/web.xml");
this.webXmlFile = new File(webXmlUrl.getFile());
-
+
final URL portletXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/portlet.xml");
this.portletXmlFile = new File(portletXmlUrl.getFile());
-
+
final URL assembledWebXmlUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/file/assembled.web.xml");
this.assembledWebXmlFile = new File(assembledWebXmlUrl.getFile());
}
@@ -54,35 +53,35 @@
public void testAssembleToNewDirectory() throws Exception {
AssemblerConfig config = new AssemblerConfig();
-
+
final File webXmlFileDest = File.createTempFile(this.webXmlFile.getName() + ".", ".xml");
webXmlFileDest.deleteOnExit();
config.setWebappDescriptor(this.webXmlFile);
config.setPortletDescriptor(this.portletXmlFile);
config.setDestination(webXmlFileDest);
-
+
FileAssembler assembler = new FileAssembler();
assembler.assemble(config);
assertXMLEqual(new FileReader(this.assembledWebXmlFile), new FileReader(webXmlFileDest));
}
-
+
public void testAssembleOverSelf() throws Exception {
AssemblerConfig config = new AssemblerConfig();
-
+
final File webXmlFileCopy = File.createTempFile(this.webXmlFile.getName() + ".", ".source.xml");
webXmlFileCopy.deleteOnExit();
FileUtils.copyFile(this.webXmlFile, webXmlFileCopy);
-
+
config.setWebappDescriptor(webXmlFileCopy);
config.setPortletDescriptor(this.portletXmlFile);
config.setDestination(webXmlFileCopy);
-
+
FileAssembler assembler = new FileAssembler();
assembler.assemble(config);
-
+
assertXMLEqual(new FileReader(this.assembledWebXmlFile), new FileReader(webXmlFileCopy));
}
}
Modified: portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/war/WarAssemblerTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/war/WarAssemblerTest.java?view=diff&rev=516149&r1=516148&r2=516149
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/war/WarAssemblerTest.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-util/src/test/java/org/apache/pluto/util/assemble/war/WarAssemblerTest.java Thu Mar 8 11:10:26 2007
@@ -26,12 +26,11 @@
import org.apache.pluto.util.assemble.AssemblerConfig;
/**
- * @author Eric Dalquist <a href="mailto:eric.dalquist@doit.wisc.edu">eric.dalquist@doit.wisc.edu</a>
* @version $Revision$
*/
public class WarAssemblerTest extends TestCase {
private File portletFile = null;
-
+
protected void setUp() throws Exception {
final URL portletUrl = this.getClass().getResource("/org/apache/pluto/util/assemble/war/WarDeployerTestPortlet.war");
this.portletFile = new File(portletUrl.getFile());
@@ -43,31 +42,31 @@
public void testAssembleToNewDirectory() throws Exception {
AssemblerConfig config = new AssemblerConfig();
-
+
config.setWarSource(this.portletFile);
-
+
final File tempDir = getTempDir();
config.setDestination(tempDir);
-
+
WarAssembler assembler = new WarAssembler();
assembler.assemble(config);
-
+
//How to validate it worked?
}
-
+
public void testAssembleOverSelf() throws Exception {
AssemblerConfig config = new AssemblerConfig();
-
+
final File portletCopy = File.createTempFile(this.portletFile.getName() + ".", ".war");
portletCopy.deleteOnExit();
FileUtils.copyFile(this.portletFile, portletCopy);
-
+
config.setWarSource(portletCopy);
config.setDestination(portletCopy.getParentFile());
-
+
WarAssembler assembler = new WarAssembler();
assembler.assemble(config);
-
+
//How to validate it worked?
}