Skip to content

Commit 35746ab

Browse files
committed
chore: ensure all Java files use CRLF line endings
As specified currently in the .gitattributes file.
1 parent cef2a89 commit 35746ab

File tree

41 files changed

+8659
-8659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+8659
-8659
lines changed
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
/*******************************************************************************
2-
* Copyright (c) 2016 Avaloq Group AG and others.
3-
* All rights reserved. This program and the accompanying materials
4-
* are made available under the terms of the Eclipse Public License v1.0
5-
* which accompanies this distribution, and is available at
6-
* http://www.eclipse.org/legal/epl-v10.html
7-
*
8-
* Contributors:
9-
* Avaloq Evolution AG - initial API and implementation
10-
*******************************************************************************/
11-
12-
package com.avaloq.tools.ddk.check.jvmmodel;
13-
14-
/**
15-
* A class to avoid multi-line strings in Xtend which can be constant strings: See https://github.com/eclipse/xtext/issues/3091.
16-
*/
17-
public final class CheckJvmModelInferrerUtil {
18-
19-
private CheckJvmModelInferrerUtil() {
20-
// empty
21-
}
22-
23-
/**
24-
* The documentation for the Get Message Method.
25-
*/
26-
public static final String GET_MESSAGE_DOCUMENTATION = """
27-
Gets the message associated with a violation of this check.
28-
29-
@param bindings
30-
the message bindings
31-
@return the message associated with a violation of this check"""; //$NON-NLS-1$
32-
}
1+
/*******************************************************************************
2+
* Copyright (c) 2016 Avaloq Group AG and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Avaloq Evolution AG - initial API and implementation
10+
*******************************************************************************/
11+
12+
package com.avaloq.tools.ddk.check.jvmmodel;
13+
14+
/**
15+
* A class to avoid multi-line strings in Xtend which can be constant strings: See https://github.com/eclipse/xtext/issues/3091.
16+
*/
17+
public final class CheckJvmModelInferrerUtil {
18+
19+
private CheckJvmModelInferrerUtil() {
20+
// empty
21+
}
22+
23+
/**
24+
* The documentation for the Get Message Method.
25+
*/
26+
public static final String GET_MESSAGE_DOCUMENTATION = """
27+
Gets the message associated with a violation of this check.
28+
29+
@param bindings
30+
the message bindings
31+
@return the message associated with a violation of this check"""; //$NON-NLS-1$
32+
}
Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
1-
/*******************************************************************************
2-
* Copyright (c) 2025 Avaloq Group AG and others.
3-
* All rights reserved. This program and the accompanying materials
4-
* are made available under the terms of the Eclipse Public License v1.0
5-
* which accompanies this distribution, and is available at
6-
* http://www.eclipse.org/legal/epl-v10.html
7-
*
8-
* Contributors:
9-
* Avaloq Group AG - initial API and implementation
10-
*******************************************************************************/
11-
package com.avaloq.tools.ddk.test.core.jupiter;
12-
13-
import java.lang.reflect.Method;
14-
15-
import org.junit.jupiter.api.extension.ExtensionContext;
16-
import org.junit.jupiter.api.extension.InvocationInterceptor;
17-
import org.junit.jupiter.api.extension.ReflectiveInvocationContext;
18-
19-
import com.avaloq.tools.ddk.test.core.BugTest;
20-
21-
22-
/**
23-
* This {@link InvocationInterceptor} implementation changes the behavior for unresolved bug tests.
24-
* <p>
25-
* The behavior for at test that is annotated with {@link BugTest(unresolved=true)} is the following:
26-
* <ul>
27-
* <li>Test evaluation <code>OK</code> results in <code>FAIL</code> ({@link AssertionError})</li>
28-
* <li>Test evaluation <code>FAIL</code> results in <code>OK</code></li>
29-
* <li>Test evaluation <code>ERROR</code> results in <code>ERROR</code></li>
30-
* </ul>
31-
* </p>
32-
* <p>
33-
* Example for a bug test:
34-
*
35-
* <pre>
36-
* public class TestClass {
37-
*
38-
* &#064;Rule
39-
* public BugTestAwareRule rule = BugTestAwareRule.getInstance();
40-
*
41-
* &#064;org.junit.Test
42-
* &#064;com.avaloq.tools.ddk.test.core.BugTest(value = &quot;BUG-42&quot;, unresolved = true)
43-
* public void testMethod() {
44-
* org.junit.Assert.fail();
45-
* }
46-
* }
47-
* </pre>
48-
* </p>
49-
*
50-
* @see BugTest
51-
*/
52-
public final class BugTestAwareRule implements InvocationInterceptor {
53-
54-
private static final String ERROR_TEST_MUST_FAIL = "The unresolved bug test must fail:"; //$NON-NLS-1$
55-
/** The singleton instance, or {@code null} if not cached. */
56-
private static BugTestAwareRule instance;
57-
private static final Object LOCK = new Object();
58-
59-
/**
60-
* Creates a new instance of {@link BugTestAwareRule}.
61-
*/
62-
private BugTestAwareRule() {
63-
// prevent instantiation
64-
}
65-
66-
/**
67-
* Returns a shared singleton instance.
68-
*
69-
* @return a shared instance, never {@code null}
70-
*/
71-
public static BugTestAwareRule getInstance() {
72-
synchronized (LOCK) {
73-
if (instance == null) {
74-
instance = new BugTestAwareRule();
75-
}
76-
return instance;
77-
}
78-
}
79-
80-
@SuppressWarnings("nls")
81-
@Override
82-
public void interceptTestMethod(final Invocation<Void> invocation, final ReflectiveInvocationContext<Method> invocationContext, final ExtensionContext extensionContext) throws Throwable {
83-
BugTest bugTestAnnotation = extensionContext.getRequiredTestMethod().getAnnotation(BugTest.class);
84-
if (bugTestAnnotation == null && extensionContext.getRequiredTestClass() != null) {
85-
bugTestAnnotation = extensionContext.getRequiredTestClass().getAnnotation(BugTest.class);
86-
}
87-
if (bugTestAnnotation != null && bugTestAnnotation.unresolved()) {
88-
try {
89-
invocation.proceed();
90-
} catch (AssertionError exception) {
91-
return;
92-
}
93-
String testCase = extensionContext.getRequiredTestClass().getSimpleName() + "." + extensionContext.getRequiredTestMethod().getName();
94-
throw new AssertionError(ERROR_TEST_MUST_FAIL + " " + testCase);
95-
} else {
96-
invocation.proceed();
97-
}
98-
}
99-
100-
}
1+
/*******************************************************************************
2+
* Copyright (c) 2025 Avaloq Group AG and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Avaloq Group AG - initial API and implementation
10+
*******************************************************************************/
11+
package com.avaloq.tools.ddk.test.core.jupiter;
12+
13+
import java.lang.reflect.Method;
14+
15+
import org.junit.jupiter.api.extension.ExtensionContext;
16+
import org.junit.jupiter.api.extension.InvocationInterceptor;
17+
import org.junit.jupiter.api.extension.ReflectiveInvocationContext;
18+
19+
import com.avaloq.tools.ddk.test.core.BugTest;
20+
21+
22+
/**
23+
* This {@link InvocationInterceptor} implementation changes the behavior for unresolved bug tests.
24+
* <p>
25+
* The behavior for at test that is annotated with {@link BugTest(unresolved=true)} is the following:
26+
* <ul>
27+
* <li>Test evaluation <code>OK</code> results in <code>FAIL</code> ({@link AssertionError})</li>
28+
* <li>Test evaluation <code>FAIL</code> results in <code>OK</code></li>
29+
* <li>Test evaluation <code>ERROR</code> results in <code>ERROR</code></li>
30+
* </ul>
31+
* </p>
32+
* <p>
33+
* Example for a bug test:
34+
*
35+
* <pre>
36+
* public class TestClass {
37+
*
38+
* &#064;Rule
39+
* public BugTestAwareRule rule = BugTestAwareRule.getInstance();
40+
*
41+
* &#064;org.junit.Test
42+
* &#064;com.avaloq.tools.ddk.test.core.BugTest(value = &quot;BUG-42&quot;, unresolved = true)
43+
* public void testMethod() {
44+
* org.junit.Assert.fail();
45+
* }
46+
* }
47+
* </pre>
48+
* </p>
49+
*
50+
* @see BugTest
51+
*/
52+
public final class BugTestAwareRule implements InvocationInterceptor {
53+
54+
private static final String ERROR_TEST_MUST_FAIL = "The unresolved bug test must fail:"; //$NON-NLS-1$
55+
/** The singleton instance, or {@code null} if not cached. */
56+
private static BugTestAwareRule instance;
57+
private static final Object LOCK = new Object();
58+
59+
/**
60+
* Creates a new instance of {@link BugTestAwareRule}.
61+
*/
62+
private BugTestAwareRule() {
63+
// prevent instantiation
64+
}
65+
66+
/**
67+
* Returns a shared singleton instance.
68+
*
69+
* @return a shared instance, never {@code null}
70+
*/
71+
public static BugTestAwareRule getInstance() {
72+
synchronized (LOCK) {
73+
if (instance == null) {
74+
instance = new BugTestAwareRule();
75+
}
76+
return instance;
77+
}
78+
}
79+
80+
@SuppressWarnings("nls")
81+
@Override
82+
public void interceptTestMethod(final Invocation<Void> invocation, final ReflectiveInvocationContext<Method> invocationContext, final ExtensionContext extensionContext) throws Throwable {
83+
BugTest bugTestAnnotation = extensionContext.getRequiredTestMethod().getAnnotation(BugTest.class);
84+
if (bugTestAnnotation == null && extensionContext.getRequiredTestClass() != null) {
85+
bugTestAnnotation = extensionContext.getRequiredTestClass().getAnnotation(BugTest.class);
86+
}
87+
if (bugTestAnnotation != null && bugTestAnnotation.unresolved()) {
88+
try {
89+
invocation.proceed();
90+
} catch (AssertionError exception) {
91+
return;
92+
}
93+
String testCase = extensionContext.getRequiredTestClass().getSimpleName() + "." + extensionContext.getRequiredTestMethod().getName();
94+
throw new AssertionError(ERROR_TEST_MUST_FAIL + " " + testCase);
95+
} else {
96+
invocation.proceed();
97+
}
98+
}
99+
100+
}

0 commit comments

Comments
 (0)