Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
<packaging>jar</packaging>

<name>Java Unified Expression Language API</name>
<version>2.2.8-SNAPSHOT</version>
<version>${parent.version}</version>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
Expand Down
40 changes: 0 additions & 40 deletions modules/api/src/test/java/javax/el/AllTests.java

This file was deleted.

12 changes: 10 additions & 2 deletions modules/api/src/test/java/javax/el/ArrayELResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
*/
package javax.el;

import junit.framework.TestCase;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import javax.el.TestContext;

public class ArrayELResolverTest extends TestCase {
public class ArrayELResolverTest {
ELContext context = new TestContext();

@Test
public void testGetCommonPropertyType() {
int scalar = 0;
int[] array = { 1, 2, 3 };
Expand All @@ -36,6 +39,7 @@ public void testGetCommonPropertyType() {
assertNull(resolver.getCommonPropertyType(context, null));
}

@Test
public void testGetFeatureDescriptors() {
int scalar = 0;
int[] array = { 1, 2, 3 };
Expand All @@ -47,6 +51,7 @@ public void testGetFeatureDescriptors() {
assertNull(resolver.getFeatureDescriptors(context, null));
}

@Test
public void testGetType() {
int scalar = 0;
int[] array = { 1, 2, 3 };
Expand Down Expand Up @@ -94,6 +99,7 @@ public void testGetType() {
}
}

@Test
public void testGetValue() {
int scalar = 0;
int[] array = { 1, 2, 3 };
Expand Down Expand Up @@ -131,6 +137,7 @@ public void testGetValue() {
assertNull(resolver.getValue(context, array, array.length));
}

@Test
public void testIsReadOnly() {
int scalar = 0;
int[] array = { 1, 2, 3 };
Expand Down Expand Up @@ -184,6 +191,7 @@ public void testIsReadOnly() {
}
}

@Test
public void testSetValue() {
int scalar = 0;
int[] array = { 1, 2, 3 };
Expand Down
17 changes: 15 additions & 2 deletions modules/api/src/test/java/javax/el/BeanELResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package javax.el;

import org.junit.jupiter.api.Test;

import java.beans.FeatureDescriptor;
import java.util.ArrayList;
import java.util.Iterator;
Expand All @@ -23,9 +25,11 @@

import javax.el.test.TestClass;

import junit.framework.TestCase;
import static org.junit.jupiter.api.Assertions.*;

import static org.junit.jupiter.api.Assertions.*;

public class BeanELResolverTest extends TestCase {
public class BeanELResolverTest {
public static class TestBean {
int readOnly = 123;
int readWrite = 456;
Expand Down Expand Up @@ -68,6 +72,7 @@ int secret() {

ELContext context = new TestContext();

@Test
public void testGetCommonPropertyType() {
BeanELResolver resolver = new BeanELResolver();

Expand All @@ -78,6 +83,7 @@ public void testGetCommonPropertyType() {
assertNull(resolver.getCommonPropertyType(context, null));
}

@Test
public void testGetFeatureDescriptors() {
BeanELResolver resolver = new BeanELResolver();

Expand All @@ -101,6 +107,7 @@ public void testGetFeatureDescriptors() {
assertEquals(4, names.size());
}

@Test
public void testGetType() {
BeanELResolver resolver = new BeanELResolver();

Expand Down Expand Up @@ -131,6 +138,7 @@ public void testGetType() {
}
}

@Test
public void testGetValue() {
Properties properties = new Properties();
properties.setProperty(ExpressionFactory.class.getName(), TestFactory.class.getName());
Expand Down Expand Up @@ -163,6 +171,7 @@ public void testGetValue() {
}
}

@Test
public void testGetValue2() {
Properties properties = new Properties();
properties.setProperty(ExpressionFactory.class.getName(), TestFactory.class.getName());
Expand All @@ -181,6 +190,7 @@ public void testGetValue2() {
assertTrue(context.isPropertyResolved());
}

@Test
public void testIsReadOnly() {
BeanELResolver resolver = new BeanELResolver();
BeanELResolver resolverReadOnly = new BeanELResolver(true);
Expand Down Expand Up @@ -219,6 +229,7 @@ public void testIsReadOnly() {
}
}

@Test
public void testSetValue() {
BeanELResolver resolver = new BeanELResolver();
BeanELResolver resolverReadOnly = new BeanELResolver(true);
Expand Down Expand Up @@ -270,6 +281,7 @@ public void testSetValue() {
}
}

@Test
public void testInvoke() {
BeanELResolver resolver = new BeanELResolver();

Expand Down Expand Up @@ -299,6 +311,7 @@ public void testInvoke() {
}
}

@Test
public void testInvoke2() {
BeanELResolver resolver = new BeanELResolver();
assertEquals(42, resolver.invoke(context, new TestClass().getAnonymousTestInterface(), "getFourtyTwo", null, new Class[]{}));
Expand Down
12 changes: 10 additions & 2 deletions modules/api/src/test/java/javax/el/CompositeELResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@
*/
package javax.el;

import org.junit.jupiter.api.Test;

import java.beans.FeatureDescriptor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import junit.framework.TestCase;
import static org.junit.jupiter.api.Assertions.*;
import javax.el.TestContext;

public class CompositeELResolverTest extends TestCase {
public class CompositeELResolverTest {
ELContext context = new TestContext();

Map<Integer,Integer> sampleMap() {
Expand All @@ -35,6 +37,7 @@ Map<Integer,Integer> sampleMap() {
return map;
}

@Test
public void testGetCommonPropertyType() {
CompositeELResolver resolver = new CompositeELResolver();
assertNull(resolver.getCommonPropertyType(context, null));
Expand Down Expand Up @@ -65,6 +68,7 @@ private int count(Iterator<FeatureDescriptor> iterator) {
return count;
}

@Test
public void testGetFeatureDescriptors() {
CompositeELResolver resolver = new CompositeELResolver();
assertFalse(resolver.getFeatureDescriptors(context, null).hasNext());
Expand All @@ -80,6 +84,7 @@ public void testGetFeatureDescriptors() {
assertEquals(5, count(resolver.getFeatureDescriptors(context, sampleMap()))); // 0, 1, 2, class, empty
}

@Test
public void testGetType() {
CompositeELResolver resolver = new CompositeELResolver();
assertNull(resolver.getType(context, null, "foo"));
Expand All @@ -98,6 +103,7 @@ public void testGetType() {
assertEquals(Object.class, resolver.getType(context, sampleMap(), 0));
}

@Test
public void testGetValue() {
CompositeELResolver resolver = new CompositeELResolver();
assertNull(resolver.getValue(context, null, "foo"));
Expand All @@ -116,6 +122,7 @@ public void testGetValue() {
assertEquals(1, resolver.getValue(context, sampleMap(), 0));
}

@Test
public void testIsReadOnly() {
CompositeELResolver resolver = new CompositeELResolver();
assertFalse(resolver.isReadOnly(context, null, "foo"));
Expand All @@ -134,6 +141,7 @@ public void testIsReadOnly() {
assertFalse(resolver.isReadOnly(context, sampleMap(), 0));
}

@Test
public void testSetValue() {
CompositeELResolver resolver = new CompositeELResolver();
resolver.setValue(context, null, "foo", "bar");
Expand Down
9 changes: 7 additions & 2 deletions modules/api/src/test/java/javax/el/ELContextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,33 @@
*/
package javax.el;

import org.junit.jupiter.api.Test;

import java.util.Locale;

import junit.framework.TestCase;
import static org.junit.jupiter.api.Assertions.*;

import javax.el.TestContext;

public class ELContextTest extends TestCase {
public class ELContextTest {

@Test
public void testContext() {
ELContext context = new TestContext();
assertNull(context.getContext(Integer.class));
context.putContext(Integer.class, "foo");
assertEquals("foo", context.getContext(Integer.class));
}

@Test
public void testLocale() {
ELContext context = new TestContext();
assertNull(context.getLocale());
context.setLocale(Locale.ENGLISH);
assertEquals(Locale.ENGLISH, context.getLocale());
}

@Test
public void testPropertyResolved() {
ELContext context = new TestContext();
assertFalse(context.isPropertyResolved());
Expand Down
8 changes: 6 additions & 2 deletions modules/api/src/test/java/javax/el/ExpressionFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
*/
package javax.el;

import org.junit.jupiter.api.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

import junit.framework.TestCase;
import static org.junit.jupiter.api.Assertions.*;

public class ExpressionFactoryTest extends TestCase {
public class ExpressionFactoryTest {
private String getFactoryClassName() throws IOException {
String className = null;
String serviceId = "META-INF/services/" + ExpressionFactory.class.getName();
Expand All @@ -36,12 +38,14 @@ private String getFactoryClassName() throws IOException {
return className;
}

@Test
public void testNewInstance() throws IOException {
ExpressionFactory factory = ExpressionFactory.newInstance();
assertNotNull(factory);
assertEquals(factory.getClass().getName(), getFactoryClassName());
}

@Test
public void testNewInstanceProperties() throws IOException {
Properties properties = new Properties();

Expand Down
Loading