f2778df88576ccc8abd552a4556dc47a246d1de2
[vfc/nfvo/wfengine.git] /
1 /*******************************************************************************
2  * Copyright (c) 2012-2013,2015 University of Stuttgart.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * and the Apache License 2.0 which both accompany this distribution,
6  * and are available at http://www.eclipse.org/legal/epl-v10.html
7  * and http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Contributors:
10  *     Oliver Kopp - initial API and implementation
11  *******************************************************************************/
12 package org.eclipse.winery.repository.importing;
13
14 import java.nio.file.FileSystems;
15 import java.nio.file.Path;
16 import java.util.ArrayList;
17 import java.util.List;
18
19 import org.eclipse.winery.repository.PrefsTestEnabledUsingConfiguredRepository;
20 import org.junit.BeforeClass;
21 import org.junit.Test;
22
23 public class TestCSARImporter {
24         
25         /**
26          * Ensure that Repository.INSTANCE exists
27          */
28         @BeforeClass
29         public static void setupPrefs() throws Exception {
30                 // Initialize preferences
31                 // We do not need them directly, but constructing them has the side effect that Repository.INSTANCE is != null
32                 new PrefsTestEnabledUsingConfiguredRepository();
33         }
34         
35         /**
36          * Quick hack to test Moodle Import
37          * 
38          * Currently, no CSARs are put into the test resources, we rely on local
39          * CSARs
40          */
41         @Test
42         public void testMoodleImport() throws Exception {
43                 CSARImporter i = new CSARImporter();
44                 Path p = FileSystems.getDefault().getPath("C:\\Users\\Oliver\\BTSync\\Projects\\OpenTOSCA\\MoodleInteropCSAR\\trunk");
45                 List<String> errors = new ArrayList<String>();
46                 i.importFromDir(p, errors, true, false);
47         }
48 }