Author: scabanovich
Date: 2010-10-25 06:02:48 -0400 (Mon, 25 Oct 2010)
New Revision: 26022
Added:
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.classpath
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.project
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/lib/
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/lib/standard.jar
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/JarAccessTest.java
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java
Log:
JBIDE-7399
https://jira.jboss.org/browse/JBIDE-7399
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.classpath
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.classpath 2010-10-25
10:02:48 UTC (rev 26022)
@@ -0,0 +1,7 @@
+<?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="lib" path="lib/standard.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.project
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.project 2010-10-25
10:02:48 UTC (rev 26022)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>TestJar</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/lib/standard.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.test/projects/TestJar/lib/standard.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java 2010-10-25
09:57:05 UTC (rev 26021)
+++
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/CommonModelAllTests.java 2010-10-25
10:02:48 UTC (rev 26022)
@@ -31,6 +31,7 @@
suite.addTestSuite(DeveloperExceptionTest.class);
suite.addTestSuite(XModelTransferBufferTest.class);
suite.addTestSuite(PropertiesLoaderTest.class);
+ suite.addTestSuite(JarAccessTest.class);
return suite;
}
}
Added:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/JarAccessTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/JarAccessTest.java
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/JarAccessTest.java 2010-10-25
10:02:48 UTC (rev 26022)
@@ -0,0 +1,45 @@
+package org.jboss.tools.common.model.test;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.model.filesystems.impl.TestJarAccess;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+import junit.framework.TestCase;
+
+public class JarAccessTest extends TestCase {
+ static String BUNDLE_NAME = "org.jboss.tools.common.model.test";
+ TestProjectProvider provider1 = null;
+ IProject project1 = null;
+
+ public void setUp() throws Exception {
+ provider1 = new TestProjectProvider(BUNDLE_NAME, null, "TestJar", true);
+ project1 = provider1.getProject();
+
+ project1.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+ JobUtils.waitForIdle();
+ }
+
+ public void testJarAccess() throws Exception {
+ IFile jar = project1.getFile(new Path("lib/standard.jar"));
+ assertTrue(jar.exists());
+ String file = jar.getLocation().toFile().getAbsolutePath();
+ assertTrue(new File(file).isFile());
+ TestJarAccess test = new TestJarAccess(file);
+ test.runAll();
+ List<String> errors = test.getErrors();
+ String message = "There were errors:";
+ for (String error: errors) {
+ message += "\n\t" + error;
+ }
+ assertTrue(message, errors.isEmpty());
+ }
+}
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/JarAccessTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain