-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44801/
-----------------------------------------------------------

Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, Nate Cole, and 
Sumit Mohanty.


Bugs: AMBARI-15407
    https://issues.apache.org/jira/browse/AMBARI-15407


Repository: ambari


Description
-------

Due to the inconsistent ordering of resources in the set of Resources created 
in 
`org.apache.ambari.server.controller.internal.ArtifactResourceProvider#getResources`,
 
`org.apache.ambari.server.controller.internal.ArtifactResourceProviderTest#testDeleteResources`
 fails since the test case expects a certain order in which the Resource are 
processed. 

Since it doesn't really make a difference what order the resources are 
processed when deleting, the test case should be fixed to not care about that. 

The follow test failure has been encountered due to this:

```
java.lang.AssertionError: 
  Unexpected method call ArtifactDAO.findByNameAndForeignKeys("test-artifact2", 
{cluster=500}):
    ArtifactDAO.findByForeignKeys({cluster=500}): expected: 1, actual: 1
    ArtifactDAO.findByNameAndForeignKeys("test-artifact", {cluster=500}): 
expected: 1, actual: 0
        at 
org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:44)
        at 
org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:94)
        at 
org.easymock.internal.ClassProxyFactory$MockMethodInterceptor.intercept(ClassProxyFactory.java:97)
        at 
org.apache.ambari.server.orm.dao.ArtifactDAO$$EnhancerByCGLIB$$40076a34.findByNameAndForeignKeys(<generated>)
        at 
org.apache.ambari.server.controller.internal.ArtifactResourceProvider$4.invoke(ArtifactResourceProvider.java:377)
        at 
org.apache.ambari.server.controller.internal.ArtifactResourceProvider$4.invoke(ArtifactResourceProvider.java:365)
        at 
org.apache.ambari.server.controller.internal.AbstractResourceProvider.invokeWithRetry(AbstractResourceProvider.java:451)
        at 
org.apache.ambari.server.controller.internal.AbstractResourceProvider.modifyResources(AbstractResourceProvider.java:332)
        at 
org.apache.ambari.server.controller.internal.ArtifactResourceProvider.deleteResources(ArtifactResourceProvider.java:245)
        at 
org.apache.ambari.server.controller.internal.ArtifactResourceProviderTest.testDeleteResources(ArtifactResourceProviderTest.java:435)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        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.junit.runner.JUnitCore.run(JUnitCore.java:157)
        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(NativeMethodAccessorImpl.java:57)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
```


Diffs
-----

  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ArtifactResourceProviderTest.java
 45c32c8 

Diff: https://reviews.apache.org/r/44801/diff/


Testing
-------

Running 
org.apache.ambari.server.controller.internal.ArtifactResourceProviderTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.805 sec - in 
org.apache.ambari.server.controller.internal.ArtifactResourceProviderTest


Thanks,

Robert Levas

Reply via email to