0
|
1 |
#
|
|
2 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
|
3
|
17 |
import os
|
0
|
18 |
|
|
19 |
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
|
|
20 |
|
|
21 |
from testautomation.base_testcase import BaseTestCase
|
3
|
22 |
from cone.public import plugin, api
|
0
|
23 |
|
|
24 |
|
|
25 |
def abspath(path):
|
|
26 |
return os.path.normpath(os.path.join(ROOT_PATH, path))
|
|
27 |
|
|
28 |
class TestExamplemlGeneration(BaseTestCase):
|
|
29 |
|
|
30 |
def test_generate_from_project(self):
|
3
|
31 |
project_dir = abspath('testdata/generation/project')
|
0
|
32 |
config = 'root.confml'
|
3
|
33 |
output_dir = abspath('temp/generation/output')
|
|
34 |
expected_dir = abspath('testdata/generation/expected')
|
0
|
35 |
|
|
36 |
self.remove_if_exists(output_dir)
|
|
37 |
|
|
38 |
prj = api.Project(api.Storage.open(project_dir))
|
|
39 |
config = prj.get_configuration(config)
|
3
|
40 |
context = plugin.GenerationContext(configuration=config,
|
|
41 |
output=output_dir)
|
0
|
42 |
impls = plugin.get_impl_set(config)
|
3
|
43 |
impls.generate(context)
|
0
|
44 |
|
|
45 |
self.assert_dir_contents_equal(output_dir, expected_dir, ['.svn'])
|
|
46 |
|