Search in sources :

Example 26 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport004.

public void testImport004() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Unused/test/Main003.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 2);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(1);
    assertTrue("../Import1.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)

Example 27 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport006.

public void testImport006() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Unused/test/Main005.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 5);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(1);
    assertTrue("../Import1.xsd".equals(d1.getSchemaLocation()));
    XSDSchemaDirective d2 = (XSDSchemaDirective) list.get(2);
    assertTrue("../Import2.xsd".equals(d2.getSchemaLocation()));
    XSDSchemaDirective d3 = (XSDSchemaDirective) list.get(3);
    assertTrue("../Import3.xsd".equals(d3.getSchemaLocation()));
    XSDSchemaDirective d4 = (XSDSchemaDirective) list.get(4);
    assertTrue("../Import4.xsd".equals(d4.getSchemaLocation()));
    XSDSchemaDirective d5 = (XSDSchemaDirective) list.get(0);
    assertTrue("../Include1.xsd".equals(d5.getSchemaLocation()));
}
Also used : XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) List(java.util.List) XSDSchema(org.eclipse.xsd.XSDSchema)

Example 28 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport012.

public void testImport012() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Unused/test/Main009b.xsd");
    importManager.performRemoval(schema);
    List list = importManager.getUnusedXSDDirectives();
    assertTrue(list.size() == 2);
    XSDSchemaDirective d1 = (XSDSchemaDirective) list.get(0);
    assertTrue("../Include2.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 29 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport016.

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

Example 30 with XSDSchemaDirective

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

the class XSDUnusedTests method testImport007.

public void testImport007() {
    XSDSchema schema = getXSDSchema(TC_ROOT_FOLDER + "/Unused/test/Main006.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)

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