コード例 #1
0
  @Test
  public void testGetPrefferedImplByDescriptorID() {

    IEclipsePreferences prefs = new DefaultScope().getNode(Activator.PLUGIN_ID);
    assertNotNull(prefs);
    String prefsString = prefs.get(QSARConstants.QSAR_PROVIDERS_ORDER_PREFERENCE, null);
    assertNotNull(prefsString);

    System.out.println("Got prefs string: " + prefsString);

    DescriptorImpl impl = qsar.getPreferredImpl(chiChainID);
    assertNotNull(impl);
    System.out.println("pref impl: " + impl.getId());
    //		assertEquals("net.bioclipse.qsar.test.descriptor2", impl.getId());
    System.out.println("wee");
  }
コード例 #2
0
  @Test
  public void testGetDescriptorImplNotInOntology() {

    System.out.println("=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.");
    System.out.println("Impl not in onology:");
    System.out.println("=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.");
    boolean toFail = false;
    for (DescriptorImpl impl : qsar.getFullDescriptorImpls()) {
      if (qsar.getDescriptorIDs().contains(impl.getDefinition())) {
        // All is well
      } else {
        System.out.println(
            "=.= Descriptor impl: " + impl.getName() + " with def: " + impl.getDefinition());
        toFail = true;
      }
    }
    System.out.println("=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.");

    assertFalse("Not all CDK impl are present in ontology, see list on stdout", toFail);
  }
コード例 #3
0
  @Test
  public void testGetDescriptors() throws BioclipseException {

    // Matches plugin.xml, just test some classes

    // Get provider by ID
    DescriptorProvider provider = qsar.getProviderByID(cdkRestProviderID);
    assertNotNull(provider);

    List<String> descImplIDs = qsar.getDescriptorImplsByProvider(cdkRestProviderID);

    List<DescriptorImpl> descs = qsar.getFullDescriptorImpls(provider);

    // Check list of IDs and list of classes equal size
    assertEquals(descImplIDs.size(), descs.size());

    List<String> descIDs = new ArrayList<String>();
    for (DescriptorImpl impl : descs) {
      descIDs.add(impl.getDefinition());
    }

    assertTrue(descIDs.contains(xlogpID));
    assertTrue(descIDs.contains(bpolID));
  }
コード例 #4
0
  @Test
  public void testGetDescriptorsByID() throws BioclipseException {

    // Get decriptor by hardcoded id
    DescriptorImpl desc = qsar.getDescriptorImpl(bpolID, cdkRestProviderID);
    assertNotNull(desc);
    assertNull(desc.getParameters());
    assertFalse(desc.isRequires3D());
    assertEquals(cdkRestProviderID, desc.getProvider().getId());
    assertNotNull(desc.getDescription());
    assertNotNull(desc.getDefinition());
  }