This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 205653
Collapse All | Expand All

(-)a/nbbuild/templates/projectized.xml (-5 / +1 lines)
Lines 231-241 Link Here
231
        <releasefilescopy cluster="${cluster}"/>
231
        <releasefilescopy cluster="${cluster}"/>
232
    </target>
232
    </target>
233
233
234
    <target name="-init-startlevel">
235
        <property name="module.startlevel" value="4"/>
236
        <property name="check.module.startlevel" value="false"/>
237
    </target>
238
239
    <target name="-check-for-libs.junit4">
234
    <target name="-check-for-libs.junit4">
240
        <condition property="build.libs.junit4">
235
        <condition property="build.libs.junit4">
241
            <not>
236
            <not>
Lines 260-265 Link Here
260
            <sequential>
255
            <sequential>
261
                <property name="test.@{test.type}.folder" location="${build.dir}/test/@{test.type}/dist"/>
256
                <property name="test.@{test.type}.folder" location="${build.dir}/test/@{test.type}/dist"/>
262
                <property name="test.@{test.type}.out.folder" location="${test.@{test.type}.folder}"/>
257
                <property name="test.@{test.type}.out.folder" location="${test.@{test.type}.folder}"/>
258
                <property name="test-@{test.type}-sys-prop.branding.token" value="nb"/>
263
            </sequential>
259
            </sequential>
264
        </macrodef>
260
        </macrodef>
265
        <test-init-nborg test.type="unit"/>
261
        <test-init-nborg test.type="unit"/>
(-)a/nbjunit/arch.xml (-3 / +12 lines)
Lines 561-567 Link Here
561
  <ul>
561
  <ul>
562
562
563
      <li>
563
      <li>
564
        <api name="nbjunit.diff.impl.CmdLine" group="property" type="export" category="devel">
564
        <api name="nbjunit.diff.impl.CmdLine" group="systemproperty" type="export" category="devel">
565
            used only when nbjunit.diff.impl is set
565
            used only when nbjunit.diff.impl is set
566
            to org.netbeans.junit.diff.NativeDiff class. This property
566
            to org.netbeans.junit.diff.NativeDiff class. This property
567
            contain command line, which is called from NativeDiff class
567
            contain command line, which is called from NativeDiff class
Lines 573-586 Link Here
573
      </li>
573
      </li>
574
574
575
      <li>
575
      <li>
576
          <api name="nbjunit.workdir" group="property" type="export" category="devel">
576
          <api name="nbjunit.workdir" group="systemproperty" type="export" category="devel">
577
            path to a directory, which is used as a root for tests' working
577
            path to a directory, which is used as a root for tests' working
578
            directories (for details see JavaDoc for NbTestCase.getWorkDir()).
578
            directories (for details see JavaDoc for NbTestCase.getWorkDir()).
579
          </api>
579
          </api>
580
      </li>
580
      </li>
581
      
581
      
582
      <li>
582
      <li>
583
          <api name="NbTestCase.order" group="property" type="export" category="friend">
583
          <api name="NbTestCase.order" group="systemproperty" type="export" category="friend">
584
            This property tries to influence the order of <code>NbTestCase</code>
584
            This property tries to influence the order of <code>NbTestCase</code>
585
            methods so it is more predicatable (see <a href="http://wiki.apidesign.org/wiki/OrderOfElements">
585
            methods so it is more predicatable (see <a href="http://wiki.apidesign.org/wiki/OrderOfElements">
586
            Order of elements</a> for description of the problem). The acceptable
586
            Order of elements</a> for description of the problem). The acceptable
Lines 603-608 Link Here
603
            randomness caused by JDK7</a>.
603
            randomness caused by JDK7</a>.
604
          </api>
604
          </api>
605
      </li>
605
      </li>
606
      <li>
607
          <api name="branding.token" group="systemproperty" type="export" category="devel">
608
              <a href="@TOP@/org/netbeans/junit/NbModuleSuite.html">NbModuleSuite</a>
609
              can now be influenced by system property <code>branding.token</code>.
610
              If it is provided (by Ant harness for example), it is used
611
              to call <a href="@org-openide-util@/org/openide/util/NbBundle.html#setBranding(java.lang.String)">
612
              NbBundle.setBranding</a>.
613
          </api>
614
      </li>
606
  </ul>
