01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.domains.storagemodel.testing;
16:
17: import javax.naming.Context;
18: import javax.naming.InitialContext;
19:
20: import com.metaboss.sdlctools.domains.storagemodel.BOMetaBossDomain;
21: import com.metaboss.sdlctools.domains.storagemodel.BORelationalStorageTechnology;
22: import com.metaboss.sdlctools.domains.storagemodel.BOStorageTechnology;
23: import com.metaboss.sdlctools.types.storagemodel.StorageTechnologyType;
24:
25: public class TestHarness {
26: public static void main(String[] args) {
27: try {
28: // Get the instance of the enterprise ps home via jndi
29: Context ctx = new InitialContext();
30: BOMetaBossDomain lDomain = (BOMetaBossDomain) ctx
31: .lookup(BOMetaBossDomain.COMPONENT_URL);
32: BOStorageTechnology[] lStorageTechnologies = lDomain
33: .getStorageTechnologies()
34: .getAllStorageTechnologies();
35: if (lStorageTechnologies != null
36: && lStorageTechnologies.length > 0) {
37: for (int lStorageTechnologyIndex = 0; lStorageTechnologyIndex < lStorageTechnologies.length; lStorageTechnologyIndex++) {
38: BOStorageTechnology lStorageTechnology = lStorageTechnologies[lStorageTechnologyIndex];
39: System.out.println("StorageTechnologyRef: "
40: + lStorageTechnology.getRef());
41: System.out.println(" Description : "
42: + lStorageTechnology.getDescription());
43: System.out.println(" Type : "
44: + lStorageTechnology.getType());
45: if (lStorageTechnology.getType().equals(
46: StorageTechnologyType.RELATIONAL)) {
47: BORelationalStorageTechnology lRelationalDetails = (BORelationalStorageTechnology) lStorageTechnology;
48: System.out
49: .println(" Assoc. Table Algorithm: "
50: + lRelationalDetails
51: .getAssociationTableNameConversionType());
52: System.out
53: .println(" Assoc. Table Prefix : "
54: + lRelationalDetails
55: .getAssociationTableNamePrefix());
56: System.out
57: .println(" Assoc. Table Suffix : "
58: + lRelationalDetails
59: .getAssociationTableNameSuffix());
60: }
61: }
62: } else
63: System.out
64: .println("No registered storage technologies found");
65: } catch (Exception e) {
66: e.printStackTrace();
67: }
68: }
69: }
|