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 (+1 lines)
Lines 260-265 Link Here
260
            <sequential>
260
            <sequential>
261
                <property name="test.@{test.type}.folder" location="${build.dir}/test/@{test.type}/dist"/>
261
                <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}"/>
262
                <property name="test.@{test.type}.out.folder" location="${test.@{test.type}.folder}"/>
263
                <property name="test-@{test.type}-sys-prop.branding.token" value="nb"/>
263
            </sequential>
264
            </sequential>
264
        </macrodef>
265
        </macrodef>
265
        <test-init-nborg test.type="unit"/>
266
        <test-init-nborg test.type="unit"/>
(-)a/nbjunit/apichanges.xml (+16 lines)
Lines 58-63 Link Here
58
    <!-- ACTUAL CHANGES BEGIN HERE: -->
58
    <!-- ACTUAL CHANGES BEGIN HERE: -->
59
59
60
<changes>
60
<changes>
61
    <change id="branding.token">
62
        <api name="nbjunit"/>
63
        <summary>System property branding.token</summary>
64
        <version major="1" minor="74"/>
65
        <date day="1" month="12" year="2011"/>
66
        <author login="jtulach"/>
67
        <compatibility addition="yes"/>
68
        <description>
69
            <p>
70
                System.getProperty("<a href="@TOP@/architecture-summary.html#systemproperty-branding.token">branding.token</a>") 
71
                recognized and influences branding used during the test.
72
            </p>
73
        </description>
74
        <class package="org.netbeans.junit" name="NbModuleSuite"/>
75
        <issue number="197066"/>
76
    </change>
61
    <change id="NbModuleSuite.Configuration.hideExtraModules">
77
    <change id="NbModuleSuite.Configuration.hideExtraModules">
62
        <api name="nbjunit"/>
78
        <api name="nbjunit"/>
63
        <summary>NbModuleSuite.Configuration.hideExtraModules()</summary>
79
        <summary>NbModuleSuite.Configuration.hideExtraModules()</summary>
(-)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/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.nbjunit/1
2
OpenIDE-Module: org.netbeans.modules.nbjunit/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/junit/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/junit/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.72
4
OpenIDE-Module-Specification-Version: 1.74
5
5
(-)a/nbjunit/src/org/netbeans/junit/NbModuleSuite.java (+14 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 815-820 Link Here
815
            System.setProperty("netbeans.home", platform.getPath());
816
            System.setProperty("netbeans.home", platform.getPath());
816
            System.setProperty("netbeans.full.hack", "true");
817
            System.setProperty("netbeans.full.hack", "true");
817
818
819
            String branding = System.getProperty("branding.token"); // NOI18N
820
            if (branding != null) {
821
                try {
822
                    Method setBranding = loader.loadClass("org.openide.util.NbBundle").getMethod("setBranding", String.class); // NOI18N
823
                    setBranding.invoke(null, branding);
824
                } catch (Throwable ex) {
825
                    if (ex instanceof InvocationTargetException) {
826
                        ex = ((InvocationTargetException)ex).getTargetException();
827
                    }
828
                    LOG.log(Level.WARNING, "Cannot set branding to " + branding, ex); // NOI18N
829
                }
830
            }
831
            
818
            File ud = new File(new File(Manager.getWorkDirPath()), "userdir" + invocations++);
832
            File ud = new File(new File(Manager.getWorkDirPath()), "userdir" + invocations++);
819
            if (config.reuseUserDir) {
833
            if (config.reuseUserDir) {
820
                ud = lastUserDir != null ? lastUserDir : ud;
834
                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
        String 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