Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-09-01 13:45:54 -0400
committerEike Stepper2016-09-01 13:45:54 -0400
commitc6aab72b0f710b80327914dd12087c1f59f4fc51 (patch)
tree33d54fc0f80d25c88309797fd7861164e46ab7a3 /plugins/org.eclipse.net4j.tests/src/org
parentdc6bbcc7a8774afec9aaa96e4344a56eb9340ae5 (diff)
downloadcdo-c6aab72b0f710b80327914dd12087c1f59f4fc51.tar.gz
cdo-c6aab72b0f710b80327914dd12087c1f59f4fc51.tar.xz
cdo-c6aab72b0f710b80327914dd12087c1f59f4fc51.zip
[500255] [Releng] Remove the .defs plugins and features from the SDKs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=500255
Diffstat (limited to 'plugins/org.eclipse.net4j.tests/src/org')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMAcceptorDefImplTest.java93
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMConnectorDefImplTest.java79
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java113
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java126
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/Util.java136
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsFactory.java48
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsPackage.java181
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDef.java77
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefTest.java261
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsFactory.java48
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsPackage.java181
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsFactoryImpl.java114
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsPackageImpl.java227
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefImpl.java236
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsFactoryImpl.java114
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsPackageImpl.java223
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsAdapterFactory.java154
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsSwitch.java162
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsAdapterFactory.java154
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsSwitch.java162
20 files changed, 0 insertions, 2889 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMAcceptorDefImplTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMAcceptorDefImplTest.java
deleted file mode 100644
index 15fdd7db86..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMAcceptorDefImplTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buffer.IBufferPool;
-import org.eclipse.net4j.defs.JVMAcceptorDef;
-import org.eclipse.net4j.defs.Net4jDefsFactory;
-import org.eclipse.net4j.internal.jvm.JVMClientConnector;
-import org.eclipse.net4j.jvm.IJVMAcceptor;
-import org.eclipse.net4j.jvm.IJVMConnector;
-import org.eclipse.net4j.util.concurrent.ThreadPool;
-import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * @author Andre Dietisheim
- */
-public class JVMAcceptorDefImplTest extends AbstractOMTest
-{
- private static final String NAME = "JVMConnector1"; //$NON-NLS-1$
-
- private static final long TIMEOUT = 10000l;
-
- private static final long DELAY = 500l;
-
- private IJVMConnector jvmConnector;
-
- @Override
- protected void doSetUp() throws Exception
- {
- jvmConnector = createJVMClientConnector();
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- LifecycleUtil.deactivate(jvmConnector);
- }
-
- public void testAcceptorDefOpensConnection()
- {
- JVMAcceptorDef jvmAcceptorDef = Net4jDefsFactory.eINSTANCE.createJVMAcceptorDef();
- jvmAcceptorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- jvmAcceptorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- jvmAcceptorDef.setName(NAME);
-
- IJVMAcceptor jvmAcceptor = (IJVMAcceptor)jvmAcceptorDef.getInstance();
-
- assertEquals(true, LifecycleUtil.isActive(jvmAcceptor));
-
- LifecycleUtil.activate(jvmConnector);
- jvmConnector.waitForConnection(DELAY + TIMEOUT);
-
- assertEquals(true, LifecycleUtil.isActive(jvmConnector));
-
- LifecycleUtil.deactivate(jvmAcceptor);
- }
-
- protected IJVMConnector createJVMClientConnector()
- {
- JVMClientConnector jvmClientConnector = new JVMClientConnector();
- jvmClientConnector.getConfig().setBufferProvider(createBufferPool());
- jvmClientConnector.getConfig().setReceiveExecutor(createThreadPool());
- jvmClientConnector.setName(NAME);
-
- return jvmClientConnector;
- }
-
- private IBufferPool createBufferPool()
- {
- IBufferPool bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
- return bufferPool;
- }
-
- private ExecutorService createThreadPool()
- {
- return ThreadPool.create();
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMConnectorDefImplTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMConnectorDefImplTest.java
deleted file mode 100644
index 7f126513ad..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/JVMConnectorDefImplTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buffer.IBufferPool;
-import org.eclipse.net4j.defs.JVMConnectorDef;
-import org.eclipse.net4j.defs.Net4jDefsFactory;
-import org.eclipse.net4j.internal.jvm.JVMAcceptor;
-import org.eclipse.net4j.jvm.IJVMAcceptor;
-import org.eclipse.net4j.jvm.IJVMConnector;
-import org.eclipse.net4j.util.concurrent.ThreadPool;
-import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * @author Andre Dietisheim
- */
-public class JVMConnectorDefImplTest extends AbstractOMTest
-{
- private static final String NAME = "test1"; //$NON-NLS-1$
-
- public void testIncompleteInitializationThrowsIllegalArgumentException()
- {
- try
- {
- Net4jDefsFactory.eINSTANCE.createJVMConnectorDef().getInstance();
- fail("IllegalStateException expected!"); //$NON-NLS-1$
- }
- catch (IllegalStateException e)
- {
- }
- }
-
- public void testConnectorLaunchableOpensConnection()
- {
- IJVMAcceptor jvmAcceptor = createJVMAcceptor();
-
- JVMConnectorDef jvmConnectorDef = Net4jDefsFactory.eINSTANCE.createJVMConnectorDef();
-
- jvmConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- jvmConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- jvmConnectorDef.setName(NAME);
- IJVMConnector jvmConnector = (IJVMConnector)jvmConnectorDef.getInstance();
- jvmConnector.connect(500L);
- assertEquals(true, jvmConnector.isConnected());
-
- LifecycleUtil.deactivate(jvmConnector);
- LifecycleUtil.deactivate(jvmAcceptor);
- }
-
- private IJVMAcceptor createJVMAcceptor()
- {
- ExecutorService threadPool = ThreadPool.create();
-
- IBufferPool bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
-
- JVMAcceptor jvmAcceptor = new JVMAcceptor();
- jvmAcceptor.setName(NAME);
- jvmAcceptor.getConfig().setBufferProvider(bufferPool);
- jvmAcceptor.getConfig().setReceiveExecutor(threadPool);
- LifecycleUtil.activate(jvmAcceptor);
-
- return jvmAcceptor;
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java
deleted file mode 100644
index ea7b78dbaa..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPAcceptorDefImplTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2008-2011, 2013 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.defs.Net4jDefsFactory;
-import org.eclipse.net4j.defs.TCPAcceptorDef;
-import org.eclipse.net4j.internal.tcp.TCPConnector;
-import org.eclipse.net4j.tcp.ITCPAcceptor;
-import org.eclipse.net4j.util.defs.ChallengeNegotiatorDef;
-import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
-import org.eclipse.net4j.util.defs.User;
-import org.eclipse.net4j.util.defs.UserManagerDef;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-/**
- * @author Andre Dietisheim
- */
-public class TCPAcceptorDefImplTest extends AbstractOMTest
-{
- private static final long TIMEOUT = 10000;
-
- private static final long DELAY = 500;
-
- private static final String HOST = "localhost"; //$NON-NLS-1$
-
- private static final int PORT = 2036;
-
- private static final String USERID = "André"; //$NON-NLS-1$
-
- private static final String PASSWORD = "aPassword"; //$NON-NLS-1$
-
- private TCPConnector tcpConnector;
-
- @Override
- protected void doSetUp() throws Exception
- {
- tcpConnector = Util.createTCPClientConnector(HOST, PORT, Util.createTCPSelector());
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- LifecycleUtil.deactivate(tcpConnector);
- }
-
- public void testAcceptorDefOpensConnection()
- {
- TCPAcceptorDef tcpAcceptorDef = createTCPAcceptorDef();
-
- ITCPAcceptor tcpAcceptor = (ITCPAcceptor)tcpAcceptorDef.getInstance();
-
- assertEquals(true, LifecycleUtil.isActive(tcpAcceptor));
-
- LifecycleUtil.activate(tcpConnector);
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- assertEquals(true, LifecycleUtil.isActive(tcpConnector));
-
- LifecycleUtil.deactivate(tcpAcceptor);
- }
-
- /**
- * Doesn't work yet: UserManager does not add its users yet
- */
- public void _testCredentialsProvider()
- {
- TCPAcceptorDef tcpAcceptorDef = createTCPAcceptorDef();
-
- User user = Net4jUtilDefsFactory.eINSTANCE.createUser();
- user.setUserID(USERID);
- user.setPassword(PASSWORD);
-
- UserManagerDef userManagerDef = Net4jUtilDefsFactory.eINSTANCE.createUserManagerDef();
- userManagerDef.getUser().add(user);
-
- ChallengeNegotiatorDef challengeNegotiatorDef = Net4jUtilDefsFactory.eINSTANCE.createChallengeNegotiatorDef();
- challengeNegotiatorDef.setRandomizer(Net4jUtilDefsFactory.eINSTANCE.createRandomizerDef());
- challengeNegotiatorDef.setUserManager(userManagerDef);
-
- tcpAcceptorDef.setNegotiator(challengeNegotiatorDef);
- ITCPAcceptor tcpAcceptor = (ITCPAcceptor)tcpAcceptorDef.getInstance();
- assertEquals(true, LifecycleUtil.isActive(tcpAcceptor));
-
- Util.addNegotiator(USERID, PASSWORD, tcpConnector);
- LifecycleUtil.activate(tcpConnector);
-
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- LifecycleUtil.deactivate(tcpConnector);
-
- Util.removeNegotiator(tcpConnector);
- LifecycleUtil.deactivate(tcpAcceptor);
- }
-
- private TCPAcceptorDef createTCPAcceptorDef()
- {
- TCPAcceptorDef tcpAcceptorDef = Net4jDefsFactory.eINSTANCE.createTCPAcceptorDef();
- tcpAcceptorDef.setHost(HOST);
- tcpAcceptorDef.setPort(PORT);
- tcpAcceptorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpAcceptorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpAcceptorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
- return tcpAcceptorDef;
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java
deleted file mode 100644
index bd8a35b8b7..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/TCPConnectorDefImplTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2008-2011, 2013 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.defs.Net4jDefsFactory;
-import org.eclipse.net4j.defs.TCPConnectorDef;
-import org.eclipse.net4j.internal.tcp.TCPAcceptor;
-import org.eclipse.net4j.tcp.ITCPConnector;
-import org.eclipse.net4j.tests.AbstractProtocolTest;
-import org.eclipse.net4j.util.defs.Net4jUtilDefsFactory;
-import org.eclipse.net4j.util.defs.PasswordCredentialsProviderDef;
-import org.eclipse.net4j.util.defs.ResponseNegotiatorDef;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-
-/**
- * @author Andre Dietisheim
- */
-public class TCPConnectorDefImplTest extends AbstractProtocolTest
-{
- private static final long DELAY = 500l;
-
- private static final int PORT = 2036;
-
- private static final long TIMEOUT = 10000l;
-
- private static final String USERID = "André"; //$NON-NLS-1$
-
- private static final String PASSWORD = "aPassword"; //$NON-NLS-1$
-
- private TCPAcceptor tcpAcceptor;
-
- @Override
- protected void doSetUp() throws Exception
- {
- tcpAcceptor = Util.createTCPAcceptor(HOST, PORT, DELAY);
- }
-
- @Override
- protected void doTearDown() throws Exception
- {
- LifecycleUtil.deactivate(tcpAcceptor);
- }
-
- public void testConnectorDefOpensConnection()
- {
- TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
-
- tcpConnectorDef.setHost(HOST);
- tcpConnectorDef.setPort(PORT);
- tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
-
- ITCPConnector tcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
-
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- assertEquals(true, LifecycleUtil.isActive(tcpConnector));
-
- LifecycleUtil.deactivate(tcpConnector);
- }
-
- public void testNewInstanceWhenTouched()
- {
- TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
-
- tcpConnectorDef.setHost(HOST);
- tcpConnectorDef.setPort(PORT);
- tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
-
- ITCPConnector thisTcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
- tcpConnectorDef.setPort(PORT + 1);
-
- assertEquals(true, tcpConnectorDef.isTouched());
-
- ITCPConnector thatTcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
-
- assertEquals(true, !LifecycleUtil.isActive(thisTcpConnector));
- assertEquals(true, !tcpConnectorDef.isTouched());
- assertEquals(true, thisTcpConnector != thatTcpConnector);
-
- LifecycleUtil.deactivate(thisTcpConnector);
- LifecycleUtil.deactivate(thatTcpConnector);
- }
-
- public void testCredentialsProvider()
- {
- Util.addNegotiator(USERID, PASSWORD, tcpAcceptor);
-
- TCPConnectorDef tcpConnectorDef = Net4jDefsFactory.eINSTANCE.createTCPConnectorDef();
-
- tcpConnectorDef.setHost(HOST);
- tcpConnectorDef.setPort(PORT);
- tcpConnectorDef.setBufferProvider(Net4jDefsFactory.eINSTANCE.createBufferPoolDef());
- tcpConnectorDef.setExecutorService(Net4jUtilDefsFactory.eINSTANCE.createThreadPoolDef());
- tcpConnectorDef.setTcpSelectorDef(Net4jDefsFactory.eINSTANCE.createTCPSelectorDef());
-
- PasswordCredentialsProviderDef credentialsProviderDef = Net4jUtilDefsFactory.eINSTANCE
- .createPasswordCredentialsProviderDef();
- credentialsProviderDef.setUserID(USERID);
- credentialsProviderDef.setPassword(PASSWORD);
-
- ResponseNegotiatorDef negotiatorDef = Net4jUtilDefsFactory.eINSTANCE.createResponseNegotiatorDef();
- negotiatorDef.setCredentialsProvider(credentialsProviderDef);
- tcpConnectorDef.setNegotiator(negotiatorDef);
-
- ITCPConnector tcpConnector = (ITCPConnector)tcpConnectorDef.getInstance();
-
- tcpConnector.waitForConnection(DELAY + TIMEOUT);
- assertEquals(true, LifecycleUtil.isActive(tcpConnector));
-
- LifecycleUtil.deactivate(tcpConnector);
-
- Util.removeNegotiator(tcpAcceptor);
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/Util.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/Util.java
deleted file mode 100644
index 2c04cdfe9c..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/defs/Util.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.tests.defs;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buffer.IBufferPool;
-import org.eclipse.net4j.internal.tcp.TCPAcceptor;
-import org.eclipse.net4j.internal.tcp.TCPClientConnector;
-import org.eclipse.net4j.internal.tcp.TCPConnector;
-import org.eclipse.net4j.internal.tcp.TCPSelector;
-import org.eclipse.net4j.util.concurrent.ThreadPool;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.security.ChallengeNegotiator;
-import org.eclipse.net4j.util.security.INegotiator;
-import org.eclipse.net4j.util.security.IRandomizer;
-import org.eclipse.net4j.util.security.PasswordCredentials;
-import org.eclipse.net4j.util.security.PasswordCredentialsProvider;
-import org.eclipse.net4j.util.security.Randomizer;
-import org.eclipse.net4j.util.security.ResponseNegotiator;
-import org.eclipse.net4j.util.security.UserManager;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * @author Eike Stepper
- */
-class Util
-{
- public static TCPAcceptor createTCPAcceptor(String host, int port, long timeout)
- {
- TCPAcceptor acceptor = new TCPAcceptor();
- acceptor.setStartSynchronously(true);
- acceptor.setSynchronousStartTimeout(timeout);
- acceptor.getConfig().setBufferProvider(createBufferPool());
- acceptor.getConfig().setReceiveExecutor(createThreadPool());
- acceptor.setSelector(createTCPSelector());
- acceptor.setAddress(host);
- acceptor.setPort(port);
-
- LifecycleUtil.activate(acceptor);
-
- return acceptor;
- }
-
- private static IRandomizer createRandomizer()
- {
- Randomizer randomizer = new Randomizer();
- LifecycleUtil.activate(randomizer);
-
- return randomizer;
- }
-
- public static void addNegotiator(String userId, String password, TCPAcceptor tcpAcceptor)
- {
- UserManager userManager = new UserManager();
- LifecycleUtil.activate(userManager);
- userManager.addUser(userId, password.toCharArray());
-
- ChallengeNegotiator challengeNegotiator = new ChallengeNegotiator();
- challengeNegotiator.setRandomizer(createRandomizer());
- challengeNegotiator.setUserManager(userManager);
- LifecycleUtil.activate(challengeNegotiator);
-
- tcpAcceptor.getConfig().setNegotiator(challengeNegotiator);
- }
-
- public static void removeNegotiator(TCPAcceptor tcpAcceptor)
- {
- INegotiator negotiator = tcpAcceptor.getConfig().getNegotiator();
- tcpAcceptor.getConfig().setNegotiator(null);
- LifecycleUtil.deactivate(negotiator);
- }
-
- public static TCPConnector createTCPClientConnector(String host, int port, TCPSelector tcpSelector)
- {
- TCPClientConnector tcpConnector = new TCPClientConnector();
- tcpConnector.getConfig().setBufferProvider(createBufferPool());
- tcpConnector.getConfig().setReceiveExecutor(createThreadPool());
- tcpConnector.setSelector(tcpSelector);
- tcpConnector.setHost(host);
- tcpConnector.setPort(port);
-
- return tcpConnector;
- }
-
- public static void addNegotiator(String userId, String password, TCPConnector tcpConnector)
- {
- PasswordCredentials passwordCredentials = new PasswordCredentials(userId, password.toCharArray());
- PasswordCredentialsProvider credentialsProvider = new PasswordCredentialsProvider(passwordCredentials);
- LifecycleUtil.activate(credentialsProvider);
-
- tcpConnector.getConfig().setNegotiator(createResponseNegotiator(credentialsProvider));
- }
-
- public static ResponseNegotiator createResponseNegotiator(PasswordCredentialsProvider credentialsProvider)
- {
- ResponseNegotiator responseNegotiator = new ResponseNegotiator();
- responseNegotiator.setCredentialsProvider(credentialsProvider);
- LifecycleUtil.activate(responseNegotiator);
- return responseNegotiator;
- }
-
- public static void removeNegotiator(TCPConnector tcpConnector)
- {
- INegotiator negotiator = tcpConnector.getConfig().getNegotiator();
- tcpConnector.setNegotiator(null);
- LifecycleUtil.deactivate(negotiator);
- }
-
- public static TCPSelector createTCPSelector()
- {
- TCPSelector selector = new TCPSelector();
- LifecycleUtil.activate(selector);
- return selector;
- }
-
- public static IBufferPool createBufferPool()
- {
- IBufferPool bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
- return bufferPool;
- }
-
- public static ExecutorService createThreadPool()
- {
- return ThreadPool.create();
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsFactory.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsFactory.java
deleted file mode 100644
index ce31800051..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each non-abstract class of
- * the model. <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.DefsPackage
- * @generated
- */
-public interface DefsFactory extends EFactory
-{
- /**
- * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- DefsFactory eINSTANCE = org.eclipse.net4j.util.tests.defs.impl.DefsFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Test Def</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Test Def</em>'.
- * @generated
- */
- TestDef createTestDef();
-
- /**
- * Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the package supported by this factory.
- * @generated
- */
- DefsPackage getDefsPackage();
-
-} // DefsFactory
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsPackage.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsPackage.java
deleted file mode 100644
index 3188fc526c..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/DefsPackage.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs;
-
-import org.eclipse.net4j.util.defs.Net4jUtilDefsPackage;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.DefsFactory
- * @model kind="package"
- * @generated
- */
-public interface DefsPackage extends EPackage
-{
- /**
- * The package name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNAME = "defs"; //$NON-NLS-1$
-
- /**
- * The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNS_URI = "http://www.eclipse.org/NET4J/defs/tests/1.0.0"; //$NON-NLS-1$
-
- /**
- * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNS_PREFIX = "net4j.defs.tests"; //$NON-NLS-1$
-
- /**
- * The singleton instance of the package. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- DefsPackage eINSTANCE = org.eclipse.net4j.util.tests.defs.impl.DefsPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.net4j.util.tests.defs.impl.TestDefImpl <em>Test Def</em>}' class.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.impl.TestDefImpl
- * @see org.eclipse.net4j.util.tests.defs.impl.DefsPackageImpl#getTestDef()
- * @generated
- */
- int TEST_DEF = 0;
-
- /**
- * The feature id for the '<em><b>References</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEST_DEF__REFERENCES = Net4jUtilDefsPackage.DEF_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Attribute</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEST_DEF__ATTRIBUTE = Net4jUtilDefsPackage.DEF_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Test Def</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEST_DEF_FEATURE_COUNT = Net4jUtilDefsPackage.DEF_FEATURE_COUNT + 2;
-
- /**
- * Returns the meta object for class '{@link org.eclipse.net4j.util.tests.defs.TestDef <em>Test Def</em>}'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Test Def</em>'.
- * @see org.eclipse.net4j.util.tests.defs.TestDef
- * @generated
- */
- EClass getTestDef();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.net4j.util.tests.defs.TestDef#getReferences
- * <em>References</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference list '<em>References</em>'.
- * @see org.eclipse.net4j.util.tests.defs.TestDef#getReferences()
- * @see #getTestDef()
- * @generated
- */
- EReference getTestDef_References();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.net4j.util.tests.defs.TestDef#getAttribute
- * <em>Attribute</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Attribute</em>'.
- * @see org.eclipse.net4j.util.tests.defs.TestDef#getAttribute()
- * @see #getTestDef()
- * @generated
- */
- EAttribute getTestDef_Attribute();
-
- /**
- * Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the factory that creates the instances of the model.
- * @generated
- */
- DefsFactory getDefsFactory();
-
- /**
- * <!-- begin-user-doc --> Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- *
- * @generated
- */
- interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.net4j.util.tests.defs.impl.TestDefImpl <em>Test Def</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.impl.TestDefImpl
- * @see org.eclipse.net4j.util.tests.defs.impl.DefsPackageImpl#getTestDef()
- * @generated
- */
- EClass TEST_DEF = eINSTANCE.getTestDef();
-
- /**
- * The meta object literal for the '<em><b>References</b></em>' reference list feature. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- EReference TEST_DEF__REFERENCES = eINSTANCE.getTestDef_References();
-
- /**
- * The meta object literal for the '<em><b>Attribute</b></em>' attribute feature. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- EAttribute TEST_DEF__ATTRIBUTE = eINSTANCE.getTestDef_Attribute();
-
- }
-
-} // DefsPackage
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDef.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDef.java
deleted file mode 100644
index b2a7dad262..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDef.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs;
-
-import org.eclipse.net4j.util.defs.Def;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Test Def</b></em>'. <!-- end-user-doc -->
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.net4j.util.tests.defs.TestDef#getReferences <em>References</em>}</li>
- * <li>{@link org.eclipse.net4j.util.tests.defs.TestDef#getAttribute <em>Attribute</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage#getTestDef()
- * @model
- * @generated
- */
-public interface TestDef extends Def
-{
- /**
- * Returns the value of the '<em><b>References</b></em>' reference list. The list contents are of type
- * {@link org.eclipse.net4j.util.defs.Def}. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>References</em>' reference list isn't clear, there really should be more of a
- * description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>References</em>' reference list.
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage#getTestDef_References()
- * @model
- * @generated
- */
- EList<Def> getReferences();
-
- /**
- * Returns the value of the '<em><b>Attribute</b></em>' attribute. <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute</em>' attribute isn't clear, there really should be more of a description
- * here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Attribute</em>' attribute.
- * @see #setAttribute(String)
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage#getTestDef_Attribute()
- * @model
- * @generated
- */
- String getAttribute();
-
- /**
- * Sets the value of the '{@link org.eclipse.net4j.util.tests.defs.TestDef#getAttribute <em>Attribute</em>}'
- * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Attribute</em>' attribute.
- * @see #getAttribute()
- * @generated
- */
- void setAttribute(String value);
-
-} // TestDef
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefTest.java
deleted file mode 100644
index c316702eaa..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefTest.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs;
-
-import org.eclipse.net4j.util.defs.Def;
-import org.eclipse.net4j.util.defs.impl.DefImpl;
-import org.eclipse.net4j.util.lifecycle.Lifecycle;
-import org.eclipse.net4j.util.lifecycle.LifecycleException;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.tests.AbstractOMTest;
-
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * @author Andre Dietisheim
- */
-public class TestDefTest extends AbstractOMTest
-{
- private Def def;
-
- public TestDefTest()
- {
- }
-
- @Override
- public void doSetUp()
- {
- def = new BlockingTokenDef();
- }
-
- public void testGetInstanceReturnsSameInstance()
- {
- Object thisInstance = def.getInstance();
- Object thatInstance = def.getInstance();
- assertEquals(true, thisInstance == thatInstance);
- }
-
- public void testInstanceCreatedIsActivated()
- {
- Object instance = def.getInstance();
- assertEquals(true, LifecycleUtil.isActive(instance));
- }
-
- public void testInstanceDeactivatesIfUnset()
- {
- Object instance = def.getInstance();
- def.unsetInstance();
- assertEquals(true, ((DefImpl)def).getInternalInstance() == null);
- assertEquals(true, !LifecycleUtil.isActive(instance));
- }
-
- public void testNewInstanceIsCreatedIfDefWasTouchedAfterwards() throws Exception
- {
- Def def = new DefImpl()
- {
- @Override
- public boolean isTouched()
- {
- return true;
- }
-
- @Override
- protected Object createInstance()
- {
- return new String(""); //$NON-NLS-1$
- }
- };
-
- Object thisInstance = def.getInstance();
- Object thatInstance = def.getInstance();
- assertEquals(true, thatInstance != thisInstance);
- }
-
- public void testSameInstanceIfDefWasntTouched() throws Exception
- {
- Def def = new DefImpl()
- {
- @Override
- public boolean isTouched()
- {
- return false;
- }
-
- @Override
- protected Object createInstance()
- {
- return new String(""); //$NON-NLS-1$
- }
- };
-
- Object thisInstance = def.getInstance();
- Object thatInstance = def.getInstance();
- assertEquals(true, thatInstance == thisInstance);
- }
-
- public void testSetAttributeTouches()
- {
- TestDef def = createTestDef();
- assertEquals(true, !def.isTouched());
- def.setAttribute("aValue"); //$NON-NLS-1$
- assertEquals(true, def.isTouched());
- def.getInstance(); // clears touched
- assertEquals(true, !def.isTouched());
- }
-
- public void testAddReferenceTouches()
- {
- TestDef def = createTestDef();
- assertEquals(true, !def.isTouched());
- def.getReferences().add(createTestDef());
- assertEquals(true, def.isTouched());
- }
-
- public void testSetInReferencedDefTouchesReferenchingDef()
- {
- TestDef def = createTestDef();
- assertEquals(true, !def.isTouched());
-
- TestDef referencedDef = createTestDef();
- def.getReferences().add(referencedDef);
- assertEquals(true, !referencedDef.isTouched());
-
- referencedDef.setAttribute("newValue"); //$NON-NLS-1$
- assertEquals(true, referencedDef.isTouched());
- assertEquals(true, def.isTouched());
- }
-
- public void testNewInstanceIsCreatedIfCurrentIsDeactivated() throws Exception
- {
- BlockingToken thisInstance = (BlockingToken)def.getInstance();
- LifecycleUtil.deactivate(thisInstance);
-
- // Wait until instance gets deactivated
- thisInstance.waitForDeactivation();
- BlockingToken thatInstance = (BlockingToken)def.getInstance();
- assertEquals(true, thatInstance != thisInstance);
- }
-
- public void testNewInstanceIsCreatedIfCurrentIsUnset() throws Exception
- {
- BlockingToken thisInstance = (BlockingToken)def.getInstance();
- def.unsetInstance();
-
- // Wait until instance gets deactivated
- thisInstance.waitForDeactivation();
- BlockingToken thatInstance = (BlockingToken)def.getInstance();
- assertEquals(true, thatInstance != thisInstance);
- }
-
- private TestDef createTestDef()
- {
- return DefsFactory.eINSTANCE.createTestDef();
- }
-
- /**
- * @author Eike Stepper
- */
- private static final class BlockingTokenDef extends DefImpl
- {
- public BlockingTokenDef()
- {
- }
-
- @Override
- protected Object createInstance()
- {
- return new BlockingToken();
- }
- }
-
- /**
- * @author Eike Stepper
- */
- private static final class BlockingToken extends Lifecycle
- {
- private static final long WAIT_TIMEOUT = 1000l;
-
- private volatile boolean isActive = false;
-
- private ReentrantLock reentrantLock = new ReentrantLock();
-
- private Condition lockReleaseCondition = reentrantLock.newCondition();
-
- public BlockingToken()
- {
- }
-
- /**
- * (Blocking) Wait for deactivation. The deactivation is triggered in a separate thread. This method allows you
- * blocking wait for deactivation
- *
- * @throws InterruptedException
- * the interrupted exception
- */
- public void waitForDeactivation() throws InterruptedException
- {
- long startTime = System.currentTimeMillis();
- reentrantLock.lock();
- try
- {
- while (isActive)
- {
- if (isTimeout(startTime))
- {
- throw new IllegalStateException("was not deactivated while waiting for '" + WAIT_TIMEOUT + "'!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- reentrantLock.wait(WAIT_TIMEOUT);
- }
- }
- finally
- {
- reentrantLock.unlock();
- }
- }
-
- @Override
- protected void doActivate() throws LifecycleException
- {
- try
- {
- reentrantLock.lock();
- isActive = true;
- }
- finally
- {
- reentrantLock.unlock();
- }
- }
-
- @Override
- protected void doDeactivate()
- {
- try
- {
- reentrantLock.lock();
- isActive = false;
- lockReleaseCondition.signal();
- }
- finally
- {
- reentrantLock.unlock();
- }
- }
-
- private boolean isTimeout(long startTime)
- {
- return System.currentTimeMillis() - startTime > WAIT_TIMEOUT;
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsFactory.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsFactory.java
deleted file mode 100644
index fbbc07eb2a..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each non-abstract class of
- * the model. <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage
- * @generated
- */
-public interface TestDefsFactory extends EFactory
-{
- /**
- * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- TestDefsFactory eINSTANCE = org.eclipse.net4j.util.tests.defs.impl.TestDefsFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Test Def</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Test Def</em>'.
- * @generated
- */
- TestDef createTestDef();
-
- /**
- * Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the package supported by this factory.
- * @generated
- */
- TestDefsPackage getTestDefsPackage();
-
-} // TestDefsFactory
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsPackage.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsPackage.java
deleted file mode 100644
index ce0db4ff99..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/TestDefsPackage.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs;
-
-import org.eclipse.net4j.util.defs.Net4jUtilDefsPackage;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.TestDefsFactory
- * @model kind="package"
- * @generated
- */
-public interface TestDefsPackage extends EPackage
-{
- /**
- * The package name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNAME = "defs"; //$NON-NLS-1$
-
- /**
- * The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNS_URI = "http://www.eclipse.org/NET4J/defs/tests/1.0.0"; //$NON-NLS-1$
-
- /**
- * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- String eNS_PREFIX = "net4j.defs.tests"; //$NON-NLS-1$
-
- /**
- * The singleton instance of the package. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- TestDefsPackage eINSTANCE = org.eclipse.net4j.util.tests.defs.impl.TestDefsPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.net4j.util.tests.defs.impl.TestDefImpl <em>Test Def</em>}' class.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.impl.TestDefImpl
- * @see org.eclipse.net4j.util.tests.defs.impl.TestDefsPackageImpl#getTestDef()
- * @generated
- */
- int TEST_DEF = 0;
-
- /**
- * The feature id for the '<em><b>References</b></em>' reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEST_DEF__REFERENCES = Net4jUtilDefsPackage.DEF_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Attribute</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEST_DEF__ATTRIBUTE = Net4jUtilDefsPackage.DEF_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Test Def</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEST_DEF_FEATURE_COUNT = Net4jUtilDefsPackage.DEF_FEATURE_COUNT + 2;
-
- /**
- * Returns the meta object for class '{@link org.eclipse.net4j.util.tests.defs.TestDef <em>Test Def</em>}'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Test Def</em>'.
- * @see org.eclipse.net4j.util.tests.defs.TestDef
- * @generated
- */
- EClass getTestDef();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.net4j.util.tests.defs.TestDef#getReferences
- * <em>References</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the reference list '<em>References</em>'.
- * @see org.eclipse.net4j.util.tests.defs.TestDef#getReferences()
- * @see #getTestDef()
- * @generated
- */
- EReference getTestDef_References();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.net4j.util.tests.defs.TestDef#getAttribute
- * <em>Attribute</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Attribute</em>'.
- * @see org.eclipse.net4j.util.tests.defs.TestDef#getAttribute()
- * @see #getTestDef()
- * @generated
- */
- EAttribute getTestDef_Attribute();
-
- /**
- * Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the factory that creates the instances of the model.
- * @generated
- */
- TestDefsFactory getTestDefsFactory();
-
- /**
- * <!-- begin-user-doc --> Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- *
- * @generated
- */
- interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.net4j.util.tests.defs.impl.TestDefImpl <em>Test Def</em>}'
- * class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.impl.TestDefImpl
- * @see org.eclipse.net4j.util.tests.defs.impl.TestDefsPackageImpl#getTestDef()
- * @generated
- */
- EClass TEST_DEF = eINSTANCE.getTestDef();
-
- /**
- * The meta object literal for the '<em><b>References</b></em>' reference list feature. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- EReference TEST_DEF__REFERENCES = eINSTANCE.getTestDef_References();
-
- /**
- * The meta object literal for the '<em><b>Attribute</b></em>' attribute feature. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- EAttribute TEST_DEF__ATTRIBUTE = eINSTANCE.getTestDef_Attribute();
-
- }
-
-} // TestDefsPackage
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsFactoryImpl.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsFactoryImpl.java
deleted file mode 100644
index 9b12089e98..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsFactoryImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.impl;
-
-import org.eclipse.net4j.util.tests.defs.DefsFactory;
-import org.eclipse.net4j.util.tests.defs.DefsPackage;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
- *
- * @generated
- */
-public class DefsFactoryImpl extends EFactoryImpl implements DefsFactory
-{
- /**
- * Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static DefsFactory init()
- {
- try
- {
- DefsFactory theDefsFactory = (DefsFactory)EPackage.Registry.INSTANCE
- .getEFactory("http://www.eclipse.org/NET4J/defs/tests/1.0.0"); //$NON-NLS-1$
- if (theDefsFactory != null)
- {
- return theDefsFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new DefsFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DefsFactoryImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case DefsPackage.TEST_DEF:
- return createTestDef();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDef createTestDef()
- {
- TestDefImpl testDef = new TestDefImpl();
- return testDef;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DefsPackage getDefsPackage()
- {
- return (DefsPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @deprecated
- * @generated
- */
- @Deprecated
- public static DefsPackage getPackage()
- {
- return DefsPackage.eINSTANCE;
- }
-
-} // DefsFactoryImpl
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsPackageImpl.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsPackageImpl.java
deleted file mode 100644
index 59bbc89b80..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/DefsPackageImpl.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.impl;
-
-import org.eclipse.net4j.util.defs.Net4jUtilDefsPackage;
-import org.eclipse.net4j.util.tests.defs.DefsFactory;
-import org.eclipse.net4j.util.tests.defs.DefsPackage;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
- *
- * @generated
- */
-public class DefsPackageImpl extends EPackageImpl implements DefsPackage
-{
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass testDefEClass;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
- * EPackage.Registry} by the package package URI value.
- * <p>
- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
- * performs initialization of the package, or returns the registered package, if one already exists. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.net4j.util.tests.defs.DefsPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private DefsPackageImpl()
- {
- super(eNS_URI, DefsFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- * Simple dependencies are satisfied by calling this method on all dependent packages before doing anything else. This
- * method drives initialization for interdependent packages directly, in parallel with this package, itself.
- * <p>
- * Of this package and its interdependencies, all packages which have not yet been registered by their URI values are
- * first created and registered. The packages are then initialized in two steps: meta-model objects for all of the
- * packages are created before any are initialized, since one package's meta-model objects may refer to those of
- * another.
- * <p>
- * Invocation of this method will not affect any packages that have already been initialized. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static DefsPackage init()
- {
- if (isInited)
- {
- return (DefsPackage)EPackage.Registry.INSTANCE.getEPackage(DefsPackage.eNS_URI);
- }
-
- // Obtain or create and register package
- DefsPackageImpl theDefsPackage = (DefsPackageImpl)(EPackage.Registry.INSTANCE
- .getEPackage(eNS_URI) instanceof DefsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI)
- : new DefsPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- Net4jUtilDefsPackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theDefsPackage.createPackageContents();
-
- // Initialize created meta-data
- theDefsPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theDefsPackage.freeze();
-
- return theDefsPackage;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getTestDef()
- {
- return testDefEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getTestDef_References()
- {
- return (EReference)testDefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getTestDef_Attribute()
- {
- return (EAttribute)testDefEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DefsFactory getDefsFactory()
- {
- return (DefsFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but its
- * first. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated)
- {
- return;
- }
- isCreated = true;
-
- // Create classes and their features
- testDefEClass = createEClass(TEST_DEF);
- createEReference(testDefEClass, TEST_DEF__REFERENCES);
- createEAttribute(testDefEClass, TEST_DEF__ATTRIBUTE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any
- * invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized)
- {
- return;
- }
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- Net4jUtilDefsPackage theNet4jUtilDefsPackage = (Net4jUtilDefsPackage)EPackage.Registry.INSTANCE
- .getEPackage(Net4jUtilDefsPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- testDefEClass.getESuperTypes().add(theNet4jUtilDefsPackage.getDef());
-
- // Initialize classes and features; add operations and parameters
- initEClass(testDefEClass, TestDef.class, "TestDef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
- initEReference(getTestDef_References(), theNet4jUtilDefsPackage.getDef(), null, "references", null, 0, -1, //$NON-NLS-1$
- TestDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
- IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTestDef_Attribute(), ecorePackage.getEString(), "attribute", null, 0, 1, TestDef.class, //$NON-NLS-1$
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-} // DefsPackageImpl
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefImpl.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefImpl.java
deleted file mode 100644
index aa5ef9e1e4..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefImpl.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.impl;
-
-import org.eclipse.net4j.util.defs.Def;
-import org.eclipse.net4j.util.defs.impl.DefImpl;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-import org.eclipse.net4j.util.tests.defs.TestDefsPackage;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-
-import java.util.Collection;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Test Def</b></em>'. <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.net4j.util.tests.defs.impl.TestDefImpl#getReferences <em>References</em>}</li>
- * <li>{@link org.eclipse.net4j.util.tests.defs.impl.TestDefImpl#getAttribute <em>Attribute</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TestDefImpl extends DefImpl implements TestDef
-{
- /**
- * The cached value of the '{@link #getReferences() <em>References</em>}' reference list. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @see #getReferences()
- * @generated
- * @ordered
- */
- protected EList<Def> references;
-
- /**
- * The default value of the '{@link #getAttribute() <em>Attribute</em>}' attribute. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @see #getAttribute()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttribute() <em>Attribute</em>}' attribute. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @see #getAttribute()
- * @generated
- * @ordered
- */
- protected String attribute = ATTRIBUTE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected TestDefImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return TestDefsPackage.Literals.TEST_DEF;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EList<Def> getReferences()
- {
- if (references == null)
- {
- references = new EObjectResolvingEList<Def>(Def.class, this, TestDefsPackage.TEST_DEF__REFERENCES);
- }
- return references;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public String getAttribute()
- {
- return attribute;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setAttribute(String newAttribute)
- {
- String oldAttribute = attribute;
- attribute = newAttribute;
- if (eNotificationRequired())
- {
- eNotify(
- new ENotificationImpl(this, Notification.SET, TestDefsPackage.TEST_DEF__ATTRIBUTE, oldAttribute, attribute));
- }
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case TestDefsPackage.TEST_DEF__REFERENCES:
- return getReferences();
- case TestDefsPackage.TEST_DEF__ATTRIBUTE:
- return getAttribute();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case TestDefsPackage.TEST_DEF__REFERENCES:
- getReferences().clear();
- getReferences().addAll((Collection<? extends Def>)newValue);
- return;
- case TestDefsPackage.TEST_DEF__ATTRIBUTE:
- setAttribute((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case TestDefsPackage.TEST_DEF__REFERENCES:
- getReferences().clear();
- return;
- case TestDefsPackage.TEST_DEF__ATTRIBUTE:
- setAttribute(ATTRIBUTE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case TestDefsPackage.TEST_DEF__REFERENCES:
- return references != null && !references.isEmpty();
- case TestDefsPackage.TEST_DEF__ATTRIBUTE:
- return ATTRIBUTE_EDEFAULT == null ? attribute != null : !ATTRIBUTE_EDEFAULT.equals(attribute);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy())
- {
- return super.toString();
- }
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attribute: ");
- result.append(attribute);
- result.append(')');
- return result.toString();
- }
-
- @Override
- protected Object createInstance()
- {
- return new String("TestDefStringInstance"); //$NON-NLS-1$
- }
-
-} // TestDefImpl
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsFactoryImpl.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsFactoryImpl.java
deleted file mode 100644
index 5a9cee360b..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsFactoryImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.impl;
-
-import org.eclipse.net4j.util.tests.defs.TestDef;
-import org.eclipse.net4j.util.tests.defs.TestDefsFactory;
-import org.eclipse.net4j.util.tests.defs.TestDefsPackage;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
- *
- * @generated
- */
-public class TestDefsFactoryImpl extends EFactoryImpl implements TestDefsFactory
-{
- /**
- * Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public static TestDefsFactory init()
- {
- try
- {
- TestDefsFactory theTestDefsFactory = (TestDefsFactory)EPackage.Registry.INSTANCE
- .getEFactory("http://www.eclipse.org/NET4J/defs/tests/1.0.0");
- if (theTestDefsFactory != null)
- {
- return theTestDefsFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new TestDefsFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDefsFactoryImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case TestDefsPackage.TEST_DEF:
- return createTestDef();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDef createTestDef()
- {
- TestDefImpl testDef = new TestDefImpl();
- return testDef;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDefsPackage getTestDefsPackage()
- {
- return (TestDefsPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @deprecated
- * @generated
- */
- @Deprecated
- public static TestDefsPackage getPackage()
- {
- return TestDefsPackage.eINSTANCE;
- }
-
-} // TestDefsFactoryImpl
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsPackageImpl.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsPackageImpl.java
deleted file mode 100644
index e6a51713c5..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/impl/TestDefsPackageImpl.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.impl;
-
-import org.eclipse.net4j.util.defs.Net4jUtilDefsPackage;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-import org.eclipse.net4j.util.tests.defs.TestDefsFactory;
-import org.eclipse.net4j.util.tests.defs.TestDefsPackage;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
- *
- * @generated
- */
-public class TestDefsPackageImpl extends EPackageImpl implements TestDefsPackage
-{
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass testDefEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
- * EPackage.Registry} by the package package URI value.
- * <p>
- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
- * performs initialization of the package, or returns the registered package, if one already exists. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private TestDefsPackageImpl()
- {
- super(eNS_URI, TestDefsFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- * <p>
- * This method is used to initialize {@link TestDefsPackage#eINSTANCE} when that field is accessed. Clients should not
- * invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static TestDefsPackage init()
- {
- if (isInited)
- {
- return (TestDefsPackage)EPackage.Registry.INSTANCE.getEPackage(TestDefsPackage.eNS_URI);
- }
-
- // Obtain or create and register package
- TestDefsPackageImpl theTestDefsPackage = (TestDefsPackageImpl)(EPackage.Registry.INSTANCE
- .get(eNS_URI) instanceof TestDefsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
- : new TestDefsPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- Net4jUtilDefsPackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theTestDefsPackage.createPackageContents();
-
- // Initialize created meta-data
- theTestDefsPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theTestDefsPackage.freeze();
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(TestDefsPackage.eNS_URI, theTestDefsPackage);
- return theTestDefsPackage;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getTestDef()
- {
- return testDefEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getTestDef_References()
- {
- return (EReference)testDefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getTestDef_Attribute()
- {
- return (EAttribute)testDefEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDefsFactory getTestDefsFactory()
- {
- return (TestDefsFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but its
- * first. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated)
- {
- return;
- }
- isCreated = true;
-
- // Create classes and their features
- testDefEClass = createEClass(TEST_DEF);
- createEReference(testDefEClass, TEST_DEF__REFERENCES);
- createEAttribute(testDefEClass, TEST_DEF__ATTRIBUTE);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any
- * invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized)
- {
- return;
- }
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- Net4jUtilDefsPackage theNet4jUtilDefsPackage = (Net4jUtilDefsPackage)EPackage.Registry.INSTANCE
- .getEPackage(Net4jUtilDefsPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- testDefEClass.getESuperTypes().add(theNet4jUtilDefsPackage.getDef());
-
- // Initialize classes and features; add operations and parameters
- initEClass(testDefEClass, TestDef.class, "TestDef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTestDef_References(), theNet4jUtilDefsPackage.getDef(), null, "references", null, 0, -1,
- TestDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
- IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTestDef_Attribute(), ecorePackage.getEString(), "attribute", null, 0, 1, TestDef.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-} // TestDefsPackageImpl
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsAdapterFactory.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsAdapterFactory.java
deleted file mode 100644
index 60d6b6457f..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsAdapterFactory.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.util;
-
-import org.eclipse.net4j.util.defs.Def;
-import org.eclipse.net4j.util.tests.defs.DefsPackage;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter <code>createXXX</code>
- * method for each class of the model. <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.DefsPackage
- * @generated
- */
-public class DefsAdapterFactory extends AdapterFactoryImpl
-{
- /**
- * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected static DefsPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DefsAdapterFactory()
- {
- if (modelPackage == null)
- {
- modelPackage = DefsPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> This implementation
- * returns <code>true</code> if the object is either the model's package or is an instance object of the model. <!--
- * end-user-doc -->
- *
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- @Override
- public boolean isFactoryForType(Object object)
- {
- if (object == modelPackage)
- {
- return true;
- }
- if (object instanceof EObject)
- {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch that delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DefsSwitch<Adapter> modelSwitch = new DefsSwitch<Adapter>()
- {
- @Override
- public Adapter caseTestDef(TestDef object)
- {
- return createTestDefAdapter();
- }
-
- @Override
- public Adapter caseDef(Def object)
- {
- return createDefAdapter();
- }
-
- @Override
- public Adapter defaultCase(EObject object)
- {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param target
- * the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- @Override
- public Adapter createAdapter(Notifier target)
- {
- return modelSwitch.doSwitch((EObject)target);
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.net4j.util.tests.defs.TestDef <em>Test Def</em>}'.
- * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
- * ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
- *
- * @return the new adapter.
- * @see org.eclipse.net4j.util.tests.defs.TestDef
- * @generated
- */
- public Adapter createTestDefAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.net4j.util.defs.Def <em>Def</em>}'. <!--
- * begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
- * ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
- *
- * @return the new adapter.
- * @see org.eclipse.net4j.util.defs.Def
- * @generated
- */
- public Adapter createDefAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns null. <!--
- * end-user-doc -->
- *
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter()
- {
- return null;
- }
-
-} // DefsAdapterFactory
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsSwitch.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsSwitch.java
deleted file mode 100644
index e2a5fb5ae3..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/DefsSwitch.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.util;
-
-import org.eclipse.net4j.util.defs.Def;
-import org.eclipse.net4j.util.tests.defs.DefsPackage;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import java.util.List;
-
-/**
- * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call
- * {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is
- * returned, which is the result of the switch. <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.DefsPackage
- * @generated
- */
-public class DefsSwitch<T>
-{
- /**
- * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected static DefsPackage modelPackage;
-
- /**
- * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public DefsSwitch()
- {
- if (modelPackage == null)
- {
- modelPackage = DefsPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public T doSwitch(EObject theEObject)
- {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(EClass theEClass, EObject theEObject)
- {
- if (theEClass.eContainer() == modelPackage)
- {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- else
- {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(int classifierID, EObject theEObject)
- {
- switch (classifierID)
- {
- case DefsPackage.TEST_DEF:
- {
- TestDef testDef = (TestDef)theEObject;
- T result = caseTestDef(testDef);
- if (result == null)
- {
- result = caseDef(testDef);
- }
- if (result == null)
- {
- result = defaultCase(theEObject);
- }
- return result;
- }
- default:
- return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Test Def</em>'. <!-- begin-user-doc --> This
- * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
- *
- * @param object
- * the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Test Def</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseTestDef(TestDef object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Def</em>'. <!-- begin-user-doc --> This
- * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
- *
- * @param object
- * the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Def</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseDef(Def object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This
- * implementation returns null; returning a non-null result will terminate the switch, but this is the last case
- * anyway. <!-- end-user-doc -->
- *
- * @param object
- * the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public T defaultCase(EObject object)
- {
- return null;
- }
-
-} // DefsSwitch
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsAdapterFactory.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsAdapterFactory.java
deleted file mode 100644
index d95feb8d07..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsAdapterFactory.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.util;
-
-import org.eclipse.net4j.util.defs.Def;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-import org.eclipse.net4j.util.tests.defs.TestDefsPackage;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter <code>createXXX</code>
- * method for each class of the model. <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage
- * @generated
- */
-public class TestDefsAdapterFactory extends AdapterFactoryImpl
-{
- /**
- * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected static TestDefsPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDefsAdapterFactory()
- {
- if (modelPackage == null)
- {
- modelPackage = TestDefsPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> This implementation
- * returns <code>true</code> if the object is either the model's package or is an instance object of the model. <!--
- * end-user-doc -->
- *
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- @Override
- public boolean isFactoryForType(Object object)
- {
- if (object == modelPackage)
- {
- return true;
- }
- if (object instanceof EObject)
- {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch that delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected TestDefsSwitch<Adapter> modelSwitch = new TestDefsSwitch<Adapter>()
- {
- @Override
- public Adapter caseTestDef(TestDef object)
- {
- return createTestDefAdapter();
- }
-
- @Override
- public Adapter caseDef(Def object)
- {
- return createDefAdapter();
- }
-
- @Override
- public Adapter defaultCase(EObject object)
- {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param target
- * the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- @Override
- public Adapter createAdapter(Notifier target)
- {
- return modelSwitch.doSwitch((EObject)target);
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.net4j.util.tests.defs.TestDef <em>Test Def</em>}'.
- * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
- * ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
- *
- * @return the new adapter.
- * @see org.eclipse.net4j.util.tests.defs.TestDef
- * @generated
- */
- public Adapter createTestDefAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.net4j.util.defs.Def <em>Def</em>}'. <!--
- * begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
- * ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
- *
- * @return the new adapter.
- * @see org.eclipse.net4j.util.defs.Def
- * @generated
- */
- public Adapter createDefAdapter()
- {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation returns null. <!--
- * end-user-doc -->
- *
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter()
- {
- return null;
- }
-
-} // TestDefsAdapterFactory
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsSwitch.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsSwitch.java
deleted file mode 100644
index 41f4cad96e..0000000000
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/defs/util/TestDefsSwitch.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2008-2012, 2015 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.net4j.util.tests.defs.util;
-
-import org.eclipse.net4j.util.defs.Def;
-import org.eclipse.net4j.util.tests.defs.TestDef;
-import org.eclipse.net4j.util.tests.defs.TestDefsPackage;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import java.util.List;
-
-/**
- * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call
- * {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is
- * returned, which is the result of the switch. <!-- end-user-doc -->
- *
- * @see org.eclipse.net4j.util.tests.defs.TestDefsPackage
- * @generated
- */
-public class TestDefsSwitch<T>
-{
- /**
- * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected static TestDefsPackage modelPackage;
-
- /**
- * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public TestDefsSwitch()
- {
- if (modelPackage == null)
- {
- modelPackage = TestDefsPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public T doSwitch(EObject theEObject)
- {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(EClass theEClass, EObject theEObject)
- {
- if (theEClass.eContainer() == modelPackage)
- {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- else
- {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(int classifierID, EObject theEObject)
- {
- switch (classifierID)
- {
- case TestDefsPackage.TEST_DEF:
- {
- TestDef testDef = (TestDef)theEObject;
- T result = caseTestDef(testDef);
- if (result == null)
- {
- result = caseDef(testDef);
- }
- if (result == null)
- {
- result = defaultCase(theEObject);
- }
- return result;
- }
- default:
- return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Test Def</em>'. <!-- begin-user-doc --> This
- * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
- *
- * @param object
- * the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Test Def</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseTestDef(TestDef object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Def</em>'. <!-- begin-user-doc --> This
- * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
- *
- * @param object
- * the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Def</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseDef(Def object)
- {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This
- * implementation returns null; returning a non-null result will terminate the switch, but this is the last case
- * anyway. <!-- end-user-doc -->
- *
- * @param object
- * the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public T defaultCase(EObject object)
- {
- return null;
- }
-
-} // TestDefsSwitch

Back to the top