Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 207199
Collapse All | Expand All

(-)a/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoReloadTest.java (-2 / +17 lines)
 Lines 44-61    Link Here 
44
44
45
package org.netbeans.core.netigso;
45
package org.netbeans.core.netigso;
46
46
47
import java.util.logging.Level;
47
import org.netbeans.core.startup.*;
48
import org.netbeans.core.startup.*;
48
import java.io.File;
49
import java.io.File;
49
import java.io.IOException;
50
import java.io.IOException;
50
import java.util.Locale;
51
import java.util.Locale;
52
import java.util.logging.Logger;
51
import org.netbeans.Module;
53
import org.netbeans.Module;
52
import org.netbeans.ModuleManager;
54
import org.netbeans.ModuleManager;
55
import org.osgi.framework.Bundle;
53
56
54
public class NetigsoReloadTest extends NetigsoHid {
57
public class NetigsoReloadTest extends NetigsoHid {
55
    private static Module m1;
58
    private static Module m1;
56
    private static ModuleManager mgr;
59
    private static ModuleManager mgr;
57
    private File withActivator;
60
    private File withActivator;
58
    private File withoutA;
61
    private File withoutA;
62
    private Logger LOG;
59
63
60
    public NetigsoReloadTest(String name) {
64
    public NetigsoReloadTest(String name) {
61
        super(name);
65
        super(name);
 Lines 64-69    Link Here 
64
    protected @Override void setUp() throws Exception {
68
    protected @Override void setUp() throws Exception {
65
        Locale.setDefault(Locale.US);
69
        Locale.setDefault(Locale.US);
66
        clearWorkDir();
70
        clearWorkDir();
71
        
72
        LOG = Logger.getLogger("TEST." + getName());
67
73
68
        File ud = new File(getWorkDir(), "ud");
74
        File ud = new File(getWorkDir(), "ud");
69
        ud.mkdirs();
75
        ud.mkdirs();
 Lines 76-82    Link Here 
76
        withoutA = changeManifest(withActivator, "Manifest-Version: 1.0\n" +
82
        withoutA = changeManifest(withActivator, "Manifest-Version: 1.0\n" +
77
                "Bundle-SymbolicName: org.activate\n" +
83
                "Bundle-SymbolicName: org.activate\n" +
78
                "Import-Package: org.osgi.framework\n" +
84
                "Import-Package: org.osgi.framework\n" +
79
                "Bundle-Version: 1.2\n");
85
                "Bundle-Version: 1.1\n");
80
    }
86
    }
81
87
82
    public void testCanReloadAModule() throws Exception {
88
    public void testCanReloadAModule() throws Exception {
 Lines 90-100    Link Here 
90
        } finally {
96
        } finally {
91
            mgr.mutexPrivileged().exitWriteAccess();
97
            mgr.mutexPrivileged().exitWriteAccess();
92
        }
98
        }
99
        
100
        Bundle b = NetigsoServicesTest.findBundle("org.activate");
101
        assertEquals("version 1.1", "1.1.0", b.getVersion().toString());
93
102
103
        LOG.info("deleting old version and replacing the JAR");
94
        assertTrue("Delete is OK", withoutA.delete());
104
        assertTrue("Delete is OK", withoutA.delete());
95
        assertTrue("Rename is OK", withActivator.renameTo(withoutA));
105
        assertTrue("Rename is OK", withActivator.renameTo(withoutA));
96
106
        LOG.log(Level.INFO, "jar {0} replaced, redeploying", withoutA);
97
        TestModuleDeployer.deployTestModule(withoutA);
107
        TestModuleDeployer.deployTestModule(withoutA);
108
        LOG.info("Deployed new module");
109
        
110
        Bundle newB = NetigsoServicesTest.findBundle("org.activate");
111
//        assertEquals("new version 1.2.1", "1.2.1", newB.getVersion());
112
        
98
        Class<?> main = m1.getClassLoader().loadClass("org.activate.Main");
113
        Class<?> main = m1.getClassLoader().loadClass("org.activate.Main");
99
        Object s = main.getField("start").get(null);
114
        Object s = main.getField("start").get(null);
100
        assertNotNull("Bundle started, its context provided", s);
115
        assertNotNull("Bundle started, its context provided", s);
(-)a/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoSelfQueryTest.java (+46 lines)
 Lines 47-52    Link Here 
47
import java.io.File;
47
import java.io.File;
48
import java.io.InputStream;
48
import java.io.InputStream;
49
import java.net.URL;
49
import java.net.URL;
50
import java.util.Collection;
50
import java.util.Dictionary;
51
import java.util.Dictionary;
51
import java.util.Enumeration;
52
import java.util.Enumeration;
52
import java.util.List;
53
import java.util.List;
 Lines 447-452    Link Here 
447
            throw new UnsupportedOperationException("Not supported yet.");
448
            throw new UnsupportedOperationException("Not supported yet.");
448
        }
449
        }
449
450
451
        @Override
452
        public <A> A adapt(Class<A> type) {
453
            throw new UnsupportedOperationException("Not supported yet.");
454
        }
455
456
        @Override
457
        public int compareTo(Bundle o) {
458
            throw new UnsupportedOperationException("Not supported yet.");
459
        }
460
461
        @Override
462
        public <S> ServiceRegistration<S> registerService(Class<S> type, S s, Dictionary<String, ?> dctnr) {
463
            throw new UnsupportedOperationException("Not supported yet.");
464
        }
465
466
        @Override
467
        public <S> ServiceReference<S> getServiceReference(Class<S> type) {
468
            throw new UnsupportedOperationException("Not supported yet.");
469
        }
470
471
        @Override
472
        public <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> type, String string) throws InvalidSyntaxException {
473
            throw new UnsupportedOperationException("Not supported yet.");
474
        }
475
476
        @Override
477
        public Bundle getBundle(String string) {
478
            throw new UnsupportedOperationException("Not supported yet.");
479
        }
480
450
    }
