configurationengine/source/plugins/example/ConeExamplePlugin/examplemlplugin/tests/unittest_exampleml_generation.py
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
equal deleted inserted replaced
-1:000000000000 0:2e8eeb919028
       
     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 
       
    17 import sys, os, unittest
       
    18 import __init__
       
    19 
       
    20 ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
       
    21 
       
    22 from testautomation.base_testcase import BaseTestCase
       
    23 from cone.public import exceptions, plugin, api, container
       
    24 
       
    25 from examplemlplugin import exampleml_reader
       
    26 
       
    27 def abspath(path):
       
    28     return os.path.normpath(os.path.join(ROOT_PATH, path))
       
    29 
       
    30 class TestExamplemlGeneration(BaseTestCase):
       
    31 
       
    32     def test_generate_from_project(self):
       
    33         project_dir     = abspath('project')
       
    34         config          = 'root.confml'
       
    35         output_dir      = abspath('temp/output')
       
    36         expected_dir    = abspath('gen_expected')
       
    37         
       
    38         self.remove_if_exists(output_dir)
       
    39         
       
    40         prj = api.Project(api.Storage.open(project_dir))
       
    41         config = prj.get_configuration(config)
       
    42         impls = plugin.get_impl_set(config)
       
    43         impls.output = output_dir
       
    44         impls.generate()
       
    45         
       
    46         self.assert_dir_contents_equal(output_dir, expected_dir, ['.svn'])
       
    47