// Path: allocate-service/src/test/java/com/stnetix/ariaddna/allocateservice/stub/VufsServiceStub.java
// public class VufsServiceStub implements IVufsService {
// 
//     @Override
//     public Metafile createEmptyMetafile() {
//         return null;
//     }
// 
//     @Override
//     public Metafile getMetafileByUuid(String fileUuid)
//             throws MetafileDoesNotExistException {
//         return null;
//     }
// 
//     @Override
//     public Metafile addBlockByUuidToMetafile(String blockUuid, Metafile metafile) {
//         return null;
//     }
// 
//     @Override
//     public Metafile removeBlockByUuidFromMetafile(String blockUuid, Metafile metafile) {
//         return null;
//     }
// 
//     @Override
//     public boolean addMetafileToMetatable(Metafile metafile) {
//         return false;
//     }
// 
//     @Override
//     public boolean removeMetafileFromMetatable(Metafile metafile) {
//         return false;
//     }
// 
//     @Override
//     public Set<String> getAllocationByBlockUuid(String blockUuid)
//             throws BlockNotExistInMetatableException {
//         Set<String> allocationSet = new HashSet<>();
//         for (int i = 0; i < 3; i++) {
//             allocationSet.add(UUID.randomUUID().toString());
//         }
//         return allocationSet;
//     }
// 
//     @Override
//     public void setAllocationForBlockByUuid(String blockUuid, Set<String> allocationSet) {
// 
//     }
// 
//     @Override
//     public boolean addMetafileAsChildToParent(Metafile childMetafile,
//             String parentMetafileUuid) {
//         return false;
//     }
// 
//     @Override
//     public boolean removeMetafileFromParent(String childMetafileUuid,
//             String parentMetafileUuid) {
//         return false;
//     }
// 
//     @Override
//     public AllocationStrategy getAllocationStrategyByMetafileUuid(String metafileUuid)
//             throws MetafileDoesNotExistException {
//         return AllocationStrategy.HA;
//     }
// 
//     @Override
//     public void setAllocationStrategyByMetafileUuid(String metafileUuid,
//             AllocationStrategy allocationStrategy) throws MetafileDoesNotExistException {
// 
//     }
// }
// 
// Path: common-utils/src/main/java/com/stnetix/ariaddna/commonutils/mavenutil/MavenUtil.java
// public class MavenUtil {
// 
//     private static final AriaddnaLogger LOGGER = AriaddnaLogger.getLogger(MavenUtil.class);
// 
//     private MavenUtil() {
//     }
// 
//     public static String getCurrentVersion() {
//         Model model = null;
//         try {
//             MavenXpp3Reader reader = new MavenXpp3Reader();
//             if ((new File("pom.xml")).exists()) {
//                 model = reader.read(new FileReader("pom.xml"));
//             } else {
//                 model = reader.read(new InputStreamReader(MavenUtil.class.getResourceAsStream(
//                         "/META-INF/maven/com.stnetix.ariaddna/common-utils/pom.xml")));
//             }
// 
//         } catch (IOException e) {
//             LOGGER.error("Can't read Pom.xml file. Exception message is: ", e.getMessage());
//         } catch (XmlPullParserException e) {
//             LOGGER.error("Can't parse Pom.xml file. Exception message is: ", e.getMessage());
//         }
//         return model != null ? model.getParent().getVersion() : "0.0.0";
//     }
// }


import com.stnetix.ariaddna.commonutils.mavenutil.MavenUtil;
import com.stnetix.ariaddna.rps.service.IResourcePolicyService;
import com.stnetix.ariaddna.vufs.bo.Block;
import com.stnetix.ariaddna.vufs.service.IVufsService;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.stnetix.ariaddna.allocateservice.exception.AllocateServiceException;
import com.stnetix.ariaddna.allocateservice.exception.AvailableSpaceNotExistException;
import com.stnetix.ariaddna.allocateservice.exception.BlockDoesNotExistInMetafileException;
import com.stnetix.ariaddna.allocateservice.service.AllocateServiceImpl;
import com.stnetix.ariaddna.allocateservice.stub.ResoucePolicyServiceStub;
import com.stnetix.ariaddna.allocateservice.stub.VufsServiceStub;
/*
 * Copyright (c) 2018 stnetix.com. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.  You may obtain a copy of
 * the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, without warranties or
 * conditions of any kind, EITHER EXPRESS OR IMPLIED.  See the License for the
 * specific language governing permissions and limitations under the License.
 */

package com.stnetix.ariaddna.allocateservice;





public class AllocateServiceImplTest {

    private AllocateServiceImpl service;

