v6.9.0
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at teammates.test.pageobjects.AppPage.getNewPageInstance(AppPage.java:169)
at teammates.test.pageobjects.AppPage.changePageType(AppPage.java:197)
at teammates.test.pageobjects.GoogleLoginPage.loginAsStudent(GoogleLoginPage.java:77)
at teammates.test.pageobjects.GoogleLoginPage.loginAsStudent(GoogleLoginPage.java:70)
at teammates.test.cases.browsertests.StudentHomePageUiTest.testContentAndLogin(StudentHomePageUiTest.java:80)
at teammates.test.cases.browsertests.StudentHomePageUiTest.allTests(StudentHomePageUiTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:771)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
at org.testng.TestNG.run(TestNG.java:1032)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at teammates.test.pageobjects.AppPage.getNewPageInstance(AppPage.java:165)
... 28 more
Caused by: java.lang.IllegalStateException: Not in the correct page!
at teammates.test.pageobjects.AppPage.(AppPage.java:146)
at teammates.test.pageobjects.StudentHomePage.(StudentHomePage.java:11)
This may have been hidden earlier due to another failure (#8524)
Error in the server log:
teammates.common.util.Logger severe: Unexpected exception caught by ControllerServlet : (Logger.java:52)
java.lang.NullPointerException
at teammates.logic.core.CoursesLogic.lambda$getCoursesForStudentAccount$0(CoursesLogic.java:479)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at teammates.logic.core.CoursesLogic.getCoursesForStudentAccount(CoursesLogic.java:481)
at teammates.logic.core.CoursesLogic.getCourseDetailsListForStudent(CoursesLogic.java:154)
at teammates.logic.api.Logic.getCourseDetailsListForStudent(Logic.java:640)
at teammates.ui.controller.StudentHomePageAction.execute(StudentHomePageAction.java:31)
at teammates.ui.controller.Action.executeAndPostProcess(Action.java:476)
at teammates.ui.controller.ControllerServlet.doPost(ControllerServlet.java:75)
at teammates.ui.controller.ControllerServlet.doGet(ControllerServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772)
at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:48)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at com.google.apphosting.runtime.jetty9.ParseBlobUploadHandler.handle(ParseBlobUploadHandler.java:120)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1182)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doHandle(AppEngineWebAppContext.java:171)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:297)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:534)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
at com.google.apphosting.runtime.jetty9.RpcConnection.handle(RpcConnection.java:202)
at com.google.apphosting.runtime.jetty9.RpcConnector.serviceRequest(RpcConnector.java:81)
at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:693)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:655)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:625)
at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:819)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:274)
at java.lang.Thread.run(Thread.java:745)
Can StudentHomePageUiTest pass if it is run separately?
Can StudentHomePageUiTest pass if it is run separately?
No, I ran it on its own 4 times. Failed each time with this error.
Guess getCourse returns null and results in NPE. There are other student entities (which is the result of state leak, may related to #8524 indeed) associated with test.student1.account (in the test.properties). Need @damithc your help to find the courses associated with the test account.
We can find the courseID associated with a certain google account in the query panel in GAE https://console.cloud.google.com/datastore/entities/query


Will this query return result?
Key(Course, 'SHomeUiT.CS2103')

Will this query return result?
Key(Course, 'SHomeUiT.CS2103')
No. I deleted that one earlier. Otherwise the test fails at a different point.
OK, I figured what you are driving at. Managed to pass the test after deleting the orphan CourseStudent entity. 馃憤
Thanks for the help. 馃挴
For the record, this is the reason: I manually deleted a Course object to correct a state leak between tests but there were CourseStudent entities related to that Course object (which should have been deleted with the course) -- the resulting inconsistent data caused this error.
Most helpful comment
For the record, this is the reason: I manually deleted a Course object to correct a state leak between tests but there were CourseStudent entities related to that Course object (which should have been deleted with the course) -- the resulting inconsistent data caused this error.