java_environment_Test.java (2be43276) | java_environment_Test.java (9cbd97ce) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 11 unchanged lines hidden (view full) --- 20 *************************************************************/ 21 22 23 24package com.sun.star.lib.uno.environments.java; 25 26import com.sun.star.uno.Type; 27import com.sun.star.uno.XInterface; | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 11 unchanged lines hidden (view full) --- 20 *************************************************************/ 21 22 23 24package com.sun.star.lib.uno.environments.java; 25 26import com.sun.star.uno.Type; 27import com.sun.star.uno.XInterface; |
28import complexlib.ComplexTestCase; | |
29 | 28 |
30public final class java_environment_Test extends ComplexTestCase { 31 public String getTestObjectName() { 32 return getClass().getName(); 33 } | 29import org.junit.Test; 30import static org.junit.Assert.*; |
34 | 31 |
35 public String[] getTestMethodNames() { 36 return new String[] { "test" }; 37 } 38 | 32public final class java_environment_Test { 33 @Test |
39 public void test() { 40 java_environment env = new java_environment(null); 41 42 Object obj = new Integer(3); 43 String[] oid = new String[1]; 44 45 Object obj2 = env.registerInterface(obj, oid, 46 new Type(XInterface.class)); 47 Object obj3 = env.registerInterface(obj, oid, 48 new Type(XInterface.class)); | 34 public void test() { 35 java_environment env = new java_environment(null); 36 37 Object obj = new Integer(3); 38 String[] oid = new String[1]; 39 40 Object obj2 = env.registerInterface(obj, oid, 41 new Type(XInterface.class)); 42 Object obj3 = env.registerInterface(obj, oid, 43 new Type(XInterface.class)); |
49 assure("register ordinary interface twice", | 44 assertTrue("register ordinary interface twice", |
50 obj2 == obj && obj3 == obj); 51 | 45 obj2 == obj && obj3 == obj); 46 |
52 assure("ask for registered interface", | 47 assertTrue("ask for registered interface", |
53 env.getRegisteredInterface(oid[0], new Type(XInterface.class)) 54 == obj); 55 56 env.revokeInterface(oid[0], new Type(XInterface.class)); 57 env.revokeInterface(oid[0], new Type(XInterface.class)); | 48 env.getRegisteredInterface(oid[0], new Type(XInterface.class)) 49 == obj); 50 51 env.revokeInterface(oid[0], new Type(XInterface.class)); 52 env.revokeInterface(oid[0], new Type(XInterface.class)); |
58 assure("revoke interface", | 53 assertTrue("revoke interface", |
59 env.getRegisteredInterface(oid[0], new Type(XInterface.class)) 60 == null); 61 } 62} | 54 env.getRegisteredInterface(oid[0], new Type(XInterface.class)) 55 == null); 56 } 57} |