481
    }
451
482
452
    private static final class MockBundle implements Bundle, BundleContent {
483
    private static final class MockBundle implements Bundle, BundleContent {
 Lines 616-620    Link Here 
616
            throw new UnsupportedOperationException("Not supported yet.");
647
            throw new UnsupportedOperationException("Not supported yet.");
617
        }
648
        }
618
649
650
        @Override
651
        public <A> A adapt(Class<A> type) {
652
            throw new UnsupportedOperationException("Not supported yet.");
653
        }
654
655
        @Override
656
        public File getDataFile(String string) {
657
            throw new UnsupportedOperationException("Not supported yet.");
658
        }
659
660
        @Override
661
        public int compareTo(Bundle o) {
662
            throw new UnsupportedOperationException("Not supported yet.");
663
        }
664
619
    }
665
    }
620
}
666
}
(-)a/core.netigso/test/unit/src/org/netbeans/core/netigso/NetigsoServicesTest.java (-2 / +6 lines)
 Lines 179-190    Link Here 
179
179
180
    static Bundle findBundle(String bsn) throws Exception {
180
    static Bundle findBundle(String bsn) throws Exception {
181
        Bundle[] arr = findFramework().getBundleContext().getBundles();
181
        Bundle[] arr = findFramework().getBundleContext().getBundles();
182
        Bundle candidate = null;
182
        for (Bundle b : arr) {
183
        for (Bundle b : arr) {
183
            if (bsn.equals(b.getSymbolicName())) {
184
            if (bsn.equals(b.getSymbolicName())) {
184
                return b;
185
                candidate = b;
186
                if ((b.getState() & Bundle.ACTIVE) != 0) {
187
                    return b;
188
                }
185
            }
189
            }
186
        }
190
        }
187
        return null;
191
        return candidate;
188
    }
192
    }
