Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-07-20 17:14:46 +0000
committerBrian Vosburgh2017-05-18 22:38:14 +0000
commitddf39d58d7934326d0981c9378b357e734911257 (patch)
tree9f823aa705f3488b279251343dfb00510ad48092 /common/tests
parent683f311fa8a53b4cbad22215be45a9f266442a2f (diff)
downloadwebtools.dali-ddf39d58d7934326d0981c9378b357e734911257.tar.gz
webtools.dali-ddf39d58d7934326d0981c9378b357e734911257.tar.xz
webtools.dali-ddf39d58d7934326d0981c9378b357e734911257.zip
delete AbstractTransformer and AbstractInterruptibleTransformer
Diffstat (limited to 'common/tests')
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java14
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java14
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java14
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java8
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java10
7 files changed, 42 insertions, 42 deletions
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
index fa0c385f4c..966c6dc900 100644
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -16,7 +16,7 @@ import org.eclipse.jpt.common.ui.internal.swt.bindings.SWTBindingTools;
import org.eclipse.jpt.common.ui.internal.swt.widgets.DisplayTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
@@ -85,13 +85,13 @@ public final class ControlSwitcherTest {
}
protected class PaneTransformer
- extends AbstractTransformer<Boolean, Control>
+ extends TransformerAdapter<Boolean, Control>
{
@Override
- public Control transform_(Boolean value) {
- return value.booleanValue() ?
+ public Control transform(Boolean value) {
+ return (value == null) ? null : (value.booleanValue() ?
ControlSwitcherTest.this.pane1 :
- ControlSwitcherTest.this.pane2;
+ ControlSwitcherTest.this.pane2);
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java
index f257662833..4551d0a04e 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/MapToolsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2013, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -24,7 +24,7 @@ import org.eclipse.jpt.common.utility.internal.factory.FactoryTools;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
import org.eclipse.jpt.common.utility.internal.queue.QueueTools;
import org.eclipse.jpt.common.utility.internal.stack.StackTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.queue.Queue;
import org.eclipse.jpt.common.utility.stack.Stack;
import org.eclipse.jpt.common.utility.transformer.Transformer;
@@ -478,20 +478,20 @@ public class MapToolsTests
public static final Transformer<String, String> REVERSE_STRING_TRANSFORMER = new ReverseStringTransformer();
public static class ReverseStringTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- protected String transform_(String input) {
+ public String transform(String input) {
return StringTools.reverse(input);
}
}
public static final Transformer<String, String> SORT_STRING_TRANSFORMER = new SortStringTransformer();
public static class SortStringTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- protected String transform_(String input) {
+ public String transform(String input) {
return new String(ArrayTools.sort(input.toCharArray()));
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
index 4cd4659dc4..370a27b490 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -14,14 +14,13 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import junit.framework.TestCase;
import org.eclipse.jpt.common.utility.internal.collection.ListTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
@@ -35,6 +34,7 @@ import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
+import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TransformationListValueModelTests extends TestCase {
@@ -329,17 +329,17 @@ public class TransformationListValueModelTests extends TestCase {
@Override
ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModel<String, String>(lvm, UPPER_CASE_TRANSFORMER);
+ return new TransformationListValueModel<>(lvm, UPPER_CASE_TRANSFORMER);
}
}
static final Transformer<String, String> UPPER_CASE_TRANSFORMER = new UpperCaseTransformer();
static class UpperCaseTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- public String transform_(String s) {
- return s.toUpperCase();
+ public String transform(String s) {
+ return (s == null) ? null : s.toUpperCase();
}
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java
index c23cf44a2d..51c65e54a6 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationModifiablePropertyValueModelTests.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.utility.tests.internal.model.value;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
@@ -220,21 +220,21 @@ public class TransformationModifiablePropertyValueModelTests
private static final Transformer<Person, Person> PARENT_TRANSFORMER = new ParentTransformer();
static class ParentTransformer
- extends AbstractTransformer<Person, Person>
+ extends TransformerAdapter<Person, Person>
{
@Override
- public Person transform_(Person p) {
- return p.getParent();
+ public Person transform(Person p) {
+ return (p == null) ? null : p.getParent();
}
}
private static final Transformer<Person, Person> CHILD_TRANSFORMER = new ChildTransformer();
static class ChildTransformer
- extends AbstractTransformer<Person, Person>
+ extends TransformerAdapter<Person, Person>
{
@Override
- public Person transform_(Person p) {
- return p.getChild();
+ public Person transform(Person p) {
+ return (p == null) ? null : p.getChild();
}
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
index 4d7248c792..f7ae005d50 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.utility.tests.internal.model.value;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
@@ -45,21 +45,21 @@ public class TransformationPropertyValueModelTests
private static final Transformer<String, String> UPPER_CASE_TRANSFORMER = new UpperCaseTransformer();
static class UpperCaseTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- public String transform_(String s) {
- return s.toUpperCase();
+ public String transform(String s) {
+ return (s == null) ? null : s.toUpperCase();
}
}
private static final Transformer<String, String> LOWER_CASE_TRANSFORMER = new LowerCaseTransformer();
static class LowerCaseTransformer
- extends AbstractTransformer<String, String>
+ extends TransformerAdapter<String, String>
{
@Override
- public String transform_(String s) {
- return s.toLowerCase();
+ public String transform(String s) {
+ return (s == null) ? null : s.toLowerCase();
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java
index fc72ef117c..102eacefdc 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformationPredicateTests.java
@@ -10,13 +10,13 @@
package org.eclipse.jpt.common.utility.tests.internal.predicate;
import java.io.Serializable;
-import junit.framework.TestCase;
import org.eclipse.jpt.common.utility.internal.predicate.IsNotNull;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
+import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TransformationPredicateTests
@@ -62,12 +62,12 @@ public class TransformationPredicateTests
}
static final Transformer<Person, String> NAME_TRANSFORMER = new NameTransformer();
static class NameTransformer
- extends AbstractTransformer<Person, String>
+ extends TransformerAdapter<Person, String>
implements Serializable
{
private static final long serialVersionUID = 1L;
@Override
- protected String transform_(Person person) {
+ public String transform(Person person) {
return person.name;
}
@Override
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java
index a687d658ba..84646f50e5 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/TransformerPredicateTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Oracle. All rights reserved.
+ * Copyright (c) 2013, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,13 +10,13 @@
package org.eclipse.jpt.common.utility.tests.internal.predicate;
import java.io.Serializable;
-import junit.framework.TestCase;
import org.eclipse.jpt.common.utility.internal.predicate.IsNotNull;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
-import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
+import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TransformerPredicateTests
@@ -68,12 +68,12 @@ public class TransformerPredicateTests
}
static class LessThan42Transformer
- extends AbstractTransformer<Integer, Boolean>
+ extends TransformerAdapter<Integer, Boolean>
implements Serializable
{
private static final long serialVersionUID = 1L;
@Override
- protected Boolean transform_(Integer integer) {
+ public Boolean transform(Integer integer) {
return Boolean.valueOf(integer.intValue() < 42);
}
@Override

Back to the top