Skip to content

Commit

Permalink
Add test case for issue #188
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Jun 20, 2022
1 parent e5f93b5 commit bb1a058
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ nb-configuration.xml
# mac
.DS_Store

/target-test/
16 changes: 16 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
<url>https://github.com/eclipse-ee4j/el-ri/issues</url>
</issueManagement>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<!-- Make sure the two versions are in sync with the maven version -->
<spec.version>6.0</spec.version>
Expand Down Expand Up @@ -136,6 +145,13 @@
</configuration>
</plugin>

<!-- Execute unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>

<!-- Checks copyright / license headers -->
<plugin>
<groupId>org.glassfish.copyright</groupId>
Expand Down
34 changes: 34 additions & 0 deletions api/src/test/java/jakarta/el/TestELUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package jakarta.el;

import java.lang.reflect.Method;
import java.util.TimeZone;

import org.junit.jupiter.api.Test;

public class TestELUtil {

/*
* https://github.com/jakartaee/expression-language/issues/188
*/
@Test
public void testAccessibleMethod() throws Exception {
TimeZone tz = TimeZone.getDefault();
Method m = ELUtil.findMethod(tz.getClass(), tz, "getRawOffset", null, null);
m.invoke(tz);
}
}

0 comments on commit bb1a058

Please sign in to comment.