189
193
190
    private File changeManifest(File orig, String manifest) throws IOException {
194
    private File changeManifest(File orig, String manifest) throws IOException {
(-)a/libs.felix/external/binaries-list (-1 / +1 lines)
 Lines 1-2    Link Here 
1
F1C19117B73A6819FA91EB646ECBA7F41073DC2A felix-3.2.2.jar
1
14F630EDF137F54188636B5139432986D5FB19B7 felix-4.0.2.jar
2
2
(-)a/libs.felix/external/felix-3.2.2-license.txt (-3 / +3 lines)
 Lines 1-9    Link Here 
1
Name: Felix
1
Name: Felix
2
Version: 3.2.2
2
Version: 4.0.2
3
Description: Apache Felix OSGi container (minus org.osgi.** packages).
3
Description: Apache Felix OSGi container.
4
License: Apache-2.0
4
License: Apache-2.0
5
OSR: 13360
5
OSR: 13360
6
Files: felix-3.2.2.jar
6
Files: felix-4.0.2.jar
7
Origin: http://archive.apache.org/dist/felix/
7
Origin: http://archive.apache.org/dist/felix/
8
8
9
                                 Apache License
9
                                 Apache License
(-)a/libs.felix/manifest.mf (-1 / +1 lines)
 Lines 10-14    Link Here 
10
 org.apache.felix.framework.cache,org.apache.felix.framework.capabilityset,
10
 org.apache.felix.framework.cache,org.apache.felix.framework.capabilityset,
11
 org.apache.felix.framework.ext,org.apache.felix.framework.resolver,
11
 org.apache.felix.framework.ext,org.apache.felix.framework.resolver,
12
 org.apache.felix.framework.util,org.apache.felix.framework.util.manifestparser,
12
 org.apache.felix.framework.util,org.apache.felix.framework.util.manifestparser,
13
 org.apache.felix.main
13
 org.apache.felix.main,org.apache.felix.framework.wiring
14
 
14
 
(-)a/libs.felix/nbproject/project.properties (-1 / +1 lines)
 Lines 40-45    Link Here 
40
# Version 2 license, then the option applies only if the new code is
40
# Version 2 license, then the option applies only if the new code is
41
# made subject to such option by the copyright holder.
41
# made subject to such option by the copyright holder.
42
42
43
release.external/felix-3.2.2.jar=modules/ext/felix-3.2.2.jar
43
release.external/felix-4.0.2.jar=modules/ext/felix-4.0.2.jar
44
javac.source=1.6
44
javac.source=1.6
45
javac.compilerargs=-Xlint -Xlint:-serial
45
javac.compilerargs=-Xlint -Xlint:-serial
(-)a/libs.felix/nbproject/project.xml (-2 / +2 lines)
 Lines 16-23    Link Here 
16
            </module-dependencies>
16
            </module-dependencies>
17
            <public-packages/>
17
            <public-packages/>
18
            <class-path-extension>
18
            <class-path-extension>
19
                <runtime-relative-path>ext/felix-3.2.2.jar</runtime-relative-path>
19
                <runtime-relative-path>ext/felix-4.0.2.jar</runtime-relative-path>
20
                <binary-origin>external/felix-3.2.2.jar</binary-origin>
20
                <binary-origin>external/felix-4.0.2.jar</binary-origin>
21
            </class-path-extension>
21
            </class-path-extension>
22
        </data>
22
        </data>
23
    </configuration>
23
    </configuration>
(-)a/libs.osgi/external/binaries-list (-1 / +1 lines)
 Lines 1-2    Link Here 
1
986195A7E31034EE73F7A896A36B24169692F142 osgi.core-4.2.jar
1
30B192ADACF0EBA1096F18B3AC445123E212CFC9 osgi.core-4.3.jar
2
972E6455724DC6ADB1C1912F53B5E3D7DF20C5FD osgi.cmpn-4.2.jar
2
972E6455724DC6ADB1C1912F53B5E3D7DF20C5FD osgi.cmpn-4.2.jar
(-)a/libs.osgi/external/osgi-4.2-license.txt (-2 / +2 lines)
 Lines 1-6    Link Here 
1
Name: OSGi
1
Name: OSGi
2
Version: 4.2
2
Version: 4.3
3
Files: osgi.core-4.2.jar osgi.cmpn-4.2.jar
3
Files: osgi.core-4.3.jar osgi.cmpn-4.2.jar
4
Description: OSGi specification (core & compendium).
4
Description: OSGi specification (core & compendium).
5
License: Apache-2.0
5
License: Apache-2.0
6
Origin: http://www.osgi.org/Download/Release4V42
6
Origin: http://www.osgi.org/Download/Release4V42
(-)a/libs.osgi/nbproject/project.properties (-1 / +1 lines)
 Lines 2-6    Link Here 
2
javac.source=1.6
2
javac.source=1.6
3
javac.compilerargs=-Xlint -Xlint:-serial
3
javac.compilerargs=-Xlint -Xlint:-serial
4
4
5
release.external/osgi.core-4.2.jar=modules/ext/osgi.core-4.2.jar
5
release.external/osgi.core-4.3.jar=modules/ext/osgi.core-4.3.jar
6
release.external/osgi.cmpn-4.2.jar=modules/ext/osgi.cmpn-4.2.jar
6
release.external/osgi.cmpn-4.2.jar=modules/ext/osgi.cmpn-4.2.jar
(-)a/libs.osgi/nbproject/project.xml (-2 / +2 lines)
 Lines 10-17    Link Here 
10
                <subpackages>org.osgi</subpackages>
10
                <subpackages>org.osgi</subpackages>
11
            </public-packages>
11
            </public-packages>
12
            <class-path-extension>
12
            <class-path-extension>
13
                <runtime-relative-path>ext/osgi.core-4.2.jar</runtime-relative-path>
13
                <runtime-relative-path>ext/osgi.core-4.3.jar</runtime-relative-path>
14
                <binary-origin>external/osgi.core-4.2.jar</binary-origin>
14
                <binary-origin>external/osgi.core-4.3.jar</binary-origin>
15
            </class-path-extension>
15
            </class-path-extension>
16
            <class-path-extension>
16
            <class-path-extension>
17
                <runtime-relative-path>ext/osgi.cmpn-4.2.jar</runtime-relative-path>
17
                <runtime-relative-path>ext/osgi.cmpn-4.2.jar</runtime-relative-path>
(-)a/netbinox/external/binaries-list (-1 / +1 lines)
Line 1    Link Here 
1
1D63B972926D053DFA427CA03841F67D4EAC6DB2 org.eclipse.osgi_3.6.0.v20100517.jar
1
2D80F93B8803250F232902C46EBA850BF1F3E67F org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar
(-)a/netbinox/external/org.eclipse.osgi_3.6.0.v20100517-license.txt (-2 / +2 lines)
 Lines 1-9    Link Here 
1
Name: Equinox
1
Name: Equinox
2
Version: 3.6.0
2
Version: 3.7.1
3
Description: Eclipse OSGi container
3
Description: Eclipse OSGi container
4
License: EPL-v10
4
License: EPL-v10
5
OSR: XXX
5
OSR: XXX
6
Files: org.eclipse.osgi_3.6.0.v20100517.jar
6
Files: org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar
7
Origin: http://www.eclipse.org/equinox/
7
Origin: http://www.eclipse.org/equinox/
8
8
9
Eclipse Public License - v 1.0
9
Eclipse Public License - v 1.0
(-)a/netbinox/nbproject/project.properties (-1 / +1 lines)
 Lines 41-46    Link Here 
41
# made subject to such option by the copyright holder.
41
# made subject to such option by the copyright holder.
42
42
43
is.autoload=true
43
is.autoload=true
44
release.external/org.eclipse.osgi_3.6.0.v20100517.jar=modules/ext/org.eclipse.osgi_3.6.0.v20100517.jar
44
release.external/org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar=modules/ext/org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar
45
javac.source=1.6
45
javac.source=1.6
46
javac.compilerargs=-Xlint -Xlint:-serial
46
javac.compilerargs=-Xlint -Xlint:-serial
(-)a/netbinox/nbproject/project.xml (-2 / +2 lines)
 Lines 85-92    Link Here 
85
                <package>org.eclipse.osgi.util</package>
85
                <package>org.eclipse.osgi.util</package>
86
            </public-packages>
86
            </public-packages>
87
            <class-path-extension>
87
            <class-path-extension>
88
                <runtime-relative-path>ext/org.eclipse.osgi_3.6.0.v20100517.jar</runtime-relative-path>
88
                <runtime-relative-path>ext/org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar</runtime-relative-path>
89
                <binary-origin>external/org.eclipse.osgi_3.6.0.v20100517.jar</binary-origin>
89
                <binary-origin>external/org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar</binary-origin>
90
            </class-path-extension>
90
            </class-path-extension>
91
        </data>
91
        </data>
92
    </configuration>
92
    </configuration>
(-)a/netbinox/src/org/netbeans/modules/netbinox/JarBundleFile.java (-2 / +2 lines)
 Lines 281-290    Link Here 
281
    }
281
    }