    @Before
    public void setUp() throws Exception {
        IResourcePolicyService rpService = new ResoucePolicyServiceStub();
// Path: allocate-service/src/test/java/com/stnetix/ariaddna/allocateservice/stub/VufsServiceStub.java
// public class VufsServiceStub implements IVufsService {
// 
//     @Override
//     public Metafile createEmptyMetafile() {
//         return null;
//     }
// 
//     @Override
//     public Metafile getMetafileByUuid(String fileUuid)
//             throws MetafileDoesNotExistException {
//         return null;
//     }
// 
//     @Override
//     public Metafile addBlockByUuidToMetafile(String blockUuid, Metafile metafile) {
//         return null;
//     }
// 
//     @Override
//     public Metafile removeBlockByUuidFromMetafile(String blockUuid, Metafile metafile) {
//         return null;
//     }
// 
//     @Override
//     public boolean addMetafileToMetatable(Metafile metafile) {
//         return false;
//     }
// 
//     @Override
//     public boolean removeMetafileFromMetatable(Metafile metafile) {
//         return false;
//     }
// 
//     @Override
//     public Set<String> getAllocationByBlockUuid(String blockUuid)
//             throws BlockNotExistInMetatableException {
//         Set<String> allocationSet = new HashSet<>();
//         for (int i = 0; i < 3; i++) {
//             allocationSet.add(UUID.randomUUID().toString());
//         }
//         return allocationSet;
//     }
// 
//     @Override
//     public void setAllocationForBlockByUuid(String blockUuid, Set<String> allocationSet) {
// 
//     }
// 
//     @Override
//     public boolean addMetafileAsChildToParent(Metafile childMetafile,
//             String parentMetafileUuid) {
//         return false;
//     }
// 
//     @Override
//     public boolean removeMetafileFromParent(String childMetafileUuid,
//             String parentMetafileUuid) {
//         return false;
//     }
// 
//     @Override
//     public AllocationStrategy getAllocationStrategyByMetafileUuid(String metafileUuid)
//             throws MetafileDoesNotExistException {
//         return AllocationStrategy.HA;
//     }
// 
//     @Override
//     public void setAllocationStrategyByMetafileUuid(String metafileUuid,
//             AllocationStrategy allocationStrategy) throws MetafileDoesNotExistException {
// 
//     }
// }
// 
// Path: common-utils/src/main/java/com/stnetix/ariaddna/commonutils/mavenutil/MavenUtil.java
// public class MavenUtil {
// 
//     private static final AriaddnaLogger LOGGER = AriaddnaLogger.getLogger(MavenUtil.class);
// 
//     private MavenUtil() {
//     }
// 
//     public static String getCurrentVersion() {
//         Model model = null;
//         try {
//             MavenXpp3Reader reader = new MavenXpp3Reader();
//             if ((new File("pom.xml")).exists()) {
//                 model = reader.read(new FileReader("pom.xml"));
//             } else {
//                 model = reader.read(new InputStreamReader(MavenUtil.class.getResourceAsStream(
//                         "/META-INF/maven/com.stnetix.ariaddna/common-utils/pom.xml")));
//             }
// 
//         } catch (IOException e) {
//             LOGGER.error("Can't read Pom.xml file. Exception message is: ", e.getMessage());
//         } catch (XmlPullParserException e) {
//             LOGGER.error("Can't parse Pom.xml file. Exception message is: ", e.getMessage());
//         }
//         return model != null ? model.getParent().getVersion() : "0.0.0";
//     }
// }


// Path: allocate-service/src/test/java/com/stnetix/ariaddna/allocateservice/AllocateServiceImplTest.java
import com.stnetix.ariaddna.commonutils.mavenutil.MavenUtil;
import com.stnetix.ariaddna.rps.service.IResourcePolicyService;
import com.stnetix.ariaddna.vufs.bo.Block;
import com.stnetix.ariaddna.vufs.service.IVufsService;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.stnetix.ariaddna.allocateservice.exception.AllocateServiceException;
import com.stnetix.ariaddna.allocateservice.exception.AvailableSpaceNotExistException;
import com.stnetix.ariaddna.allocateservice.exception.BlockDoesNotExistInMetafileException;
import com.stnetix.ariaddna.allocateservice.service.AllocateServiceImpl;
import com.stnetix.ariaddna.allocateservice.stub.ResoucePolicyServiceStub;
import com.stnetix.ariaddna.allocateservice.stub.VufsServiceStub;

/*
 * Copyright (c) 2018 stnetix.com. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.  You may obtain a copy of
 * the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, without warranties or
 * conditions of any kind, EITHER EXPRESS OR IMPLIED.  See the License for the
 * specific language governing permissions and limitations under the License.
 */

package com.stnetix.ariaddna.allocateservice;





public class AllocateServiceImplTest {

    private AllocateServiceImpl service;

    @Before
    public void setUp() throws Exception {
        IResourcePolicyService rpService = new ResoucePolicyServiceStub();
        IVufsService vufsService = new VufsServiceStub();