Examples of Launch


Examples of com.clarkparsia.empire.api.nasa.Launch

    String javaAssistMarker = "$$_javassist";

    String aLaunchURI = "http://nasa.dataincubator.org/launch/SATURNSA1";

    Launch aLaunch = aManager.find(Launch.class, aLaunchURI);

    LaunchUsingProxy aProxySupportingLaunch = aManager.find(LaunchUsingProxy.class, aLaunchURI);

    // this object is proxied
    LaunchSite aOrigSite = aProxySupportingLaunch.getLaunchSite();

    // this should be a proxy class...
    // the easy way to check this is via the class name to see if its a javassist created class.
    // this means the proxy was correctly created in RdfGenerator
    // and the proxy *works* if the results of the gets and sets are what is expected.
    assertTrue(aOrigSite.getClass().getName().indexOf(javaAssistMarker) != -1);

    // and the non-proxying version should not return a proxy object
    assertTrue(aLaunch.getLaunchSite().getClass().getName().indexOf(javaAssistMarker) == -1);

    // and the proxied object should be equal to a non proxied version of the same thing
    assertEquals(aOrigSite, aLaunch.getLaunchSite());

    // we want to make sure that get/set operations work via a proxied object fine, that we don't get anything cached
    // or stale proxied objects returned accidentally

    LaunchSite aNewSite = new LaunchSite();
View Full Code Here

Examples of com.clarkparsia.empire.api.nasa.Launch

    insertData((MutableDataSource) aManager.getDelegate(), new File(DATA_FILE));

    String aLaunchURI = "http://nasa.dataincubator.org/launch/SATURNSA1";
   
    Launch aLaunch = aManager.find(Launch.class, aLaunchURI);
    LaunchUsingProxy aProxySupportingLaunch = aManager.find(LaunchUsingProxy.class, aLaunchURI);   

    assertTrue(aProxySupportingLaunch.getSpacecraft().size() > 0);

    // the values for this are all space craft in the data
    // but the mapping just specifies an untyped collection (a List).
    // we're using the targetEntity property of the OneToMany annotation to
    // specify the type, so we want to make sure that everything returned by this
    // function is a space craft.  The fact that it returns at all pretty much
    // guarantees that, but we want to make sure.
    for (Object aObj : aProxySupportingLaunch.getSpacecraft()) {
      assertTrue(aObj instanceof Spacecraft);
    }

    // "normal" mapping should be equal to the proxied, targetEntity mapped version
    assertTrue(Lists.newArrayList(aLaunch.getSpacecraft()).equals(Lists.newArrayList(aProxySupportingLaunch.getSpacecraft())));
  }
View Full Code Here

Examples of com.clarkparsia.empire.api.nasa.Launch

    String aOtherLaunchURI = "http://nasa.dataincubator.org/launch/PION2";

    // ================= test remove cascade
    LaunchUsingProxy aExistingLaunchWithProxy = aManager.find(LaunchUsingProxy.class, aLaunchURI);
   
    Launch aExistingLaunch = aManager.find(Launch.class, aOtherLaunchURI);
   
    assertTrue(aExistingLaunch != null);

    List<Spacecraft> aExistingSpacecraft = aExistingLaunch.getSpacecraft();

    assertTrue(aExistingSpacecraft.size() > 0);

    aExistingLaunch.getSpacecraft().clear();

    aManager.remove(aExistingLaunch);

    // delete shoudl have worked...
    assertFalse(aManager.contains(aExistingLaunch));
View Full Code Here

Examples of com.clarkparsia.empire.api.nasa.Launch

    insertData((MutableDataSource) aManager.getDelegate(), new File(DATA_FILE));
   
    // ================= test persist cascade

    LaunchUsingProxy aNewLaunchWithProxy = new LaunchUsingProxy();
    Launch aNewLaunch = new Launch();

    Spacecraft aNewOtherSpacecraft = new Spacecraft();
    aNewOtherSpacecraft.setRdfId(new SupportsRdfId.URIKey(URI.create("http://empire.clarkparsia.com/test/persist/cascade/aNewOtherSpacecraft")));
    aNewOtherSpacecraft.setAgency("agency");

    aNewLaunchWithProxy.setOtherSpacecraft(aNewOtherSpacecraft);
    aNewLaunch.setOtherSpacecraft(aNewOtherSpacecraft);

    aManager.persist(aNewLaunch);

    assertTrue(aManager.contains(aNewLaunch));

    // it was persisted as a relation...
    assertTrue(aManager.find(Launch.class, aNewLaunch.getRdfId()).getOtherSpacecraft().getRdfId().equals(aNewOtherSpacecraft.getRdfId()));

    // but persist does not cascade
    assertFalse(aManager.contains(aNewOtherSpacecraft));

    aManager.persist(aNewLaunchWithProxy);
View Full Code Here

