Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 201309 Details for
Bug 354427
Overridden @PC @PD methods do not get called if the overridden version is not annotated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Context tests patch v1
bug354427-tests-patch-v1.txt (text/plain), 3.01 KB, created by
Remy Suen
on 2011-08-11 08:04:55 EDT
(
hide
)
Description:
Context tests patch v1
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2011-08-11 08:04:55 EDT
Size:
3.01 KB
patch
obsolete
>diff --git src/org/eclipse/e4/core/internal/tests/contexts/inject/Bug354427Test.java src/org/eclipse/e4/core/internal/tests/contexts/inject/Bug354427Test.java >new file mode 0 >index 0000000..f5ff1a8 0 >--- /dev/null >+++ src/org/eclipse/e4/core/internal/tests/contexts/inject/Bug354427Test.java >@@ -0,0 +1,68 @@ >+/******************************************************************************* >+ * Copyright (c) 2011 IBM Corporation 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: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.e4.core.internal.tests.contexts.inject; >+ >+import javax.annotation.PostConstruct; >+import javax.annotation.PreDestroy; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.e4.core.contexts.ContextInjectionFactory; >+import org.eclipse.e4.core.contexts.EclipseContextFactory; >+import org.eclipse.e4.core.contexts.IEclipseContext; >+ >+public class Bug354427Test extends TestCase { >+ >+ public static class SuperInject { >+ >+ boolean pcCalled = false; >+ boolean pdCalled = false; >+ >+ @PostConstruct >+ void pc() { >+ pcCalled = true; >+ } >+ >+ @PreDestroy >+ void pd() { >+ pdCalled = true; >+ } >+ } >+ >+ public static class SubInject extends SuperInject { >+ >+ @Override >+ void pc() { >+ super.pc(); >+ } >+ >+ @Override >+ void pd() { >+ super.pd(); >+ } >+ } >+ >+ public void testUnannotatedOverrides() throws Exception { >+ IEclipseContext context = EclipseContextFactory.create(); >+ >+ SubInject subInject = ContextInjectionFactory.make(SubInject.class, context); >+ >+ assertTrue(subInject.pcCalled); >+ assertFalse(subInject.pdCalled); >+ >+ context.dispose(); >+ >+ assertTrue(subInject.pcCalled); >+ assertFalse(subInject.pdCalled); >+ } >+ >+} >diff --git src/org/eclipse/e4/core/tests/CoreTestSuite.java src/org/eclipse/e4/core/tests/CoreTestSuite.java >index a99e9ea..15eb2f2 100644 >--- src/org/eclipse/e4/core/tests/CoreTestSuite.java >+++ src/org/eclipse/e4/core/tests/CoreTestSuite.java >@@ -24,6 +24,7 @@ > import org.eclipse.e4.core.internal.tests.contexts.inject.AnnotationsInjectionTest; > import org.eclipse.e4.core.internal.tests.contexts.inject.Bug304585Test; > import org.eclipse.e4.core.internal.tests.contexts.inject.Bug317183Test; >+import org.eclipse.e4.core.internal.tests.contexts.inject.Bug354427Test; > import org.eclipse.e4.core.internal.tests.contexts.inject.ComplexDisposalTest; > import org.eclipse.e4.core.internal.tests.contexts.inject.ContextFunctionDynamicsTest; > import org.eclipse.e4.core.internal.tests.contexts.inject.ContextInjectionDisposeTest; >@@ -102,5 +103,6 @@ > addTestSuite(ActivationInjectionTest.class); > addTestSuite(GenericsInjectionTest.class); > addTestSuite(RecursiveObjectCreationTest.class); >+ addTestSuite(Bug354427Test.class); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 354427
: 201309