Examples of XMLReference


Examples of org.tuba.data.xml.XMLReference

  private static final String id5 = "hsdnfngh56"; //$NON-NLS-1$
  private static final String id6 = "cnnbcbn6"; //$NON-NLS-1$

  @Test
  public void test() throws ParseException {
    XMLReference ref;
    XMLArtefact artefact;

    artefact = constructArtefact(file, id1);
    ref = getReference(artefact);
    testReference(artefact, ref);
    Assert.assertEquals("mockrepository_provider", ref //$NON-NLS-1$
        .getProvider().getId());
    Assert.assertEquals("CompositePattern", ref.getProvider() //$NON-NLS-1$
        .getArtefact());
    Assert.assertTrue(ref.getOperations().isEmpty());
    Assert.assertNotNull(ref.getIntegrator());
    Assert.assertEquals("integrator.image", ref //$NON-NLS-1$
        .getIntegrator().getId());

    artefact = constructArtefact(file, id2);
    ref = getReference(artefact);
    testReference(artefact, ref);
    Assert.assertTrue(ref.getOperations().size() == 1);
    Assert.assertEquals("operation.diagramtoimage", ref //$NON-NLS-1$
        .getOperations().get(0).getId());

    artefact = constructArtefact(file, id3);
    ref = getReference(artefact);
    testReference(artefact, ref);
    Assert.assertTrue(ref.getOperations().size() == 3);

    artefact = constructArtefact(file, id4);
    ref = getReference(artefact);
    testReference(artefact, ref);
    Assert.assertNull(ref.getIntegrator());

    artefact = constructArtefact(file, id5);
    ref = getReference(artefact);
    testReference(artefact, ref);
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testUpdate() throws ParseException {
    XMLArtefact artefact = constructArtefact(file, id1);
    XMLReference ref = getReference(artefact);

    String time = Long.toString(System.currentTimeMillis());

    Element element = new Element(TAG_TIME);
    element.setAttribute(VALUE, time);
    List<Element> elements = new ArrayList<Element>();
    elements.add(element);
    Configuration configuration = new Configuration(elements);
    ref.getIntegrator().setConfiguration(configuration);

    ReferenceManager.getInstance().saveReference(ref, artefact);

    ref = getReference(artefact);
    configuration = ref.getIntegrator().getConfiguration();
    Assert.assertNotNull(configuration);
    Assert.assertEquals(1, configuration.getConfigurationElements().size());
    String value = configuration.getConfigurationElements().get(0)
        .getAttributeValue(VALUE);
    Assert.assertEquals(time, value);

    ref.getIntegrator().setConfiguration(null);
    ReferenceManager.getInstance().saveReference(ref, artefact);

    ref = getReference(artefact);
    configuration = ref.getIntegrator().getConfiguration();
    Assert.assertNull(configuration);
  }
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  @Test
  public void testReferenceDeletion() throws ParseException, IOException {
    XMLArtefact artefact = constructArtefact("nonexistingfile", "id"); //$NON-NLS-1$ //$NON-NLS-2$
    ReferenceManager.getInstance().deleteReference(artefact);

    XMLReference reference = createReference();
    artefact = ReferenceManager.getInstance().generateArtefact(
        "test/some.odt", reference); //$NON-NLS-1$
    artefact.setContext("test/"); //$NON-NLS-1$

    ReferenceManager.getInstance().deleteReference(artefact);
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

    artefact.getReferenceFile().delete();
  }

  @Test
  public void testReferenceCreation() throws ParseException, IOException {
    XMLReference reference = createReference();
    XMLArtefact artefact = ReferenceManager.getInstance().generateArtefact(
        "test/some.odt", reference); //$NON-NLS-1$
    artefact.setContext("test/"); //$NON-NLS-1$

    Assert.assertTrue(artefact.getReferenceFile().exists());
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testBadFile2() throws ParseException {
    String fileName = getBadFileName(2);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertNull(ref);
  }
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testBadFile3() throws ParseException {
    String fileName = getBadFileName(3);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertNull(ref.getProvider());
  }
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testBadFile4() throws ParseException {
    String fileName = getBadFileName(4);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertNull(ref.getProvider().getId());
  }
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testBadFile5() throws ParseException {
    String fileName = getBadFileName(5);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertEquals(ref.getProvider().getId(), "first.provider"); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testBadFile6() throws ParseException {
    String fileName = getBadFileName(6);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertNull(ref.getProvider().getArtefact());
  }
View Full Code Here

Examples of org.tuba.data.xml.XMLReference

  }

  @Test
  public void testBadFile7() throws ParseException {
    String fileName = getBadFileName(7);
    XMLReference ref = getReference(constructArtefact(fileName, id3));
    Assert.assertNull(ref.getIntegrator().getId());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.