Skip to content

Commit

Permalink
MONDRIAN: Call compliance tests from main suite; fix some errors.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 13144]
  • Loading branch information
julianhyde committed Oct 29, 2009
1 parent bbf2b64 commit 9e9a83d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
18 changes: 13 additions & 5 deletions build.xml
Expand Up @@ -1400,15 +1400,23 @@ diagrams and hyperlinks to source code">
<record name="javadoc-complaints.log" action="stop"/>
<loadfile srcFile="javadoc-complaints.log" property="javadoc.complaints">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.LineContains">
<param type="negate" value="true"/>
<param type="contains" value="Error fetching URL"/>
</filterreader>
<!-- only interested in lines that are errors or warnings -->
<linecontainsregexp>
<regexp pattern=":[0-9]+: "/>
</linecontainsregexp>
<!-- ignore: unwrap does not exist until JDK1.6 -->
<linecontains negate="true">
<contains value="Tag @link: can't find unwrap(Class)"/>
</linecontains>
<!-- ignore: FactoryJdbc4Impl is only built in JDK1.6 -->
<linecontains negate="true">
<contains value="FactoryJdbc4Impl.java"/>
</linecontains>
<striplinebreaks />
</filterchain>
</loadfile>
<fail if="javadoc.complaints"
message="Javadoc reported warnings or errors; see javadoc-complaints.log for details"/>
message="Javadoc reported warnings or errors; see javadoc-complaints.log for details: ${javadoc.complaints}"/>
<delete file="javadoc-complaints.log"/>
<!-- Save disk space since we're just checking. -->
<antcall target="cleanJavadoc"/>
Expand Down
4 changes: 2 additions & 2 deletions src/main/mondrian/olap/Query.java
Expand Up @@ -12,6 +12,7 @@
*/

package mondrian.olap;

import mondrian.calc.Calc;
import mondrian.calc.ExpCompiler;
import mondrian.calc.ResultStyle;
Expand All @@ -20,7 +21,6 @@
import mondrian.olap.type.*;
import mondrian.resource.MondrianResource;
import mondrian.rolap.*;
import mondrian.util.Bug;

import java.io.*;
import java.util.*;
Expand Down Expand Up @@ -350,7 +350,7 @@ public Validator createValidator(
}

/**
*@Deprecated this method has been deprecated, please use clone instead.
* @deprecated this method has been deprecated; please use {@link #clone}
*/
public Query safeClone() {
return (Query) clone();
Expand Down
5 changes: 2 additions & 3 deletions testsrc/main/mondrian/rolap/sql/SelectNotInGroupByTest.java
Expand Up @@ -9,17 +9,16 @@
*/
package mondrian.rolap.sql;

import java.sql.SQLException;

import mondrian.rolap.BatchTestCase;
import mondrian.spi.Dialect;
import mondrian.test.SqlPattern;
import mondrian.test.TestContext;

/**
* Test that various values of {@link Dialect#supportSelectNotInGroupBy}
* Test that various values of {@link Dialect#allowsSelectNotInGroupBy}
* produce correctly optimized SQL.
*
* @author Eric McDermid
* @version $Id$
*/
public class SelectNotInGroupByTest extends BatchTestCase {
Expand Down
2 changes: 2 additions & 0 deletions testsrc/main/mondrian/test/Main.java
Expand Up @@ -35,6 +35,7 @@
import mondrian.xmla.impl.DynamicDatasourceXmlaServletTest;
import mondrian.xmla.test.XmlaTest;
import mondrian.test.clearview.*;
import mondrian.test.build.CodeComplianceTest;
import mondrian.calc.impl.ConstantCalcTest;
import mondrian.rolap.agg.AggregationOnDistinctCountMeasuresTest;
import org.apache.log4j.Logger;
Expand Down Expand Up @@ -279,6 +280,7 @@ public static Test suite() throws Exception {
addTest(suite, BitKeyTest.class);
addTest(suite, TypeTest.class);
addTest(suite, SteelWheelsTestCase.class);
addTest(suite, CodeComplianceTest.class);

boolean testNonEmpty = isRunOnce();
if (!MondrianProperties.instance().EnableNativeNonEmpty.get()) {
Expand Down
29 changes: 20 additions & 9 deletions testsrc/main/mondrian/test/build/AntTestBase.java
Expand Up @@ -13,8 +13,8 @@
import junit.framework.TestCase;

import java.io.*;
import java.util.ArrayList;
import java.util.*;

import mondrian.olap.Util;

/**
* Base class for tests that execute Ant targets. Sub-classes
Expand All @@ -27,10 +27,10 @@
* <ol>
* <li>Ant can be invoked by executing <code>ant</code>. That is, ant is
* on the current PATH.</li>
* <li>The version of Ant on the PATH is new enough to execute the Aspen
* <li>The version of Ant on the PATH is new enough to execute the
* build.xml script.</li>
* <li>The test is being invoked with the root Aspen directory (e.g.
* //depot/aspen) as the current directory.</li>
* <li>The test is being invoked in the root directory (e.g.
* //open/mondrian) as the current directory or a subdirectory of it.</li>
* </ol>
*
* <pre>
Expand All @@ -49,6 +49,8 @@
*/
abstract class AntTestBase extends TestCase
{
private static final boolean DEBUG = false;

/**
* Creates an AntTestBase.
*
Expand All @@ -69,13 +71,20 @@ abstract class AntTestBase extends TestCase
protected void runAntTest(String target)
throws IOException, InterruptedException
{
Runtime runtime = Runtime.getRuntime();
if (Util.PreJdk15) {
// Cannot invoke ant in JDK 1.4 or ealier.
// ant gives "Unknown argument: -cp"
return;
}

Runtime runtime = Runtime.getRuntime();
Process proc =
runtime.exec(new String[] { "ant", "-find", "build.xml", target });

final Sucker outSucker = new Sucker(proc.getInputStream(), System.out);
final Sucker errSucker = new Sucker(proc.getErrorStream(), System.err);
final Sucker outSucker =
new Sucker(proc.getInputStream(), DEBUG ? System.out : null);
final Sucker errSucker =
new Sucker(proc.getErrorStream(), DEBUG ? System.err : null);
outSucker.start();
errSucker.start();

Expand Down Expand Up @@ -120,7 +129,9 @@ public void run() {
try {
while ((x = stream.read(buf)) >= 0) {
baos.write(buf, 0, x);
out.write(buf, 0, x);
if (out != null) {
out.write(buf, 0, x);
}
}
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 9e9a83d

Please sign in to comment.