Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2fbad9fe40e31fe1abbaa0068e62fc70e2def5b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * CONTRIBUTORS:
 * 		Juergen Haug (initial contribution)
 * 
 *******************************************************************************/

package org.eclipse.etrice.ui.launch

import java.nio.file.Paths
import org.junit.Test

import static org.eclipse.etrice.generator.launch.GeneratorLaunchHelper.*
import static org.junit.Assert.*

class TestGeneratorLaunchHelper {

	private def get(Iterable<String> list) {
		getAllDependenciesWithinProjects(list).toList
	}

	@Test
	def void notExisting() {
		#[] => [models|assertEquals(models, get(models))]
//		#[''] => [models|assertEquals(models, get(models))]
		#['1', '.0ß+/§`}]"°'] => [models|assertEquals(models, get(models))]
		#['1.room', '2.etphys', '3.etmap', '4.etconfig', '5.unknown'] => [models|assertEquals(models, get(models))]
	}

	@Test
	def void project() {
		val (String) => String toAbsolutePath = [file| Paths.get('models/generatorLaunchHelper', file).toAbsolutePath.toString]

		assertEquals(
			#[
			'project1/System.etmap',
			'project1/NotMapped.room',
			'project1/Physical.etphys',
			'project1/Dep.room'
		].map[toAbsolutePath.apply(it)], get(
			#[
			'project1/System.etmap',
			'project1/NotMapped.room'
		].map[toAbsolutePath.apply(it)]))

	}
}

Back to the top