Added
Link Here
|
1 |
/** |
2 |
* <copyright> |
3 |
* |
4 |
* Copyright (c) 2009 SAP AG and others. |
5 |
* All rights reserved. This program and the accompanying materials |
6 |
* are made available under the terms of the Eclipse Public License v1.0 |
7 |
* which accompanies this distribution, and is available at |
8 |
* http://www.eclipse.org/legal/epl-v10.html |
9 |
* |
10 |
* Contributors: |
11 |
* SAP - Initial API and implementation |
12 |
* |
13 |
* </copyright> |
14 |
* |
15 |
* $Id$ |
16 |
*/ |
17 |
package org.eclipse.emf.validation.tests; |
18 |
|
19 |
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin; |
20 |
import org.osgi.framework.Bundle; |
21 |
|
22 |
import junit.framework.TestCase; |
23 |
|
24 |
/** |
25 |
* Tests for the validation plugin integration. |
26 |
* |
27 |
* @author Boris Gruschko |
28 |
* |
29 |
*/ |
30 |
public class PluginTest extends TestCase { |
31 |
|
32 |
private static final String DEBUG_OPTION = "org.eclipse.emf.validation/debug"; //$NON-NLS-1$ |
33 |
|
34 |
public PluginTest() { |
35 |
super( "Validation plugin integration"); //$NON-NLS-1$ |
36 |
} |
37 |
|
38 |
/** |
39 |
* Tests the dynamic switch into debug/trace mode |
40 |
*/ |
41 |
public void testDebugModeSetting() { |
42 |
assertEquals(Bundle.ACTIVE, EMFModelValidationPlugin.getPlugin().getBundle().getState()); |
43 |
assertFalse(EMFModelValidationPlugin.getPlugin().isDebugging()); |
44 |
assertFalse(EMFModelValidationPlugin.Tracing.shouldTrace(DEBUG_OPTION)); |
45 |
|
46 |
EMFModelValidationPlugin.getPlugin().setDebugging(true); |
47 |
|
48 |
assertTrue(EMFModelValidationPlugin.getPlugin().isDebugging()); |
49 |
assertTrue(EMFModelValidationPlugin.Tracing.shouldTrace(DEBUG_OPTION)); |
50 |
|
51 |
EMFModelValidationPlugin.getPlugin().setDebugging(false); |
52 |
|
53 |
assertFalse(EMFModelValidationPlugin.Tracing.shouldTrace(DEBUG_OPTION)); |
54 |
} |
55 |
|
56 |
} |