JBoss Tools SVN: r6563 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-25 17:10:52 -0500 (Mon, 25 Feb 2008)
New Revision: 6563
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
Log:
logger added
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2008-02-25 21:33:55 UTC (rev 6562)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2008-02-25 22:10:52 UTC (rev 6563)
@@ -10,6 +10,7 @@
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
+import org.jboss.ide.eclipse.archives.core.model.other.internal.ArchivesWorkspaceLogger;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspacePreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariables;
@@ -39,13 +40,8 @@
ProjectUtils.addProjectNature(project);
}
- /* (non-Javadoc)
- * @see org.jboss.ide.eclipse.archives.core.ArchivesCore#createLogger()
- */
- @Override
protected IArchivesLogger createLogger() {
- // TODO Auto-generated method stub
- return null;
+ return new ArchivesWorkspaceLogger();
}
}
16 years, 3 months
JBoss Tools SVN: r6562 - in trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test: util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-25 16:33:55 -0500 (Mon, 25 Feb 2008)
New Revision: 6562
Added:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/TruezipUtilTest.java
Removed:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java
Modified:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/FileIOUtil.java
Log:
moving unit tests around
Modified: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2008-02-25 21:31:03 UTC (rev 6561)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2008-02-25 21:33:55 UTC (rev 6562)
@@ -1,6 +1,6 @@
package org.jboss.ide.eclipse.archives.test;
-import org.jboss.ide.eclipse.archives.test.xb.FileIOTest;
+import org.jboss.ide.eclipse.archives.test.util.TruezipUtilTest;
import org.jboss.ide.eclipse.archives.test.xb.MarshallUnmarshallTest;
import junit.framework.Test;
@@ -10,7 +10,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("Archives Tests");
- suite.addTestSuite(FileIOTest.class);
+ suite.addTestSuite(TruezipUtilTest.class);
suite.addTestSuite(MarshallUnmarshallTest.class);
suite.addTestSuite(ModelUtilTest.class);
Modified: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/FileIOUtil.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/FileIOUtil.java 2008-02-25 21:31:03 UTC (rev 6561)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/FileIOUtil.java 2008-02-25 21:33:55 UTC (rev 6562)
@@ -12,5 +12,4 @@
children[i].delete();
}
}
-
}
Added: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/TruezipUtilTest.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/TruezipUtilTest.java (rev 0)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/util/TruezipUtilTest.java 2008-02-25 21:33:55 UTC (rev 6562)
@@ -0,0 +1,162 @@
+package org.jboss.ide.eclipse.archives.test.util;
+
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
+import org.jboss.ide.eclipse.archives.test.ArchivesTest;
+import org.osgi.framework.Bundle;
+
+public class TruezipUtilTest extends TestCase {
+ private Bundle bundle;
+ private IPath bundlePath;
+ protected void setUp() {
+ if( bundlePath == null ) {
+ try {
+ bundle = ArchivesTest.getDefault().getBundle();
+ URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
+ bundlePath = new Path(bundleURL.getFile());
+ } catch( IOException ioe) {}
+ }
+ }
+
+ protected void tearDown() {
+ try {
+ de.schlichtherle.io.File.umount();
+ } catch( Exception e ) {}
+ FileIOUtil.clearFolder(bundlePath.append("tmp").toFile().listFiles());
+ }
+
+
+ public void testPathExists() {
+ IPath inputs = bundlePath.append("inputs");
+ assertTrue(TrueZipUtil.pathExists(bundlePath));
+ assertTrue(TrueZipUtil.pathExists(inputs));
+ assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees")));
+ assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("one.txt")));
+
+ assertFalse(TrueZipUtil.pathExists(bundlePath.append("doesNotExist")));
+ assertFalse(TrueZipUtil.pathExists(inputs.append("doesNotExist")));
+ assertFalse(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("doesNotExist.txt")));
+ }
+
+ public void testCreationAndDeletion() {
+ IPath tmpDir = bundlePath.append("tmp");
+
+ // create archives via both APIs,
+ IPath creationArchive1 = tmpDir.append("creationArchive1.jar");
+ IPath creationArchive2 = tmpDir.append("creationArchive2.zip");
+ IPath creationArchive3 = tmpDir.append("creationArchive3");
+
+ assertFalse(TrueZipUtil.pathExists(creationArchive1));
+ TrueZipUtil.createArchive(creationArchive1);
+ assertTrue(TrueZipUtil.pathExists(creationArchive1));
+ assertFalse(creationArchive1.toFile().isDirectory());
+
+ assertFalse(TrueZipUtil.pathExists(creationArchive2));
+ TrueZipUtil.createArchive(creationArchive2);
+ assertTrue(TrueZipUtil.pathExists(creationArchive2));
+ assertFalse(creationArchive2.toFile().isDirectory());
+
+ // and also create an archive with no suffix
+ assertFalse(TrueZipUtil.pathExists(creationArchive3));
+ TrueZipUtil.createArchive(creationArchive3);
+ assertTrue(TrueZipUtil.pathExists(creationArchive3));
+ assertFalse(creationArchive3.toFile().isDirectory());
+
+
+ // create folders with various names
+ IPath creationFolder1 = tmpDir.append("creationFolder1.jar");
+ IPath creationFolder2 = tmpDir.append("creationFolder2.zip");
+ IPath creationFolder3 = tmpDir.append("creationFolder3");
+
+ assertFalse(TrueZipUtil.pathExists(creationFolder1));
+ TrueZipUtil.createFolder(creationFolder1);
+ assertTrue(TrueZipUtil.pathExists(creationFolder1));
+ assertTrue(creationFolder1.toFile().isDirectory());
+
+ assertFalse(TrueZipUtil.pathExists(creationFolder2));
+ TrueZipUtil.createFolder(creationFolder2);
+ assertTrue(TrueZipUtil.pathExists(creationFolder2));
+ assertTrue(creationFolder2.toFile().isDirectory());
+
+ assertFalse(TrueZipUtil.pathExists(creationFolder3));
+ TrueZipUtil.createFolder(creationFolder3);
+ assertTrue(TrueZipUtil.pathExists(creationFolder3));
+ assertTrue(creationFolder3.toFile().isDirectory());
+
+
+ // folders and archives of all extensions work.
+ // keep one folder and one archive and add to each
+ // another folder, archive, and file
+
+ IPath archiveFolder = creationArchive1.append("folderName");
+ IPath archiveArchive = creationArchive1.append("archiveName.war");
+
+ IPath folderFolder = creationFolder1.append("folderName");
+ IPath folderArchive = creationFolder1.append("archiveName.war");
+
+
+ assertFalse(TrueZipUtil.pathExists(archiveFolder));
+ assertFalse(TrueZipUtil.pathExists(archiveArchive));
+ TrueZipUtil.createFolder(archiveFolder);
+ TrueZipUtil.createArchive(archiveArchive);
+ try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
+ assertTrue(TrueZipUtil.pathExists(archiveFolder));
+ assertTrue(TrueZipUtil.pathExists(archiveArchive));
+ assertFalse(archiveFolder.toFile().exists());
+ assertFalse(archiveArchive.toFile().exists());
+
+
+ assertFalse(TrueZipUtil.pathExists(folderFolder));
+ assertFalse(TrueZipUtil.pathExists(folderArchive));
+ TrueZipUtil.createFolder(folderFolder);
+ TrueZipUtil.createArchive(folderArchive);
+ try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
+ assertTrue(TrueZipUtil.pathExists(archiveFolder));
+ assertTrue(TrueZipUtil.pathExists(archiveArchive));
+ assertTrue(folderFolder.toFile().exists());
+ assertTrue(folderArchive.toFile().exists());
+
+ // copy a file into them
+ IPath archiveFile = creationArchive1.append("file.txt");
+ IPath folderFile = creationArchive1.append("file.txt");
+
+ String srcPath = bundlePath.append("inputs").append("fileTrees")
+ .append("flatTextFiles").append("two.txt").toOSString();
+ try {
+ assertFalse(TrueZipUtil.pathExists(archiveFile));
+ assertFalse(TrueZipUtil.pathExists(folderFile));
+ TrueZipUtil.copyFile(srcPath, archiveFile);
+ TrueZipUtil.copyFile(srcPath, folderFile);
+ assertTrue(TrueZipUtil.pathExists(archiveFile));
+ assertTrue(TrueZipUtil.pathExists(folderFile));
+ } catch( Exception e ) {
+ fail("IOException: " + e.getMessage());
+ }
+
+ de.schlichtherle.io.File f = TrueZipUtil.getFile(creationFolder1);
+ int numChildren = f.list().length;
+ assertEquals(2, numChildren);
+ TrueZipUtil.deleteEmptyChildren(f);
+ int numChildren2 = f.list().length;
+ assertEquals(0, numChildren2);
+
+ de.schlichtherle.io.File f2 = TrueZipUtil.getFile(creationArchive1);
+ TrueZipUtil.deleteAll(creationArchive1);
+ assertFalse(TrueZipUtil.pathExists(f2));
+ }
+
+ protected IPath bundleEntryToGlobalPath(String entry) {
+ try {
+ return new Path(FileLocator.toFileURL(bundle.getEntry(entry)).getFile());
+ } catch( IOException e ) {
+ return null;
+ }
+ }
+}
Deleted: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java 2008-02-25 21:31:03 UTC (rev 6561)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java 2008-02-25 21:33:55 UTC (rev 6562)
@@ -1,163 +0,0 @@
-package org.jboss.ide.eclipse.archives.test.xb;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
-import org.jboss.ide.eclipse.archives.test.ArchivesTest;
-import org.jboss.ide.eclipse.archives.test.util.FileIOUtil;
-import org.osgi.framework.Bundle;
-
-public class FileIOTest extends TestCase {
- private Bundle bundle;
- private IPath bundlePath;
- protected void setUp() {
- if( bundlePath == null ) {
- try {
- bundle = ArchivesTest.getDefault().getBundle();
- URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
- bundlePath = new Path(bundleURL.getFile());
- } catch( IOException ioe) {}
- }
- }
-
- protected void tearDown() {
- try {
- de.schlichtherle.io.File.umount();
- } catch( Exception e ) {}
- FileIOUtil.clearFolder(bundlePath.append("tmp").toFile().listFiles());
- }
-
-
- public void testPathExists() {
- IPath inputs = bundlePath.append("inputs");
- assertTrue(TrueZipUtil.pathExists(bundlePath));
- assertTrue(TrueZipUtil.pathExists(inputs));
- assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees")));
- assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("one.txt")));
-
- assertFalse(TrueZipUtil.pathExists(bundlePath.append("doesNotExist")));
- assertFalse(TrueZipUtil.pathExists(inputs.append("doesNotExist")));
- assertFalse(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("doesNotExist.txt")));
- }
-
- public void testCreationAndDeletion() {
- IPath tmpDir = bundlePath.append("tmp");
-
- // create archives via both APIs,
- IPath creationArchive1 = tmpDir.append("creationArchive1.jar");
- IPath creationArchive2 = tmpDir.append("creationArchive2.zip");
- IPath creationArchive3 = tmpDir.append("creationArchive3");
-
- assertFalse(TrueZipUtil.pathExists(creationArchive1));
- TrueZipUtil.createArchive(creationArchive1);
- assertTrue(TrueZipUtil.pathExists(creationArchive1));
- assertFalse(creationArchive1.toFile().isDirectory());
-
- assertFalse(TrueZipUtil.pathExists(creationArchive2));
- TrueZipUtil.createArchive(creationArchive2);
- assertTrue(TrueZipUtil.pathExists(creationArchive2));
- assertFalse(creationArchive2.toFile().isDirectory());
-
- // and also create an archive with no suffix
- assertFalse(TrueZipUtil.pathExists(creationArchive3));
- TrueZipUtil.createArchive(creationArchive3);
- assertTrue(TrueZipUtil.pathExists(creationArchive3));
- assertFalse(creationArchive3.toFile().isDirectory());
-
-
- // create folders with various names
- IPath creationFolder1 = tmpDir.append("creationFolder1.jar");
- IPath creationFolder2 = tmpDir.append("creationFolder2.zip");
- IPath creationFolder3 = tmpDir.append("creationFolder3");
-
- assertFalse(TrueZipUtil.pathExists(creationFolder1));
- TrueZipUtil.createFolder(creationFolder1);
- assertTrue(TrueZipUtil.pathExists(creationFolder1));
- assertTrue(creationFolder1.toFile().isDirectory());
-
- assertFalse(TrueZipUtil.pathExists(creationFolder2));
- TrueZipUtil.createFolder(creationFolder2);
- assertTrue(TrueZipUtil.pathExists(creationFolder2));
- assertTrue(creationFolder2.toFile().isDirectory());
-
- assertFalse(TrueZipUtil.pathExists(creationFolder3));
- TrueZipUtil.createFolder(creationFolder3);
- assertTrue(TrueZipUtil.pathExists(creationFolder3));
- assertTrue(creationFolder3.toFile().isDirectory());
-
-
- // folders and archives of all extensions work.
- // keep one folder and one archive and add to each
- // another folder, archive, and file
-
- IPath archiveFolder = creationArchive1.append("folderName");
- IPath archiveArchive = creationArchive1.append("archiveName.war");
-
- IPath folderFolder = creationFolder1.append("folderName");
- IPath folderArchive = creationFolder1.append("archiveName.war");
-
-
- assertFalse(TrueZipUtil.pathExists(archiveFolder));
- assertFalse(TrueZipUtil.pathExists(archiveArchive));
- TrueZipUtil.createFolder(archiveFolder);
- TrueZipUtil.createArchive(archiveArchive);
- try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
- assertTrue(TrueZipUtil.pathExists(archiveFolder));
- assertTrue(TrueZipUtil.pathExists(archiveArchive));
- assertFalse(archiveFolder.toFile().exists());
- assertFalse(archiveArchive.toFile().exists());
-
-
- assertFalse(TrueZipUtil.pathExists(folderFolder));
- assertFalse(TrueZipUtil.pathExists(folderArchive));
- TrueZipUtil.createFolder(folderFolder);
- TrueZipUtil.createArchive(folderArchive);
- try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
- assertTrue(TrueZipUtil.pathExists(archiveFolder));
- assertTrue(TrueZipUtil.pathExists(archiveArchive));
- assertTrue(folderFolder.toFile().exists());
- assertTrue(folderArchive.toFile().exists());
-
- // copy a file into them
- IPath archiveFile = creationArchive1.append("file.txt");
- IPath folderFile = creationArchive1.append("file.txt");
-
- String srcPath = bundlePath.append("inputs").append("fileTrees")
- .append("flatTextFiles").append("two.txt").toOSString();
- try {
- assertFalse(TrueZipUtil.pathExists(archiveFile));
- assertFalse(TrueZipUtil.pathExists(folderFile));
- TrueZipUtil.copyFile(srcPath, archiveFile);
- TrueZipUtil.copyFile(srcPath, folderFile);
- assertTrue(TrueZipUtil.pathExists(archiveFile));
- assertTrue(TrueZipUtil.pathExists(folderFile));
- } catch( Exception e ) {
- fail("IOException: " + e.getMessage());
- }
-
- de.schlichtherle.io.File f = TrueZipUtil.getFile(creationFolder1);
- int numChildren = f.list().length;
- assertEquals(2, numChildren);
- TrueZipUtil.deleteEmptyChildren(f);
- int numChildren2 = f.list().length;
- assertEquals(0, numChildren2);
-
- de.schlichtherle.io.File f2 = TrueZipUtil.getFile(creationArchive1);
- TrueZipUtil.deleteAll(creationArchive1);
- assertFalse(TrueZipUtil.pathExists(f2));
- }
-
- protected IPath bundleEntryToGlobalPath(String entry) {
- try {
- return new Path(FileLocator.toFileURL(bundle.getEntry(entry)).getFile());
- } catch( IOException e ) {
- return null;
- }
- }
-}
16 years, 3 months
JBoss Tools SVN: r6561 - in trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test: xb and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-25 16:31:03 -0500 (Mon, 25 Feb 2008)
New Revision: 6561
Added:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/MarshallUnmarshallTest.java
Removed:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/FileIOTest.java
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/MarshallUnmarshallTest.java
Modified:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
Log:
moving unit tests around
Modified: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2008-02-25 20:25:36 UTC (rev 6560)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2008-02-25 21:31:03 UTC (rev 6561)
@@ -1,5 +1,8 @@
package org.jboss.ide.eclipse.archives.test;
+import org.jboss.ide.eclipse.archives.test.xb.FileIOTest;
+import org.jboss.ide.eclipse.archives.test.xb.MarshallUnmarshallTest;
+
import junit.framework.Test;
import junit.framework.TestSuite;
Deleted: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/FileIOTest.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/FileIOTest.java 2008-02-25 20:25:36 UTC (rev 6560)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/FileIOTest.java 2008-02-25 21:31:03 UTC (rev 6561)
@@ -1,163 +0,0 @@
-package org.jboss.ide.eclipse.archives.test;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
-import org.jboss.ide.eclipse.archives.test.util.FileIOUtil;
-import org.osgi.framework.Bundle;
-
-public class FileIOTest extends TestCase {
- private Bundle bundle;
- private IPath bundlePath;
- protected void setUp() {
- if( bundlePath == null ) {
- try {
- bundle = ArchivesTest.getDefault().getBundle();
- URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
- bundlePath = new Path(bundleURL.getFile());
- } catch( IOException ioe) {}
- }
- }
-
- protected void tearDown() {
- try {
- de.schlichtherle.io.File.umount();
- } catch( Exception e ) {}
- FileIOUtil.clearFolder(bundlePath.append("tmp").toFile().listFiles());
- }
-
-
- public void testPathExists() {
- IPath inputs = bundlePath.append("inputs");
- assertTrue(TrueZipUtil.pathExists(bundlePath));
- assertTrue(TrueZipUtil.pathExists(inputs));
- assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees")));
- assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("one.txt")));
-
- assertFalse(TrueZipUtil.pathExists(bundlePath.append("doesNotExist")));
- assertFalse(TrueZipUtil.pathExists(inputs.append("doesNotExist")));
- assertFalse(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("doesNotExist.txt")));
- }
-
- public void testCreationAndDeletion() {
- IPath tmpDir = bundlePath.append("tmp");
-
- // create archives via both APIs,
- IPath creationArchive1 = tmpDir.append("creationArchive1.jar");
- IPath creationArchive2 = tmpDir.append("creationArchive2.zip");
- IPath creationArchive3 = tmpDir.append("creationArchive3");
-
- assertFalse(TrueZipUtil.pathExists(creationArchive1));
- TrueZipUtil.createArchive(creationArchive1);
- assertTrue(TrueZipUtil.pathExists(creationArchive1));
- assertFalse(creationArchive1.toFile().isDirectory());
-
- assertFalse(TrueZipUtil.pathExists(creationArchive2));
- TrueZipUtil.createArchive(creationArchive2);
- assertTrue(TrueZipUtil.pathExists(creationArchive2));
- assertFalse(creationArchive2.toFile().isDirectory());
-
- // and also create an archive with no suffix
- assertFalse(TrueZipUtil.pathExists(creationArchive3));
- TrueZipUtil.createArchive(creationArchive3);
- assertTrue(TrueZipUtil.pathExists(creationArchive3));
- assertFalse(creationArchive3.toFile().isDirectory());
-
-
- // create folders with various names
- IPath creationFolder1 = tmpDir.append("creationFolder1.jar");
- IPath creationFolder2 = tmpDir.append("creationFolder2.zip");
- IPath creationFolder3 = tmpDir.append("creationFolder3");
-
- assertFalse(TrueZipUtil.pathExists(creationFolder1));
- TrueZipUtil.createFolder(creationFolder1);
- assertTrue(TrueZipUtil.pathExists(creationFolder1));
- assertTrue(creationFolder1.toFile().isDirectory());
-
- assertFalse(TrueZipUtil.pathExists(creationFolder2));
- TrueZipUtil.createFolder(creationFolder2);
- assertTrue(TrueZipUtil.pathExists(creationFolder2));
- assertTrue(creationFolder2.toFile().isDirectory());
-
- assertFalse(TrueZipUtil.pathExists(creationFolder3));
- TrueZipUtil.createFolder(creationFolder3);
- assertTrue(TrueZipUtil.pathExists(creationFolder3));
- assertTrue(creationFolder3.toFile().isDirectory());
-
-
- // folders and archives of all extensions work.
- // keep one folder and one archive and add to each
- // another folder, archive, and file
-
- IPath archiveFolder = creationArchive1.append("folderName");
- IPath archiveArchive = creationArchive1.append("archiveName.war");
-
- IPath folderFolder = creationFolder1.append("folderName");
- IPath folderArchive = creationFolder1.append("archiveName.war");
-
-
- assertFalse(TrueZipUtil.pathExists(archiveFolder));
- assertFalse(TrueZipUtil.pathExists(archiveArchive));
- TrueZipUtil.createFolder(archiveFolder);
- TrueZipUtil.createArchive(archiveArchive);
- try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
- assertTrue(TrueZipUtil.pathExists(archiveFolder));
- assertTrue(TrueZipUtil.pathExists(archiveArchive));
- assertFalse(archiveFolder.toFile().exists());
- assertFalse(archiveArchive.toFile().exists());
-
-
- assertFalse(TrueZipUtil.pathExists(folderFolder));
- assertFalse(TrueZipUtil.pathExists(folderArchive));
- TrueZipUtil.createFolder(folderFolder);
- TrueZipUtil.createArchive(folderArchive);
- try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
- assertTrue(TrueZipUtil.pathExists(archiveFolder));
- assertTrue(TrueZipUtil.pathExists(archiveArchive));
- assertTrue(folderFolder.toFile().exists());
- assertTrue(folderArchive.toFile().exists());
-
- // copy a file into them
- IPath archiveFile = creationArchive1.append("file.txt");
- IPath folderFile = creationArchive1.append("file.txt");
-
- String srcPath = bundlePath.append("inputs").append("fileTrees")
- .append("flatTextFiles").append("two.txt").toOSString();
- try {
- assertFalse(TrueZipUtil.pathExists(archiveFile));
- assertFalse(TrueZipUtil.pathExists(folderFile));
- TrueZipUtil.copyFile(srcPath, archiveFile);
- TrueZipUtil.copyFile(srcPath, folderFile);
- assertTrue(TrueZipUtil.pathExists(archiveFile));
- assertTrue(TrueZipUtil.pathExists(folderFile));
- } catch( Exception e ) {
- fail("IOException: " + e.getMessage());
- }
-
- de.schlichtherle.io.File f = TrueZipUtil.getFile(creationFolder1);
- int numChildren = f.list().length;
- assertEquals(2, numChildren);
- TrueZipUtil.deleteEmptyChildren(f);
- int numChildren2 = f.list().length;
- assertEquals(0, numChildren2);
-
- de.schlichtherle.io.File f2 = TrueZipUtil.getFile(creationArchive1);
- TrueZipUtil.deleteAll(creationArchive1);
- assertFalse(TrueZipUtil.pathExists(f2));
- }
-
- protected IPath bundleEntryToGlobalPath(String entry) {
- try {
- return new Path(FileLocator.toFileURL(bundle.getEntry(entry)).getFile());
- } catch( IOException e ) {
- return null;
- }
- }
-}
Deleted: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/MarshallUnmarshallTest.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/MarshallUnmarshallTest.java 2008-02-25 20:25:36 UTC (rev 6560)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/MarshallUnmarshallTest.java 2008-02-25 21:31:03 UTC (rev 6561)
@@ -1,175 +0,0 @@
-package org.jboss.ide.eclipse.archives.test;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XMLBinding;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbFileSet;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbFolder;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackage;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackages;
-import org.jboss.ide.eclipse.archives.test.util.FileIOUtil;
-import org.osgi.framework.Bundle;
-
-public class MarshallUnmarshallTest extends TestCase {
- private Bundle bundle;
- private IPath bundlePath;
- private IPath archiveDescriptors;
- protected void setUp() {
- if( bundlePath == null ) {
- try {
- bundle = ArchivesTest.getDefault().getBundle();
- URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
- bundlePath = new Path(bundleURL.getFile());
- archiveDescriptors = bundlePath.append("inputs").append("archiveDescriptors");
- } catch( IOException ioe) {}
- }
- }
-
-
- public void tearDown() {
- FileIOUtil.clearFolder(bundlePath.append("tmp").toFile().listFiles());
- }
-
- public void testUnmarshall() {
- // unmarshall from file
- FileInputStream fis = null;
- try {
- fis = new FileInputStream(archiveDescriptors.append("descriptor1.xml").toFile());
- } catch( Exception e ) {
- fail(e.getMessage());
- }
- XbPackages packs = XMLBinding.unmarshal(fis, new NullProgressMonitor());
- assertDescriptor1Accurate(packs);
-
- // unmarshall from string
- try {
- String content = fileAsString(archiveDescriptors.append("descriptor1.xml").toFile());
- packs = XMLBinding.unmarshal(content, new NullProgressMonitor());
- assertDescriptor1Accurate(packs);
- } catch( Exception e ) {
- fail(e.getMessage());
- }
-
- }
-
- public String fileAsString(File f) throws Exception {
- FileInputStream fis = new FileInputStream(f);
- int x= fis.available();
- byte b[]= new byte[x];
- fis.read(b);
- return new String(b);
- }
-
- public void testMarshall() {
- IPath tmpFolder = bundlePath.append("tmp");
-
- XbPackages packs = new XbPackages();
- XbPackage pack1 = new XbPackage();
- pack1.setName("TestProject.jar");
- pack1.setPackageType("jar");
- pack1.setToDir("/some/external/path");
- pack1.setExploded(false);
- pack1.setInWorkspace(false);
- packs.addChild(pack1);
-
- XbPackage pack2 = new XbPackage();
- pack2.setName("TestProject2.jar");
- pack2.setPackageType("jar");
- pack2.setToDir("/SomeProject");
- pack2.setExploded(true);
- pack2.setInWorkspace(true);
- packs.addChild(pack2);
-
- XbFolder folder1 = new XbFolder();
- folder1.setName("folder");
- pack1.addChild(folder1);
-
- XbFolder folder2 = new XbFolder();
- folder2.setName("folder2");
- pack1.addChild(folder2);
-
- XbFolder inner1 = new XbFolder();
- inner1.setName("inner1");
- folder2.addChild(inner1);
-
- XbFileSet fs = new XbFileSet();
- fs.setDir("/some/global/path");
- fs.setIncludes("**/*.xml");
- fs.setInWorkspace(false);
- inner1.addChild(fs);
-
- assertDescriptor1Accurate(packs);
-
- String packsAsString = XMLBinding.serializePackages(packs, new NullProgressMonitor());
- XbPackages packsFromString = XMLBinding.unmarshal(packsAsString, new NullProgressMonitor());
- assertDescriptor1Accurate(packsFromString);
-
- try {
- OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(tmpFolder.append("marshallTest.xml").toFile()));
- XMLBinding.marshall(packs, writer, new NullProgressMonitor());
- writer.close();
-
- XbPackages packsFromFile = XMLBinding.unmarshal(new FileInputStream(tmpFolder.append("marshallTest.xml").toFile()), new NullProgressMonitor());
- assertDescriptor1Accurate(packsFromFile);
- } catch(Exception e) {
- fail(e.getMessage());
- }
-
- }
-
- void assertDescriptor1Accurate(XbPackages packs) {
- assertEquals(2, packs.getAllChildren().size());
- assertEquals(2, packs.getChildren(XbPackage.class).size());
-
- XbPackage pack1 = (XbPackage)packs.getAllChildren().get(0);
- XbPackage pack2 = (XbPackage)packs.getAllChildren().get(1);
-
- // pack 1
- assertEquals("TestProject.jar", pack1.getName());
- assertEquals("/some/external/path", pack1.getToDir());
- assertEquals("jar", pack1.getPackageType());
- assertFalse(pack1.isExploded());
- assertFalse(pack1.isInWorkspace());
- assertEquals(2, pack1.getAllChildren().size());
- assertEquals(2, pack1.getChildren(XbFolder.class).size());
-
- XbFolder folder1 = (XbFolder)pack1.getAllChildren().get(0);
- XbFolder folder2 = (XbFolder)pack1.getAllChildren().get(1);
-
- assertEquals(0, folder1.getAllChildren().size());
- assertEquals("folder", folder1.getName());
-
- assertEquals(1, folder2.getAllChildren().size());
- assertEquals(1, folder2.getChildren(XbFolder.class).size());
- assertEquals("folder2", folder2.getName());
-
- XbFolder innerFolder = (XbFolder)folder2.getAllChildren().get(0);
- assertEquals("inner1", innerFolder.getName());
- assertEquals(1, innerFolder.getAllChildren().size());
- assertEquals(1, innerFolder.getChildren(XbFileSet.class).size());
-
- XbFileSet fs = (XbFileSet)innerFolder.getAllChildren().get(0);
- assertEquals(fs.getIncludes(), "**/*.xml");
- assertEquals(fs.getDir(), "/some/global/path");
- assertFalse(fs.isInWorkspace());
-
- // pack 2
- assertEquals(0, pack2.getAllChildren().size());
- assertEquals("TestProject2.jar", pack2.getName());
- assertEquals("/SomeProject", pack2.getToDir());
- assertEquals("jar", pack2.getPackageType());
- assertTrue(pack2.isExploded());
- assertTrue(pack2.isInWorkspace());
- }
-}
Copied: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java (from rev 6560, trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/FileIOTest.java)
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java (rev 0)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/FileIOTest.java 2008-02-25 21:31:03 UTC (rev 6561)
@@ -0,0 +1,163 @@
+package org.jboss.ide.eclipse.archives.test.xb;
+
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
+import org.jboss.ide.eclipse.archives.test.ArchivesTest;
+import org.jboss.ide.eclipse.archives.test.util.FileIOUtil;
+import org.osgi.framework.Bundle;
+
+public class FileIOTest extends TestCase {
+ private Bundle bundle;
+ private IPath bundlePath;
+ protected void setUp() {
+ if( bundlePath == null ) {
+ try {
+ bundle = ArchivesTest.getDefault().getBundle();
+ URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
+ bundlePath = new Path(bundleURL.getFile());
+ } catch( IOException ioe) {}
+ }
+ }
+
+ protected void tearDown() {
+ try {
+ de.schlichtherle.io.File.umount();
+ } catch( Exception e ) {}
+ FileIOUtil.clearFolder(bundlePath.append("tmp").toFile().listFiles());
+ }
+
+
+ public void testPathExists() {
+ IPath inputs = bundlePath.append("inputs");
+ assertTrue(TrueZipUtil.pathExists(bundlePath));
+ assertTrue(TrueZipUtil.pathExists(inputs));
+ assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees")));
+ assertTrue(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("one.txt")));
+
+ assertFalse(TrueZipUtil.pathExists(bundlePath.append("doesNotExist")));
+ assertFalse(TrueZipUtil.pathExists(inputs.append("doesNotExist")));
+ assertFalse(TrueZipUtil.pathExists(inputs.append("fileTrees").append("flatTextFiles").append("doesNotExist.txt")));
+ }
+
+ public void testCreationAndDeletion() {
+ IPath tmpDir = bundlePath.append("tmp");
+
+ // create archives via both APIs,
+ IPath creationArchive1 = tmpDir.append("creationArchive1.jar");
+ IPath creationArchive2 = tmpDir.append("creationArchive2.zip");
+ IPath creationArchive3 = tmpDir.append("creationArchive3");
+
+ assertFalse(TrueZipUtil.pathExists(creationArchive1));
+ TrueZipUtil.createArchive(creationArchive1);
+ assertTrue(TrueZipUtil.pathExists(creationArchive1));
+ assertFalse(creationArchive1.toFile().isDirectory());
+
+ assertFalse(TrueZipUtil.pathExists(creationArchive2));
+ TrueZipUtil.createArchive(creationArchive2);
+ assertTrue(TrueZipUtil.pathExists(creationArchive2));
+ assertFalse(creationArchive2.toFile().isDirectory());
+
+ // and also create an archive with no suffix
+ assertFalse(TrueZipUtil.pathExists(creationArchive3));
+ TrueZipUtil.createArchive(creationArchive3);
+ assertTrue(TrueZipUtil.pathExists(creationArchive3));
+ assertFalse(creationArchive3.toFile().isDirectory());
+
+
+ // create folders with various names
+ IPath creationFolder1 = tmpDir.append("creationFolder1.jar");
+ IPath creationFolder2 = tmpDir.append("creationFolder2.zip");
+ IPath creationFolder3 = tmpDir.append("creationFolder3");
+
+ assertFalse(TrueZipUtil.pathExists(creationFolder1));
+ TrueZipUtil.createFolder(creationFolder1);
+ assertTrue(TrueZipUtil.pathExists(creationFolder1));
+ assertTrue(creationFolder1.toFile().isDirectory());
+
+ assertFalse(TrueZipUtil.pathExists(creationFolder2));
+ TrueZipUtil.createFolder(creationFolder2);
+ assertTrue(TrueZipUtil.pathExists(creationFolder2));
+ assertTrue(creationFolder2.toFile().isDirectory());
+
+ assertFalse(TrueZipUtil.pathExists(creationFolder3));
+ TrueZipUtil.createFolder(creationFolder3);
+ assertTrue(TrueZipUtil.pathExists(creationFolder3));
+ assertTrue(creationFolder3.toFile().isDirectory());
+
+
+ // folders and archives of all extensions work.
+ // keep one folder and one archive and add to each
+ // another folder, archive, and file
+
+ IPath archiveFolder = creationArchive1.append("folderName");
+ IPath archiveArchive = creationArchive1.append("archiveName.war");
+
+ IPath folderFolder = creationFolder1.append("folderName");
+ IPath folderArchive = creationFolder1.append("archiveName.war");
+
+
+ assertFalse(TrueZipUtil.pathExists(archiveFolder));
+ assertFalse(TrueZipUtil.pathExists(archiveArchive));
+ TrueZipUtil.createFolder(archiveFolder);
+ TrueZipUtil.createArchive(archiveArchive);
+ try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
+ assertTrue(TrueZipUtil.pathExists(archiveFolder));
+ assertTrue(TrueZipUtil.pathExists(archiveArchive));
+ assertFalse(archiveFolder.toFile().exists());
+ assertFalse(archiveArchive.toFile().exists());
+
+
+ assertFalse(TrueZipUtil.pathExists(folderFolder));
+ assertFalse(TrueZipUtil.pathExists(folderArchive));
+ TrueZipUtil.createFolder(folderFolder);
+ TrueZipUtil.createArchive(folderArchive);
+ try {de.schlichtherle.io.File.umount();} catch( Exception e ) {}
+ assertTrue(TrueZipUtil.pathExists(archiveFolder));
+ assertTrue(TrueZipUtil.pathExists(archiveArchive));
+ assertTrue(folderFolder.toFile().exists());
+ assertTrue(folderArchive.toFile().exists());
+
+ // copy a file into them
+ IPath archiveFile = creationArchive1.append("file.txt");
+ IPath folderFile = creationArchive1.append("file.txt");
+
+ String srcPath = bundlePath.append("inputs").append("fileTrees")
+ .append("flatTextFiles").append("two.txt").toOSString();
+ try {
+ assertFalse(TrueZipUtil.pathExists(archiveFile));
+ assertFalse(TrueZipUtil.pathExists(folderFile));
+ TrueZipUtil.copyFile(srcPath, archiveFile);
+ TrueZipUtil.copyFile(srcPath, folderFile);
+ assertTrue(TrueZipUtil.pathExists(archiveFile));
+ assertTrue(TrueZipUtil.pathExists(folderFile));
+ } catch( Exception e ) {
+ fail("IOException: " + e.getMessage());
+ }
+
+ de.schlichtherle.io.File f = TrueZipUtil.getFile(creationFolder1);
+ int numChildren = f.list().length;
+ assertEquals(2, numChildren);
+ TrueZipUtil.deleteEmptyChildren(f);
+ int numChildren2 = f.list().length;
+ assertEquals(0, numChildren2);
+
+ de.schlichtherle.io.File f2 = TrueZipUtil.getFile(creationArchive1);
+ TrueZipUtil.deleteAll(creationArchive1);
+ assertFalse(TrueZipUtil.pathExists(f2));
+ }
+
+ protected IPath bundleEntryToGlobalPath(String entry) {
+ try {
+ return new Path(FileLocator.toFileURL(bundle.getEntry(entry)).getFile());
+ } catch( IOException e ) {
+ return null;
+ }
+ }
+}
Copied: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/MarshallUnmarshallTest.java (from rev 6560, trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/MarshallUnmarshallTest.java)
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/MarshallUnmarshallTest.java (rev 0)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/xb/MarshallUnmarshallTest.java 2008-02-25 21:31:03 UTC (rev 6561)
@@ -0,0 +1,176 @@
+package org.jboss.ide.eclipse.archives.test.xb;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XMLBinding;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbFileSet;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbFolder;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackage;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackages;
+import org.jboss.ide.eclipse.archives.test.ArchivesTest;
+import org.jboss.ide.eclipse.archives.test.util.FileIOUtil;
+import org.osgi.framework.Bundle;
+
+public class MarshallUnmarshallTest extends TestCase {
+ private Bundle bundle;
+ private IPath bundlePath;
+ private IPath archiveDescriptors;
+ protected void setUp() {
+ if( bundlePath == null ) {
+ try {
+ bundle = ArchivesTest.getDefault().getBundle();
+ URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
+ bundlePath = new Path(bundleURL.getFile());
+ archiveDescriptors = bundlePath.append("inputs").append("archiveDescriptors");
+ } catch( IOException ioe) {}
+ }
+ }
+
+
+ public void tearDown() {
+ FileIOUtil.clearFolder(bundlePath.append("tmp").toFile().listFiles());
+ }
+
+ public void testUnmarshall() {
+ // unmarshall from file
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(archiveDescriptors.append("descriptor1.xml").toFile());
+ } catch( Exception e ) {
+ fail(e.getMessage());
+ }
+ XbPackages packs = XMLBinding.unmarshal(fis, new NullProgressMonitor());
+ assertDescriptor1Accurate(packs);
+
+ // unmarshall from string
+ try {
+ String content = fileAsString(archiveDescriptors.append("descriptor1.xml").toFile());
+ packs = XMLBinding.unmarshal(content, new NullProgressMonitor());
+ assertDescriptor1Accurate(packs);
+ } catch( Exception e ) {
+ fail(e.getMessage());
+ }
+
+ }
+
+ public String fileAsString(File f) throws Exception {
+ FileInputStream fis = new FileInputStream(f);
+ int x= fis.available();
+ byte b[]= new byte[x];
+ fis.read(b);
+ return new String(b);
+ }
+
+ public void testMarshall() {
+ IPath tmpFolder = bundlePath.append("tmp");
+
+ XbPackages packs = new XbPackages();
+ XbPackage pack1 = new XbPackage();
+ pack1.setName("TestProject.jar");
+ pack1.setPackageType("jar");
+ pack1.setToDir("/some/external/path");
+ pack1.setExploded(false);
+ pack1.setInWorkspace(false);
+ packs.addChild(pack1);
+
+ XbPackage pack2 = new XbPackage();
+ pack2.setName("TestProject2.jar");
+ pack2.setPackageType("jar");
+ pack2.setToDir("/SomeProject");
+ pack2.setExploded(true);
+ pack2.setInWorkspace(true);
+ packs.addChild(pack2);
+
+ XbFolder folder1 = new XbFolder();
+ folder1.setName("folder");
+ pack1.addChild(folder1);
+
+ XbFolder folder2 = new XbFolder();
+ folder2.setName("folder2");
+ pack1.addChild(folder2);
+
+ XbFolder inner1 = new XbFolder();
+ inner1.setName("inner1");
+ folder2.addChild(inner1);
+
+ XbFileSet fs = new XbFileSet();
+ fs.setDir("/some/global/path");
+ fs.setIncludes("**/*.xml");
+ fs.setInWorkspace(false);
+ inner1.addChild(fs);
+
+ assertDescriptor1Accurate(packs);
+
+ String packsAsString = XMLBinding.serializePackages(packs, new NullProgressMonitor());
+ XbPackages packsFromString = XMLBinding.unmarshal(packsAsString, new NullProgressMonitor());
+ assertDescriptor1Accurate(packsFromString);
+
+ try {
+ OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(tmpFolder.append("marshallTest.xml").toFile()));
+ XMLBinding.marshall(packs, writer, new NullProgressMonitor());
+ writer.close();
+
+ XbPackages packsFromFile = XMLBinding.unmarshal(new FileInputStream(tmpFolder.append("marshallTest.xml").toFile()), new NullProgressMonitor());
+ assertDescriptor1Accurate(packsFromFile);
+ } catch(Exception e) {
+ fail(e.getMessage());
+ }
+
+ }
+
+ void assertDescriptor1Accurate(XbPackages packs) {
+ assertEquals(2, packs.getAllChildren().size());
+ assertEquals(2, packs.getChildren(XbPackage.class).size());
+
+ XbPackage pack1 = (XbPackage)packs.getAllChildren().get(0);
+ XbPackage pack2 = (XbPackage)packs.getAllChildren().get(1);
+
+ // pack 1
+ assertEquals("TestProject.jar", pack1.getName());
+ assertEquals("/some/external/path", pack1.getToDir());
+ assertEquals("jar", pack1.getPackageType());
+ assertFalse(pack1.isExploded());
+ assertFalse(pack1.isInWorkspace());
+ assertEquals(2, pack1.getAllChildren().size());
+ assertEquals(2, pack1.getChildren(XbFolder.class).size());
+
+ XbFolder folder1 = (XbFolder)pack1.getAllChildren().get(0);
+ XbFolder folder2 = (XbFolder)pack1.getAllChildren().get(1);
+
+ assertEquals(0, folder1.getAllChildren().size());
+ assertEquals("folder", folder1.getName());
+
+ assertEquals(1, folder2.getAllChildren().size());
+ assertEquals(1, folder2.getChildren(XbFolder.class).size());
+ assertEquals("folder2", folder2.getName());
+
+ XbFolder innerFolder = (XbFolder)folder2.getAllChildren().get(0);
+ assertEquals("inner1", innerFolder.getName());
+ assertEquals(1, innerFolder.getAllChildren().size());
+ assertEquals(1, innerFolder.getChildren(XbFileSet.class).size());
+
+ XbFileSet fs = (XbFileSet)innerFolder.getAllChildren().get(0);
+ assertEquals(fs.getIncludes(), "**/*.xml");
+ assertEquals(fs.getDir(), "/some/global/path");
+ assertFalse(fs.isInWorkspace());
+
+ // pack 2
+ assertEquals(0, pack2.getAllChildren().size());
+ assertEquals("TestProject2.jar", pack2.getName());
+ assertEquals("/SomeProject", pack2.getToDir());
+ assertEquals("jar", pack2.getPackageType());
+ assertTrue(pack2.isExploded());
+ assertTrue(pack2.isInWorkspace());
+ }
+}
16 years, 3 months
JBoss Tools SVN: r6560 - trunk/tests/features/org.jboss.tools.test.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-02-25 15:25:36 -0500 (Mon, 25 Feb 2008)
New Revision: 6560
Modified:
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
fIx JUnit test build errors, because of some plug-ins were moved to new place
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-02-25 20:05:16 UTC (rev 6559)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-02-25 20:25:36 UTC (rev 6560)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.test_feature"
- label="Tools Tests"
- version="2.0.0">
-
- <description url="http://www.jboss.org/tools">
- JBossTools unit tests feature
- </description>
-
- <copyright>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.test_feature"
+ label="Tools Tests"
+ version="2.0.0">
+
+ <description url="http://www.jboss.org/tools">
+ JBossTools unit tests feature
+ </description>
+
+ <copyright>
Copyright (c) 2007 Exadel, Inc and Red Hat, Inc.
Distributed under license by Red Hat, Inc. All rights reserved.
This program is 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:
-Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="http://www.eclipse.org/legal/epl-v10.html">
+Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -214,160 +214,159 @@
No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose.
Each party waives its rights to a jury trial in any resulting
-litigation.
- </license>
-
- <plugin
- id="org.jboss.tools.common.kb.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.model.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.verification.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.text.ext.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.verification.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.core.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.xulrunner.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.richfaces.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.facelets.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.jsf.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.vpe.seam.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.struts.vpe.struts.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.model.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.jst.jsp.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.struts.vpe.struts"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.vpe.html.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.jsp.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
+litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.common.kb.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.model.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.verification.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.text.ext.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.verification.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.xulrunner.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.richfaces.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.facelets.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.jsf.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.seam.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.struts.vpe.struts.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.model.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.jst.jsp.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.html.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.jsp.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.vpe.myfaces.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
16 years, 3 months
JBoss Tools SVN: r6559 - trunk/struts/features/org.jboss.tools.struts.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-02-25 15:05:16 -0500 (Mon, 25 Feb 2008)
New Revision: 6559
Modified:
trunk/struts/features/org.jboss.tools.struts.feature/feature.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1821
templates for struts included in struts feature
Modified: trunk/struts/features/org.jboss.tools.struts.feature/feature.xml
===================================================================
--- trunk/struts/features/org.jboss.tools.struts.feature/feature.xml 2008-02-25 16:50:31 UTC (rev 6558)
+++ trunk/struts/features/org.jboss.tools.struts.feature/feature.xml 2008-02-25 20:05:16 UTC (rev 6559)
@@ -253,4 +253,11 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.struts.vpe.struts"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
16 years, 3 months
JBoss Tools SVN: r6558 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: src/org/jboss/tools/jsf/vpe/jsf/test/jbide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-25 11:50:31 -0500 (Mon, 25 Feb 2008)
New Revision: 6558
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/675/testInsertTag.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-675, junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/675/testInsertTag.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/675/testInsertTag.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/675/testInsertTag.xhtml 2008-02-25 16:50:31 UTC (rev 6558)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <body>
+ <form action="">
+
+ </form>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-02-25 16:40:33 UTC (rev 6557)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-02-25 16:50:31 UTC (rev 6558)
@@ -94,6 +94,9 @@
styledText.insert("t");
}
+ if(getException()!=null) {
+ throw getException();
+ }
}
/**
* Tests tag Input on Source Page
@@ -152,6 +155,58 @@
styledText.insert("t");
}
+ if(getException()!=null) {
+ throw getException();
+ }
}
+ public void testInsertTagOnPage() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath("JBIDE/675/testInsertTag.xhtml",
+ IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + "JBIDE/675/testInsertTag.xhtml", file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+
+ styledText.setCaretOffset(285);
+ styledText.insert("<test></test>");
+ IndexedRegion treeNode = ContentAssistUtils.getNodeAt(part
+ .getSourceEditor().getTextViewer(), 290);
+ Node node = (Node) treeNode;
+ assertNotNull(node);
+
+ VpeController vpeController = getVpeController(part);
+
+ VpeDomMapping domMapping = vpeController.getDomMapping();
+
+ VpeNodeMapping nodeMapping = domMapping.getNodeMapping(node);
+
+ assertNotNull(nodeMapping);
+
+ nsIDOMNode div = nodeMapping.getVisualNode();
+
+ nsIDOMNode span = div.getFirstChild();
+
+ nsIDOMNode textNode = span.getFirstChild();
+
+ assertEquals(textNode.getNodeType(), nsIDOMNode.TEXT_NODE);
+
+ assertNotNull(textNode.getNodeValue());
+ assertNotNull(node.getNodeName());
+ assertEquals(textNode.getNodeValue().trim(), node.getNodeName()
+ .trim());
+ }
}
16 years, 3 months
JBoss Tools SVN: r6557 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-02-25 11:40:33 -0500 (Mon, 25 Feb 2008)
New Revision: 6557
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateFileList.java
Log:
Code adjustment.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateFileList.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateFileList.java 2008-02-25 11:36:54 UTC (rev 6556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateFileList.java 2008-02-25 16:40:33 UTC (rev 6557)
@@ -74,21 +74,21 @@
}
private VpeTemplateFile[] createTemplateFileList() {
- List templateList = createTemplateFileListImpl();
- return (VpeTemplateFile[]) templateList.toArray(new VpeTemplateFile[templateList.size()]);
+ List<VpeTemplateFile> templateList = createTemplateFileListImpl();
+ return templateList.toArray(new VpeTemplateFile[templateList.size()]);
}
- private List createTemplateFileListImpl() {
- List templateList = new ArrayList();
+ private List<VpeTemplateFile> createTemplateFileListImpl() {
+ List<VpeTemplateFile> templateList = new ArrayList<VpeTemplateFile>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry.getExtensionPoint("org.jboss.tools.vpe.templates");
+ IExtensionPoint extensionPoint = registry.getExtensionPoint(VpePlugin.EXTESION_POINT_VPE_TEMPLATES);
IExtension[] extensions = extensionPoint.getExtensions();
for (int i=0;i<extensions.length;i++) {
IExtension extension = extensions[i];
IConfigurationElement[] elements = extension.getConfigurationElements();
for(int j=0;j<elements.length;j++) {
- String pathAttrValue = elements[j].getAttribute("path");
+ String pathAttrValue = elements[j].getAttribute("path"); //$NON-NLS-1$
try {
VpeTemplateFile templateFile = new VpeTemplateFile(pathAttrValue, elements[j]);
templateList.add(templateFile);
@@ -104,7 +104,7 @@
VpePlugin plugin = VpePlugin.getDefault();
Bundle bundle =
confElement==null?plugin.getBundle():Platform.getBundle(confElement.getContributor().getName());
- URL url = bundle.getEntry("/");
+ URL url = bundle.getEntry("/"); //$NON-NLS-1$
IPath path = new Path(FileLocator.toFileURL(url).getFile());
path = path.append(name);
return path;
16 years, 3 months
JBoss Tools SVN: r6556 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-02-25 06:36:54 -0500 (Mon, 25 Feb 2008)
New Revision: 6556
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java
Log:
Code adjustment
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java 2008-02-25 10:45:15 UTC (rev 6555)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java 2008-02-25 11:36:54 UTC (rev 6556)
@@ -23,10 +23,9 @@
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMNodeList;
/**
- * Test JBIDE-1615
+ * Test JBIDE-1460
*
* @author dsakovich(a)exadel.com
*
@@ -41,7 +40,7 @@
super(name);
}
- // test method for JBIDE 1615
+ // test method for JBIDE 1460
public void testJBIDE_1460() throws Throwable {
// wait
TestUtil.waitForJobs();
16 years, 3 months
JBoss Tools SVN: r6555 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/1460 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-02-25 05:45:15 -0500 (Mon, 25 Feb 2008)
New Revision: 6555
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1460/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1460/JBIDE-1460.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
Add JUnit test for http://jira.jboss.com/jira/browse/JBIDE-1460
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1460/JBIDE-1460.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1460/JBIDE-1460.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1460/JBIDE-1460.xhtml 2008-02-25 10:45:15 UTC (rev 6555)
@@ -0,0 +1,13 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <rich:tree style="width:300px" switchType="ajax" stateAdvisor="#{treeDemoStateAdvisor}">
+ <rich:recursiveTreeNodesAdaptor roots="#{fileSystemBean.sourceRoots}" var="item" nodes="#{item.nodes}" />
+ </rich:tree>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-23 08:04:14 UTC (rev 6554)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-25 10:45:15 UTC (rev 6555)
@@ -17,6 +17,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1105Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1460Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1479Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1484Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1615Test;
@@ -55,6 +56,7 @@
suite.addTestSuite(JBIDE1105Test.class);
suite.addTestSuite(JBIDE1744Test.class);
suite.addTestSuite(JBIDE675Test.class);
+ suite.addTestSuite(JBIDE1460Test.class);
// $JUnit-END$
//added by Max Areshkau
//add here projects which should be imported for junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java 2008-02-25 10:45:15 UTC (rev 6555)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+
+/**
+ * Test JBIDE-1615
+ *
+ * @author dsakovich(a)exadel.com
+ *
+ */
+public class JBIDE1460Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "jsfTest";
+
+ private static final String TEST_PAGE_NAME = "JBIDE/1460/JBIDE-1460.xhtml";
+
+ public JBIDE1460Test(String name) {
+ super(name);
+ }
+
+ // test method for JBIDE 1615
+ public void testJBIDE_1460() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file " + file.getFullPath(),
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ // check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "span" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_SPAN);
+
+ assertEquals(5, elements.size());
+
+ nsIDOMNode span = elements.get(2);
+
+ nsIDOMNode text = span.getFirstChild();
+ assertEquals(text.getNodeValue().trim(), "#{item.nodes}");
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+}
16 years, 3 months
JBoss Tools SVN: r6554 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-23 03:04:14 -0500 (Sat, 23 Feb 2008)
New Revision: 6554
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java
Log:
was removed incorrect imports
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java 2008-02-23 08:03:10 UTC (rev 6553)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyCheckbox.java 2008-02-23 08:04:14 UTC (rev 6554)
@@ -13,19 +13,14 @@
import java.util.ArrayList;
import java.util.List;
-import javax.smartcardio.ATR;
-
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
16 years, 3 months