Skip to content

Commit

Permalink
Remove ZIP files as much as possible
Browse files Browse the repository at this point in the history
- remove tests from websvc.saas.codegen that rely on undonated code
  from Oracle and thus won't work
- remove tests from projectimport.eclipse.core that rely on undonated
  files and thus won't work. The contained ZIP does not need to be a ZIP
  and is stored is stored in exploded form
- biglist.zip is not a zip file, but a gzipped txt file
- Test files for the xml.schema.model tests are stored in exploded form
  in the archive and the ZIP files are build at test build time
- The pp.zip files in mercurial, git and subversion are build at test
  build time
- the SvnWcParserData.zip file holds multiple working copies and can't
  be simply replaced. It is renamed to make it easier to understand what
  is contained in the file
  • Loading branch information
matthiasblaesing committed Oct 16, 2021
1 parent 6ae59da commit 5ffd3ed
Show file tree
Hide file tree
Showing 118 changed files with 3,811 additions and 974 deletions.
6 changes: 6 additions & 0 deletions ide/git/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@
<project basedir="." default="build" name="ide/git">
<description>Builds, tests, and runs the project org.netbeans.modules.git</description>
<import file="../../nbbuild/templates/projectized.xml"/>

<target name="do-qa-functional-test-build" depends="projectized.do-qa-functional-test-build">
<zip destfile="${build.test.qa-functional.dir}/data/files/pp.zip">
<zipfileset dir="${build.test.qa-functional.dir}/data/files" includes="pp.TIFF"/>
</zip>
</target>
</project>
Binary file removed ide/git/test/qa-functional/data/files/pp.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public final class TestKit {
private final static String WORK_PATH = "work";
public static final String PROJECT_NAME = "JavaApp";
public static final String PROJECT_TYPE = "Java Application";
public static final String PROJECT_CATEGORY = "Java";
public static final String PROJECT_CATEGORY = "Java with Ant";
public static final String CLONE_SUF_0 = "_clone0";
public static final String CLONE_SUF_1 = "_clone1";
public final static String LOGGER_NAME = "org.netbeans.modules.git.t9y";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.io.FileOutputStream;
import java.util.StringTokenizer;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import org.netbeans.jellytools.JellyTestCase;
import org.netbeans.jellytools.MainWindowOperator;
import org.netbeans.jellytools.NbDialogOperator;
Expand All @@ -48,7 +47,7 @@ public class VCSClassLoadingTest extends JellyTestCase {
private static final String SEPARATOR = "|";
private static final String FILE = "vcswhitelist_";
private static final String TXT = ".txt";
private static final String ZIP = ".zip";
private static final String TXT_GZ = ".txt.gz";
private static final String BIGLIST = "biglist";
private static final String[] LIST = {HG.toLowerCase(),CVS.toLowerCase(),SVN.toLowerCase(),GIT.toLowerCase()};
private static final String FS = File.separator;
Expand Down Expand Up @@ -190,39 +189,19 @@ public void testTraverseGitMenu() throws Exception {
testWhitelist();
}

@SuppressWarnings("NestedAssignment")
private static void unzipBigList() {
try {
FileInputStream inputStream = new FileInputStream(PATH+BIGLIST+ZIP);
try (FileInputStream inputStream = new FileInputStream(PATH+BIGLIST+TXT_GZ);
GZIPInputStream gzipInput = new GZIPInputStream(inputStream);
FileOutputStream outputStream = new FileOutputStream(PATH+BIGLIST+TXT);
FileOutputStream outputStream = new FileOutputStream(PATH+BIGLIST+TXT)) {
int ch;
while ((ch = gzipInput.read()) != -1) {
outputStream.write(ch);
}
inputStream.close();
gzipInput.close();
outputStream.close();
}
catch (Exception err)
{
System.out.println("An error occurred - while unzipping "+PATH+BIGLIST+ZIP+" :\n" + err.getMessage());
}
}

private static void zipBigList(String pathToBigList) {
try {
FileOutputStream fileOutputStream = new FileOutputStream(PATH+BIGLIST+ZIP);
GZIPOutputStream zipOutputStream = new GZIPOutputStream(fileOutputStream);
FileInputStream fileInputStream = new FileInputStream(PATH+BIGLIST+TXT);
int ch;
while ((ch = fileInputStream.read()) != -1) {
zipOutputStream.write(ch);
}
fileInputStream.close();
zipOutputStream.close();
}
catch (Exception err) {
System.out.println("An error occurred - while zipping "+PATH+BIGLIST+TXT+" :\n" + err.getMessage());
System.out.println("An error occurred - while unzipping "+PATH+BIGLIST+TXT_GZ+" :\n" + err.getMessage());
}
}
}
14 changes: 14 additions & 0 deletions ide/mercurial/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,18 @@
<project basedir="." default="build" name="ide/mercurial">
<description>Builds, tests, and runs the project org.netbeans.modules.mercurial</description>
<import file="../../nbbuild/templates/projectized.xml"/>

<target name="do-qa-functional-test-build" depends="projectized.do-qa-functional-test-build" unless="${disable.qa-functional.tests}">
<mkdir dir="${build.test.qa-functional.dir}/data/files" />
<zip destfile="${build.test.qa-functional.dir}/data/files/pp.zip">
<zipfileset dir="${build.test.qa-functional.dir}/data/files" includes="pp.TIFF"/>
</zip>
<zip destfile="${build.test.qa-functional.dir}/data/JavaApp_repo.zip">
<mappedresources>
<fileset dir="${build.test.qa-functional.dir}/data/JavaApp_repo" includes="**" />
<globmapper from="*" to=".*"/>
</mappedresources>
</zip>

</target>
</project>
Binary file not shown.
4 changes: 4 additions & 0 deletions ide/mercurial/test/qa-functional/data/JavaApp_repo/hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
syntax: glob
.hgignore
*.orig
.*~
Binary file removed ide/mercurial/test/qa-functional/data/files/pp.zip
Binary file not shown.
7 changes: 6 additions & 1 deletion ide/subversion/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
<import file="../../nbbuild/templates/projectized.xml"/>
<property name="test.unit.data.dir" value="test/unit/data"/>
<property name="build.test.unit.data.dir" value="build/test/unit/data"/>
<target name="do-qa-functional-test-build" depends="projectized.do-qa-functional-test-build">
<zip destfile="${build.test.qa-functional.dir}/data/files/pp.zip">
<zipfileset dir="${build.test.qa-functional.dir}/data/files" includes="pp.TIFF"/>
</zip>
</target>
<target name="test-build-datajar">
<antcall target="projectized-common.test-preinit"/>
<mkdir dir="${build.test.unit.data.dir}/SvnWcParser"/>
<unzip src="${test.unit.data.dir}/SvnWcParserData.zip"
<unzip src="${test.unit.data.dir}/svn_workingcopy_sample_data.zip"
dest="${build.test.unit.data.dir}/SvnWcParser"/>
<zip destfile="${test.qa-functional.out.folder}/data.zip" basedir="${test.qa-functional.data.dir}"/>
</target>
Expand Down
Binary file removed ide/subversion/test/qa-functional/data/files/pp.zip
Binary file not shown.
30 changes: 30 additions & 0 deletions ide/xml.schema.model/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,34 @@
-->
<project name="ide/xml.schema.model" default="build" basedir=".">
<import file="../../nbbuild/templates/projectized.xml"/>
<target name="do-unit-test-build" depends="projectized.do-unit-test-build">
<macrodef name="package-zip-from-resources">
<attribute name="zipbasename"/>
<attribute name="prefix" default=""/>
<sequential>
<zip destfile="${build.test.unit.classes.dir}/org/netbeans/modules/xml/schema/model/resources/@{zipbasename}.zip">
<zipfileset dir="${build.test.unit.dir}/data/org/netbeans/modules/xml/schema/model/resources/@{zipbasename}" prefix="@{prefix}" includes="**"/>
</zip>
</sequential>
</macrodef>

<package-zip-from-resources zipbasename="resolve1" prefix="resolve1/" />
<package-zip-from-resources zipbasename="resolve2" prefix="resolve2/" />
<package-zip-from-resources zipbasename="resolve3" prefix="resolve3/" />
<package-zip-from-resources zipbasename="resolve4" prefix="resolve4/" />
<package-zip-from-resources zipbasename="resolve5" prefix="resolve5/" />
<package-zip-from-resources zipbasename="resolve6" prefix="resolve6/" />
<package-zip-from-resources zipbasename="resolve7" prefix="resolve7/" />
<package-zip-from-resources zipbasename="resolve8" prefix="resolve8/" />
<package-zip-from-resources zipbasename="resolve9" prefix="resolve9/" />
<package-zip-from-resources zipbasename="resolve10" prefix="resolve10/"/>
<package-zip-from-resources zipbasename="resolve11" prefix="resolve11/" />
<package-zip-from-resources zipbasename="resolve12" prefix="resolve12/" />
<package-zip-from-resources zipbasename="resolve13" prefix="resolve13/" />
<package-zip-from-resources zipbasename="resolve14" prefix="resolve14/" />
<package-zip-from-resources zipbasename="resolve15" prefix="resolve15/" />
<package-zip-from-resources zipbasename="cyclic_dependencies" prefix="cyclic_dependencies/" />
<package-zip-from-resources zipbasename="performance1" prefix="" />
<package-zip-from-resources zipbasename="performance2" prefix="" />
</target>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="cyclic_dependencies_test"
xmlns:tns="cyclic_dependencies_test"
elementFormDefault="qualified">
<xsd:include schemaLocation="B.xsd"/>
<xsd:include schemaLocation="C.xsd"/>
<xsd:complexType name="complexTypeA">
<xsd:sequence/>
</xsd:complexType>
</xsd:schema>


Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="cyclic_dependencies_test"
xmlns:tns="cyclic_dependencies_test"
elementFormDefault="qualified">
<!--xsd:include schemaLocation="C.xsd"/-->
<!--xsd:include schemaLocation="F.xsd"/-->
<xsd:element name="elemC" type="tns:complexTypeC"></xsd:element>
<xsd:element name="elemF" type="tns:complexTypeF"></xsd:element>
<xsd:complexType name="complexTypeB">
<xsd:sequence>
<xsd:element name="elementC" type="tns:complexTypeC"></xsd:element>
</xsd:sequence>
<xsd:sequence>
<xsd:element name="elementF" type="tns:complexTypeF"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>




Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="cyclic_dependencies_test"
xmlns:tns="cyclic_dependencies_test"
elementFormDefault="qualified">
<xsd:include schemaLocation="D.xsd"/>
<xsd:complexType name="complexTypeC">
<xsd:sequence/>
</xsd:complexType>
</xsd:schema>

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="cyclic_dependencies_test"
xmlns:tns="cyclic_dependencies_test"
elementFormDefault="qualified">
<xsd:include schemaLocation="A.xsd"/>
<xsd:complexType name="complexTypeD">
<xsd:sequence/>
</xsd:complexType>
</xsd:schema>

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="cyclic_dependencies_test"
xmlns:tns="cyclic_dependencies_test"
elementFormDefault="qualified">
<xsd:include schemaLocation="B.xsd"/>
<xsd:include schemaLocation="F.xsd"/>
<xsd:complexType name="complexTypeE">
<xsd:sequence/>
</xsd:complexType>
</xsd:schema>

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="cyclic_dependencies_test"
xmlns:tns="cyclic_dependencies_test"
elementFormDefault="qualified">
<xsd:include schemaLocation="C.xsd"/>
<xsd:complexType name="complexTypeF">
<xsd:sequence/>
</xsd:complexType>
</xsd:schema>

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="windows-1252"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="hl7_performance_test"
xmlns:tns="hl7_performance_test"
elementFormDefault="qualified">

<xsd:include schemaLocation="unresolvedIncludes.xsd" />

<xsd:element name="A1" type="tns:C1"/>
<xsd:element name="A2" type="tns:C2"/>
<xsd:element name="A3" type="tns:C3"/>

</xsd:schema>
Loading

0 comments on commit 5ffd3ed

Please sign in to comment.