1.1 --- a/samples/individualsamples/build.xml Sat Jun 14 09:57:12 2008 +0200
1.2 +++ b/samples/individualsamples/build.xml Sat Jun 14 09:57:15 2008 +0200
1.3 @@ -2,8 +2,8 @@
1.4 <!-- You may freely edit this file. See commented blocks below for -->
1.5 <!-- some examples of how to customize the build. -->
1.6 <!-- (If you delete it and reopen the project it will be recreated.) -->
1.7 -<project name="single" default="default" basedir=".">
1.8 - <description>Builds, tests, and runs the project single.</description>
1.9 +<project name="individualsamples" default="default" basedir=".">
1.10 + <description>Builds, tests, and runs the project individualsamples.</description>
1.11 <import file="nbproject/build-impl.xml"/>
1.12 <!--
1.13
1.14 @@ -54,7 +54,7 @@
1.15
1.16 An example of overriding the target for project execution could look like this:
1.17
1.18 - <target name="run" depends="single-impl.jar">
1.19 + <target name="run" depends="individualsamples-impl.jar">
1.20 <exec dir="bin" executable="launcher.exe">
1.21 <arg file="${dist.jar}"/>
1.22 </exec>
2.1 --- a/samples/individualsamples/nbproject/build-impl.xml Sat Jun 14 09:57:12 2008 +0200
2.2 +++ b/samples/individualsamples/nbproject/build-impl.xml Sat Jun 14 09:57:15 2008 +0200
2.3 @@ -19,7 +19,7 @@
2.4 - cleanup
2.5
2.6 -->
2.7 -<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="single-impl">
2.8 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="individualsamples-impl">
2.9 <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
2.10 <!--
2.11 ======================
3.1 --- a/samples/individualsamples/nbproject/genfiles.properties Sat Jun 14 09:57:12 2008 +0200
3.2 +++ b/samples/individualsamples/nbproject/genfiles.properties Sat Jun 14 09:57:15 2008 +0200
3.3 @@ -1,8 +1,8 @@
3.4 -build.xml.data.CRC32=779207c8
3.5 -build.xml.script.CRC32=d568c301
3.6 +build.xml.data.CRC32=b3e64e2a
3.7 +build.xml.script.CRC32=fc7f81ad
3.8 build.xml.stylesheet.CRC32=be360661
3.9 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
3.10 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
3.11 -nbproject/build-impl.xml.data.CRC32=779207c8
3.12 -nbproject/build-impl.xml.script.CRC32=9a0410b5
3.13 +nbproject/build-impl.xml.data.CRC32=b3e64e2a
3.14 +nbproject/build-impl.xml.script.CRC32=330c4cd3
3.15 nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
4.1 --- a/samples/individualsamples/nbproject/project.properties Sat Jun 14 09:57:12 2008 +0200
4.2 +++ b/samples/individualsamples/nbproject/project.properties Sat Jun 14 09:57:15 2008 +0200
4.3 @@ -19,6 +19,9 @@
4.4 dist.javadoc.dir=${dist.dir}/javadoc
4.5 excludes=
4.6 file.reference.junit-4.4.jar=../libs/dist/junit-4.4.jar
4.7 +file.reference.org-netbeans-insane.jar=../libs/dist/org-netbeans-insane.jar
4.8 +file.reference.org-netbeans-modules-nbjunit.jar=../libs/dist/org-netbeans-modules-nbjunit.jar
4.9 +file.reference.org-openide-filesystems.jar=../libs/dist/org-openide-filesystems.jar
4.10 includes=**
4.11 jar.compress=false
4.12 javac.classpath=
4.13 @@ -30,7 +33,10 @@
4.14 javac.test.classpath=\
4.15 ${javac.classpath}:\
4.16 ${build.classes.dir}:\
4.17 - ${file.reference.junit-4.4.jar}
4.18 + ${file.reference.junit-4.4.jar}:\
4.19 + ${file.reference.org-netbeans-insane.jar}:\
4.20 + ${file.reference.org-netbeans-modules-nbjunit.jar}:\
4.21 + ${file.reference.org-openide-filesystems.jar}
4.22 javadoc.additionalparam=
4.23 javadoc.author=false
4.24 javadoc.encoding=${source.encoding}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/samples/individualsamples/src/org/apidesign/samples/Synchronization.java Sat Jun 14 09:57:15 2008 +0200
5.3 @@ -0,0 +1,13 @@
5.4 +package org.apidesign.samples;
5.5 +
5.6 +public class Synchronization {
5.7 + private final Object anObject = new Object();
5.8 +
5.9 + public void methodUsingSynchronizedBlock() {
5.10 + // BEGIN: synchronize.anObject
5.11 + synchronized (anObject) {
5.12 + // do the critical stuff
5.13 + }
5.14 + // END: synchronize.anObject
5.15 + }
5.16 +}
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/samples/individualsamples/test/org/apidesign/samples/FileSystemLikeTCK.java Sat Jun 14 09:57:15 2008 +0200
6.3 @@ -0,0 +1,75 @@
6.4 +package org.apidesign.samples;
6.5 +
6.6 +import java.io.File;
6.7 +import java.io.IOException;
6.8 +import junit.framework.Test;
6.9 +import org.netbeans.junit.NbTestCase;
6.10 +import org.netbeans.junit.NbTestSetup;
6.11 +import org.netbeans.junit.NbTestSuite;
6.12 +import org.openide.filesystems.FileSystem;
6.13 +import org.openide.filesystems.JarFileSystem;
6.14 +
6.15 +public class FileSystemLikeTCK {
6.16 + // BEGIN: tck.factory
6.17 + public static abstract class FileSystemFactoryHid extends NbTestSetup {
6.18 + public FileSystemFactoryHid(Test testToDecorate) {
6.19 + super(testToDecorate);
6.20 + }
6.21 +
6.22 + protected abstract FileSystem createFileSystem(
6.23 + String testName, String[] resources
6.24 + ) throws Exception;
6.25 + protected abstract void destroyFileSystem(
6.26 + String testName
6.27 + ) throws IOException;
6.28 + }
6.29 + // END: tck.factory
6.30 +
6.31 +
6.32 + // BEGIN: tck.setup
6.33 + public static class JarFileSystemTest extends FileSystemFactoryHid {
6.34 + public JarFileSystemTest(Test testToDecorate) {
6.35 + super(testToDecorate);
6.36 + }
6.37 +
6.38 + public static Test suite() {
6.39 + NbTestSuite suite = new NbTestSuite();
6.40 + suite.addTestSuite(RepositoryTestHid.class);
6.41 + suite.addTestSuite(FileSystemTestHid.class);
6.42 + suite.addTestSuite(FileObjectTestHid.class);
6.43 + return new JarFileSystemTest(suite);
6.44 + }
6.45 +
6.46 + protected void destroyFileSystem(String testName) throws IOException {
6.47 + }
6.48 +
6.49 + protected FileSystem createFileSystem(String testName, String[] resources) throws Exception {
6.50 + JarFileSystem fs = new JarFileSystem();
6.51 + fs.setJarFile(createJarFile(testName, resources));
6.52 + return fs;
6.53 + }
6.54 + }
6.55 + // END: tck.setup
6.56 +
6.57 + static File createJarFile(String name, String[] resources) {
6.58 + return null;
6.59 + }
6.60 +
6.61 + public static final class RepositoryTestHid extends NbTestCase {
6.62 + public RepositoryTestHid(String name) {
6.63 + super(name);
6.64 + }
6.65 +
6.66 + }
6.67 + public static final class FileSystemTestHid extends NbTestCase {
6.68 + public FileSystemTestHid(String name) {
6.69 + super(name);
6.70 + }
6.71 +
6.72 + }
6.73 + public static final class FileObjectTestHid extends NbTestCase {
6.74 + public FileObjectTestHid(String name) {
6.75 + super(name);
6.76 + }
6.77 + }
6.78 +}