Search in sources :

Example 11 with XSDSchemaDirective

use of org.eclipse.xsd.XSDSchemaDirective in project webtools.sourceediting by eclipse.

the class XSDUnusedTests method testCircularIncludes001.

public void testCircularIncludes001() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Includes/circular/test/Main001.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 1);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(0);
    assertTrue("../Include4.xsd".equals(d1.getSchemaLocation()));
}
Also used : XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) List(java.util.List) XSDSchema(org.eclipse.xsd.XSDSchema)

Example 12 with XSDSchemaDirective

use of org.eclipse.xsd.XSDSchemaDirective in project webtools.sourceediting by eclipse.

the class XSDUnusedTests method testImport001.

public void testImport001() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Simple/Test.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 1);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(0);
    assertTrue("Import001.xsd".equals(d1.getSchemaLocation()));
}
Also used : XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) List(java.util.List) XSDSchema(org.eclipse.xsd.XSDSchema)

Example 13 with XSDSchemaDirective

use of org.eclipse.xsd.XSDSchemaDirective in project webtools.sourceediting by eclipse.

the class XSDUnusedTests method testImport003.

public void testImport003() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Unused/test/Main002.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 1);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(0);
    assertTrue("../Import1.xsd".equals(d1.getSchemaLocation()));
}
Also used : XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) List(java.util.List) XSDSchema(org.eclipse.xsd.XSDSchema)

Example 14 with XSDSchemaDirective

use of org.eclipse.xsd.XSDSchemaDirective in project webtools.sourceediting by eclipse.

the class XSDUnusedTests method testImport001RepeatRemovalTwice.

public void testImport001RepeatRemovalTwice() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Simple/Test.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 1);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(0);
    assertTrue("Import001.xsd".equals(d1.getSchemaLocation()));
    importManager.performRemoval(schema);
    list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 0);
    importManager.performRemoval(schema);
    list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 0);
}
Also used : XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) List(java.util.List) XSDSchema(org.eclipse.xsd.XSDSchema)

Example 15 with XSDSchemaDirective

use of org.eclipse.xsd.XSDSchemaDirective in project webtools.sourceediting by eclipse.

the class XSDUnusedTests method testImport005.

public void testImport005() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Unused/test/Main004.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 2);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(1);
    assertTrue("../Import3.xsd".equals(d1.getSchemaLocation()));
    XSDSchemaDirective d2 = (XSDSchemaDirective) list.get(0);
    assertTrue("../Include1.xsd".equals(d2.getSchemaLocation()));
}
Also used : XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) List(java.util.List) XSDSchema(org.eclipse.xsd.XSDSchema)

Aggregations

XSDSchemaDirective (org.eclipse.xsd.XSDSchemaDirective)33 XSDSchema (org.eclipse.xsd.XSDSchema)28 List (java.util.List)24 Iterator (java.util.Iterator)5 XSDImport (org.eclipse.xsd.XSDImport)4 XSDRedefine (org.eclipse.xsd.XSDRedefine)4 EObject (org.eclipse.emf.ecore.EObject)3 ArrayList (java.util.ArrayList)2 Adapter (org.eclipse.emf.common.notify.Adapter)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 XSDSchemaDirectiveAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter)2 XSDAttributeDeclaration (org.eclipse.xsd.XSDAttributeDeclaration)2 XSDAttributeGroupDefinition (org.eclipse.xsd.XSDAttributeGroupDefinition)2 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)2 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)2 XSDInclude (org.eclipse.xsd.XSDInclude)2 XSDModelGroupDefinition (org.eclipse.xsd.XSDModelGroupDefinition)2 MissingJarsException (com.amalto.workbench.service.MissingJarsException)1 InaccessibleWSDLException (com.sun.xml.internal.ws.wsdl.parser.InaccessibleWSDLException)1 IOException (java.io.IOException)1