282
282
283
    @Override
283
    @Override
284
    public Enumeration getEntryPaths(String prefix) {
284
    public Enumeration<String> getEntryPaths(String prefix) {
285
        BundleFile d = delegate("getEntryPaths", prefix);
285
        BundleFile d = delegate("getEntryPaths", prefix);
286
        if (d == null) {
286
        if (d == null) {
287
            return Collections.enumeration(Collections.emptyList());
287
            return Collections.enumeration(Collections.<String>emptyList());
288
        }
288
        }
289
        return d.getEntryPaths(prefix);
289
        return d.getEntryPaths(prefix);
290
    }
290
    }
(-)a/netbinox/src/org/netbeans/modules/netbinox/Netbinox.java (-1 / +18 lines)
 Lines 44-49    Link Here 
44
import java.io.File;
44
import java.io.File;
45
import java.io.InputStream;
45
import java.io.InputStream;
46
import java.lang.reflect.Field;
46
import java.lang.reflect.Field;
47
import java.util.Collection;
47
import java.util.Dictionary;
48
import java.util.Dictionary;
48
import java.util.Map;
49
import java.util.Map;
49
import java.util.Properties;
50
import java.util.Properties;
 Lines 104-110    Link Here 
104
        public Context(BundleContext delegate) {
105
        public Context(BundleContext delegate) {
105
            this.delegate = delegate;
106
            this.delegate = delegate;
106
        }
107
        }