Examples of com.clarkparsia.empire.api.nasa.Launch

    String aLaunchURI = "http://nasa.dataincubator.org/launch/SATURNSA1";
    String aOtherLaunchURI = "http://nasa.dataincubator.org/launch/PION2";

    // =============== test merge cascade
    LaunchUsingProxy aExistingLaunchWithProxy = aManager.find(LaunchUsingProxy.class, aLaunchURI);
    Launch aExistingLaunch = aManager.find(Launch.class, aOtherLaunchURI);
   
    assertTrue(aExistingLaunch != null);

    Spacecraft aNewSpacecraft = new Spacecraft();
    aNewSpacecraft.setRdfId(new SupportsRdfId.URIKey(URI.create("http://empire.clarkparsia.com/test/merge/cascade/aNewOtherSpacecraft")));
    aNewSpacecraft.setAgency("agency");

    aExistingLaunch.setOtherSpacecraft(aNewSpacecraft);
    aExistingLaunchWithProxy.setOtherSpacecraft(aNewSpacecraft);

    aManager.merge(aExistingLaunch);

    assertTrue(aManager.contains(aExistingLaunch));
View Full Code Here

Examples of com.clarkparsia.empire.api.nasa.Launch

    assumeTrue(aManager.getDelegate() instanceof MutableDataSource);

    insertData((MutableDataSource) aManager.getDelegate(), new File(DATA_FILE));

    // ============ test all cascade
    Launch aNewLaunch = new Launch();
    LaunchUsingProxy aNewLaunchWithProxy = new LaunchUsingProxy();

    LaunchSite aNewSiteOne = new LaunchSite();
    aNewSiteOne.setLabel(Arrays.asList("new launch site one"));

    LaunchSite aNewSiteTwo = new LaunchSite();
    aNewSiteTwo.setLabel(Arrays.asList("new launch site two"));

    aNewLaunch.setLaunchSite(aNewSiteOne);
    aNewLaunchWithProxy.setLaunchSite(aNewSiteOne);

    aManager.persist(aNewLaunch);

    assertTrue(aManager.contains(aNewLaunch));
    assertTrue(aManager.find(Launch.class, aNewLaunch.getRdfId()).getLaunchSite().getRdfId().equals(aNewSiteOne.getRdfId()));
    assertFalse(aManager.contains(aNewSiteOne));

    aManager.persist(aNewLaunchWithProxy);

    assertTrue(aManager.contains(aNewLaunchWithProxy));
    assertTrue(aManager.find(LaunchUsingProxy.class, aNewLaunchWithProxy.getRdfId()).getLaunchSite().equals(aNewSiteOne));
    assertTrue(aManager.contains(aNewSiteOne));

    aNewLaunch.setLaunchSite(aNewSiteTwo);
    aNewLaunchWithProxy.setLaunchSite(aNewSiteTwo);

    aManager.merge(aNewLaunch);

    assertTrue(aManager.contains(aNewLaunch));
    assertTrue(aManager.find(Launch.class, aNewLaunch.getRdfId()).getLaunchSite().getRdfId().equals(aNewSiteTwo.getRdfId()));
    assertFalse(aManager.contains(aNewSiteTwo));

    aManager.merge(aNewLaunchWithProxy);

    assertTrue(aManager.contains(aNewLaunchWithProxy));
View Full Code Here

Examples of org.eclipse.debug.core.Launch

        args.add("-Dprose.address=" + address);
        args.add("-Dinsert=" + aspect.getFullyQualifiedName());
        if (txId != null) args.add("-DtxId=" + txId);
        vmConfig.setVMArguments((String[]) args.toArray(new String[] {}));

        ILaunch launch = new Launch(null, ILaunchManager.RUN_MODE, null);
        vmRunner.run(vmConfig, launch, null);
        DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
    }
View Full Code Here

Examples of org.eclipse.debug.core.Launch

    return TestabilityConstants.TESTABILITY.equals(mode);
  }

  public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) {
    if (TestabilityConstants.TESTABILITY.equals(mode)) {
      return new Launch(configuration, mode, null);
    } else {
      throw new IllegalStateException(
          "Cannot launch testability configuration when not in testability mode.");
    }
  }
View Full Code Here

Examples of org.eclipse.debug.core.Launch

  }

  @Override
  public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
    if (isRunMode(mode)) {
      return new Launch(configuration, mode, null);
    } else {
      throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
          "Can only launch JS Test Driver configuration from Run mode"));
    }
  }
View Full Code Here

Examples of org.eclipse.debug.core.Launch

        copy.setAttribute(RutaLaunchConstants.ARG_DESCRIPTOR, descriptorAbsolutePath);
        copy.setAttribute(RutaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
        ILaunchConfiguration lc = copy.doSave();

        String mode = ILaunchManager.RUN_MODE;
        ILaunch launch = new Launch(lc, mode, null);

        ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();

        ILaunch launched = launchConfiguration.launch(ILaunchManager.RUN_MODE, monitor);

        while (!launched.isTerminated()) {
          try {
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.