Skip to content
Commits on Source (5)
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ie.wombat.jbdiff.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
#Tue Dec 18 11:44:16 EST 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.source=1.3
#Thu Nov 01 14:26:02 CET 2007
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JBDiff Test Plug-in
Bundle-SymbolicName: ie.wombat.jbdiff.test
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: ie.wombat.jbdiff.test.Activator
Import-Package: org.osgi.framework;version="1.3.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4
Require-Bundle: org.junit,
ie.wombat.jbdiff
Automatic-Module-Name: ie.wombat.jbdiff.test
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>org.eclipse.equinox.p2-parent</artifactId>
<groupId>org.eclipse</groupId>
<version>4.8.0-SNAPSHOT</version>
<relativePath>../../org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-parent</relativePath>
</parent>
<groupId>ie.wombat.jbdiff</groupId>
<artifactId>ie.wombat.jbdiff.test</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
</project>
/*******************************************************************************
* Copyright (c) 2007 compeople AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* compeople AG (Stefan Liebig) - initial API and implementation
*******************************************************************************/
package ie.wombat.jbdiff.test;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
/*
* (non-Javadoc)
*
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
Activator.context = context;
}
/*
* (non-Javadoc)
*
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
Activator.context = null;
}
/**
* @return the context
*/
public static BundleContext getContext() {
return context;
}
}
/*******************************************************************************
* Copyright (c) 2007 compeople AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* compeople AG (Stefan Liebig) - initial API and implementation
*******************************************************************************/
package ie.wombat.jbdiff.test;
import ie.wombat.jbdiff.JBDiff;
import ie.wombat.jbdiff.JBPatch;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import junit.framework.TestCase;
public class DiffPatchTest extends TestCase {
public void testNullData() throws Exception {
bench("null.data", "null.data");
}
public void testOneData() throws Exception {
bench("one.data", "one.data");
}
public void testOneHundredData() throws Exception {
bench("onehundred.data", "onehundred.data");
}
public void testOneHundredXData() throws Exception {
bench("onehundred.data", "onehundredX.data");
}
public void testOneXHundredXData() throws Exception {
bench("onehundred.data", "oneXhundredX.data");
}
public void testPdeCoreJar() throws Exception {
bench("org.eclipse.pde.core_3.2.jar", "org.eclipse.pde.core_3.3.jar");
}
public void testEclipse() throws Exception {
bench("eclipse-3.2.exe", "eclipse-3.3.exe");
}
private void bench(String resource1, String resource2) throws Exception {
byte[] oldData = getTestData(resource1);
byte[] newData = getTestData(resource2);
System.out.println(resource1 + "(" + (oldData.length / 1024)
+ " kb) -> " + resource2 + "(" + (newData.length / 1024)
+ " kb)");
diffAndPatchJBDiff(oldData, newData);
System.out.println("");
}
/**
* @param resource1
* @param resource2
* @throws IOException
*/
private void diffAndPatchJBDiff(byte[] oldData, byte[] newData)
throws IOException {
try {
long start = System.currentTimeMillis();
byte[] diff = JBDiff.bsdiff(oldData, oldData.length, newData,
newData.length);
long diffEnd = System.currentTimeMillis();
byte[] patch = JBPatch.bspatch(oldData, oldData.length, diff);
long patchEnd = System.currentTimeMillis();
System.out.println("JBDiff: Size= " + diff.length + " b ("
+ diff.length / 1024 + " kb), Diffing " + (diffEnd - start)
+ " ms, Patching: " + (patchEnd - diffEnd) + " ms");
assertTrue(Arrays.equals(newData, patch));
} catch (RuntimeException re) {
System.err.println("JBDiff: error: " + re.getMessage());
}
}
private static byte[] getTestData(String name) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
InputStream input = new BufferedInputStream(Activator.getContext()
.getBundle().getEntry("testData/" + name).openStream());
int r;
while ((r = input.read()) != -1) {
out.write(r);
}
input.close();
out.close();
return out.toByteArray();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ie.wombat.jbdiff</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
#Wed Nov 14 12:49:16 EST 2007
eclipse.preferences.version=1
encoding/<project>=ISO-8859-1
#Tue Dec 18 11:43:17 EST 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.source=1.3
#Thu Nov 01 14:00:53 CET 2007
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Jbdiff Plug-in
Bundle-SymbolicName: ie.wombat.jbdiff
Bundle-Version: 0.1.0.qualifier
Import-Package: org.osgi.framework;version="1.3.0"
Bundle-ActivationPolicy: lazy
Export-Package: ie.wombat.jbdiff
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4
Automatic-Module-Name: ie.wombat.jbdiff
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h3>About This Content</h3>
<p>June 5, 2006</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content").
Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor&rsquo;s license
that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
<h3>Third Party Content</h3>
<p>The Content includes items that have been sourced from third parties as set out below. If you
did not receive this Content directly from the Eclipse Foundation, the following is provided
for informational purposes only, and you should look to the Redistributor&rsquo;s license for
terms and conditions of use.</p>
<em>
<h4>ie.wombat.jbdiff&nbsp;</h4>
<p>This library version is based on JBDiff (<a href="http://www.wombat.ie/software/jbdiff/downloads/">http://www.wombat.ie/software/jbdiff/downloads/</a>) which is also available under the OSI Approved :: BSD License (original) <a href="http://www.opensource.org/licenses/bsd-license.html">http://www.opensource.org/licenses/bsd-license.html</a><br />
</p>
</em>
</body>
</html>
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>org.eclipse.equinox.p2-parent</artifactId>
<groupId>org.eclipse</groupId>
<version>4.8.0-SNAPSHOT</version>
<relativePath>../../org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-parent</relativePath>
</parent>
<groupId>ie.wombat.jbdiff</groupId>
<artifactId>ie.wombat.jbdiff</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>