Examples of TestDataSource


Examples of com.clarkparsia.empire.api.TestDataSource

    RdfGenerator.asRdf(new TestPerson());
  }

  @Test(expected=InvalidRdfException.class)
  public void testNoDefaultConstructor() throws InvalidRdfException, DataSourceException {
    RdfGenerator.fromRdf(NoDefaultConstructor.class, URI.create("urn:foo"), new TestDataSource());
  }
View Full Code Here

Examples of com.clarkparsia.empire.api.TestDataSource

    RdfGenerator.fromRdf(NoDefaultConstructor.class, URI.create("urn:foo"), new TestDataSource());
  }

  @Test(expected=InvalidRdfException.class)
  public void testUnreachableConstructor() throws InvalidRdfException, DataSourceException {
    RdfGenerator.fromRdf(UnreachableConstructor.class, URI.create("urn:foo"), new TestDataSource());
  }
View Full Code Here

Examples of com.clarkparsia.empire.api.TestDataSource

  }

  @Test
  public void testNoStatements() throws InvalidRdfException, DataSourceException {
    // we should at least return an object in these cases.
    assertFalse(RdfGenerator.fromRdf(TestPerson.class, URI.create("urn:foo"), new TestDataSource()) == null);
  }
View Full Code Here

Examples of com.clarkparsia.empire.api.TestDataSource

      Graph aSourceGraph = new GraphImpl();
      aSourceGraph.addAll(aGraph);
      aSourceGraph.addAll(RdfGenerator.asRdf(aJoe));
      aSourceGraph.addAll(RdfGenerator.asRdf(aJane));

      TestPerson aPerson = RdfGenerator.fromRdf(TestPerson.class, aBob.getRdfId(), new TestDataSource(aSourceGraph));

      assertEquals(aBob, aPerson);

      // now lets test the round trip w/ the added trick of a circular dependency
      aBob.setSpouse(aJane);

      aGraph = RdfGenerator.asRdf(aBob);

      // this is the set of data that would normally be in the database
      aSourceGraph = new GraphImpl();
      aSourceGraph.addAll(aGraph);
      aSourceGraph.addAll(RdfGenerator.asRdf(aJoe));
      aSourceGraph.addAll(RdfGenerator.asRdf(aJane));

      aPerson = RdfGenerator.fromRdf(TestPerson.class, aBob.getRdfId(), new TestDataSource(aSourceGraph));

      // should still be equal, should have re-used Jane
      assertEquals(aBob, aPerson);
    }
    catch (Exception e) {
View Full Code Here

Examples of com.clarkparsia.empire.api.TestDataSource

            Graph aGraph = RdfGenerator.asRdf( root );

            Graph aSourceGraph = new GraphImpl();
            aSourceGraph.addAll(aGraph);

            MyRootClass aRoot = RdfGenerator.fromRdf(MyRootClass.class, "urn:id:00", new TestDataSource(aSourceGraph));
            assertSame( aRoot.getFoo().get( 0 ).getClass(), aImpl.getClass() );
        } catch ( Exception e ) {
            e.printStackTrace();
            fail( e.getMessage() );
        }
View Full Code Here

Examples of net.thucydides.core.csv.TestDataSource

    DataDrivenAnnotations usingEnvironmentVariables(EnvironmentVariables environmentVariables) {
        return new DataDrivenAnnotations(this.testClass, environmentVariables);
    }

    public DataTable getParametersTableFromTestDataSource() throws Throwable {
        TestDataSource testDataSource = new CSVTestDataSource(findTestDataSource(), findTestDataSeparator());
        List<Map<String, String>> testData = testDataSource.getData();
        List<String> headers = testDataSource.getHeaders();
        return DataTable.withHeaders(headers)
                .andMappedRows(testData)
                .build();
    }
View Full Code Here

Examples of net.thucydides.core.csv.TestDataSource

    public boolean hasTestDataSourceDefined() {
        return (findUseTestDataFromAnnotation() != null) && (findTestDataSource() != null);
    }

    public <T> List<T> getDataAsInstancesOf(final Class<T> clazz) throws IOException {
        TestDataSource testdata = new CSVTestDataSource(findTestDataSource(), findTestDataSeparator());
        return testdata.getDataAsInstancesOf(clazz);
    }
View Full Code Here

Examples of net.thucydides.core.csv.TestDataSource

        TestDataSource testdata = new CSVTestDataSource(findTestDataSource(), findTestDataSeparator());
        return testdata.getDataAsInstancesOf(clazz);
    }

    public int countDataEntries() throws IOException {
        TestDataSource testdata = new CSVTestDataSource(findTestDataSource(), findTestDataSeparator());
        return testdata.getData().size();
    }
View Full Code Here

Examples of net.thucydides.core.csv.TestDataSource

    @SuppressWarnings("unchecked")
    public <T> T run(final T steps) throws IOException {

        useDefaultStepFactoryIfUnassigned();
        TestDataSource testdata = new CSVTestDataSource(testDataSource, separator);

        StepEventBus.getEventBus().useExamplesFrom(dataTable(testdata));

        Class<?> scenarioStepsClass = steps.getClass().getSuperclass();
        List<T> instanciatedSteps = (List<T>) testdata.getInstanciatedInstancesFrom(scenarioStepsClass, factory);

        DataDrivenStepFactory dataDrivenStepFactory = new DataDrivenStepFactory(factory);
        T stepsProxy = (T) dataDrivenStepFactory.newDataDrivenSteps(scenarioStepsClass, instanciatedSteps);

        return stepsProxy;
View Full Code Here

Examples of org.apache.axiom.testutils.activation.TestDataSource

        test(dh, new StAXOMBuilder(blob.getInputStream()), false, false, true);
    }
   
    @Test
    public void testWithDataHandlerReaderExtension() throws Exception {
        DataHandler dh = new DataHandler(new TestDataSource('X', Integer.MAX_VALUE));
        OMElement document = createTestDocument(dh);
        test(dh, new StAXOMBuilder(document.getXMLStreamReader()), true, true, false);
    }
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.