// }
util.utils.shortWait(2000);
System.out.println("Creating: " + entry.entryName);
LogWriter log = (LogWriter) m_aDynamicClassLoader.getInstance((String) m_aParams.get("LogWriter"));
log.initialize(entry, logging);
entry.UserDefinedParams = m_aParams;
tCase.setLogWriter((PrintWriter) log);
tCase.initializeTestCase(m_aParams);
TestEnvironment tEnv = getTestEnvironment(tCase, entry);
if (tEnv == null)
{
continue;
}
final String sObjectName = tCase.getObjectName();
// System.out.println(sObjectName + " recreated ");
for (int j = 0; j < entry.SubEntryCount; j++)
{
DescEntry aSubEntry = entry.SubEntries[j];
final boolean bIsToTest = aSubEntry.isToTest;
if (!bIsToTest)
{
Summarizer.summarizeDown(aSubEntry, "not part of the job");
continue;
}
// final String sEntryName = aSubEntry.entryName;
final String sLongEntryName = aSubEntry.longName;
if ((exclusions != null) && (exclusions.contains(sLongEntryName)))
{
Summarizer.summarizeDown(aSubEntry, "known issue");
continue;
}
// System.out.println("running: '" + sLongEntryName + "' testcode: [" + sEntryName + "]");
// this will shown in test itself
LogWriter ifclog = (LogWriter) m_aDynamicClassLoader.getInstance( (String) m_aParams.get("LogWriter"));
ifclog.initialize(aSubEntry, logging);
aSubEntry.UserDefinedParams = m_aParams;
aSubEntry.Logger = ifclog;
if ((tEnv == null) || tEnv.isDisposed())
{
closeExistingOffice();
tEnv = getEnv(entry, m_aParams);
tCase = tEnv.getTestCase();
}
// MultiMethodTest ifc = null;
lib.TestResult res = null;
// run the interface test twice if it failed.
int countInterfaceTestRun = 0;
boolean finished = false;
while (!finished)
{
try
{
countInterfaceTestRun++;
finished = true;
res = executeInterfaceTest(aSubEntry, tEnv, m_aParams);
}
catch (IllegalArgumentException iae)
{
System.out.println("Couldn't load class " + aSubEntry.entryName);
System.out.println("**** " + iae.getMessage() + " ****");
Summarizer.summarizeDown(aSubEntry, iae.getMessage());
}
catch (java.lang.NoClassDefFoundError iae)
{
System.out.println("Couldn't load class " + aSubEntry.entryName);
System.out.println("**** " + iae.getMessage() + " ****");
Summarizer.summarizeDown(aSubEntry, iae.getMessage());
}
catch (java.lang.RuntimeException e)
{
closeExistingOffice();
tEnv = getEnv(entry, m_aParams);
tCase = tEnv.getTestCase();
if (countInterfaceTestRun < 2)
{
finished = false;
}
else
{
Summarizer.summarizeDown(aSubEntry, e.toString() + ".FAILED");
}
}
}
setState(aSubEntry, res);
sumIt.summarizeUp(aSubEntry);
LogWriter sumIfc = OutProducerFactory.createOutProducer(m_aParams);
aSubEntry.UserDefinedParams = m_aParams;
sumIfc.initialize(aSubEntry, logging);
sumIfc.summary(aSubEntry);
}
try
{
if (!keepdocument)
{
tCase.cleanupTestCase(m_aParams);
}
}
catch (Exception e)
{
System.err.println( "couldn't cleanup:" + e.toString() );
}
catch (java.lang.NoClassDefFoundError e)
{
System.err.println( "couldn't cleanup:" + e.toString() );
}
sumIt.summarizeUp(entry);
LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams);
sumObj.initialize(entry, logging);
sumObj.summary(entry);
}
if (entries.length > 0)
{
System.out.println();