Search in sources :

Example 6 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport017.

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

Example 7 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport014.

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

Example 8 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport015.

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

Example 9 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport018.

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

Example 10 with XSDSchemaDirective

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

the class XSDUnusedTests method testCircularIncludes002.

public void testCircularIncludes002() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Includes/circular/test/Main002.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 6);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(0);
    assertTrue("../Include1.xsd".equals(d1.getSchemaLocation()));
    XSDSchemaDirective d2 = (XSDSchemaDirective) list.get(1);
    assertTrue("../Include2.xsd".equals(d2.getSchemaLocation()));
    XSDSchemaDirective d3 = (XSDSchemaDirective) list.get(2);
    assertTrue("../Include3.xsd".equals(d3.getSchemaLocation()));
    XSDSchemaDirective d4 = (XSDSchemaDirective) list.get(3);
    assertTrue("../Include4.xsd".equals(d4.getSchemaLocation()));
    XSDSchemaDirective d5 = (XSDSchemaDirective) list.get(4);
    assertTrue("../Include5.xsd".equals(d5.getSchemaLocation()));
    XSDSchemaDirective d6 = (XSDSchemaDirective) list.get(5);
    assertTrue("../Include6.xsd".equals(d6.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