Skip to content

Instantly share code, notes, and snippets.

@tebeka
Created January 28, 2011 22:00
Show Gist options
  • Save tebeka/801085 to your computer and use it in GitHub Desktop.
Save tebeka/801085 to your computer and use it in GitHub Desktop.
package com.adconion.ntdw.util;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.adconion.AbstractDatabaseTest;
@Test(groups = "functest", sequential = true)
public class NamedQueriesTest extends AbstractDatabaseTest {
@DataProvider(name = "beans")
public Object[][] getBeans() {
return new Object[][] { { "amgUnknownLastHour" } };
}
@Test(dataProvider = "beans")
public void testBeanSQL(String beanName) {
NamedQueryMetric namedQuery = (NamedQueryMetric) ctx.getBean(beanName);
}
@Override
protected String getContainerPath() {
return "classpath:ntdw/StandardMetrics.xml";
}
@Override
protected String getDataSourceBeanName() {
return "dwDataSource";
}
}
@tebeka
Copy link
Author

tebeka commented Jan 28, 2011

RemoteTestNG starting
FAILED CONFIGURATION: @BeforeClass abstractBeforeClass
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'amgImpressionsLastHour' defined in class path resource [ntdw/StandardMetrics.xml]: Could not resolve parent bean definition 'abstractNamedQueryMetric'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'abstractNamedQueryMetric' is defined
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1032)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:982)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:968)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:420)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at com.adconion.system.config.XmlApplicationContext.refresh(XmlApplicationContext.java:171)
at com.adconion.system.config.XmlApplicationContext.(XmlApplicationContext.java:85)
at com.adconion.AbstractDatabaseTest.abstractBeforeClass(AbstractDatabaseTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:173)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.runWorkers(TestRunner.java:1125)
at org.testng.TestRunner.privateRun(TestRunner.java:749)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
at org.testng.SuiteRunner.run(SuiteRunner.java:223)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:954)
at org.testng.TestNG.runSuitesLocally(TestNG.java:883)
at org.testng.TestNG.run(TestNG.java:817)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'abstractNamedQueryMetric' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:968)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:737)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1018)
... 33 more

FAILED CONFIGURATION: @AfterMethod tearDownDatabase
java.lang.NullPointerException
at com.adconion.AbstractDatabaseTest.tearDownDatabase(AbstractDatabaseTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:757)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1168)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:1125)
at org.testng.TestRunner.privateRun(TestRunner.java:749)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
at org.testng.SuiteRunner.run(SuiteRunner.java:223)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:954)
at org.testng.TestNG.runSuitesLocally(TestNG.java:883)
at org.testng.TestNG.run(TestNG.java:817)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)

SKIPPED CONFIGURATION: @BeforeMethod setUpDatabase
SKIPPED: testBeanSQL("amgUnknownLastHour")

Default test
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 2, Skips: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment