You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by be...@apache.org on 2018/03/27 12:45:01 UTC
[ambari] branch trunk updated: AMBARI-23338 blueprints with
installed cluster should bw read-only (benyoka) (#764)
This is an automated email from the ASF dual-hosted git repository.
benyoka pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 2efd134 AMBARI-23338 blueprints with installed cluster should bw read-only (benyoka) (#764)
2efd134 is described below
commit 2efd134576df4865a8badd1aeb9b99aaeb4e33d3
Author: benyoka <be...@users.noreply.github.com>
AuthorDate: Tue Mar 27 14:44:58 2018 +0200
AMBARI-23338 blueprints with installed cluster should bw read-only (benyoka) (#764)
Checked CI logs, Java unit test completed without issues:
2133881 [INFO] Results:
2133881 [INFO]
2133881 [WARNING] Tests run: 5070, Failures: 0, Errors: 0, Skipped: 67
CI test failed due to failing python test in ambari-server (also failing on trunk) and cleanup issue after building ambari-agent. Both issues are unrelated.
---
.../ambari/server/controller/AmbariServer.java | 5 +-
.../internal/BlueprintResourceProvider.java | 36 ++++--
.../ambari/server/orm/dao/TopologyRequestDAO.java | 6 +
.../server/orm/entities/TopologyRequestEntity.java | 3 +-
.../internal/BlueprintResourceProviderTest.java | 127 +++++++++++++--------
5 files changed, 114 insertions(+), 63 deletions(-)
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index f8e4d21..f7f7f31 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -91,6 +91,7 @@ import org.apache.ambari.server.orm.dao.PermissionDAO;
import org.apache.ambari.server.orm.dao.PrincipalDAO;
import org.apache.ambari.server.orm.dao.PrivilegeDAO;
import org.apache.ambari.server.orm.dao.ResourceDAO;
+import org.apache.ambari.server.orm.dao.TopologyRequestDAO;
import org.apache.ambari.server.orm.dao.UserDAO;
import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
import org.apache.ambari.server.orm.entities.MetainfoEntity;
@@ -916,8 +917,8 @@ public class AmbariServer {
StackDefinedPropertyProvider.init(injector);
AbstractControllerResourceProvider.init(injector.getInstance(ResourceProviderFactory.class));
BlueprintResourceProvider.init(injector.getInstance(BlueprintFactory.class),
- injector.getInstance(BlueprintDAO.class), injector.getInstance(SecurityConfigurationFactory.class),
- injector.getInstance(Gson.class), ambariMetaInfo);
+ injector.getInstance(BlueprintDAO.class), injector.getInstance(TopologyRequestDAO.class),
+ injector.getInstance(SecurityConfigurationFactory.class), injector.getInstance(Gson.class), ambariMetaInfo);
StackDependencyResourceProvider.init(ambariMetaInfo);
ClusterResourceProvider.init(injector.getInstance(TopologyManager.class),
injector.getInstance(TopologyRequestFactoryImpl.class), injector.getInstance(SecurityConfigurationFactory
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
index c665aec..020dbb9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
@@ -18,6 +18,8 @@
package org.apache.ambari.server.controller.internal;
+import static java.util.stream.Collectors.toSet;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -43,6 +45,7 @@ import org.apache.ambari.server.controller.spi.SystemException;
import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
import org.apache.ambari.server.orm.dao.BlueprintDAO;
+import org.apache.ambari.server.orm.dao.TopologyRequestDAO;
import org.apache.ambari.server.orm.entities.BlueprintConfigEntity;
import org.apache.ambari.server.orm.entities.BlueprintConfiguration;
import org.apache.ambari.server.orm.entities.BlueprintEntity;
@@ -50,6 +53,7 @@ import org.apache.ambari.server.orm.entities.BlueprintSettingEntity;
import org.apache.ambari.server.orm.entities.HostGroupComponentEntity;
import org.apache.ambari.server.orm.entities.HostGroupEntity;
import org.apache.ambari.server.orm.entities.StackEntity;
+import org.apache.ambari.server.orm.entities.TopologyRequestEntity;
import org.apache.ambari.server.stack.NoSuchStackException;
import org.apache.ambari.server.state.SecurityType;
import org.apache.ambari.server.state.StackInfo;
@@ -156,6 +160,11 @@ public class BlueprintResourceProvider extends AbstractControllerResourceProvide
private static BlueprintDAO blueprintDAO;
/**
+ * Topology request dao
+ */
+ private static TopologyRequestDAO topologyRequestDAO;
+
+ /**
* Used to serialize to/from json.
*/
private static Gson jsonSerializer;
@@ -175,13 +184,14 @@ public class BlueprintResourceProvider extends AbstractControllerResourceProvide
* Static initialization.
*
* @param factory blueprint factory
- * @param dao blueprint data access object
+ * @param bpDao blueprint data access object
* @param gson json serializer
*/
- public static void init(BlueprintFactory factory, BlueprintDAO dao, SecurityConfigurationFactory
- securityFactory, Gson gson, AmbariMetaInfo metaInfo) {
+ public static void init(BlueprintFactory factory, BlueprintDAO bpDao, TopologyRequestDAO trDao,
+ SecurityConfigurationFactory securityFactory, Gson gson, AmbariMetaInfo metaInfo) {
blueprintFactory = factory;
- blueprintDAO = dao;
+ blueprintDAO = bpDao;
+ topologyRequestDAO = trDao;
securityConfigurationFactory = securityFactory;
jsonSerializer = gson;
ambariMetaInfo = metaInfo;
@@ -274,18 +284,20 @@ public class BlueprintResourceProvider extends AbstractControllerResourceProvide
Set<Resource> setResources = getResources(
new RequestImpl(null, null, null, null), predicate);
+ List<TopologyRequestEntity> provisionRequests = topologyRequestDAO.findAllProvisionRequests();
+ // Blueprints for which a provision request was submitted. This blueprints (should be zero or one) are read only.
+ Set<String> provisionedBlueprints =
+ provisionRequests.stream().map(TopologyRequestEntity::getBlueprintName).collect(toSet());
+
for (final Resource resource : setResources) {
final String blueprintName =
(String) resource.getPropertyValue(BLUEPRINT_NAME_PROPERTY_ID);
-
+ Preconditions.checkArgument(!provisionedBlueprints.contains(blueprintName),
+ "Blueprint %s cannot be deleted as cluster provisioning was initiated on it.", blueprintName);
LOG.info("Deleting Blueprint, name = " + blueprintName);
-
- modifyResources(new Command<Void>() {
- @Override
- public Void invoke() throws AmbariException {
- blueprintDAO.removeByName(blueprintName);
- return null;
- }
+ modifyResources(() -> {
+ blueprintDAO.removeByName(blueprintName);
+ return null;
});
}
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyRequestDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyRequestDAO.java
index 6831ebe..6ad25d4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyRequestDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyRequestDAO.java
@@ -57,6 +57,12 @@ public class TopologyRequestDAO {
return daoUtils.selectAll(entityManagerProvider.get(), TopologyRequestEntity.class);
}
+ @RequiresSession
+ public List<TopologyRequestEntity> findAllProvisionRequests() {
+ return daoUtils.selectList(entityManagerProvider.get().createNamedQuery("TopologyRequestEntity.findProvisionRequests",
+ TopologyRequestEntity.class));
+ }
+
@Transactional
public void create(TopologyRequestEntity requestEntity) {
entityManagerProvider.get().persist(requestEntity);
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
index d281838..934ad6c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/TopologyRequestEntity.java
@@ -45,7 +45,8 @@ import org.apache.ambari.server.controller.internal.ProvisionAction;
pkColumnName = "sequence_name", valueColumnName = "sequence_value",
pkColumnValue = "topology_request_id_seq", initialValue = 0)
@NamedQueries({
- @NamedQuery(name = "TopologyRequestEntity.findByClusterId", query = "SELECT req FROM TopologyRequestEntity req WHERE req.clusterId = :clusterId")
+ @NamedQuery(name = "TopologyRequestEntity.findByClusterId", query = "SELECT req FROM TopologyRequestEntity req WHERE req.clusterId = :clusterId"),
+ @NamedQuery(name = "TopologyRequestEntity.findProvisionRequests", query = "SELECT req FROM TopologyRequestEntity req WHERE req.action = 'PROVISION'"),
})
public class TopologyRequestEntity {
@Id
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
index c7b8d71..7b15412 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
@@ -63,6 +63,7 @@ import org.apache.ambari.server.controller.spi.SystemException;
import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
import org.apache.ambari.server.orm.dao.BlueprintDAO;
import org.apache.ambari.server.orm.dao.StackDAO;
+import org.apache.ambari.server.orm.dao.TopologyRequestDAO;
import org.apache.ambari.server.orm.entities.BlueprintConfigEntity;
import org.apache.ambari.server.orm.entities.BlueprintConfiguration;
import org.apache.ambari.server.orm.entities.BlueprintEntity;
@@ -70,6 +71,7 @@ import org.apache.ambari.server.orm.entities.BlueprintSettingEntity;
import org.apache.ambari.server.orm.entities.HostGroupComponentEntity;
import org.apache.ambari.server.orm.entities.HostGroupEntity;
import org.apache.ambari.server.orm.entities.StackEntity;
+import org.apache.ambari.server.orm.entities.TopologyRequestEntity;
import org.apache.ambari.server.state.PropertyInfo;
import org.apache.ambari.server.state.SecurityType;
import org.apache.ambari.server.state.StackInfo;
@@ -87,6 +89,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import com.google.common.collect.ImmutableList;
import com.google.gson.Gson;
/**
@@ -100,7 +103,8 @@ public class BlueprintResourceProviderTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
- private final static BlueprintDAO dao = createStrictMock(BlueprintDAO.class);
+ private final static BlueprintDAO blueprintDao = createStrictMock(BlueprintDAO.class);
+ private final static TopologyRequestDAO topologyRequestDAO = createMock(TopologyRequestDAO.class);
private final static StackDAO stackDAO = createNiceMock(StackDAO.class);
private final static BlueprintEntity entity = createStrictMock(BlueprintEntity.class);
private final static Blueprint blueprint = createMock(Blueprint.class);
@@ -112,7 +116,7 @@ public class BlueprintResourceProviderTest {
@BeforeClass
public static void initClass() {
- BlueprintResourceProvider.init(blueprintFactory, dao, securityFactory, gson, metaInfo);
+ BlueprintResourceProvider.init(blueprintFactory, blueprintDao, topologyRequestDAO, securityFactory, gson, metaInfo);
StackEntity stackEntity = new StackEntity();
stackEntity.setStackName("test-stack-name");
@@ -131,7 +135,7 @@ public class BlueprintResourceProviderTest {
@Before
public void resetGlobalMocks() {
- reset(dao, metaInfo, blueprintFactory, securityFactory, blueprint, entity);
+ reset(blueprintDao, topologyRequestDAO, metaInfo, blueprintFactory, securityFactory, blueprint, entity);
}
@Test
@@ -156,10 +160,10 @@ public class BlueprintResourceProviderTest {
expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
- dao.create(entity);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ blueprintDao.create(entity);
- replay(dao, entity, metaInfo, blueprintFactory, securityFactory, blueprint, setting, request, managementController);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, securityFactory, blueprint, setting, request, managementController);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -178,7 +182,7 @@ public class BlueprintResourceProviderTest {
assertEquals(request, lastEvent.getRequest());
assertNull(lastEvent.getPredicate());
- verify(dao, entity, blueprintFactory, securityFactory, metaInfo, request, managementController);
+ verify(blueprintDao, entity, blueprintFactory, securityFactory, metaInfo, request, managementController);
}
@Test()
@@ -232,10 +236,10 @@ public class BlueprintResourceProviderTest {
expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
- dao.create(entity);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ blueprintDao.create(entity);
- replay(dao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -254,7 +258,7 @@ public class BlueprintResourceProviderTest {
assertEquals(request, lastEvent.getRequest());
assertNull(lastEvent.getPredicate());
- verify(dao, entity, blueprintFactory, metaInfo, request, managementController);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request, managementController);
}
@Test
@@ -273,9 +277,9 @@ public class BlueprintResourceProviderTest {
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
- replay(dao, entity, metaInfo, blueprintFactory, blueprint, request);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, blueprint, request);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -292,7 +296,7 @@ public class BlueprintResourceProviderTest {
// expected
}
- verify(dao, entity, blueprintFactory, metaInfo, request);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request);
}
@@ -317,10 +321,10 @@ public class BlueprintResourceProviderTest {
expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
- dao.create(entity);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ blueprintDao.create(entity);
- replay(dao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -339,7 +343,7 @@ public class BlueprintResourceProviderTest {
assertEquals(request, lastEvent.getRequest());
assertNull(lastEvent.getPredicate());
- verify(dao, entity, blueprintFactory, metaInfo, request, managementController);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request, managementController);
}
@Test
@@ -359,7 +363,7 @@ public class BlueprintResourceProviderTest {
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- replay(dao, entity, metaInfo, blueprintFactory, securityFactory, blueprint, request);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, securityFactory, blueprint, request);
// end expectations
try {
@@ -368,7 +372,7 @@ public class BlueprintResourceProviderTest {
} catch (IllegalArgumentException e) {
// expected
}
- verify(dao, entity, blueprintFactory, metaInfo, request);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request);
}
@Test
@@ -394,10 +398,10 @@ public class BlueprintResourceProviderTest {
expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
- dao.create(entity);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ blueprintDao.create(entity);
- replay(dao, entity, metaInfo, blueprintFactory, securityFactory, blueprint, setting, request, managementController);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, securityFactory, blueprint, setting, request, managementController);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -416,7 +420,7 @@ public class BlueprintResourceProviderTest {
assertEquals(request, lastEvent.getRequest());
assertNull(lastEvent.getPredicate());
- verify(dao, entity, blueprintFactory, metaInfo, request, managementController);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request, managementController);
}
@Test
@@ -430,13 +434,13 @@ public class BlueprintResourceProviderTest {
results.add(entity);
// set expectations
- expect(dao.findAll()).andReturn(results);
- replay(dao, request);
+ expect(blueprintDao.findAll()).andReturn(results);
+ replay(blueprintDao, request);
Set<Resource> setResults = provider.getResources(request, null);
assertEquals(1, setResults.size());
- verify(dao);
+ verify(blueprintDao);
validateResource(setResults.iterator().next(), false);
}
@@ -458,13 +462,13 @@ public class BlueprintResourceProviderTest {
results.add(entity);
// set expectations
- expect(dao.findAll()).andReturn(results);
- replay(dao, request);
+ expect(blueprintDao.findAll()).andReturn(results);
+ replay(blueprintDao, request);
Set<Resource> setResults = provider.getResources(request, null);
assertEquals(1, setResults.size());
- verify(dao);
+ verify(blueprintDao);
validateResource(setResults.iterator().next(), true);
}
@@ -476,10 +480,11 @@ public class BlueprintResourceProviderTest {
BlueprintEntity blueprintEntity = createEntity(getBlueprintTestProperties().iterator().next());
// set expectations
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(blueprintEntity);
- dao.removeByName(blueprintEntity.getBlueprintName());
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(blueprintEntity);
+ blueprintDao.removeByName(blueprintEntity.getBlueprintName());
expectLastCall();
- replay(dao);
+ expect(topologyRequestDAO.findAllProvisionRequests()).andReturn(ImmutableList.of());
+ replay(blueprintDao, topologyRequestDAO);
Predicate predicate = new EqualsPredicate<>(
BlueprintResourceProvider.BLUEPRINT_NAME_PROPERTY_ID, BLUEPRINT_NAME);
@@ -495,9 +500,35 @@ public class BlueprintResourceProviderTest {
assertEquals(ResourceProviderEvent.Type.Delete, lastEvent.getType());
assertNotNull(lastEvent.getPredicate());
- verify(dao);
+ verify(blueprintDao);
}
+ @Test(expected = IllegalArgumentException.class)
+ public void testDeleteResources_clusterAlreadyProvisioned() throws SystemException, UnsupportedPropertyException,
+ NoSuchParentResourceException, NoSuchResourceException {
+
+ BlueprintEntity blueprintEntity = createEntity(getBlueprintTestProperties().iterator().next());
+
+ // set expectations
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(blueprintEntity);
+ blueprintDao.removeByName(blueprintEntity.getBlueprintName());
+ expectLastCall();
+ TopologyRequestEntity topologyRequestEntity = new TopologyRequestEntity();
+ topologyRequestEntity.setBlueprintName(BLUEPRINT_NAME);
+ expect(topologyRequestDAO.findAllProvisionRequests()).andReturn(ImmutableList.of(topologyRequestEntity));
+ replay(blueprintDao, topologyRequestDAO);
+
+
+ Predicate predicate = new EqualsPredicate<>(
+ BlueprintResourceProvider.BLUEPRINT_NAME_PROPERTY_ID, BLUEPRINT_NAME);
+
+ AbstractResourceProviderTest.TestObserver observer = new AbstractResourceProviderTest.TestObserver();
+ provider.addObserver(observer);
+
+ provider.deleteResources(new RequestImpl(null, null, null, null), predicate);
+ }
+
+
@Test
public void testCreateResources_withEmptyConfiguration() throws Exception {
@@ -520,10 +551,10 @@ public class BlueprintResourceProviderTest {
expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
- dao.create(entity);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ blueprintDao.create(entity);
- replay(dao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -542,7 +573,7 @@ public class BlueprintResourceProviderTest {
assertEquals(request, lastEvent.getRequest());
assertNull(lastEvent.getPredicate());
- verify(dao, entity, blueprintFactory, metaInfo, request, managementController);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request, managementController);
}
@Test
@@ -567,10 +598,10 @@ public class BlueprintResourceProviderTest {
expect(blueprint.getName()).andReturn(BLUEPRINT_NAME).atLeastOnce();
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- expect(dao.findByName(BLUEPRINT_NAME)).andReturn(null);
- dao.create(entity);
+ expect(blueprintDao.findByName(BLUEPRINT_NAME)).andReturn(null);
+ blueprintDao.create(entity);
- replay(dao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
+ replay(blueprintDao, entity, metaInfo, blueprintFactory, blueprint, setting, request, managementController);
// end expectations
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -589,7 +620,7 @@ public class BlueprintResourceProviderTest {
assertEquals(request, lastEvent.getRequest());
assertNull(lastEvent.getPredicate());
- verify(dao, entity, blueprintFactory, metaInfo, request, managementController);
+ verify(blueprintDao, entity, blueprintFactory, metaInfo, request, managementController);
}
@Test
@@ -610,7 +641,7 @@ public class BlueprintResourceProviderTest {
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- replay(dao, metaInfo, request);
+ replay(blueprintDao, metaInfo, request);
// end expectations
try {
@@ -620,7 +651,7 @@ public class BlueprintResourceProviderTest {
//expected exception
assertEquals(BlueprintResourceProvider.CONFIGURATION_MAP_SIZE_CHECK_ERROR_MESSAGE, e.getMessage());
}
- verify(dao, metaInfo, request);
+ verify(blueprintDao, metaInfo, request);
}
@Test
@@ -639,7 +670,7 @@ public class BlueprintResourceProviderTest {
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- replay(dao, metaInfo, request);
+ replay(blueprintDao, metaInfo, request);
// end expectations
try {
@@ -649,7 +680,7 @@ public class BlueprintResourceProviderTest {
//expected exception
assertEquals(BlueprintResourceProvider.CONFIGURATION_MAP_CHECK_ERROR_MESSAGE, e.getMessage());
}
- verify(dao, metaInfo, request);
+ verify(blueprintDao, metaInfo, request);
}
@Test
@@ -668,7 +699,7 @@ public class BlueprintResourceProviderTest {
expect(request.getProperties()).andReturn(setProperties);
expect(request.getRequestInfoProperties()).andReturn(requestInfoProperties);
- replay(dao, metaInfo, request);
+ replay(blueprintDao, metaInfo, request);
// end expectations
try {
@@ -678,7 +709,7 @@ public class BlueprintResourceProviderTest {
//expected exception
assertEquals(BlueprintResourceProvider.CONFIGURATION_LIST_CHECK_ERROR_MESSAGE, e.getMessage());
}
- verify(dao, metaInfo, request);
+ verify(blueprintDao, metaInfo, request);
}
public static Set<Map<String, Object>> getBlueprintTestProperties() {
--
To stop receiving notification emails like this one, please contact
benyoka@apache.org.