Tom Beerbower created AMBARI-7186:
-------------------------------------

             Summary: Fix unit test 
ViewRegistryTest.testReadViewArchives_exception
                 Key: AMBARI-7186
                 URL: https://issues.apache.org/jira/browse/AMBARI-7186
             Project: Ambari
          Issue Type: Task
            Reporter: Tom Beerbower
            Assignee: Tom Beerbower
             Fix For: 1.7.0


Possibly intermittent failure.

{code}
Error Message

   Expectation failure on verify:     ViewDAO.findAll(): expected: 1, actual: 0

Stacktrace

java.lang.AssertionError: 
  Expectation failure on verify:
    ViewDAO.findAll(): expected: 1, actual: 0
        at org.easymock.internal.MocksControl.verify(MocksControl.java:183)
        at org.easymock.EasyMock.verify(EasyMock.java:2142)
        at 
org.apache.ambari.server.view.ViewRegistryTest.testReadViewArchives_exception(ViewRegistryTest.java:421)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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:103)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

Standard Output

2014-09-05 14:58:05,172 INFO  [main] configuration.Configuration 
(Configuration.java:<init>(394)) - Reading password from existing file
2014-09-05 14:58:05,199 INFO  [pool-1-thread-2] view.ViewRegistry 
(ViewRegistry.java:extractViewArchive(1138)) - Creating archive folder 
/var/lib/ambari-server/resources/views/work/MY_VIEW{1.0.0}.
2014-09-05 14:58:05,200 INFO  [pool-1-thread-2] view.ViewRegistry 
(ViewRegistry.java:extractViewArchive(1146)) - Extracting files from null:
2014-09-05 14:58:05,200 INFO  [pool-1-thread-2] view.ViewRegistry 
(ViewRegistry.java:extractViewArchive(1153)) -     
/var/lib/ambari-server/resources/views/work/MY_VIEW{1.0.0}/view.xml
2014-09-05 14:58:05,212 ERROR [pool-1-thread-2] view.ViewRegistry 
(ViewRegistry.java:readViewArchive(1306)) - Caught exception loading view 
MY_VIEW : Expected exception.
java.lang.IllegalArgumentException: Expected exception.
        at 
org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:46)
        at 
org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:85)
        at 
org.easymock.internal.ClassProxyFactory$MockMethodInterceptor.intercept(ClassProxyFactory.java:94)
        at 
org.apache.ambari.server.orm.dao.ViewDAO$$EnhancerByCGLIB$$7f2cc684.findByName(<generated>)
        at 
org.apache.ambari.server.view.ViewRegistry.syncView(ViewRegistry.java:1041)
        at 
org.apache.ambari.server.view.ViewRegistry.readViewArchive(ViewRegistry.java:1291)
        at 
org.apache.ambari.server.view.ViewRegistry.access$200(ViewRegistry.java:114)
        at 
org.apache.ambari.server.view.ViewRegistry$1$1.run(ViewRegistry.java:436)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
{code}


{code}
Stacktrace

java.lang.IllegalArgumentException
        at 
java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1310)
        at 
java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1198)
        at 
org.apache.ambari.server.view.ViewRegistry.getExecutorService(ViewRegistry.java:1321)
        at 
org.apache.ambari.server.view.ViewRegistry.readViewArchives(ViewRegistry.java:403)
        at 
org.apache.ambari.server.view.ViewRegistryTest.testReadViewArchives_exception(ViewRegistryTest.java:406)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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:103)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

Standard Output

2014-09-05 14:59:18,107 INFO  [main] configuration.Configuration 
(Configuration.java:<init>(394)) - Reading password from existing file
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to