I would like some help running the java cucumber ‘hello world’ example found in this package:
cucumber.examples.java.helloworld.HelloStepdefs
Am wondering have I missed something in my set-up?
java version "1.6.0_37"
Eclipse Indigo Service Release 2 with m2e plug-in
https://github.com/cucumber/cucumber.git 1.1.3-SNAPSHOT
I keep getting the below error:
Feature: Hello World Time elapsed: 0 sec <<< ERROR!
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at gherkin.formatter.PrettyFormatter.indentedLocation(PrettyFormatter.java:142)
at gherkin.formatter.PrettyFormatter.printStep(PrettyFormatter.java:255)
at gherkin.formatter.PrettyFormatter.match(PrettyFormatter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cucumber.runtime.Utils$1.call(Utils.java:44)
at cucumber.runtime.Timeout.timeout(Timeout.java:12)
at cucumber.runtime.Utils.invoke(Utils.java:40)
at cucumber.runtime.RuntimeOptions$2.invoke(RuntimeOptions.java:138)
at $Proxy11.match(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.match(JUnitReporter.java:61)
at cucumber.runtime.Runtime.runStep(Runtime.java:250)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:49)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:43)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:83)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:77)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at cucumber.api.junit.Cucumber.run(Cucumber.java:82)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Even I am facing same issue with 1.1.3 :( just saw this https://groups.google.com/forum/?fromgroups=#!topic/cukes/rCVf28oK1SI it seems to be a regression issue . i changed version in pom and build files to 1.1.2 and it is working fine now.
this error only happens for me when a formatter is configured, remove it, and all the tests run correctly.
So, remove formatting... and version 1.1.3 works, but you do loose all output ?!
Related
I'm getting the error below while running Junit for the hibernate class I made...
So far whatever I googled, I found that I need to set sql.syntax_mys=true for db connection for Junit . But it doesn't work.
datasource.url=jdbc:hsqldb:mem:data-test;sql.syntax_mys=true;shutdown=false
I have Maria DB, I could not find any compatible value in hsqldb for Maria db so I used MySQL syntax sql.syntax_mys=true.
Can someone please help me fix this?
My query in hibernate class is below:
Query query = getCurrentSession().createQuery(
"select avg(availability) as wiActual
from SlaDropPoint
where year = DATE_FORMAT(sysdate(),'%Y')
and client ='All'
and str_to_date(concat(CONVERT(year,CHAR),CONVERT(month,CHAR)), '%Y%m')
!=str_to_date(date_format(sysdate(), '%b-%Y'),'%b-%Y')");
My test case is:
#Test
#Transactional(transactionManager="itlmTransactionManager")
public void testGetDashboardData() {
double result = availabilityDAO.getDashboardData();
assertNotNull(result);
}
It has already created data for this table #before this method call . And Junit works fine if I write simple query like select avg(availability) as wiActual from SlaDropPoint where year ='2016'
So it has problem with functions I used but how to ignore them I can't change the query.
Any pointer/help will be appreciated.
> org.hibernate.exception.SQLGrammarException: could not prepare statement
> at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
> at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
> at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
> at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:148)
> at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1928)
> at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1897)
> at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1875)
at org.hibernate.loader.Loader.doQuery(Loader.java:919)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
at org.hibernate.loader.Loader.doList(Loader.java:2611)
at org.hibernate.loader.Loader.doList(Loader.java:2594)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2423)
at org.hibernate.loader.Loader.list(Loader.java:2418)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:220)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
at com.fmr.itlm.stabilityprogramupdate.dao.hibernate.StabilityProgramUpdateAvailabilityHibernateDAO.getDashboardData(StabilityProgramUpdateAvailabilityHibernateDAO.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy64.getDashboardData(Unknown Source)
at com.fmr.itlm.stabilityprogramupdate.dao.StabilityProgramUpdateAvailabilityDAOTest.testGetDashboardData(StabilityProgramUpdateAvailabilityDAOTest.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:85)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:86)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:241)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: DATE_FORMAT
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:293)
at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:293)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:146)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:172)
... 60 more
Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: DATE_FORMAT
Because not exist function DATE_FORMAT(sysdate(),'%Y') for hsqldb
Try using for hql: to_char(mydate,'yyyy')
In fact, you will have to write a different query for testing and for production code
Our system can run over both web platform and Windows platform. We created tests for the web platform by Cucumer, Selenium, and JUnit and it works fine but very slow.
We decided to execute the same tests on the Windows platform, and created a program which integrates with it, operated by the JUnit. It works very very faster, but we have a problem.
Most cases when AssertTrue has to fail the test, it actually calls fail(), but the test continues running to the next sentence. Moreover, the output of the fail() is actually printed.
Why does it occur?
EDIT: I don't know what can be clearer than what I wrote, but you want:
assertTrue("retval = " + params[0], params[0].equals("0"));
When params[0] = "1018" the test is supposed to stop with failure. But it continues to the next code instruction.
The output is:
java.lang.AssertionError: retval = 1026
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.assertTrue(Assert.java:41)
at com.eshbel_17_0.WinformBridge.readToJava(WinformBridge.java:225)
at com.eshbel_17_0.WinformExec.runDirectProcedure(WinformExec.java:111)
at com.eshbel_17_0.Definitions.the_user_runs_the_direct_activation(Definitions.java:362)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cucumber.runtime.Utils$1.call(Utils.java:34)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:30)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:35)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:298)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:48)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:89)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:40)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at cucumber.api.junit.Cucumber.run(Cucumber.java:94)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Oh, I found why it happens, and it's so foolish mistake!
This code is sorrounded by try-catch block, and gets also Throwable e. it includes also Assertion Error exception, so test not failed.
We are trying to run a OLAP query with olap4j against SSAS. I've managed to setup the XML/A endpoint, and SSMS connects to the endpoint correctly and works fine.
However each time I try to run a query from JAVA it fails.
Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
Connection connection = DriverManager.getConnection(
"jdbc:xmla:Server=http://servername/msmdpump.dll;Catalog=DatabaseName");
OlapWrapper wrapper = (OlapWrapper) connection;
OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
CellSet set = olapConnection.createStatement().executeOlapQuery(
"SELECT [Measures].[Foo] ON COLUMNS, " +
"[Dimension].[Id].[All].children ON ROWS FROM [Cube]");
The exception/stacktrace:
java.lang.AssertionError
at org.olap4j.driver.xmla.XmlaOlap4jElement.<init>(XmlaOlap4jElement.java:43)
at org.olap4j.driver.xmla.XmlaOlap4jProperty.<init>(XmlaOlap4jProperty.java:54)
at org.olap4j.driver.xmla.XmlaOlap4jConnection$PropertyHandler.handle(XmlaOlap4jConnection.java:1890)
at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(DeferredNamedListImpl.java:136)
at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:90)
at org.olap4j.driver.xmla.DeferredNamedListImpl.size(DeferredNamedListImpl.java:116)
at java.util.AbstractCollection.toArray(Unknown Source)
at java.util.ArrayList.addAll(Unknown Source)
at org.olap4j.driver.xmla.XmlaOlap4jLevel.getProperties(XmlaOlap4jLevel.java:189)
at org.olap4j.driver.xmla.XmlaOlap4jConnection$MemberHandler.addUserDefinedDimensionProperties(XmlaOlap4jConnection.java:1739)
at org.olap4j.driver.xmla.XmlaOlap4jConnection$MemberHandler.handle(XmlaOlap4jConnection.java:1698)
at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
at org.olap4j.driver.xmla.XmlaOlap4jCube$RawMetadataReader.lookupMemberRelatives(XmlaOlap4jCube.java:547)
at org.olap4j.driver.xmla.XmlaOlap4jCube$RawMetadataReader.lookupMemberByUniqueName(XmlaOlap4jCube.java:438)
at org.olap4j.driver.xmla.XmlaOlap4jCube$DelegatingMetadataReader.lookupMemberByUniqueName(XmlaOlap4jCube.java:252)
at org.olap4j.driver.xmla.XmlaOlap4jCube$CachingMetadataReader.lookupMemberByUniqueName(XmlaOlap4jCube.java:338)
at org.olap4j.driver.xmla.XmlaOlap4jConnection$MeasureHandler.handle(XmlaOlap4jConnection.java:1555)
at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
at org.olap4j.driver.xmla.XmlaOlap4jCube.<init>(XmlaOlap4jCube.java:110)
at org.olap4j.driver.xmla.XmlaOlap4jConnection$CubeHandler.handle(XmlaOlap4jConnection.java:1284)
at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:854)
at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(DeferredNamedListImpl.java:136)
at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:90)
at org.olap4j.driver.xmla.DeferredNamedListImpl.size(DeferredNamedListImpl.java:116)
at java.util.AbstractList$Itr.hasNext(Unknown Source)
at org.olap4j.driver.xmla.XmlaOlap4jCellSet.lookupCube(XmlaOlap4jCellSet.java:520)
at org.olap4j.driver.xmla.XmlaOlap4jCellSet.createMetaData(XmlaOlap4jCellSet.java:403)
at org.olap4j.driver.xmla.XmlaOlap4jCellSet.populate(XmlaOlap4jCellSet.java:181)
at org.olap4j.driver.xmla.XmlaOlap4jStatement.executeOlapQuery(XmlaOlap4jStatement.java:372)
at com.socgen.moma.services.pricingassetscope.DefaultPricingAssetScopeManagerTest.testOlap4j(DefaultPricingAssetScopeManagerTest.java:184)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
14:17
For some reason, the code tries to build an XMLA element with a null unique name.
XmlaOlap4jElement(
String uniqueName,
String name,
String caption,
String description)
{
assert uniqueName != null;
Try sniffing the messages coming out of SSAS. There's probably something funky with the XML it returns.
Alternatively, you can take the high road and turn off assertions, but this error is a sign that something terribly wrong is going on and I recommend against this approach.
I have a problem with instrumentation of my Model classes when I use JDK8 features there(lamba). It just silently skips those classes.
When I try to call:
CtClass clazz = getClazz("me.factorify.server.person.domain.Person");
clazz.getModifiers();
I get this exception:
java.lang.RuntimeException: java.io.IOException: invalid constant type: 18 at 14
at javassist.CtClassType.getClassFile2(CtClassType.java:204)
at javassist.CtClassType.getModifiers(CtClassType.java:388)
at me.factorify.server.person.domain.PersonTest.testName(PersonTest.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.io.IOException: invalid constant type: 18 at 14
at javassist.bytecode.ConstPool.readOne(ConstPool.java:1044)
at javassist.bytecode.ConstPool.read(ConstPool.java:984)
at javassist.bytecode.ConstPool.<init>(ConstPool.java:125)
at javassist.bytecode.ClassFile.read(ClassFile.java:770)
at javassist.bytecode.ClassFile.<init>(ClassFile.java:114)
at javassist.CtClassType.getClassFile2(CtClassType.java:191)
... 28 more
It's caused by old version of javassist/asm.
Do you have any workaround for that?
EDIT: I think I fixed it and created this pull request https://github.com/javalite/activejdbc/pull/336
#jacub.petr, thanks for the pull request. We built and deployed the latest snapshot with your fix. Pull version 1.4.9-SNAPSHOT from https://oss.sonatype.org/content/repositories/snapshots/org/javalite/activejdbc/1.4.10-SNAPSHOT/ and try again. We will be releasing 1.5 soon and your fix will be included
I'm trying to automate a simple new project wizard using SwtBot 2.2.1 . The code is the one that I've found in the tutorial
bot.menu("File").menu("New").menu("Project...").click();
The problem is that the click() method call never returns. My target platform is Eclipse Kepler on Linux x86_64 . The new project dialog is brought up however, so I'm not sure why the call does not return. Here's a screenshot of what the Eclipse instance under test looks like when the test hangs
The stack trace of the main thread is
"main" prio=10 tid=0x00007f12c0006000 nid=0x428b runnable [0x00007f12c68d2000]
java.lang.Thread.State: RUNNABLE
at org.eclipse.swt.internal.gtk.OS.Call(Native Method)
at org.eclipse.swt.widgets.Display.sleep(Display.java:4233)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
at org.eclipse.jface.window.Window.open(Window.java:802)
at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1401)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot$2.run(AbstractSWTBot.java:166)
at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$5.doRun(UIThreadRunnable.java:221)
at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.run(UIThreadRunnable.java:78)
at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.asyncExec(UIThreadRunnable.java:223)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.asyncExec(AbstractSWTBot.java:576)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:155)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:136)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:126)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.click(SWTBotMenu.java:60)
at org.apache.sling.ide.test.impl.ui.NewContentPackageWizardTest.createNewContentProject(NewContentPackageWizardTest.java:55)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner.run(SWTBotJunit4ClassRunner.java:54)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
- locked <0x00000000fe4fc480> (a org.eclipse.swt.widgets.RunnableLock)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3717)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3366)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47)
at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
What can I do to make the test run successfully?
My error was launching the tests on the UI thread. Once I unchecked 'Run on UI thread' in the launch configuration, the tests executed fine.