Examples of TestInterface


Examples of com.aetrion.flickr.test.TestInterface

        return tagsInterface;
    }

    public TestInterface getTestInterface() {
        if (testInterface == null) {
            testInterface = new TestInterface(apiKey, sharedSecret, transport);
        }
        return testInterface;
    }
View Full Code Here

Examples of com.clarkparsia.empire.api.TestInterface

  @Test
  public void testInstGen() throws Exception {
    Class<TestInterface> aIntClass = InstanceGenerator.generateInstanceClass(TestInterface.class);

    TestInterface aInt = aIntClass.newInstance();

    // this should successfully re-use the previously generated class file.  we want to make sure
    // this can happen without error.
    TestInterface aInt2 = InstanceGenerator.generateInstanceClass(TestInterface.class).newInstance();

    URI aURI = URI.create("urn:uri");
    Integer aNumber = 5;
    String aStr = "some string value";
    SupportsRdfId.RdfKey aKey = new SupportsRdfId.URIKey(URI.create("urn:id"));
    SupportsRdfId.RdfKey aKey2 = new SupportsRdfId.URIKey(URI.create("urn:id2"));

    aInt.setURI(aURI);
    aInt.setInt(aNumber);
    aInt.setString(aStr);
    aInt.setRdfId(aKey);

    aInt2.setRdfId(aKey2);

    aInt.setObject(aInt2);

    assertEquals(aInt, aInt);
    assertEquals(aURI, aInt.getURI());
View Full Code Here

Examples of com.sun.jna.DirectTest.TestInterface

        delta = System.currentTimeMillis() - start;
        System.out.println("Memory write (bulk): " + delta + "ms");

        ///////////////////////////////////////////
        // Callbacks
        TestInterface tlib = (TestInterface)Native.loadLibrary("testlib", TestInterface.class);
        start = System.currentTimeMillis();
        TestInterface.Int32Callback cb = new TestInterface.Int32Callback() {
            public int invoke(int arg1, int arg2) {
                return arg1 + arg2;
            }
        };
        tlib.callInt32CallbackRepeatedly(cb, 1, 2, COUNT);
        delta = System.currentTimeMillis() - start;
        System.out.println("callback (JNA interface): " + delta + "ms");

        tlib = new TestLibrary();
        start = System.currentTimeMillis();
        tlib.callInt32CallbackRepeatedly(cb, 1, 2, COUNT);
        delta = System.currentTimeMillis() - start;
        System.out.println("callback (JNA direct): " + delta + "ms");

        start = System.currentTimeMillis();
        TestInterface.NativeLongCallback nlcb = new TestInterface.NativeLongCallback() {
            public NativeLong invoke(NativeLong arg1, NativeLong arg2) {
                return new NativeLong(arg1.longValue() + arg2.longValue());
            }
        };
        tlib.callLongCallbackRepeatedly(nlcb, new NativeLong(1), new NativeLong(2), COUNT);
        delta = System.currentTimeMillis() - start;
        System.out.println("callback w/NativeMapped (JNA interface): " + delta + "ms");

        tlib = new TestLibrary();
        start = System.currentTimeMillis();
        tlib.callLongCallbackRepeatedly(nlcb, new NativeLong(1), new NativeLong(2), COUNT);
        delta = System.currentTimeMillis() - start;
        System.out.println("callback w/NativeMapped (JNA direct): " + delta + "ms");
    }
View Full Code Here

Examples of org.apache.tuscany.sca.extensibility.test.TestInterface

    public void testNewLazyInstance() throws Exception {
        Collection<ServiceDeclaration> sds =
            ServiceDiscovery.getInstance().getServiceDeclarations(TestInterface.class, true);
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        Iterator<ServiceDeclaration> iterator = sds.iterator();
        TestInterface ti = ServiceHelper.newLazyInstance(registry, iterator.next(), TestInterface.class);
        Assert.assertTrue(Proxy.isProxyClass(ti.getClass()));
        Assert.assertTrue(ti instanceof LifeCycleListener);
        Assert.assertTrue(ti.toString().startsWith("Proxy"));
        Assert.assertEquals(System.identityHashCode(ti), ti.hashCode());
        ServiceHelper.start(ti);
        ServiceHelper.stop(ti);
        QName name = ti.getArtifactType();
        Assert.assertEquals(new QName("http://sample", "Test2"), name);
        String str = ti.test("ABC");
        Assert.assertEquals("Test 2: ABC", str);
        ServiceHelper.stop(ti);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface

     */
    @Test
    public void test_registerServant() {
        try {
            String uri = createCorbanameURI("Nested/Test");
            TestInterface servant = new TestInterfaceServant();
            host.registerServant(uri, servant);
            TestInterface ref = TestInterfaceHelper.narrow(host.lookup(uri));
            assertEquals(2, ref.getInt(2));
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface

     */
    @Test
    public void test_unregisterServant() {
        try {
            String uri = createCorbanameURI("Unregistering/Test");
            TestInterface servant = new TestInterfaceServant();

            // creating and releasing using corbaname URI
            host.registerServant(uri, servant);
            host.unregisterServant(uri);
            host.registerServant(uri, servant);
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.jee.testing.general.TestInterface

     */
    @Test
    public void test_nameAlreadyRegistered() {
        // test using URI
        try {
            TestInterface servant = new TestInterfaceServant();
            String uri = createCorbanameURI("AlreadyRegisteredTest2");
            host.registerServant(uri, servant);
            host.registerServant(uri, servant);
            fail();
        } catch (CorbaHostException e) {
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.testing.general.TestInterface

     */
    @Test
    public void test_registerServant() {
        try {
            String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, "Nested/Test");
            TestInterface servant = new TestInterfaceServant();
            host.registerServant(uri, servant);
            TestInterface ref = TestInterfaceHelper.narrow(host.lookup(uri));
            assertEquals(2, ref.getInt(2));
        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.testing.general.TestInterface

    @Test
    public void test_unregisterServant() {
        try {
            String objName = "Unregistering/Test";
            String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, objName);
            TestInterface servant = new TestInterfaceServant();

            // creating and releasing using corbaname URI
            host.registerServant(uri, servant);
            host.unregisterServant(uri);
            host.registerServant(uri, servant);
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.testing.general.TestInterface

     */
    @Test
    public void test_nameAlreadyRegistered() {
        // test using URI
        try {
            TestInterface servant = new TestInterfaceServant();
            String uri = CorbaHostUtils.createCorbanameURI(LOCALHOST, DEFAULT_PORT, "AlreadyRegisteredTest2");
            host.registerServant(uri, servant);
            host.registerServant(uri, servant);
            fail();
        } catch (CorbaHostException e) {
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.