Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7f27d529b62f0f820eaf2adac354e2d972522246 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package org.eclipse.papyrus.infra.core.serviceregistry;

import org.eclipse.papyrus.infra.core.serviceregistry.IService;
import org.eclipse.papyrus.infra.core.serviceregistry.ServicesRegistry;


/**
 * Fake service for testing purpose.
 *
 * @author cedric dumoulin
 *
 */
public class FakeService implements IService {


	static public TestTrace trace = new TestTrace();

	static int count = 0;

	public String name = "name" + count++;


	/**
	 *
	 * Constructor.
	 *
	 */
	public FakeService() {
		trace.addTrace(name, "create");
	}

	/**
	 * Constructor.
	 *
	 * @param name
	 */
	public FakeService(String name) {
		this.name = name;
		trace.addTrace(name, "create");
	}


	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the trace
	 */
	static public TestTrace getTrace() {
		return trace;
	}


	/**
	 * @param trace
	 *            the trace to set
	 */
	public void setTrace(TestTrace trace) {
		FakeService.trace = trace;
	}

	@Override
	public void init(ServicesRegistry servicesRegistry) {
		trace.addTrace(name, "init", servicesRegistry);
	}

	@Override
	public void startService() {
		trace.addTrace(name, "start");
	}

	@Override
	public void disposeService() {
		trace.addTrace(name, "dispose");
	}

}

Back to the top