/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
//
/**
* @author Prashant Baliga <prabalig@in.ibm.com>
*
*/
package org.apache.imperius.spl.tests;
import java.util.Enumeration;
import java.util.logging.Logger;
import junit.framework.TestFailure;
import junit.framework.TestResult;
import junit.framework.TestSuite;
import org.apache.imperius.util.SPLLogger;
public class TestMain {
private static Logger logger = SPLLogger.getSPLLogger().getLogger();
/**
* @param args
*/
public static void main(String[] args) {
TestSuite testsuite=new TestSuite();
//testsuite.addTestSuite(AbsTests.class);
//testsuite.addTestSuite(AdditionTests.class);
//testsuite.addTestSuite(AssignmentExpressionTests.class);
testsuite.addTestSuite(BooleanExpressionTest.class);
testsuite.addTestSuite(StringExpressionTest.class);
testsuite.addTestSuite(NumericExpressionTest.class);
testsuite.addTestSuite(NewExpressionTest.class);
testsuite.addTestSuite(CollectionExpressionsTest.class);
testsuite.addTestSuite(UtilityTest.class);
TestResult result=new TestResult();
testsuite.run(result);
Enumeration enm=result.errors();
while(enm.hasMoreElements()){
TestFailure ob=(TestFailure)enm.nextElement();
System.out.println("Failed Test : "+ob.failedTest().toString()+" "+ob.trace());
logger.severe("Failed Test : "+ob.failedTest().toString()+" "+ob.trace());
}
Enumeration enm1=result.failures();
while(enm1.hasMoreElements()){
TestFailure ob=(TestFailure)enm1.nextElement();
System.out.println("Failed Test : "+ob.failedTest().toString()+" "+ob.trace());
logger.severe("Failed Test : "+ob.failedTest().toString()+" "+ob.trace());
}
System.out.println("result errorCount "+result.errorCount()+ " result failureCount "+ result.failureCount()+ " result status "+result.wasSuccessful()+ result.errors()
);
}
}