JBoss Portal SVN: r8728 - in modules/test/trunk/unit/src/main/org/jboss: unit/report/impl/junit and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-20 18:33:04 -0400 (Sat, 20 Oct 2007)
New Revision: 8728
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ByteArrayOutputStreamExt.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ForkedOutputStream.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputManager.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputView.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitReporter.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
Log:
- Handle System.out / System.err at the Main level
- added SystemOutputManager and SystemOutputView for managing System.out / System.err
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java 2007-10-20 21:13:45 UTC (rev 8727)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -31,6 +31,7 @@
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.jboss.unit.runner.model.BuilderException;
+import org.jboss.unit.tooling.SystemOutputManager;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -72,21 +73,32 @@
private static void test2()
throws ParserConfigurationException, IOException, SAXException, BuilderException
{
- InputStream in = SampleTests.class.getResourceAsStream("f1.xml");
- InputSource source = new InputSource(in);
- ModelBuilder builder = new ModelBuilder(source);
- TestSuiteDef suite = builder.build();
+ SystemOutputManager outputManager = new SystemOutputManager();
- TestRunner runner = suite.createRunner();
+ try
+ {
+ outputManager.start();
- TestRunnerEventListener junitReporter = new JUnitReporter("output/tests", SampleTests.class.getName());
- // add listeners
+ InputStream in = SampleTests.class.getResourceAsStream("f1.xml");
+ InputSource source = new InputSource(in);
+ ModelBuilder builder = new ModelBuilder(source);
+ TestSuiteDef suite = builder.build();
- TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster();
- broadcaster.addListener(junitReporter);
- broadcaster.addListener(new PrintListener());
+ TestRunner runner = suite.createRunner();
- // run the test
- runner.run(new TestRunnerContextSupport(broadcaster));
+ TestRunnerEventListener junitReporter = new JUnitReporter("output/tests", SampleTests.class.getName());
+ // add listeners
+
+ TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster();
+ broadcaster.addListener(junitReporter);
+ broadcaster.addListener(new PrintListener());
+
+ // run the test
+ runner.run(new TestRunnerContextSupport(broadcaster));
+ }
+ finally
+ {
+ outputManager.stop();
+ }
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitReporter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitReporter.java 2007-10-20 21:13:45 UTC (rev 8727)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitReporter.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -22,13 +22,8 @@
******************************************************************************/
package org.jboss.unit.report.impl.junit;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunnerEvent;
+import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.EndTestCaseEvent;
import org.jboss.unit.runner.event.EndTestSuiteEvent;
@@ -36,7 +31,12 @@
import org.jboss.unit.runner.event.StartRunnerEvent;
import org.jboss.unit.runner.event.StartTestCaseEvent;
import org.jboss.unit.runner.event.StartTestSuiteEvent;
+import org.jboss.unit.tooling.SystemOutputManager;
+import org.jboss.unit.tooling.SystemOutputView;
+import java.io.StringWriter;
+import java.io.IOException;
+
/**
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -47,24 +47,16 @@
{
/** The JUnit test report */
private JUnitTestReport report;
-
- /** The system error printStream */
- private ByteArrayOutputStream systemError;
-
- /** The system out printStream */
- private ByteArrayOutputStream systemOut;
-
+
/** To dir */
- private static String toDir;
+ private String toDir;
+ private SystemOutputView view;
public JUnitReporter(String reportToDir)
{
toDir = reportToDir;
// redirecting system out and err
- this.systemError = new ByteArrayOutputStream();
- this.systemOut = new ByteArrayOutputStream();
- this.setStreams(systemError, systemOut);
this.report = new JUnitTestReport();
}
@@ -84,13 +76,24 @@
if (event instanceof StartRunnerEvent)
{
report.startJUnitTestSuite((StartRunnerEvent) event);
+ view = SystemOutputManager.getInstance().createView();
}
else if (event instanceof EndRunnerEvent)
{
// append system out and system err
- report.appendSystemError(systemError.toString());
- report.appendSystemOutput(systemOut.toString());
-
+ try
+ {
+ StringWriter out = new StringWriter();
+ StringWriter err = new StringWriter();
+ view.writeTo(out, err);
+ report.appendSystemError(err.toString());
+ report.appendSystemOutput(out.toString());
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+
// Testsuite End
report.endTestSuite((EndRunnerEvent) event);
@@ -118,67 +121,4 @@
report.endTest((EndTestCaseEvent) event);
}
}
-
- private void setStreams(ByteArrayOutputStream a, ByteArrayOutputStream b)
- {
- PrintStream savedError = System.err;
- PrintStream savedOut = System.out;
-
- System.setErr(new PrintStream(new CaptureOutputStream(savedError, a)));
- System.setOut(new PrintStream(new CaptureOutputStream(savedOut, b)));
-
- }
-
- private class CaptureOutputStream extends OutputStream
- {
- private OutputStream s1;
- private OutputStream s2;
-
- public CaptureOutputStream(OutputStream s1, OutputStream s2)
- {
- this.s1 = s1;
- this.s2 = s2;
- }
-
- @Override
- public void close() throws IOException
- {
- try
- {
- s1.close();
- }
- finally
- {
- s2.close();
- }
- }
-
- @Override
- public void flush() throws IOException
- {
- s1.flush();
- s2.flush();
- }
-
- @Override
- public void write(int b) throws IOException
- {
- s1.write(b);
- s2.write(b);
- }
-
- @Override
- public void write(byte[] b) throws IOException
- {
- s1.write(b);
- s2.write(b);
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException
- {
- s1.write(b, off, len);
- s2.write(b, off, len);
- }
- }
}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ByteArrayOutputStreamExt.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ByteArrayOutputStreamExt.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ByteArrayOutputStreamExt.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.unit.tooling;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class ByteArrayOutputStreamExt extends ByteArrayOutputStream
+{
+
+ public int writeTo(OutputStream out, int from) throws IOException, ArrayIndexOutOfBoundsException
+ {
+ out.write(buf, from, count);
+ return count;
+ }
+
+ public int writeTo(Writer out, int from) throws IOException, ArrayIndexOutOfBoundsException
+ {
+ String s = new String(buf, from, count);
+ out.write(s);
+ return count;
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ForkedOutputStream.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ForkedOutputStream.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/ForkedOutputStream.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.unit.tooling;
+
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class ForkedOutputStream extends OutputStream
+{
+
+ /** . */
+ private final OutputStream out1;
+
+ /** . */
+ private final OutputStream out2;
+
+ public ForkedOutputStream(OutputStream out1, OutputStream out2)
+ {
+ this.out1 = out1;
+ this.out2 = out2;
+ }
+
+ public void write(int i) throws IOException
+ {
+ safeWrite(out1, i);
+ safeWrite(out2, i);
+ }
+
+ public void flush() throws IOException
+ {
+ safeFlush(out1);
+ safeFlush(out2);
+ }
+
+ private void safeWrite(OutputStream out, int i)
+ {
+ try
+ {
+ out.write(i);
+ }
+ catch (IOException ignore)
+ {
+ }
+ }
+
+ private void safeFlush(OutputStream out)
+ {
+ try
+ {
+ out.flush();
+ }
+ catch (IOException ignore)
+ {
+ }
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-20 21:13:45 UTC (rev 8727)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -153,12 +153,20 @@
this.broadcaster = broadcaster;
}
+ private SystemOutputManager systemManager;
+
public void execute() throws Exception
{
- // For now lets just be verbose. Later we need some real logging + 'debug' switch
- System.out.println("TestRunnerContext contains: ");
- System.out.println("Properties: " + properties.toString());
+ systemManager = new SystemOutputManager();
+ systemManager.start();
+ //
+ try
+ {
+ // For now lets just be verbose. Later we need some real logging + 'debug' switch
+ System.out.println("TestRunnerContext contains: ");
+ System.out.println("Properties: " + properties.toString());
+
// System.out.println("System properties:");
// for (Object key : System.getProperties().keySet())
// {
@@ -166,15 +174,21 @@
// System.out.println(key + "=" + System.getProperty((String)key));
// }
- StringWriter sw = new StringWriter();
- broadcaster.addListener(new PrintListener(sw));
+ StringWriter sw = new StringWriter();
+ broadcaster.addListener(new PrintListener(sw));
- TestRunnerContextSupport runnerContext = new TestRunnerContextSupport(properties, new ParametrizationSet(), mainFilter, broadcaster);
- runner.run(runnerContext);
+ TestRunnerContextSupport runnerContext = new TestRunnerContextSupport(properties, new ParametrizationSet(), mainFilter, broadcaster);
+ runner.run(runnerContext);
- sw.close();
+ sw.close();
- System.out.println(sw.toString());
+ System.out.println(sw.toString());
+ }
+ finally
+ {
+ systemManager.stop();
+ }
+
}
public static void main(String[] args) throws Exception
Added: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputManager.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputManager.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputManager.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * 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.unit.tooling;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SystemOutputManager
+{
+
+ /** . */
+ private static SystemOutputManager instance;
+
+ /** . */
+ private PrintStream originalOut;
+
+ /** . */
+ private PrintStream originalErr;
+
+ /** . */
+ private ByteArrayOutputStreamExt baosOut;
+
+ /** . */
+ private ByteArrayOutputStreamExt baosErr;
+
+ public SystemOutputManager()
+ {
+ }
+
+ public static SystemOutputManager getInstance()
+ {
+ return instance;
+ }
+
+ public SystemOutputView createView()
+ {
+ return new SystemOutputView(baosOut, baosErr);
+ }
+
+ public void start()
+ {
+ synchronized (SystemOutputManager.class)
+ {
+ if (instance != null)
+ {
+ throw new IllegalStateException();
+ }
+
+ //
+ baosOut = new ByteArrayOutputStreamExt();
+ baosErr = new ByteArrayOutputStreamExt();
+ originalOut = System.out;
+ originalErr = System.err;
+ ForkedOutputStream fOut = new ForkedOutputStream(originalOut, baosOut);
+ ForkedOutputStream fErr = new ForkedOutputStream(originalErr, baosErr);
+
+ //
+ System.setOut(new PrintStream(fOut, true));
+ System.setErr(new PrintStream(fErr, true));
+ instance = this;
+ }
+ }
+
+ public void stop()
+ {
+ synchronized (SystemOutputManager.class)
+ {
+ if (instance != null)
+ {
+ System.out.flush();
+ System.err.flush();
+ instance = null;
+ System.setOut(originalOut);
+ System.setErr(originalErr);
+ }
+ }
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputView.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputView.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/SystemOutputView.java 2007-10-20 22:33:04 UTC (rev 8728)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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.unit.tooling;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SystemOutputView
+{
+
+ /** . */
+ private ByteArrayOutputStreamExt out;
+
+ /** . */
+ private ByteArrayOutputStreamExt err;
+
+ /** . */
+ private int outCount;
+
+ /** . */
+ private int errCount;
+
+ public SystemOutputView(ByteArrayOutputStreamExt out, ByteArrayOutputStreamExt err)
+ {
+ this.out = out;
+ this.err = err;
+ this.outCount = 0;
+ this.errCount = 0;
+ }
+
+ public void writeTo(OutputStream toOut, OutputStream toErr) throws IOException
+ {
+ outCount = out.writeTo(toOut, outCount);
+ errCount = err.writeTo(toErr, errCount);
+ }
+
+ public void writeTo(Writer toOut, Writer toErr) throws IOException
+ {
+ outCount = out.writeTo(toOut, outCount);
+ errCount = err.writeTo(toErr, errCount);
+ }
+
+ public void reset()
+ {
+ outCount = 0;
+ errCount = 0;
+ }
+}
16 years, 8 months
JBoss Portal SVN: r8727 - modules/identity/trunk/identity.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-20 17:13:45 -0400 (Sat, 20 Oct 2007)
New Revision: 8727
Modified:
modules/identity/trunk/identity/build.xml
Log:
- fix for embedded OpenDS packaging
Modified: modules/identity/trunk/identity/build.xml
===================================================================
--- modules/identity/trunk/identity/build.xml 2007-10-20 15:47:17 UTC (rev 8726)
+++ modules/identity/trunk/identity/build.xml 2007-10-20 21:13:45 UTC (rev 8727)
@@ -275,7 +275,7 @@
<jar jarfile="${build.lib}/test-identity.sar">
<fileset dir="${build.resources}/test-identity-sar"/>
- <fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-jboss-lib-jdk5.jar"/>
+ <fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-jboss-lib.jar"/>
<fileset dir="${sun.opends.lib}" includes="OpenDS.jar"/>
<fileset dir="${sleepycat.sleepycat.lib}" includes="je.jar"/>
</jar>
16 years, 8 months
JBoss Portal SVN: r8726 - modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-10-20 11:47:17 -0400 (Sat, 20 Oct 2007)
New Revision: 8726
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java
Log:
- using TestInfo.name instead of TestId
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java 2007-10-20 14:29:10 UTC (rev 8725)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java 2007-10-20 15:47:17 UTC (rev 8726)
@@ -159,13 +159,12 @@
{
this.tests++;
this.errors++;
+ StringBuffer nb = new StringBuffer();
+ /** The current tested Class */
Element e = document.createElement(XMLConstants.ERROR);
e.setAttribute(XMLConstants.ATTR_TYPE, event.getFailure().getType().name());
e.setAttribute(XMLConstants.ATTR_MESSAGE, event.getFailure().getMessage());
- if ( event.getFailure().getCause() != null)
- {
- e.appendChild(document.createCDATASection(stackToString(event.getFailure().getCause())));
- }
+ e.appendChild(document.createCDATASection(stackToString(event.getFailure().getStackTrace())));
rootElement.appendChild(e);
}
@@ -174,6 +173,8 @@
TestId testId = event.getTestId();
TestResult result = event.getTestResult();
Element test = document.createElement(XMLConstants.TESTCASE);
+ TestInfo info = this.startedTests.get(testId);
+
/** The testcase name */
StringBuffer nb = new StringBuffer();
/** The current tested Class */
@@ -182,15 +183,9 @@
nb.append(testSuiteName);
nb.append(".");
}
- /** TestId */
- for(int i = 0; i < testId.getLength(); i ++)
- {
- if (i > 0)
- {
- nb.append(".");
- }
- nb.append(testId.getName(i));
- }
+ /** Adding testcase name */
+ nb.append(info.getName());
+
String testName = nb.toString();
/** The testcase parameters */
@@ -209,12 +204,10 @@
if ( parameters.length() > 0)
testName = testName + "?" + parameters.toString();
-
/** Test case attributes */
test.setAttribute(XMLConstants.ATTR_NAME, testName);
test.setAttribute(XMLConstants.ATTR_TIME, FORMAT.format(result.getDurationMillis() / 1000.0));
/** Check if test was started */
- TestInfo info = this.startedTests.get(testId);
if ( info != null)
{
// remove test from started List
@@ -246,10 +239,8 @@
this.errors++;
failureType = XMLConstants.ERROR;
}
- if (failure.getCause() != null)
- {
- test.appendChild(addError(failureType, failure.getCause()));
- }
+
+ test.appendChild(addError(failureType, failure.getStackTrace()));
}
this.rootElement.appendChild(test);
@@ -401,7 +392,6 @@
}
}
-
public String getTestSuiteName()
{
if (testSuiteName == null)
16 years, 8 months
JBoss Portal SVN: r8725 - modules/test/trunk/unit/src/main/org/jboss/unit.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-20 10:29:10 -0400 (Sat, 20 Oct 2007)
New Revision: 8725
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
Log:
added a non null stacktrace throwable on the Failure object
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-20 14:28:22 UTC (rev 8724)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-20 14:29:10 UTC (rev 8725)
@@ -67,7 +67,7 @@
this.message = message;
this.cause = cause;
this.type = type;
- this.stackTrace = cause != null ? cause : new Exception();
+ this.stackTrace = cause != null ? cause : new Exception("Failed at");
}
public String getMessage()
16 years, 8 months
JBoss Portal SVN: r8724 - modules/test/trunk/unit/src/main/org/jboss/unit.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-20 10:28:22 -0400 (Sat, 20 Oct 2007)
New Revision: 8724
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
Log:
added a non null stacktrace throwable on the Failure object
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-20 14:17:56 UTC (rev 8723)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-20 14:28:22 UTC (rev 8724)
@@ -40,25 +40,34 @@
/** The type of failure. */
private final FailureType type;
+ /** The non null stack trace. */
+ private final Throwable stackTrace;
+
public Failure(String message, FailureType type)
{
- this.message = message;
- this.cause = null;
- this.type = type;
+ this(message, null, type);
}
public Failure(Throwable cause, FailureType type)
{
- this.message = cause.getMessage();
- this.cause = cause;
- this.type = type;
+ this(null, cause, type);
}
public Failure(String message, Throwable cause, FailureType type)
{
+ if (message == null)
+ {
+ if (cause != null)
+ {
+ message = cause.getMessage();
+ }
+ }
+
+ //
this.message = message;
this.cause = cause;
this.type = type;
+ this.stackTrace = cause != null ? cause : new Exception();
}
public String getMessage()
@@ -71,6 +80,11 @@
return cause;
}
+ public Throwable getStackTrace()
+ {
+ return stackTrace;
+ }
+
public FailureType getType()
{
return type;
16 years, 8 months
JBoss Portal SVN: r8723 - in modules/test/trunk/unit/src: resources/test/org/jboss/test/unit/sample and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-20 10:17:56 -0400 (Sat, 20 Oct 2007)
New Revision: 8723
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver2.java
Modified:
modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml
Log:
adding use case for simple test case executed
Copied: modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver2.java (from rev 8722, modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver1.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver2.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver2.java 2007-10-20 14:17:56 UTC (rev 8723)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.test.unit.sample;
+
+import org.jboss.unit.TestId;
+import org.jboss.unit.driver.AbstractTestDriver;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.impl.SimpleTestCaseInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestDriver2 extends AbstractTestDriver
+{
+
+ public TestInfo getInfo()
+ {
+ return new SimpleTestCaseInfo("test");
+ }
+
+ public DriverResponse invoke(TestId id, DriverCommand command)
+ {
+ return new EndTestResponse();
+ }
+}
\ No newline at end of file
Modified: modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml
===================================================================
--- modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml 2007-10-20 13:59:49 UTC (rev 8722)
+++ modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml 2007-10-20 14:17:56 UTC (rev 8723)
@@ -27,4 +27,7 @@
<generic>
<class name="org.jboss.test.unit.sample.TestDriver1"/>
</generic>
+ <generic>
+ <class name="org.jboss.test.unit.sample.TestDriver2"/>
+ </generic>
</jboss-unit>
16 years, 8 months
JBoss Portal SVN: r8722 - modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-10-20 09:59:49 -0400 (Sat, 20 Oct 2007)
New Revision: 8722
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java
Log:
- checking if cause is null
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java 2007-10-20 12:45:09 UTC (rev 8721)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/report/impl/junit/JUnitTestReport.java 2007-10-20 13:59:49 UTC (rev 8722)
@@ -36,7 +36,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
@@ -61,7 +60,6 @@
import org.jboss.unit.runner.event.RunnerFailureEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
import org.jboss.unit.runner.event.StartTestCaseEvent;
-import org.jboss.unit.runner.event.StartTestSuiteEvent;
import org.jboss.unit.runner.results.TestFailure;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -229,7 +227,7 @@
errorNotStarted.setAttribute(XMLConstants.ATTR_MESSAGE, "TestCase: " + testName + " was not started properly. (No StartTestEvent)");
test.appendChild(errorNotStarted);
}
-
+
/** If testcase failed */
if (result instanceof TestFailure)
{
@@ -248,9 +246,12 @@
this.errors++;
failureType = XMLConstants.ERROR;
}
+ if (failure.getCause() != null)
+ {
+ test.appendChild(addError(failureType, failure.getCause()));
+ }
+ }
- test.appendChild(addError(failureType, failure.getCause()));
- }
this.rootElement.appendChild(test);
}
@@ -313,6 +314,8 @@
Source source = new DOMSource(this.rootElement);
Transformer xtrans = TransformerFactory.newInstance().newTransformer();
xtrans.setOutputProperty(OutputKeys.INDENT, "yes");
+ xtrans.setOutputProperty(OutputKeys.METHOD, "xml");
+ xtrans.setOutputProperty(OutputKeys.STANDALONE, "yes");
Result result = new StreamResult(new FileOutputStream(file));
xtrans.transform(source, result);
}
16 years, 8 months
JBoss Portal SVN: r8721 - in modules/test/trunk/unit: src/main/org/jboss/test/unit/sample and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-20 08:45:09 -0400 (Sat, 20 Oct 2007)
New Revision: 8721
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver1.java
Modified:
modules/test/trunk/unit/build.xml
modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestedClass2.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java
modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml
Log:
added a generic test driver in the samples
Modified: modules/test/trunk/unit/build.xml
===================================================================
--- modules/test/trunk/unit/build.xml 2007-10-20 00:32:11 UTC (rev 8720)
+++ modules/test/trunk/unit/build.xml 2007-10-20 12:45:09 UTC (rev 8721)
@@ -200,4 +200,13 @@
</target>
+ <target name="reports" depends="init">
+ <junitreport todir="output/tests">
+ <fileset dir="output/tests">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="output/tests"/>
+ </junitreport>
+ </target>
+
</project>
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java 2007-10-20 00:32:11 UTC (rev 8720)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/SampleTests.java 2007-10-20 12:45:09 UTC (rev 8721)
@@ -79,7 +79,7 @@
TestRunner runner = suite.createRunner();
- TestRunnerEventListener junitReporter = new JUnitReporter("output", SampleTests.class.getName());
+ TestRunnerEventListener junitReporter = new JUnitReporter("output/tests", SampleTests.class.getName());
// add listeners
TestRunnerEventBroadcaster broadcaster = new TestRunnerEventBroadcaster();
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver1.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver1.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestDriver1.java 2007-10-20 12:45:09 UTC (rev 8721)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.test.unit.sample;
+
+import org.jboss.unit.Failure;
+import org.jboss.unit.TestId;
+import org.jboss.unit.driver.AbstractTestDriver;
+import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.DriverException;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.impl.composite.CompositeTestDriver;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.impl.SimpleTestCaseInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestDriver1 extends CompositeTestDriver
+{
+ public TestDriver1() throws DriverException
+ {
+ mount(new AbstractTestDriver()
+ {
+ public TestInfo getInfo()
+ {
+ return new SimpleTestCaseInfo("test1");
+ }
+ public DriverResponse invoke(TestId id, DriverCommand command)
+ {
+ return new EndTestResponse();
+ }
+ });
+ mount(new AbstractTestDriver()
+ {
+ public TestInfo getInfo()
+ {
+ return new SimpleTestCaseInfo("test2");
+ }
+ public DriverResponse invoke(TestId id, DriverCommand command)
+ {
+ return new FailureResponse(Failure.createAssertionFailure("failure"));
+ }
+ });
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestedClass2.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestedClass2.java 2007-10-20 00:32:11 UTC (rev 8720)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/sample/TestedClass2.java 2007-10-20 12:45:09 UTC (rev 8721)
@@ -46,5 +46,4 @@
{
assertEquals("foo", foo);
}
-
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java 2007-10-20 00:32:11 UTC (rev 8720)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java 2007-10-20 12:45:09 UTC (rev 8721)
@@ -32,7 +32,7 @@
/** . */
private DriverContext context;
- public void initDriver(DriverContext context)
+ public void initDriver(DriverContext context) throws DriverException
{
this.context = context;
@@ -40,7 +40,7 @@
doInit();
}
- protected void doInit()
+ protected void doInit() throws DriverException
{
}
Modified: modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml
===================================================================
--- modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml 2007-10-20 00:32:11 UTC (rev 8720)
+++ modules/test/trunk/unit/src/resources/test/org/jboss/test/unit/sample/f1.xml 2007-10-20 12:45:09 UTC (rev 8721)
@@ -24,4 +24,7 @@
<class name="XYZ"/>
</test>
</pojo>
+ <generic>
+ <class name="org.jboss.test.unit.sample.TestDriver1"/>
+ </generic>
</jboss-unit>
16 years, 8 months
JBoss Portal SVN: r8720 - in modules/test/trunk/remote/src: resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-19 20:32:11 -0400 (Fri, 19 Oct 2007)
New Revision: 8720
Modified:
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml
Log:
make the server name injected in the deployer handler
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-19 16:37:54 UTC (rev 8719)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-20 00:32:11 UTC (rev 8720)
@@ -77,6 +77,9 @@
private String archivePath;
/** . */
+ private String serverName;
+
+ /** . */
private Deployer deployer;
// public String getInitialNodeId()
@@ -94,6 +97,11 @@
return archivePath;
}
+ public String getServerName()
+ {
+ return serverName;
+ }
+
public NodeManager getNodeManager()
{
return nodeManager;
@@ -141,6 +149,7 @@
// Get this property
this.archivePath = context.getProperty("archivePath");
+ this.serverName = context.getProperty("serverName");
//
run();
Modified: modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml
===================================================================
--- modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml 2007-10-19 16:37:54 UTC (rev 8719)
+++ modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml 2007-10-20 00:32:11 UTC (rev 8720)
@@ -28,7 +28,7 @@
<bean name="NodeFactory" class="org.jboss.portal.test.framework.impl.generic.server.GenericNodeFactory">
<constructor>
<parameter>servers.xml</parameter>
- <parameter>RemoteTomcat_6_0</parameter>
+ <parameter><inject bean="TestDriver" property="serverName" state="Instantiated"/></parameter>
</constructor>
</bean>
16 years, 8 months
JBoss Portal SVN: r8719 - in docs/template/user-guide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-19 12:37:54 -0400 (Fri, 19 Oct 2007)
New Revision: 8719
Modified:
docs/template/user-guide/en/master.xml
docs/template/user-guide/en/modules/sample.xml
Log:
update the doc template to include what we should use to write well formated documentation (not exhaustive of course)
Modified: docs/template/user-guide/en/master.xml
===================================================================
--- docs/template/user-guide/en/master.xml 2007-10-19 15:42:38 UTC (rev 8718)
+++ docs/template/user-guide/en/master.xml 2007-10-19 16:37:54 UTC (rev 8719)
@@ -10,9 +10,9 @@
<releaseinfo>Change Release Info in master.xml</releaseinfo>
<releaseinfo>Change Release Info Date in master.xml</releaseinfo>
<author>
- <firstname>Thomas</firstname>
- <surname>Heute</surname>
- <email>theute(a)jboss.org</email>
+ <firstname>Your first name</firstname>
+ <surname>Your last name</surname>
+ <email>your.email(a)your.domain.com</email>
</author>
</bookinfo>
<toc/>
Modified: docs/template/user-guide/en/modules/sample.xml
===================================================================
--- docs/template/user-guide/en/modules/sample.xml 2007-10-19 15:42:38 UTC (rev 8718)
+++ docs/template/user-guide/en/modules/sample.xml 2007-10-19 16:37:54 UTC (rev 8719)
@@ -1,58 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="ajax">
+<chapter id="sample">
<chapterinfo>
<author>
- <firstname>Julien</firstname>
- <surname>Viet</surname>
- <email>julien.viet(a)jboss.com</email>
+ <firstname>Your first name</firstname>
+ <surname>Your last name</surname>
+ <email>your.email(a)your.domain.com</email>
</author>
</chapterinfo>
- <title>My title</title>
- <para>This section covers the ajax features provided by the portal.</para>
+ <title>Sample chapter</title>
+ <para>This is the beginning of the sample chapter.</para>
<sect1>
- <title>Introduction</title>
- <para>Todo</para>
- </sect1>
- <sect1>
- <title>Ajaxified markup</title>
+ <title>sample section</title>
+ <para>This is the beginning of the sample section. It contains examples of how docbook should be used in the context
+ of a documentation for a Java related product.</para>
+
<sect2>
- <title>Ajaxified layouts</title>
- <para>Part of the Ajax capabilities are implemented in the layout framework which provide the structure for
- generating portal pages. The good news is that the existing layout only requires a few modifications in
- order to be ajaxified.</para>
- <para>We will use as example an simplified version of the layout JSP provided in JBoss Portal 2.6 and outline
- what are the required changes that makes it an ajaxified layout:
+ <title>Bullet points</title>
<programlisting><![CDATA[
-<%@ taglib uri="/WEB-INF/theme/portal-layout.tld" prefix="p" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html;"/>
- <!-- inject the theme, default to the Renaissance theme if
- nothing is selected for the portal or the page -->
- <p:theme themeName="renaissance"/>
- <!-- insert header content that was possibly set by portlets on the page -->
- <p:headerContent/>
-</head>
+<itemizedlist>
+ <listitem>Item1</listitem>
+ <listitem>Item2</listitem>
+ <listitem>Item3</listitem>
+</itemizedlist>
]]></programlisting>
+ <para>
<itemizedlist>
- <listitem><![CDATA[<p:theme themeName="renaissance"/>]]> should be already present as it exists since 2.4 but is even more
- necessary as it will inject in the page the reference to the ajax stylesheet.</listitem>
- <listitem><![CDATA[<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>]]> should be added before any other region
- in the markup of the layout.</listitem>
- <listitem><![CDATA[<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>]]> should be added after any other region
- in the markup of the layout.</listitem>
+ <listitem>Item1</listitem>
+ <listitem>Item2</listitem>
+ <listitem>Item3</listitem>
</itemizedlist>
</para>
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/sample/partial-refresh.png" format="png"/>
- </imageobject>
- <caption>
- <para>The portal providing partial refresh</para>
- </caption>
- </mediaobject>
</sect2>
+
+ <sect2>
+ <title>Interface or annotation reference</title>
+ <programlisting><![CDATA[
+<interfacename>mypackage.MyInterface</interfacename>
+<interfacename>@MyAnnotation</interfacename>
+]]></programlisting>
+ <para>
+ <interfacename>mypackage.MyInterface</interfacename>
+ <interfacename>@MyAnnotation</interfacename>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Class reference</title>
+ <programlisting><![CDATA[
+<classname>mypackage.MyClass</classname>
+]]></programlisting>
+ <para>
+ <classname>mypackage.MyClass</classname>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Parameter reference</title>
+ <programlisting><![CDATA[
+<parameter>MyParameter</parameter>
+]]></programlisting>
+ <para>
+ <parameter>MyParameter</parameter>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Method referece</title>
+ <programlisting><![CDATA[
+<methodname>myMethod()</methodname>
+]]></programlisting>
+ <para>
+ <methodname>myMethod()</methodname>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Exception reference</title>
+ <programlisting><![CDATA[
+<exceptionname>mypackage.MyException</exceptionname>
+]]></programlisting>
+ <para>
+ <exceptionname>mypackage.MyException</exceptionname>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>A variable name</title>
+ <programlisting><![CDATA[
+<varname>myVariable</varname>
+]]></programlisting>
+ <para>
+ <varname>myVariable</varname>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>File reference</title>
+ <programlisting><![CDATA[
+<filename>MyFile</filename>
+]]></programlisting>
+ <para>
+ <filename>MyFile</filename>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Literal reference</title>
+ <programlisting><![CDATA[
+<literal>null</literal>
+<literal>1</literal>
+<literal>"foo"</literal>
+]]></programlisting>
+ <para>
+ <literal>null</literal>
+ <literal>1</literal>
+ <literal>"foo"</literal>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>A constant</title>
+ <programlisting><![CDATA[
+<constant>MAX_VALUE</constant>
+]]></programlisting>
+ <para>
+ <constant>MAX_VALUE</constant>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Inline code</title>
+ <programlisting><![CDATA[
+<code>System.out.println()</code>
+]]></programlisting>
+ <para>
+ <code>System.out.println()</code>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Code or XML with a caption</title>
+ <programlisting>
+<example>
+ <programlisting><![CDATA[public class MyClass
+{
+}
+]]></programlisting>
+ <caption>This is the MyClass class</caption>
+</example>
+</programlisting>
+ <para>
+ <example>
+ <programlisting><![CDATA[public class MyClass
+{
+}
+]]></programlisting>
+ <caption>This is the MyClass class</caption>
+ </example>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>A database name</title>
+ <programlisting><![CDATA[
+<database>MyDatabase</database>
+]]></programlisting>
+ <para>
+ <database>MyDatabase</database>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>A shell command</title>
+ <programlisting><![CDATA[
+<command>ls -l</command>
+]]></programlisting>
+ <para>
+ <command>ls -l</command>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>A shell example</title>
+ <programlisting><![CDATA[
+<screen><![CDATA[julien-viets-computer:~/java/jboss-portal-template/user-guide julien$ ls -l
+total 8
+drwxr-xr-x 3 julien julien 102 Oct 19 18:14 build
+-rwxr-xr-x 1 julien julien 923 Oct 19 17:40 build.xml
+drwxr-xr-x 6 julien julien 204 Oct 19 17:42 en
+]]></screen>
+]]></programlisting>
+ <para>
+ <screen><![CDATA[julien-viets-computer:~/java/jboss-portal-template/user-guide julien$ ls -l
+total 8
+drwxr-xr-x 3 julien julien 102 Oct 19 18:14 build
+-rwxr-xr-x 1 julien julien 923 Oct 19 17:40 build.xml
+drwxr-xr-x 6 julien julien 204 Oct 19 17:42 en
+]]></screen>
+ </para>
+ </sect2>
+
</sect1>
+
</chapter>
16 years, 8 months