Skip to content

Commit

Permalink
log start/end of each integration test, make test method names unique
Browse files Browse the repository at this point in the history
  • Loading branch information
rasahner committed Jan 7, 2016
1 parent 3048b1f commit 33504d0
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets 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.
*/

package io.druid.testing.utils;

import org.testng.ITestResult;
import org.testng.TestListenerAdapter;
import com.metamx.common.logger.Logger;

public class LoggerListener extends TestListenerAdapter
{
private static final Logger LOG = new Logger(LoggerListener.class);

@Override
public void onTestFailure(ITestResult tr)
{
LOG.info ("[%s] -- Test method failed", tr.getName());
}

@Override
public void onTestSkipped(ITestResult tr)
{
LOG.info ("[%s] -- Test method skipped", tr.getName());
}

@Override
public void onTestSuccess(ITestResult tr)
{
LOG.info ("[%s] -- Test method passed", tr.getName());
}

@Override
public void onTestStart(ITestResult tr)
{
LOG.info ("[%s] -- TEST START", tr.getName() );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class ITUnionQueryTest extends AbstractIndexerTest
IntegrationTestingConfig config;

@Test
public void testRealtimeIndexTask() throws Exception
public void testUnionQuery() throws Exception
{
final int numTasks = 4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Boolean call() throws Exception
}

@Test
public void testQueriesFromFile() throws Exception
public void testTwitterQueriesFromFile() throws Exception
{
queryHelper.testQueriesFromFile(TWITTER_QUERIES_RESOURCE, 2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Boolean call() throws Exception
}

@Test
public void testQueriesFromFile() throws Exception
public void testWikipediaQueriesFromFile() throws Exception
{
queryHelper.testQueriesFromFile(WIKIPEDIA_QUERIES_RESOURCE, 2);
}
Expand Down
3 changes: 3 additions & 0 deletions integration-tests/src/test/resources/testng.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@


<suite name="IntegrationTestSuite">
<listeners>
<listener class-name="io.druid.testing.utils.LoggerListener" />
</listeners>
<test name="AllTests">
<packages>
<package name="io.druid.tests.*"/>
Expand Down

0 comments on commit 33504d0

Please sign in to comment.