615
  </ul>
607
 
616
 
608
617
(-)a/nbjunit/src/org/netbeans/junit/NbModuleSuite.java (+16 lines)
Lines 43-48 Link Here
43
package org.netbeans.junit;
43
package org.netbeans.junit;
44
44
45
import java.io.*;
45
import java.io.*;
46
import java.lang.reflect.InvocationTargetException;
46
import org.netbeans.junit.internal.NbModuleLogHandler;
47
import org.netbeans.junit.internal.NbModuleLogHandler;
47
import java.lang.reflect.Method;
48
import java.lang.reflect.Method;
48
import java.net.URI;
49
import java.net.URI;
Lines 800-805 Link Here
800
                }
801
                }
801
            }
802
            }
802
            
803
            
804
            
803
            // loader that does not see our current classloader
805
            // loader that does not see our current classloader
804
            JUnitLoader junit = new JUnitLoader(config.parentClassLoader, NbModuleSuite.class.getClassLoader());
806
            JUnitLoader junit = new JUnitLoader(config.parentClassLoader, NbModuleSuite.class.getClassLoader());
805
            URLClassLoader loader = new URLClassLoader(bootCP.toArray(new URL[0]), junit);
807
            URLClassLoader loader = new URLClassLoader(bootCP.toArray(new URL[0]), junit);
Lines 815-820 Link Here
815
            System.setProperty("netbeans.home", platform.getPath());
817
            System.setProperty("netbeans.home", platform.getPath());
816
            System.setProperty("netbeans.full.hack", "true");
818
            System.setProperty("netbeans.full.hack", "true");
817
819
820
            String branding = System.getProperty("branding.token"); // NOI18N
821
            if (branding != null) {
822
                try {
823
                    Method setBranding = loader.loadClass("org.openide.util.NbBundle").getMethod("setBranding", String.class); // NOI18N
824
                    setBranding.invoke(null, branding);
825
                } catch (Throwable ex) {
826
                    if (ex instanceof InvocationTargetException) {
827
                        ex = ((InvocationTargetException)ex).getTargetException();
828
                    }
829
                    LOG.log(Level.WARNING, "Cannot set branding to {0}", branding); // NOI18N
830
                    LOG.log(Level.INFO, "Cannot set branding because of following exception", ex); // NOI18N
831
                }
832
            }
833
            
818
            File ud = new File(new File(Manager.getWorkDirPath()), "userdir" + invocations++);
834
            File ud = new File(new File(Manager.getWorkDirPath()), "userdir" + invocations++);
819
            if (config.reuseUserDir) {
835
            if (config.reuseUserDir) {
820
                ud = lastUserDir != null ? lastUserDir : ud;
836
                ud = lastUserDir != null ? lastUserDir : ud;
(-)5f2b1b034911 (+72 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
package test.pkg.not.in.junit;
46
47
import java.util.logging.Level;
48
import junit.framework.Test;
49
import org.netbeans.junit.NbModuleSuite;
50
import org.netbeans.junit.NbTestCase;
51
import org.openide.util.NbBundle;
52
53
/**
54
 *
55
 * @author Jaroslav Tulach <jtulach@netbeans.org>
56
 */
57
public class BrandingAssignedTest extends NbTestCase {
58
    
59
    public BrandingAssignedTest(String testName) {
60
        super(testName);
61
    }
62
    
63
    public static Test suite() {
64
        return NbModuleSuite.createConfiguration(BrandingAssignedTest.class)
65
            .clusters(".*").failOnException(Level.WARNING).suite();
66
    }
67
68
    public void testBrandingIsAssigned() throws Exception {
69
        Object branding = NbBundle.getBranding();
70
        assertEquals("Default branding in NetBeans is nb", "nb", branding);
71
    }
72
}
(-)a/o.eclipse.equinox.common/nbproject/project.properties (+1 lines)
Lines 1-3 Link Here
1
module.startlevel=2
1
release.external/org.eclipse.equinox.common-3.6.0.jar=modules/org-eclipse-equinox-common.jar
2
release.external/org.eclipse.equinox.common-3.6.0.jar=modules/org-eclipse-equinox-common.jar
2
is.autoload=true
3
is.autoload=true
3
nbm.module.author=Tomas Stupka
4
nbm.module.author=Tomas Stupka

Return to bug 205653