Easter cleaning

This commit is contained in:
Willem Cazander 2025-05-07 21:46:32 +02:00
commit 9e36078b2e
1862 changed files with 270281 additions and 0 deletions

View file

@ -0,0 +1,87 @@
/*
* Copyright (c) 2004-2014, Willem Cazander
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.x4o.tool.ant.plugin;
import java.io.File;
import org.apache.tools.ant.BuildFileRule;
import org.apache.tools.ant.BuildFileTest;
/**
* X4OWriteDocTaskTest tests the doc ant task.
*
* @author Willem Cazander
* @version 1.0 Aug 23, 2012
*/
public class X4OWriteLanguageDocTaskTest extends BuildFileTest {
public void setUp() {
configureProject("src/test/resources/junit/test-write-language-doc.xml");
}
public void testEldDocCel() {
executeTarget("test-elddoc-cel");
File testDir = new File("target/test-elddoc/cel");
int files = testDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
public void testEldDocEld() {
executeTarget("test-elddoc-eld");
File testDir = new File("target/test-elddoc/eld");
int files = testDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
///assertEquals("Message was logged but should not.", getLog(), "");
//expectLog("use.message", "attribute-text");
//assertLogContaining("Nested Element 1");
}
public void testEldDocEldCustom() {
executeTarget("test-elddoc-eld-custom");
File testDir = new File("target/test-elddoc/eld-custom");
int files = testDir.listFiles().length;
assertEquals("Should created more then two files", true, files>2);
}
public void testEldDocEldVerbose() {
executeTarget("test-elddoc-cel-verbose");
assertLogContaining("Verbose:");
}
public void testFailAllMissing() {
expectBuildException("test-fail-all", "Should get exception with no attributes.");
}
public void testFailBasePath() {
expectBuildException("test-fail-destdir", "Should get exception id destdir is not set.");
}
public void testFailBasePathError() {
expectBuildException("test-fail-destdir-error", "Should get exception id destdir does not exists.");
}
public void testFailLanguage() {
expectBuildException("test-fail-language", "Should get exception id language is not set.");
}
public void testFailLanguageError() {
expectBuildException("test-fail-language-error", "Should get exception id language throws error.");
}
}

View file

@ -0,0 +1,79 @@
/*
* Copyright (c) 2004-2014, Willem Cazander
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.x4o.tool.ant.plugin;
import java.io.File;
import org.apache.tools.ant.BuildFileTest;
/**
* X4OWriteSchemaTaskTest tests the schema ant task.
*
* @author Willem Cazander
* @version 1.0 Aug 23, 2012
*/
public class X4OWriteLanguageSchemaTaskTest extends BuildFileTest {
public void setUp() {
configureProject("src/test/resources/junit/test-write-language-schema.xml");
}
public void testCelSchemaFull() {
executeTarget("test-cel-schema-full");
File testDir = new File("target/test-schemas/cel-full");
int files = testDir.listFiles().length;
assertEquals("Should created only 2 files", 2, files);
}
public void testCelSchemaSingle() {
executeTarget("test-cel-schema-single");
File testDir = new File("target/test-schemas/cel-single");
int files = testDir.listFiles().length;
assertEquals("Should created only one file", 1, files);
///assertEquals("Message was logged but should not.", getLog(), "");
//expectLog("use.message", "attribute-text");
//assertLogContaining("Nested Element 1");
}
public void testCelSchemaVerbose() {
executeTarget("test-cel-schema-verbose");
assertLogContaining("Verbose:");
}
public void testFailAllMissing() {
expectBuildException("test-fail-all", "Should get exception if no attributes are set.");
}
public void testFailBasePath() {
expectBuildException("test-fail-destdir", "Should get exception id destdir is not set.");
}
public void testFailBasePathError() {
expectBuildException("test-fail-destdir-error", "Should get exception id destdir does not exists.");
}
public void testFailLanguage() {
expectBuildException("test-fail-language", "Should get exception id language is not set.");
}
public void testFailLanguageError() {
expectBuildException("test-fail-language-error", "Should get exception id language throws error.");
}
}

View file

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004-2014, Willem Cazander
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="ant-elddoc-task" basedir="../../../..">
<property name="test.dir" value="${basedir}/target/test-elddoc/"/>
<target name="init">
<taskdef name="x4oTask" classname="org.x4o.tool.ant.plugin.X4OTask"/>
<mkdir dir="${test.dir}"/>
<mkdir dir="${test.dir}/test"/>
</target>
<target name="test-elddoc-cel" depends="init">
<mkdir dir="${test.dir}/cel"/>
<x4oTask languageName="cel" taskId="eld-doc">
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/output/path"
value="${test.dir}/cel"
/>
</x4oTask>
</target>
<target name="test-elddoc-cel-verbose" depends="init">
<mkdir dir="${test.dir}/cel-verbose"/>
<x4oTask languageName="cel" taskId="eld-doc" verbose="true">
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/output/path"
value="${test.dir}/cel-verbose"
/>
</x4oTask>
</target>
<target name="test-elddoc-eld" depends="init">
<mkdir dir="${test.dir}/eld"/>
<x4oTask languageName="eld" taskId="eld-doc">
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/output/path"
value="${test.dir}/eld"
/>
</x4oTask>
</target>
<target name="test-elddoc-eld-custom" depends="init">
<mkdir dir="${test.dir}/eld-custom"/>
<x4oTask languageName="eld" taskId="eld-doc">
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/output/path"
value="${test.dir}/eld-custom"
/>
<x4oTaskProperty
key="http://x4o.org/properties/content/output/char-tab"
value=" "
/>
<x4oTaskProperty
key="http://x4o.org/properties/content/output/comment-enable"
value="false"
/>
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/meta/stylesheet-thema"
value="jdk6"
/>
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/javadoc/link"
value="http://docs.oracle.com/javase/7/docs/api/"
/>
<!-- fixme map type property config
<x4oTaskProperty
key="http://x4o.org/properties/eld-doc/javadoc/link-offline"
value="http://www.x4o.org/apidocs/,file:///home/willemc/devv/git/x4o/x4o-driver/target/apidocs"
/>
-->
</x4oTask>
</target>
<target name="test-fail-all" depends="init">
<x4oTask/>
</target>
<target name="test-fail-destdir" depends="init">
<x4oTask languageName="cel"/>
</target>
<target name="test-fail-destdir-error" depends="init">
<x4oTask languageName="cel" destdir="${test.dir}/no-dir"/>
</target>
<target name="test-fail-language" depends="init">
<x4oTask destdir="${test.dir}/test"/>
</target>
<target name="test-fail-language-error" depends="init">
<x4oTask destdir="${test.dir}/test" languageName="cel-error"/>
</target>
</project>

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004-2014, Willem Cazander
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="ant-schema-task" basedir="../../../..">
<property name="test.dir" value="${basedir}/target/test-schemas/"/>
<target name="init">
<taskdef name="x4oTask" classname="org.x4o.tool.ant.plugin.X4OTask"/>
<mkdir dir="${test.dir}"/>
<mkdir dir="${test.dir}/test"/>
</target>
<target name="test-cel-schema-full" depends="init">
<mkdir dir="${test.dir}/cel-full"/>
<x4oTask languageName="cel" taskId="eld-xsd">
<x4oTaskProperty
key="http://x4o.org/properties/eld-xsd/output/path"
value="${test.dir}/cel-full"
/>
</x4oTask>
</target>
<target name="test-cel-schema-single" depends="init">
<mkdir dir="${test.dir}/cel-single"/>
<x4oTask languageName="cel" taskId="eld-xsd">
<x4oTaskProperty
key="http://x4o.org/properties/eld-xsd/output/path"
value="${test.dir}/cel-single"
/>
<x4oTaskProperty
key="http://x4o.org/properties/eld-xsd/filter/namespace"
value="http://cel.x4o.org/xml/ns/cel-core"
/>
</x4oTask>
</target>
<target name="test-cel-schema-verbose" depends="init">
<mkdir dir="${test.dir}/cel-single-verbose"/>
<x4oTask languageName="cel" taskId="eld-xsd" verbose="true">
<x4oTaskProperty
key="http://x4o.org/properties/eld-xsd/output/path"
value="${test.dir}/cel-single-verbose"
/>
<x4oTaskProperty
key="http://x4o.org/properties/eld-xsd/filter/namespace"
value="http://cel.x4o.org/xml/ns/cel-core"
/>
</x4oTask>
</target>
<target name="test-fail-all" depends="init">
<x4oTask/>
</target>
<target name="test-fail-destdir" depends="init">
<x4oTask languageName="cel"/>
</target>
<target name="test-fail-destdir-error" depends="init">
<x4oTask languageName="cel" destdir="${test.dir}/no-dir"/>
</target>
<target name="test-fail-language" depends="init">
<x4oTask destdir="${test.dir}/test"/>
</target>
<target name="test-fail-language-error" depends="init">
<x4oTask destdir="${test.dir}/test" languageName="eld-error"/>
</target>
</project>