Unit tests are now compilable and runnable BLD200406241800
authormmatula@netbeans.org
Sun, 20 Jun 2004 15:24:26 +0000
changeset 1530b29574ab8bad
parent 1529 cc85a9d681ab
child 1531 3d87f07fbc01
Unit tests are now compilable and runnable
mdr/build.xml
mdr/nbproject/build-impl.xml
mdr/nbproject/project.properties
mdr/test/build.xml
mdr/test/unit/src/org/netbeans/mdr/test/AdditionalIndexTest.java
mdr/test/unit/src/org/netbeans/mdr/test/AdvancedXMITest.java
mdr/test/unit/src/org/netbeans/mdr/test/DTDProducerTest.java
mdr/test/unit/src/org/netbeans/mdr/test/FederationTest.java
mdr/test/unit/src/org/netbeans/mdr/test/HandlerStorageTest.java
mdr/test/unit/src/org/netbeans/mdr/test/InterceptionTest.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRAttributePreListener.java
mdr/test/unit/src/org/netbeans/mdr/test/MDREventsTestCase.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRExportImportTest.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAssociationEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAssociationPreEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAttributeEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAttributePreEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestCase.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestExtentEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestExtentPreEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestInstanceEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MDRTestInstancePreEvents.java
mdr/test/unit/src/org/netbeans/mdr/test/MultiAttrTest.java
mdr/test/unit/src/org/netbeans/mdr/test/MultivaluedIndexTest.java
mdr/test/unit/src/org/netbeans/mdr/test/PackageInheritanceTest.java
mdr/test/unit/src/org/netbeans/mdr/test/QueryByPrefixTest.java
mdr/test/unit/src/org/netbeans/mdr/test/StaticFeaturesTest.java
mdr/test/unit/src/org/netbeans/mdr/test/TransactionTest.java
mdr/test/unit/src/org/netbeans/mdr/test/TransientTest.java
mdr/test/unit/src/org/netbeans/mdr/test/UniqueIndexTest.java
     1.1 --- a/mdr/build.xml	Thu Jun 17 14:48:05 2004 +0000
     1.2 +++ b/mdr/build.xml	Sun Jun 20 15:24:26 2004 +0000
     1.3 @@ -34,6 +34,11 @@
     1.4      <target name="test" description="Run unit tests.">
     1.5          <ant antfile="nbproject/build-impl.xml" target="test-nb"/>
     1.6      </target>
     1.7 +    <target name="clean-test" description="Cleans unit tests.">
     1.8 +        <property file="nbproject/project.properties"/>
     1.9 +        <delete dir="${build.test.classes.dir}"/>
    1.10 +        <delete dir="${build.test.results.dir}"/>
    1.11 +    </target>
    1.12      <target name="test-single">
    1.13          <ant antfile="nbproject/build-impl.xml" target="test-single-nb"/>
    1.14      </target>
    1.15 @@ -49,7 +54,7 @@
    1.16      <target name="nbm"/>
    1.17  
    1.18    <!-- Build MDR download zips -->
    1.19 -  <target name="download">
    1.20 +  <target name="download" description="Builds zip file containing standalone mdr libraries.">
    1.21      <echo message="Building MDR download zip files..."/>
    1.22      <ant dir="../openide" target="libs"/>
    1.23      <ant dir="jmi" target="netbeans"/>
     2.1 --- a/mdr/nbproject/build-impl.xml	Thu Jun 17 14:48:05 2004 +0000
     2.2 +++ b/mdr/nbproject/build-impl.xml	Sun Jun 20 15:24:26 2004 +0000
     2.3 @@ -136,7 +136,7 @@
     2.4      </target>
     2.5      <target if="have.tests" depends="init,compile" name="test-build">
     2.6          <mkdir dir="${build.test.classes.dir}"/>
     2.7 -        <javac includeantruntime="false" source="${javac.source}" deprecation="${javac.deprecation}" debug="true" destdir="${build.test.classes.dir}" srcdir="test">
     2.8 +        <javac includeantruntime="false" source="${javac.source}" deprecation="${javac.deprecation}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}">
     2.9              <classpath>
    2.10                  <path path="${javac.test.classpath}"/>
    2.11              </classpath>
    2.12 @@ -150,6 +150,7 @@
    2.13      <target if="have.tests" depends="init,test-build" name="test">
    2.14          <mkdir dir="${build.test.results.dir}"/>
    2.15          <junit errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    2.16 +	    <jvmarg value="-Dwork.dir=${build.test.results.dir}"/>
    2.17              <batchtest todir="${build.test.results.dir}">
    2.18                  <fileset dir="${test.src.dir}">
    2.19                      <include name="**/*Test.java"/>
     3.1 --- a/mdr/nbproject/project.properties	Thu Jun 17 14:48:05 2004 +0000
     3.2 +++ b/mdr/nbproject/project.properties	Sun Jun 20 15:24:26 2004 +0000
     3.3 @@ -7,7 +7,7 @@
     3.4  javadoc.nonavbar=false
     3.5  build.classes.dir=${build.dir}/classes
     3.6  run.classpath=${javac.classpath}\:${build.classes.dir}
     3.7 -javac.test.classpath=${javac.classpath}\:${build.classes.dir}\:${libs.junit.classpath}
     3.8 +javac.test.classpath=${javac.classpath}\:${build.classes.dir}\:${libs.junit.classpath}\:${test.src.dir}/org/netbeans/mdr/test/data/component.jar\:${test.src.dir}/org/netbeans/mdr/test/data/indexedModel.jar\:${test.src.dir}/org/netbeans/mdr/test/data/java-jmi.jar\:${test.src.dir}/org/netbeans/mdr/test/data/pkg_inh-jmi.jar\:${test.src.dir}/org/netbeans/mdr/test/data/staticFeatures.jar\:${test.src.dir}/org/netbeans/mdr/test/data/uml-14.jar\:${test.src.dir}/org/netbeans/mdr/test/data/text-jmi.jar
     3.9  no.dependencies=false
    3.10  javac.debug=true
    3.11  javadoc.author=false
    3.12 @@ -21,15 +21,15 @@
    3.13  jar.compress=false
    3.14  javadoc.version=false
    3.15  dist.javadoc.dir=${dist.dir}/javadoc
    3.16 -build.dir=build
    3.17 +build.dir=${basedir}/build
    3.18  javadoc.splitindex=true
    3.19  javadoc.encoding=
    3.20  debug.test.classpath=${run.test.classpath}
    3.21 -test.src.dir=test
    3.22 +test.src.dir=test/unit/src
    3.23  dist.dir=dist
    3.24  build.test.results.dir=${build.dir}/test/results
    3.25  javadoc.private=false
    3.26  javac.deprecation=false
    3.27  platform.active=default_platform
    3.28  javadoc.windowtitle=
    3.29 -javac.source=1.4
    3.30 +javac.source=1.4
    3.31 \ No newline at end of file
     4.1 --- a/mdr/test/build.xml	Thu Jun 17 14:48:05 2004 +0000
     4.2 +++ b/mdr/test/build.xml	Sun Jun 20 15:24:26 2004 +0000
     4.3 @@ -1,5 +1,6 @@
     4.4 -<?xml version="1.0"?>
     4.5 +<?xml version="1.0" encoding="UTF-8"?>
     4.6  <!--
     4.7 +
     4.8                  Sun Public License Notice
     4.9  
    4.10  The contents of this file are subject to the Sun Public License
    4.11 @@ -8,90 +9,17 @@
    4.12  http://www.sun.com/
    4.13  
    4.14  The Original Code is NetBeans. The Initial Developer of the Original
    4.15 -Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
    4.16 +Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
    4.17  Microsystems, Inc. All Rights Reserved.
    4.18  -->
    4.19  
    4.20 -<project name="MDR test build script" basedir="." default="all">
    4.21 -
    4.22 -    <!-- Properties: external files -->
    4.23 -    <property name="openide.jar" location="../../openide/netbeans/lib/openide.jar"/>
    4.24 -
    4.25 -    <!-- Points to directory with IDE to test-->
    4.26 -    <property name="netbeans.home" location="../../nbbuild/netbeans"/>
    4.27 -    
    4.28 -    <!-- Name of tested module -->
    4.29 -    <property name="xtest.module" value="mdr"/>
    4.30 -    
    4.31 -    <!-- Home of XTest -->
    4.32 -    <property name="xtest.home" location="../../xtest"/>
    4.33 -
    4.34 -    <!-- default testtypes, attributes used when no value is supplied from command line -->
    4.35 -    <property name="xtest.testtype" value="unit"/>
    4.36 -    <property name="xtest.attribs" value="stable"/>
    4.37 -    
    4.38 -    <!-- Points to antfile with module's harness. 
    4.39 -         Targets from that antfile is called from this build.xml -->
    4.40 -    <property name="xtest.module_harness.antfile" location="${xtest.home}/lib/module_harness.xml"/>
    4.41 -
    4.42 -    <!--
    4.43 -    ******************************************************
    4.44 -    ** You should not change anything after this comment,
    4.45 -    **    unless you really know what you do
    4.46 -    ******************************************************
    4.47 -    -->
    4.48 -    
    4.49 -    <!-- Ant property. Value 'ignore' means that system classpath is ignored
    4.50 -         and only classpath specified in build file is used. -->
    4.51 -    <property name="build.sysclasspath" value="ignore"/>
    4.52 -    
    4.53 -    <!-- ============ -->
    4.54 -    <!-- Main targets -->
    4.55 -    <!-- ============ -->
    4.56 -    
    4.57 -    <target name="all" depends="runtests"/>
    4.58 -    
    4.59 -    <!-- This calls target which will call compilers according to cfg file.
    4.60 -         You should not change this target unless you realy know what you are doing -->
    4.61 -    <target name="buildtests">
    4.62 -       <ant dir="." antfile="${xtest.module_harness.antfile}"
    4.63 -             target="compiler-launcher"/>
    4.64 -    </target>
    4.65 -    
    4.66 -    <!-- This calls common clean process. -->
    4.67 -    <!-- You can write your own if you need something special -->
    4.68 -    <target name="cleantests">
    4.69 -       <ant dir="." antfile="${xtest.module_harness.antfile}"
    4.70 -             target="cleantests"/>
    4.71 -    </target> 
    4.72 -
    4.73 -    <!-- This target runs tests. You should not change this --> 
    4.74 -    <!-- target unless you realy know what you are doing -->
    4.75 -    <target name="runtests" depends="buildtests">
    4.76 -        <echo message="Module: Running tests for ${xtest.module}, testtype ${xtest.testtype}, attribs=${xtest.attribs}"/>
    4.77 -        <ant dir="." antfile="${xtest.module_harness.antfile}"
    4.78 -             target="runtests"/>
    4.79 -    </target>
    4.80 -    
    4.81 -    <!-- This target is executed from test-executor in newly created Project -->
    4.82 -    <!-- Name of this task is defined in cfg-xxx.xml -->
    4.83 -    <target name="test_report">
    4.84 -        <ant dir="." antfile="${xtest.module_harness.antfile}"
    4.85 -             target="test_report"/>
    4.86 -    </target>
    4.87 -    
    4.88 -    <target name="cleanresults">
    4.89 -        <ant dir="." antfile="${xtest.module_harness.antfile}"
    4.90 -             target="cleanresults"/>
    4.91 -    </target>
    4.92 -    
    4.93 -    <target name="realclean" depends="cleantests,cleanresults">
    4.94 -        <ant dir="." antfile="${xtest.module_harness.antfile}"
    4.95 -             target="realclean"/>
    4.96 -    </target>
    4.97 -    
    4.98 -    <target name="printconfig">
    4.99 -        <echo message="Default config is testtype: ${xtest.testtype}, attributes: ${xtest.attribs}."/>
   4.100 -    </target>
   4.101 -    
   4.102 +<project name="module test build script" basedir="." default="all">
   4.103 +   <property name="main.dir" location=".."/>
   4.104 +   <target name="all" description="Runs MDR library unit tests." depends="clean,runtests"/>
   4.105 +   <target name="runtests" depends="clean"> 
   4.106 +      <ant antfile="${main.dir}/build.xml" inheritAll="false" target="test"/>
   4.107 +   </target>
   4.108 +   <target name="clean">
   4.109 +      <ant dir="${main.dir}" target="clean-test"/>
   4.110 +   </target>
   4.111  </project>
     5.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/AdditionalIndexTest.java	Thu Jun 17 14:48:05 2004 +0000
     5.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/AdditionalIndexTest.java	Sun Jun 20 15:24:26 2004 +0000
     5.3 @@ -18,10 +18,10 @@
     5.4  import java.net.*;
     5.5  
     5.6  import junit.extensions.*;
     5.7 +import junit.framework.*;
     5.8  
     5.9  import org.netbeans.api.mdr.*;
    5.10  import org.openide.util.Lookup;
    5.11 -import org.netbeans.junit.*;
    5.12  
    5.13  import org.netbeans.mdr.util.*;
    5.14  import org.netbeans.mdr.storagemodel.*;
    5.15 @@ -52,11 +52,11 @@
    5.16          junit.textui.TestRunner.run (suite ());
    5.17      }
    5.18      
    5.19 -    public static NbTest suite () {
    5.20 -        NbTestSuite suite = new NbTestSuite ();
    5.21 +    public static Test suite () {
    5.22 +        TestSuite suite = new TestSuite ();
    5.23          suite.addTestSuite (AdditionalIndexTest.class);
    5.24          
    5.25 -        NbTestSetup setup = new NbTestSetup (suite) {
    5.26 +        TestSetup setup = new TestSetup (suite) {
    5.27              public void setUp () {
    5.28              }
    5.29              public void tearDown () {
    5.30 @@ -78,7 +78,6 @@
    5.31          
    5.32          Sentence s1 = pkg.getSentence().createSentence();
    5.33          Sentence s2 = pkg.getSentence().createSentence();
    5.34 -        
    5.35          Object [][] keys = {{"a", "bb", "ccc"}, {i1, i2, i3}, {s1, s2, null}};
    5.36          int [][][] counts = new int [KEY_COUNT][KEY_COUNT][KEY_COUNT];
    5.37          
     6.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/AdvancedXMITest.java	Thu Jun 17 14:48:05 2004 +0000
     6.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/AdvancedXMITest.java	Sun Jun 20 15:24:26 2004 +0000
     6.3 @@ -18,11 +18,11 @@
     6.4  import java.net.*;
     6.5  
     6.6  import junit.extensions.*;
     6.7 +import junit.framework.*;
     6.8  
     6.9  import org.netbeans.api.xmi.*;
    6.10  import org.netbeans.api.xmi.sax.*;
    6.11  import org.openide.util.Lookup;
    6.12 -import org.netbeans.junit.*;
    6.13  
    6.14  import org.netbeans.mdr.util.*;
    6.15  import org.netbeans.mdr.NBMDRepositoryImpl;
    6.16 @@ -51,7 +51,7 @@
    6.17          name [2] = "extFile_B.xml";
    6.18          
    6.19          for (int x = 0; x < N; x++) {
    6.20 -            file [x] = new File (name [x]);            
    6.21 +            file [x] = getFile (name [x]);            
    6.22          }
    6.23      }
    6.24      
    6.25 @@ -63,11 +63,11 @@
    6.26          junit.textui.TestRunner.run (suite ());
    6.27      }
    6.28      
    6.29 -    public static NbTest suite () {
    6.30 -        NbTestSuite suite = new NbTestSuite ();
    6.31 +    public static Test suite () {
    6.32 +        TestSuite suite = new TestSuite ();
    6.33          suite.addTestSuite (AdvancedXMITest.class);
    6.34          
    6.35 -        NbTestSetup setup = new NbTestSetup (suite) {
    6.36 +        TestSetup setup = new TestSetup (suite) {
    6.37              public void setUp () {
    6.38              }
    6.39              public void tearDown () {
    6.40 @@ -90,7 +90,7 @@
    6.41  
    6.42          final String name = "test_encod.xml";
    6.43          try {
    6.44 -            OutputStream os = new FileOutputStream (name);
    6.45 +            OutputStream os = new FileOutputStream (getFile(name));
    6.46              repository.beginTrans (true);
    6.47              writer.write (os, name, pkg, null);
    6.48              os.flush ();
    6.49 @@ -105,7 +105,7 @@
    6.50          RefPackage pkg_2 = instantiateModel ("Text.xml", "Text", "EncodingPkg_2");
    6.51          try {
    6.52              repository.beginTrans (true);
    6.53 -            reader.read (new File (name).toURL ().toExternalForm (), pkg_2);
    6.54 +            reader.read (getFile (name).toURL ().toExternalForm (), pkg_2);
    6.55          } catch (Exception e) {            
    6.56              fail (e.getMessage ());
    6.57          } finally {
    6.58 @@ -202,7 +202,7 @@
    6.59          reader.getConfiguration().setReferenceResolver(new TextResolver ());
    6.60          
    6.61          try {
    6.62 -            OutputStream os = new FileOutputStream ("textExp.xml");
    6.63 +            OutputStream os = new FileOutputStream (getFile("textExp.xml"));
    6.64              repository.beginTrans (true);
    6.65              writer.write (os, "textExp.xml", pkg, null);
    6.66              os.flush ();
    6.67 @@ -215,7 +215,7 @@
    6.68          }
    6.69          
    6.70          try {
    6.71 -            OutputStream os = new FileOutputStream ("words.xml");
    6.72 +            OutputStream os = new FileOutputStream (getFile("words.xml"));
    6.73              repository.beginTrans (true);
    6.74              writer.write (os, "words.xml", pkg, null);
    6.75              os.flush ();
    6.76 @@ -227,7 +227,7 @@
    6.77              repository.endTrans ();
    6.78          }
    6.79          
    6.80 -        File file = new File ("textExp.xml");
    6.81 +        File file = getFile ("textExp.xml");
    6.82          RefPackage pkg_2 = instantiateModel ("Text.xml", "Text", "Resolver_2");
    6.83          try {
    6.84              repository.beginTrans (true);
    6.85 @@ -257,7 +257,7 @@
    6.86          ((InputConfig)reader.getConfiguration()).setHeaderConsumer(new HeaderConsumer ());
    6.87                  
    6.88          try {
    6.89 -            OutputStream os = new FileOutputStream ("headerTest.xml");
    6.90 +            OutputStream os = new FileOutputStream (getFile("headerTest.xml"));
    6.91              repository.beginTrans (true);
    6.92              writer.write (os, null, pkg, null);
    6.93              os.flush ();
    6.94 @@ -269,7 +269,7 @@
    6.95              repository.endTrans ();
    6.96          }
    6.97          
    6.98 -        File file = new File ("headerTest.xml");
    6.99 +        File file = getFile ("headerTest.xml");
   6.100          RefPackage pkg_2 = instantiateModel ("Java.xml", "Core", "HeaderProvider_2");
   6.101          try {
   6.102              repository.beginTrans (true);
     7.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/DTDProducerTest.java	Thu Jun 17 14:48:05 2004 +0000
     7.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/DTDProducerTest.java	Sun Jun 20 15:24:26 2004 +0000
     7.3 @@ -18,12 +18,12 @@
     7.4  import java.net.*;
     7.5  
     7.6  import junit.extensions.*;
     7.7 +import junit.framework.*;
     7.8  
     7.9  import org.netbeans.api.mdr.DTDProducer;
    7.10  import org.netbeans.api.xmi.*;
    7.11  import org.netbeans.api.xmi.sax.*;
    7.12  import org.openide.util.Lookup;
    7.13 -import org.netbeans.junit.*;
    7.14  
    7.15  import org.netbeans.mdr.util.*;
    7.16  import org.netbeans.mdr.NBMDRepositoryImpl;
    7.17 @@ -50,11 +50,11 @@
    7.18          junit.textui.TestRunner.run (suite ());
    7.19      }
    7.20      
    7.21 -    public static NbTest suite () {
    7.22 -        NbTestSuite suite = new NbTestSuite ();
    7.23 +    public static Test suite () {
    7.24 +        TestSuite suite = new TestSuite ();
    7.25          suite.addTestSuite (DTDProducerTest.class);
    7.26          
    7.27 -        NbTestSetup setup = new NbTestSetup (suite) {
    7.28 +        TestSetup setup = new TestSetup (suite) {
    7.29              public void setUp () {
    7.30              }
    7.31              public void tearDown () {
    7.32 @@ -82,7 +82,7 @@
    7.33          XMIReader reader = XMIReaderFactory.getDefault ().createXMIReader ();
    7.34  
    7.35          try {
    7.36 -            OutputStream os = new FileOutputStream (fileName + ".dtd");
    7.37 +            OutputStream os = new FileOutputStream (getFile(fileName + ".dtd"));
    7.38              producer.generate (os, pkg);
    7.39              os.flush ();
    7.40              os.close ();
    7.41 @@ -91,8 +91,8 @@
    7.42              fail (e.getMessage ());
    7.43          }
    7.44  
    7.45 -        File file_temp = new File (fileName + ".temp");
    7.46 -        File file = new File (fileName + ".xml");
    7.47 +        File file_temp = getFile (fileName + ".temp");
    7.48 +        File file = getFile (fileName + ".xml");
    7.49  
    7.50          try {
    7.51              OutputStream os = new FileOutputStream (file_temp);
    7.52 @@ -171,6 +171,7 @@
    7.53          public void validate (File xmiFile) {
    7.54              try {
    7.55                  InputSource input = new InputSource (new FileInputStream (xmiFile));
    7.56 +                input.setSystemId(xmiFile.toURL().toString());
    7.57                  SAXParserFactory factory = SAXParserFactory.newInstance ();
    7.58                  factory.setValidating (true);
    7.59                  SAXParser saxParser = factory.newSAXParser ();
     8.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/FederationTest.java	Thu Jun 17 14:48:05 2004 +0000
     8.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/FederationTest.java	Sun Jun 20 15:24:26 2004 +0000
     8.3 @@ -12,10 +12,10 @@
     8.4  import java.text.MessageFormat;
     8.5  
     8.6  import junit.extensions.*;
     8.7 +import junit.framework.*;
     8.8  
     8.9  import org.netbeans.api.mdr.*;
    8.10  import org.openide.util.Lookup;
    8.11 -import org.netbeans.junit.*;
    8.12  
    8.13  import org.netbeans.mdr.util.*;
    8.14  import org.netbeans.mdr.NBMDRepositoryImpl;
    8.15 @@ -322,10 +322,10 @@
    8.16          ((NBMDRepositoryImpl)this.repository).unmountStorage(storageId);
    8.17      }
    8.18      
    8.19 -    public static NbTest suite() {
    8.20 -        NbTestSuite suite = new NbTestSuite();
    8.21 +    public static Test suite() {
    8.22 +        TestSuite suite = new TestSuite();
    8.23          suite.addTestSuite(FederationTest.class);
    8.24 -        NbTestSetup setup = new NbTestSetup(suite) {
    8.25 +        TestSetup setup = new TestSetup(suite) {
    8.26              public void setUp() {
    8.27              }
    8.28              
     9.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/HandlerStorageTest.java	Thu Jun 17 14:48:05 2004 +0000
     9.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/HandlerStorageTest.java	Sun Jun 20 15:24:26 2004 +0000
     9.3 @@ -12,10 +12,10 @@
     9.4  import java.text.MessageFormat;
     9.5  
     9.6  import junit.extensions.*;
     9.7 +import junit.framework.*;
     9.8  
     9.9  import org.netbeans.api.mdr.*;
    9.10  import org.openide.util.Lookup;
    9.11 -import org.netbeans.junit.*;
    9.12  
    9.13  import org.netbeans.mdr.util.*;
    9.14  import org.netbeans.mdr.NBMDRepositoryImpl;
    9.15 @@ -66,10 +66,10 @@
    9.16      }
    9.17      
    9.18      
    9.19 -    public static NbTest suite() {
    9.20 -        NbTestSuite suite = new NbTestSuite();
    9.21 +    public static Test suite() {
    9.22 +        TestSuite suite = new TestSuite();
    9.23          suite.addTestSuite(HandlerStorageTest.class);
    9.24 -        NbTestSetup setup = new NbTestSetup(suite) {
    9.25 +        TestSetup setup = new TestSetup(suite) {
    9.26              public void setUp() {
    9.27              }    
    9.28              public void tearDown() {
    10.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/InterceptionTest.java	Thu Jun 17 14:48:05 2004 +0000
    10.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/InterceptionTest.java	Sun Jun 20 15:24:26 2004 +0000
    10.3 @@ -13,9 +13,9 @@
    10.4  package org.netbeans.mdr.test;
    10.5  
    10.6  import java.util.*;
    10.7 +import junit.framework.*;
    10.8  
    10.9  import org.netbeans.api.mdr.*;
   10.10 -import org.netbeans.junit.*;
   10.11  
   10.12  import javax.jmi.reflect.*;
   10.13  import javax.jmi.model.*;
   10.14 @@ -44,17 +44,8 @@
   10.15          super(testName);
   10.16      }
   10.17  
   10.18 -    public static NbTest suite() {
   10.19 -        NbTestSuite suite = new NbTestSuite();
   10.20 -        suite.addTestSuite(InterceptionTest.class);
   10.21 -        NbTestSetup setup = new NbTestSetup(suite) {
   10.22 -            public void setUp() {
   10.23 -            }
   10.24 -            
   10.25 -            public void tearDown() {
   10.26 -            }
   10.27 -        };
   10.28 -        return setup;
   10.29 +    public static Test suite() {
   10.30 +        return new TestSuite(InterceptionTest.class);
   10.31      }
   10.32      
   10.33      public static void main(String[] args) {
    11.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRAttributePreListener.java	Thu Jun 17 14:48:05 2004 +0000
    11.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRAttributePreListener.java	Sun Jun 20 15:24:26 2004 +0000
    11.3 @@ -21,14 +21,14 @@
    11.4  import java.io.PrintWriter;
    11.5  import java.io.PrintStream;
    11.6  
    11.7 -import org.netbeans.junit.*;
    11.8  import junit.extensions.*;
    11.9 +import junit.framework.*;
   11.10  
   11.11  /**
   11.12   *
   11.13   * @author  mk97936
   11.14   */
   11.15 -public class MDRAttributePreListener extends NbTestCase implements MDRPreChangeListener {
   11.16 +public class MDRAttributePreListener extends TestCase implements MDRPreChangeListener {
   11.17      
   11.18      // "type" of event
   11.19      public static final int PLANNED = 0;
    12.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDREventsTestCase.java	Thu Jun 17 14:48:05 2004 +0000
    12.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDREventsTestCase.java	Sun Jun 20 15:24:26 2004 +0000
    12.3 @@ -18,10 +18,10 @@
    12.4  import java.net.*;
    12.5  
    12.6  import junit.extensions.*;
    12.7 +import junit.framework.*;
    12.8  
    12.9  import org.netbeans.api.mdr.*;
   12.10  import org.openide.util.Lookup;
   12.11 -import org.netbeans.junit.*;
   12.12  
   12.13  import org.netbeans.mdr.util.*;
   12.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   12.15 @@ -32,12 +32,13 @@
   12.16  
   12.17  import javax.jmi.reflect.*;
   12.18  import javax.jmi.model.*;
   12.19 +import javax.jmi.xmi.*;
   12.20  
   12.21  /**
   12.22   * Abstract predecessor of MDR test cases handling set up and providing some "high level"
   12.23   * functionality over repository (e.g. load model method).
   12.24   */
   12.25 -public abstract class MDREventsTestCase extends NbTestCase /*implements MDRPreChangeListener, MDRChangeListener*/ {
   12.26 +public abstract class MDREventsTestCase extends TestCase /*implements MDRPreChangeListener, MDRChangeListener*/ {
   12.27      
   12.28      // "type" of event
   12.29      public static final int PLANNED = 2;
   12.30 @@ -69,7 +70,7 @@
   12.31          ModelPackage pkg = null;
   12.32          
   12.33          Lookup lookup = Lookup.getDefault ();
   12.34 -        XMIReader reader = (XMIReader) lookup.lookup (XMISaxReaderImpl.class);
   12.35 +        XmiReader reader = (XmiReader) lookup.lookup (XmiReader.class);
   12.36          URL url = this.getClass ().getResource ("data" + File.separator + docName);
   12.37          if (url == null) {
   12.38              fail ("Resource not found.");
   12.39 @@ -83,7 +84,7 @@
   12.40          
   12.41          try {
   12.42              repository.beginTrans (true);
   12.43 -            reader.read (url.toExternalForm(), new RefPackage[] { pkg } );
   12.44 +            reader.read (url.toExternalForm(), pkg);
   12.45          } catch (Exception e) {
   12.46              fail (e.getMessage ());
   12.47          } finally {
   12.48 @@ -146,18 +147,12 @@
   12.49      // -------------------------------------------------------------------------
   12.50      
   12.51      protected void setUp() {
   12.52 -        
   12.53 -        String workDir = System.getProperty("work.dir");        
   12.54 -        
   12.55          // properties will be set only if running outside of IDE
   12.56          if (System.getProperty("org.openide.version") == null) {
   12.57 -            System.setProperty("org.netbeans.mdr.persistence.Dir", 
   12.58 -                workDir + File.separator + "TestEventsRepository_" + System.currentTimeMillis());
   12.59 +            System.setProperty("org.netbeans.mdr.persistence.Dir", System.getProperty("work.dir") + "/TestEventsRepository_" + System.currentTimeMillis());
   12.60              System.setProperty("org.netbeans.mdr.storagemodel.StorageFactoryClassName",
   12.61                  "org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeFactory");
   12.62 -            //System.setProperty("org.openide.util.Lookup", "org.netbeans.mdr.test.MDRTestLookup");
   12.63              System.setProperty("org.netbeans.lib.jmi.Logger.fileName", "");
   12.64 -            System.setProperty("org.netbeans.mdr.SaveStorageOnExit", "true");
   12.65          }
   12.66          
   12.67          repository = MDRManager.getDefault().getDefaultRepository();
   12.68 @@ -301,4 +296,11 @@
   12.69          
   12.70      }*/
   12.71      
   12.72 +    protected void log(String message) {
   12.73 +        getLog().println(message);
   12.74 +    }
   12.75 +    
   12.76 +    protected PrintStream getLog() {
   12.77 +        return System.err;
   12.78 +    }
   12.79  }
    13.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRExportImportTest.java	Thu Jun 17 14:48:05 2004 +0000
    13.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRExportImportTest.java	Sun Jun 20 15:24:26 2004 +0000
    13.3 @@ -18,10 +18,10 @@
    13.4  import java.net.*;
    13.5  
    13.6  import junit.extensions.*;
    13.7 +import junit.framework.*;
    13.8  
    13.9  import org.netbeans.api.mdr.*;
   13.10  import org.openide.util.Lookup;
   13.11 -import org.netbeans.junit.*;
   13.12  
   13.13  import org.netbeans.mdr.util.*;
   13.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   13.15 @@ -32,6 +32,7 @@
   13.16  
   13.17  import javax.jmi.reflect.*;
   13.18  import javax.jmi.model.*;
   13.19 +import javax.jmi.xmi.*;
   13.20  
   13.21  /**
   13.22   * Test case verifying functionality of XmiReader and XmiWriter.
   13.23 @@ -46,11 +47,11 @@
   13.24          junit.textui.TestRunner.run (suite ());
   13.25      }
   13.26      
   13.27 -    public static NbTest suite () {
   13.28 -        NbTestSuite suite = new NbTestSuite ();
   13.29 +    public static Test suite () {
   13.30 +        TestSuite suite = new TestSuite ();
   13.31          suite.addTestSuite (MDRExportImportTest.class);
   13.32          
   13.33 -        NbTestSetup setup = new NbTestSetup (suite) {
   13.34 +        TestSetup setup = new TestSetup (suite) {
   13.35              public void setUp () {
   13.36              }
   13.37              public void tearDown () {
   13.38 @@ -66,14 +67,14 @@
   13.39          new RandomDataGenerator ().generate (pkg, 0, 5);
   13.40          
   13.41          Lookup lookup = Lookup.getDefault ();
   13.42 -        XMIReader reader = (XMIReader) lookup.lookup (XMISaxReaderImpl.class);
   13.43 -        XMIWriter writer = (XMIWriter) lookup.lookup (XMIWriter.class);
   13.44 +        XmiReader reader = (XmiReader) lookup.lookup (XmiReader.class);
   13.45 +        XmiWriter writer = (XmiWriter) lookup.lookup (XmiWriter.class);
   13.46          
   13.47 -        File file = new File ("temp.xml");
   13.48 +        File file = getFile ("temp.xml");
   13.49          try {
   13.50              OutputStream os = new FileOutputStream (file);
   13.51              repository.beginTrans (true);
   13.52 -            writer.write (os, pkg);
   13.53 +            writer.write (os, pkg, null);
   13.54              os.flush ();
   13.55              os.close ();
   13.56          } catch (Exception e) {
   13.57 @@ -83,7 +84,7 @@
   13.58          }        
   13.59          try {
   13.60              repository.beginTrans (true);
   13.61 -            reader.read (file.toURL ().toExternalForm(), new RefPackage[] {pkg});            
   13.62 +            reader.read (file.toURL ().toExternalForm(), pkg);            
   13.63          } catch (Exception e) {            
   13.64              fail (e.getMessage ());
   13.65          } finally {
   13.66 @@ -93,80 +94,6 @@
   13.67      }
   13.68      
   13.69      /**
   13.70 -     * Loads and instantiates UML metamodel, generates random instances, exports
   13.71 -     * them to xmi files and loades them back (in another extent).
   13.72 -     *
   13.73 -     * Note that UML 1.4 metamodel is not part of open source. It have to be
   13.74 -     * added to 'data' directory (together with related Diff file), otherwise
   13.75 -     * this test always fails.
   13.76 -     */    
   13.77 -    public void testUML () {
   13.78 -        URL url = this.getClass ().getResource ("data//01-02-15.xml");
   13.79 -        if (url == null)
   13.80 -            fail ("Resource not found: " + "data//01-02-15.xml (UML 1.4 metamodel have to be downloaded from www.omg.org and placed in data directory)");
   13.81 -        url = this.getClass ().getResource ("data//01-02-15_Diff.xml");
   13.82 -        if (url == null)
   13.83 -            fail ("Resource not found: " + "data//01-02-15_Diff.xml (UML 1.4 metamodel Diff file have to be downloaded from mdr.netbeans.org and placed in data directory)");
   13.84 -        try {
   13.85 -            Class.forName ("org.omg.uml.UmlPackage");
   13.86 -        } catch (ClassNotFoundException e) {
   13.87 -            fail ("UML jmi interfaces not included in path.");
   13.88 -        }
   13.89 -
   13.90 -        // load UML metamodel
   13.91 -        ModelPackage model = loadMOFModel("01-02-15_Diff.xml", "model");                
   13.92 -        // instantiate UML metamodel
   13.93 -        RefPackage pkg_1 = createExtent (findMofPackage(model, "UML"), "UML");
   13.94 -        // generate random instances and links
   13.95 -        new RandomDataGenerator ().generate (pkg_1, 0, 12);
   13.96 -        
   13.97 -        Lookup lookup = Lookup.getDefault ();
   13.98 -        XMIReader reader = (XMIReader) lookup.lookup (XMIReader.class);
   13.99 -        XMIWriter writer = (XMIWriter) lookup.lookup (XMIWriter.class);
  13.100 -        
  13.101 -        // export generated data
  13.102 -        File file = new File ("uml_data.xml");
  13.103 -        try {
  13.104 -            OutputStream os = new FileOutputStream (file);
  13.105 -            repository.beginTrans (true);
  13.106 -            writer.write (os, pkg_1);
  13.107 -            os.flush ();
  13.108 -            os.close ();
  13.109 -        } catch (Exception e) {
  13.110 -            fail (e.getMessage ());
  13.111 -        } finally {
  13.112 -            repository.endTrans ();
  13.113 -        }
  13.114 -        
  13.115 -        // create second extent of UML metamodel
  13.116 -        RefPackage pkg_2 = createExtent (findMofPackage(model, "UML"), "UML_2");
  13.117 -        // read back exported data
  13.118 -        try {
  13.119 -            repository.beginTrans (true);
  13.120 -            reader.read (file.toURL ().toExternalForm(), new RefPackage[] {pkg_2});            
  13.121 -        } catch (Exception e) {            
  13.122 -            fail (e.getMessage ());
  13.123 -        } finally {
  13.124 -            repository.endTrans ();
  13.125 -        }
  13.126 -        
  13.127 -        // compare number of instances and links in both extents
  13.128 -        compareData (pkg_1, pkg_2, new HashSet ());
  13.129 -        
  13.130 -        deleteModel (pkg_1);
  13.131 -        deleteModel (pkg_2);
  13.132 -        deleteModel (model);        
  13.133 -    }
  13.134 -    
  13.135 -    /**
  13.136 -     * Creates instance of Model package, loads Java metamodel into it, exports the loaded
  13.137 -     * data and compares the created XMI file to the original one.
  13.138 -     */
  13.139 -    public void testJavaModel () {
  13.140 -        readWrite ("Java.xml");
  13.141 -    }
  13.142 -    
  13.143 -    /**
  13.144       * Creates instance of Model package, loads Text metamodel into it, exports the loaded
  13.145       * data and compares the created XMI file to the original one.
  13.146       */
  13.147 @@ -184,8 +111,8 @@
  13.148          org.netbeans.api.xmi.XMIReader reader = 
  13.149              org.netbeans.api.xmi.XMIReaderFactory.getDefault ().createXMIReader ();
  13.150  
  13.151 -        File file_1 = new File ("out.xml");
  13.152 -        File file_2 = new File ("out_2.xml");
  13.153 +        File file_1 = getFile ("out.xml");
  13.154 +        File file_2 = getFile ("out_2.xml");
  13.155           
  13.156          try {
  13.157              repository.beginTrans (false);
  13.158 @@ -229,8 +156,8 @@
  13.159          new RandomDataGenerator ().generate (pkg, 0, 10);
  13.160          
  13.161          Lookup lookup = Lookup.getDefault ();
  13.162 -        XMIReader reader = (XMIReader) lookup.lookup (XMISaxReaderImpl.class);
  13.163 -        XMIWriter writer = (XMIWriterImpl) lookup.lookup (XMIWriter.class);
  13.164 +        XmiReader reader = (XmiReader) lookup.lookup (XmiReader.class);
  13.165 +        XmiWriter writer = (XmiWriter) lookup.lookup (XmiWriter.class);
  13.166          
  13.167          RefClass proxyWord = pkg.refClass ("Word");
  13.168          RefClass proxySentence = pkg.refClass ("Sentence");
  13.169 @@ -254,7 +181,7 @@
  13.170              }
  13.171          }
  13.172          
  13.173 -        File file = new File ("temp.xml");
  13.174 +        File file = getFile ("temp.xml");
  13.175          try {
  13.176              OutputStream os = new FileOutputStream (file);
  13.177              repository.beginTrans (true);
  13.178 @@ -269,7 +196,7 @@
  13.179          }        
  13.180          try {
  13.181              repository.beginTrans (true);
  13.182 -            reader.read (file.toURL ().toExternalForm(), new RefPackage[] {pkg2});
  13.183 +            reader.read (file.toURL ().toExternalForm(), pkg2);
  13.184          } catch (Exception e) {            
  13.185              fail (e.getMessage ());
  13.186          } finally {
  13.187 @@ -331,8 +258,8 @@
  13.188       */
  13.189      public void readWrite (String docName) {
  13.190          Lookup lookup = Lookup.getDefault ();
  13.191 -        XMIReader reader = (XMIReader) lookup.lookup (XMISaxReaderImpl.class);
  13.192 -        XMIWriter writer = (XMIWriter) lookup.lookup (XMIWriter.class);
  13.193 +        XmiReader reader = (XmiReader) lookup.lookup (XmiReader.class);
  13.194 +        XmiWriter writer = (XmiWriter) lookup.lookup (XmiWriter.class);
  13.195          URL url = this.getClass ().getResource ("data" + File.separator + docName);
  13.196          if (url == null)
  13.197              fail ("Resource not found.");
  13.198 @@ -341,17 +268,17 @@
  13.199          );
  13.200          try {
  13.201              repository.beginTrans (true);
  13.202 -            reader.read (url.toExternalForm(), new RefPackage[] {pkg});
  13.203 +            reader.read (url.toExternalForm(), pkg);
  13.204          } catch (Exception e) {                        
  13.205              fail (e.getMessage ());
  13.206          } finally {
  13.207              repository.endTrans ();
  13.208          }
  13.209 -        File file = new File ("temp.xml");
  13.210 +        File file = getFile ("temp.xml");
  13.211          try {
  13.212              OutputStream os = new FileOutputStream (file);
  13.213              repository.beginTrans (true);
  13.214 -            writer.write (os, pkg);
  13.215 +            writer.write (os, pkg, null);
  13.216              os.flush ();
  13.217              os.close ();
  13.218          } catch (Exception e) {
    14.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAssociationEvents.java	Thu Jun 17 14:48:05 2004 +0000
    14.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAssociationEvents.java	Sun Jun 20 15:24:26 2004 +0000
    14.3 @@ -11,7 +11,6 @@
    14.4  import java.util.Collection;
    14.5  
    14.6  import junit.framework.*;
    14.7 -import org.netbeans.junit.*;
    14.8  
    14.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   14.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    15.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAssociationPreEvents.java	Thu Jun 17 14:48:05 2004 +0000
    15.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAssociationPreEvents.java	Sun Jun 20 15:24:26 2004 +0000
    15.3 @@ -11,7 +11,6 @@
    15.4  import java.util.Collection;
    15.5  
    15.6  import junit.framework.*;
    15.7 -import org.netbeans.junit.*;
    15.8  
    15.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   15.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    16.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAttributeEvents.java	Thu Jun 17 14:48:05 2004 +0000
    16.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAttributeEvents.java	Sun Jun 20 15:24:26 2004 +0000
    16.3 @@ -11,7 +11,6 @@
    16.4  import java.util.Collection;
    16.5  
    16.6  import junit.framework.*;
    16.7 -import org.netbeans.junit.*;
    16.8  
    16.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   16.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    17.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAttributePreEvents.java	Thu Jun 17 14:48:05 2004 +0000
    17.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestAttributePreEvents.java	Sun Jun 20 15:24:26 2004 +0000
    17.3 @@ -11,7 +11,6 @@
    17.4  import java.util.Collection;
    17.5  
    17.6  import junit.framework.*;
    17.7 -import org.netbeans.junit.*;
    17.8  
    17.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   17.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    18.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestCase.java	Thu Jun 17 14:48:05 2004 +0000
    18.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestCase.java	Sun Jun 20 15:24:26 2004 +0000
    18.3 @@ -18,24 +18,24 @@
    18.4  import java.net.*;
    18.5  
    18.6  import junit.extensions.*;
    18.7 +import junit.framework.*;
    18.8  
    18.9  import org.netbeans.api.mdr.*;
   18.10  import org.openide.util.Lookup;
   18.11 -import org.netbeans.junit.*;
   18.12  
   18.13  import org.netbeans.mdr.util.*;
   18.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   18.15 -import org.netbeans.lib.jmi.xmi.*;
   18.16  import org.netbeans.lib.jmi.mapping.*;
   18.17  
   18.18  import javax.jmi.reflect.*;
   18.19  import javax.jmi.model.*;
   18.20 +import javax.jmi.xmi.*;
   18.21  
   18.22  /**
   18.23   * Abstract predecessor of MDR test cases handling set up and providing some "high level"
   18.24   * functionality over repository (e.g. load model method).
   18.25   */
   18.26 -public abstract class MDRTestCase extends NbTestCase {
   18.27 +public abstract class MDRTestCase extends TestCase {
   18.28      
   18.29      // default repository, it is inited by setUp method
   18.30      protected MDRepository repository = null;
   18.31 @@ -56,7 +56,7 @@
   18.32       */
   18.33      public ModelPackage loadMOFModel (String docName, String pkgName) {
   18.34          Lookup lookup = Lookup.getDefault ();
   18.35 -        XMIReader reader = (XMIReader) lookup.lookup (XMISaxReaderImpl.class);        
   18.36 +        XmiReader reader = (XmiReader) lookup.lookup (XmiReader.class);
   18.37          URL url = this.getClass ().getResource ("data//" + docName);
   18.38          if (url == null)
   18.39              fail ("Resource not found: " + "data//" + docName);
   18.40 @@ -65,7 +65,7 @@
   18.41          );
   18.42          try {
   18.43              repository.beginTrans (true);
   18.44 -            reader.read (url.toExternalForm(), new RefPackage[] {pkg});
   18.45 +            reader.read (url.toExternalForm(), pkg);
   18.46          } catch (Exception e) {
   18.47              fail (e.getMessage ());
   18.48          } finally {
   18.49 @@ -102,6 +102,10 @@
   18.50       * Creates extent according to given MofPackage and name.
   18.51       */
   18.52      public RefPackage createExtent (MofPackage pkg, String name) {
   18.53 +        RefPackage extent = getExtent(name);
   18.54 +        if (extent != null) {
   18.55 +            extent.refDelete();
   18.56 +        }
   18.57          try {
   18.58              return repository.createExtent (name, pkg);
   18.59          } catch (CreationFailedException e) {
   18.60 @@ -125,15 +129,11 @@
   18.61      }
   18.62     
   18.63      protected void setUp() {
   18.64 -        String workDir = System.getProperty("work.dir");        
   18.65 -        
   18.66          // properties will be set only if running outside of IDE
   18.67          if (System.getProperty("org.openide.version") == null) {
   18.68 -            System.setProperty("org.netbeans.mdr.persistence.Dir", workDir + File.separator + "test_repository_1");
   18.69 +            System.setProperty("org.netbeans.mdr.persistence.Dir", System.getProperty("work.dir") + "/test_repository_1");
   18.70              System.setProperty("org.netbeans.mdr.storagemodel.StorageFactoryClassName",
   18.71              "org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeFactory");
   18.72 -            System.setProperty("org.openide.util.Lookup", "org.netbeans.mdr.test.MDRTestLookup");
   18.73 -            System.setProperty("org.netbeans.mdr.SaveStorageOnExit", "true");
   18.74          }
   18.75          
   18.76          repository = ((MDRManager) Lookup.getDefault().lookup(MDRManager.class)).getDefaultRepository();
   18.77 @@ -144,7 +144,14 @@
   18.78              fail ("MOF package not found.");        
   18.79      }
   18.80      
   18.81 +    protected static File getFile(String fileName) {
   18.82 +        return new File(System.getProperty("work.dir") + '/' + fileName);
   18.83 +    }
   18.84 +    
   18.85      protected void tearDown() {        
   18.86      }
   18.87      
   18.88 +    protected void log(String message) {
   18.89 +        System.err.println(message);
   18.90 +    }
   18.91  }
    19.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestExtentEvents.java	Thu Jun 17 14:48:05 2004 +0000
    19.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestExtentEvents.java	Sun Jun 20 15:24:26 2004 +0000
    19.3 @@ -12,7 +12,6 @@
    19.4  import java.util.Iterator;
    19.5  import java.util.LinkedList;
    19.6  import junit.framework.*;
    19.7 -import org.netbeans.junit.*;
    19.8  
    19.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   19.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    20.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestExtentPreEvents.java	Thu Jun 17 14:48:05 2004 +0000
    20.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestExtentPreEvents.java	Sun Jun 20 15:24:26 2004 +0000
    20.3 @@ -8,7 +8,6 @@
    20.4  package org.netbeans.mdr.test;
    20.5  
    20.6  import junit.framework.*;
    20.7 -import org.netbeans.junit.*;
    20.8  
    20.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   20.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    21.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestInstanceEvents.java	Thu Jun 17 14:48:05 2004 +0000
    21.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestInstanceEvents.java	Sun Jun 20 15:24:26 2004 +0000
    21.3 @@ -11,7 +11,6 @@
    21.4  import java.util.Collection;
    21.5  
    21.6  import junit.framework.*;
    21.7 -import org.netbeans.junit.*;
    21.8  
    21.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   21.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    22.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestInstancePreEvents.java	Thu Jun 17 14:48:05 2004 +0000
    22.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MDRTestInstancePreEvents.java	Sun Jun 20 15:24:26 2004 +0000
    22.3 @@ -11,7 +11,6 @@
    22.4  import java.util.Collection;
    22.5  
    22.6  import junit.framework.*;
    22.7 -import org.netbeans.junit.*;
    22.8  
    22.9  import org.netbeans.mdr.handlers.BaseObjectHandler;
   22.10  import org.netbeans.mdr.NBMDRepositoryImpl;
    23.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MultiAttrTest.java	Thu Jun 17 14:48:05 2004 +0000
    23.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MultiAttrTest.java	Sun Jun 20 15:24:26 2004 +0000
    23.3 @@ -18,10 +18,10 @@
    23.4  import java.net.*;
    23.5  
    23.6  import junit.extensions.*;
    23.7 +import junit.framework.*;
    23.8  
    23.9  import org.netbeans.api.mdr.*;
   23.10  import org.openide.util.Lookup;
   23.11 -import org.netbeans.junit.*;
   23.12  
   23.13  import org.netbeans.mdr.util.*;
   23.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   23.15 @@ -44,11 +44,11 @@
   23.16          junit.textui.TestRunner.run (suite ());
   23.17      }
   23.18      
   23.19 -    public static NbTest suite () {
   23.20 -        NbTestSuite suite = new NbTestSuite ();
   23.21 +    public static Test suite () {
   23.22 +        TestSuite suite = new TestSuite ();
   23.23          suite.addTestSuite (MultiAttrTest.class);
   23.24          
   23.25 -        NbTestSetup setup = new NbTestSetup (suite) {
   23.26 +        TestSetup setup = new TestSetup (suite) {
   23.27              public void setUp () {
   23.28              }
   23.29              public void tearDown () {
    24.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/MultivaluedIndexTest.java	Thu Jun 17 14:48:05 2004 +0000
    24.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/MultivaluedIndexTest.java	Sun Jun 20 15:24:26 2004 +0000
    24.3 @@ -18,10 +18,10 @@
    24.4  import java.net.*;
    24.5  
    24.6  import junit.extensions.*;
    24.7 +import junit.framework.*;
    24.8  
    24.9  import org.netbeans.api.mdr.*;
   24.10  import org.openide.util.Lookup;
   24.11 -import org.netbeans.junit.*;
   24.12  
   24.13  import org.netbeans.mdr.util.*;
   24.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   24.15 @@ -50,11 +50,11 @@
   24.16          junit.textui.TestRunner.run (suite ());
   24.17      }
   24.18      
   24.19 -    public static NbTest suite () {
   24.20 -        NbTestSuite suite = new NbTestSuite ();
   24.21 +    public static Test suite () {
   24.22 +        TestSuite suite = new TestSuite ();
   24.23          suite.addTestSuite (MultivaluedIndexTest.class);
   24.24          
   24.25 -        NbTestSetup setup = new NbTestSetup (suite) {
   24.26 +        TestSetup setup = new TestSetup (suite) {
   24.27              public void setUp () {
   24.28  //                org.netbeans.mdr.handlers.BaseObjectHandler.setDefaultClassLoader (this.getClass ().getClassLoader ());
   24.29              }
    25.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/PackageInheritanceTest.java	Thu Jun 17 14:48:05 2004 +0000
    25.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/PackageInheritanceTest.java	Sun Jun 20 15:24:26 2004 +0000
    25.3 @@ -18,10 +18,10 @@
    25.4  import java.net.*;
    25.5  
    25.6  import junit.extensions.*;
    25.7 +import junit.framework.*;
    25.8  
    25.9  import org.netbeans.api.mdr.*;
   25.10  import org.openide.util.Lookup;
   25.11 -import org.netbeans.junit.*;
   25.12  
   25.13  import org.netbeans.mdr.util.*;
   25.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   25.15 @@ -47,11 +47,11 @@
   25.16          junit.textui.TestRunner.run (suite ());
   25.17      }
   25.18      
   25.19 -    public static NbTest suite () {
   25.20 -        NbTestSuite suite = new NbTestSuite ();
   25.21 +    public static Test suite () {
   25.22 +        TestSuite suite = new TestSuite ();
   25.23          suite.addTestSuite (PackageInheritanceTest.class);
   25.24          
   25.25 -        NbTestSetup setup = new NbTestSetup (suite) {
   25.26 +        TestSetup setup = new TestSetup (suite) {
   25.27              public void setUp () {
   25.28  //                org.netbeans.mdr.handlers.BaseObjectHandler.setDefaultClassLoader (this.getClass ().getClassLoader ());
   25.29              }
    26.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/QueryByPrefixTest.java	Thu Jun 17 14:48:05 2004 +0000
    26.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/QueryByPrefixTest.java	Sun Jun 20 15:24:26 2004 +0000
    26.3 @@ -18,10 +18,10 @@
    26.4  import java.net.*;
    26.5  
    26.6  import junit.extensions.*;
    26.7 +import junit.framework.*;
    26.8  
    26.9  import org.netbeans.api.mdr.*;
   26.10  import org.openide.util.Lookup;
   26.11 -import org.netbeans.junit.*;
   26.12  
   26.13  import org.netbeans.mdr.util.*;
   26.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   26.15 @@ -50,11 +50,11 @@
   26.16          junit.textui.TestRunner.run (suite ());
   26.17      }
   26.18      
   26.19 -    public static NbTest suite () {
   26.20 -        NbTestSuite suite = new NbTestSuite ();
   26.21 +    public static Test suite () {
   26.22 +        TestSuite suite = new TestSuite ();
   26.23          suite.addTestSuite (QueryByPrefixTest.class);
   26.24          
   26.25 -        NbTestSetup setup = new NbTestSetup (suite) {
   26.26 +        TestSetup setup = new TestSetup (suite) {
   26.27              public void setUp () {
   26.28              }
   26.29              public void tearDown () {
    27.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/StaticFeaturesTest.java	Thu Jun 17 14:48:05 2004 +0000
    27.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/StaticFeaturesTest.java	Sun Jun 20 15:24:26 2004 +0000
    27.3 @@ -18,10 +18,10 @@
    27.4  import java.net.*;
    27.5  
    27.6  import junit.extensions.*;
    27.7 +import junit.framework.*;
    27.8  
    27.9  import org.netbeans.api.mdr.*;
   27.10  import org.openide.util.Lookup;
   27.11 -import org.netbeans.junit.*;
   27.12  
   27.13  import org.netbeans.mdr.util.*;
   27.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   27.15 @@ -46,11 +46,11 @@
   27.16          junit.textui.TestRunner.run (suite ());
   27.17      }
   27.18      
   27.19 -    public static NbTest suite () {
   27.20 -        NbTestSuite suite = new NbTestSuite ();
   27.21 +    public static Test suite () {
   27.22 +        TestSuite suite = new TestSuite ();
   27.23          suite.addTestSuite (StaticFeaturesTest.class);
   27.24          
   27.25 -        NbTestSetup setup = new NbTestSetup (suite) {
   27.26 +        TestSetup setup = new TestSetup (suite) {
   27.27              public void setUp () {
   27.28              }
   27.29              public void tearDown () {
    28.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/TransactionTest.java	Thu Jun 17 14:48:05 2004 +0000
    28.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/TransactionTest.java	Sun Jun 20 15:24:26 2004 +0000
    28.3 @@ -18,10 +18,10 @@
    28.4  import java.net.*;
    28.5  
    28.6  import junit.extensions.*;
    28.7 +import junit.framework.*;
    28.8  
    28.9  import org.netbeans.api.mdr.*;
   28.10  import org.openide.util.Lookup;
   28.11 -import org.netbeans.junit.*;
   28.12  
   28.13  import org.netbeans.mdr.util.*;
   28.14  import org.netbeans.mdr.NBMDRepositoryImpl;
   28.15 @@ -48,11 +48,11 @@
   28.16          junit.textui.TestRunner.run (suite ());
   28.17      }
   28.18      
   28.19 -    public static NbTest suite () {
   28.20 -        NbTestSuite suite = new NbTestSuite ();
   28.21 +    public static Test suite () {
   28.22 +        TestSuite suite = new TestSuite ();
   28.23          suite.addTestSuite (TransactionTest.class);
   28.24          
   28.25 -        NbTestSetup setup = new NbTestSetup (suite) {
   28.26 +        TestSetup setup = new TestSetup (suite) {
   28.27              public void setUp () {
   28.28  //                org.netbeans.mdr.handlers.BaseObjectHandler.setDefaultClassLoader (this.getClass ().getClassLoader ());
   28.29              }
    29.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/TransientTest.java	Thu Jun 17 14:48:05 2004 +0000
    29.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/TransientTest.java	Sun Jun 20 15:24:26 2004 +0000
    29.3 @@ -11,7 +11,7 @@
    29.4  import javax.jmi.reflect.*;
    29.5  import javax.jmi.model.*;
    29.6  import junit.extensions.*;
    29.7 -import org.netbeans.junit.*;
    29.8 +import junit.framework.*;
    29.9  /**
   29.10   *
   29.11   * @author  tz97951
   29.12 @@ -197,10 +197,10 @@
   29.13      
   29.14      
   29.15      
   29.16 -    public static NbTest suite() {
   29.17 -        NbTestSuite suite = new NbTestSuite();
   29.18 +    public static Test suite() {
   29.19 +        TestSuite suite = new TestSuite();
   29.20          suite.addTestSuite(TransientTest.class);
   29.21 -        NbTestSetup setup = new NbTestSetup(suite) {
   29.22 +        TestSetup setup = new TestSetup(suite) {
   29.23              public void setUp() {
   29.24              }
   29.25              
    30.1 --- a/mdr/test/unit/src/org/netbeans/mdr/test/UniqueIndexTest.java	Thu Jun 17 14:48:05 2004 +0000
    30.2 +++ b/mdr/test/unit/src/org/netbeans/mdr/test/UniqueIndexTest.java	Sun Jun 20 15:24:26 2004 +0000
    30.3 @@ -16,9 +16,9 @@
    30.4  import java.util.*;
    30.5  
    30.6  import junit.extensions.*;
    30.7 +import junit.framework.*;
    30.8  
    30.9  import org.openide.util.Lookup;
   30.10 -import org.netbeans.junit.*;
   30.11  
   30.12  import org.netbeans.mdr.util.*;
   30.13  import org.netbeans.mdr.NBMDRepositoryImpl;
   30.14 @@ -45,11 +45,11 @@
   30.15          junit.textui.TestRunner.run (suite ());
   30.16      }
   30.17      
   30.18 -    public static NbTest suite () {
   30.19 -        NbTestSuite suite = new NbTestSuite ();
   30.20 +    public static Test suite () {
   30.21 +        TestSuite suite = new TestSuite ();
   30.22          suite.addTestSuite (UniqueIndexTest.class);
   30.23          
   30.24 -        NbTestSetup setup = new NbTestSetup (suite) {
   30.25 +        TestSetup setup = new TestSetup (suite) {
   30.26              public void setUp () {
   30.27  //                org.netbeans.mdr.handlers.BaseObjectHandler.setDefaultClassLoader (this.getClass ().getClassLoader ());
   30.28              }