107
108
        
108
        public boolean ungetService(ServiceReference sr) {
109
        public boolean ungetService(ServiceReference sr) {
109
            return delegate.ungetService(sr);
110
            return delegate.ungetService(sr);
110
        }
111
        }
 Lines 140-145    Link Here 
140
            }
141
            }
141
            return delegate.installBundle(url, in);
142
            return delegate.installBundle(url, in);
142
        }
143
        }
144
        
145
        public <S extends Object> Collection<ServiceReference<S>> getServiceReferences(Class<S> type, String string) throws InvalidSyntaxException {
146
            return delegate.getServiceReferences(type, string);
147
        }
148
        
149
        public <S extends Object> ServiceReference<S> getServiceReference(Class<S> type) {
150
            return delegate.getServiceReference(type);
151
        }
152
153
        public <S extends Object> ServiceRegistration<S> registerService(Class<S> type, S s, Dictionary<String, ?> dctnr) {
154
            return delegate.registerService(type, s, dctnr);
155
        }
143
156
144
        public ServiceReference[] getServiceReferences(String string, String string1) throws InvalidSyntaxException {
157
        public ServiceReference[] getServiceReferences(String string, String string1) throws InvalidSyntaxException {
145
            return delegate.getServiceReferences(string, string1);
158
            return delegate.getServiceReferences(string, string1);
 Lines 172-177    Link Here 
172
        public Bundle getBundle() {
185
        public Bundle getBundle() {
173
            return delegate.getBundle();
186
            return delegate.getBundle();
174
        }
187
        }
188
        
189
        public Bundle getBundle(String s) {
190
            return delegate.getBundle(s);
191
        }
175
192
176
        public ServiceReference[] getAllServiceReferences(String string, String string1) throws InvalidSyntaxException {
193
        public ServiceReference[] getAllServiceReferences(String string, String string1) throws InvalidSyntaxException {
177
            return delegate.getAllServiceReferences(string, string1);
194
            return delegate.getAllServiceReferences(string, string1);
(-)a/netbinox/src/org/netbeans/modules/netbinox/NetbinoxHooks.java (-8 / +16 lines)
 Lines 47-60    Link Here 
47
import java.net.URL;
47
import java.net.URL;
48
import java.net.URLConnection;
48
import java.net.URLConnection;
49
import java.security.ProtectionDomain;
49
import java.security.ProtectionDomain;
50
import java.util.ArrayList;
50
import java.util.*;
51
import java.util.Collection;
52
import java.util.Collections;
53
import java.util.Enumeration;
54
import java.util.HashSet;
55
import java.util.Map;
56
import java.util.Properties;
57
import java.util.Set;
58
import java.util.logging.Level;
51
import java.util.logging.Level;
59
import java.util.logging.LogRecord;
52
import java.util.logging.LogRecord;
60
import org.eclipse.osgi.baseadaptor.BaseAdaptor;
53
import org.eclipse.osgi.baseadaptor.BaseAdaptor;
 Lines 204-209    Link Here 
204
            }
197
            }
205
198
206
            @Override
199
            @Override
200
            public List<URL> findEntries(String string, String string1, int i) {
201
                throw new UnsupportedOperationException("Not supported yet.");
202
            }
203
204
            @Override
205
            public Collection<String> listResources(String string, String string1, int i) {
206
                throw new UnsupportedOperationException("Not supported yet.");
207
            }
208
209
            @Override
210
            public Collection<String> listLocalResources(String string, String string1, int i) {
211
                throw new UnsupportedOperationException("Not supported yet.");
212
            }
213
214
            @Override
207
            protected URL findResource(String name) {
215
            protected URL findResource(String name) {
208
                return findLocalResource(name);
216
                return findLocalResource(name);
209
            }
217
            }
(-)a/netbinox/test/unit/src/org/netbeans/modules/netbinox/CountingSecurityManager.java (+4 lines)
 Lines 442-447    Link Here 
442
            // Just finite number of files in a cache
442
            // Just finite number of files in a cache
443
            return false;
443
            return false;
444
        }
444
        }
445
        if (file.contains("/var/cache/netigso/org.eclipse.core.runtime/.")) {
446
            // Just finite number of files in a cache
447
            return false;
448
        }
445
        if (
449
        if (
446
            file.equals(System.getProperty("netbeans.user")) ||
450
            file.equals(System.getProperty("netbeans.user")) ||
447
            file.equals(System.getProperty("netbeans.home")) ||
451
            file.equals(System.getProperty("netbeans.home")) ||

Return to bug 207199
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo